/* ============================================================
   OSNOVA site chrome for the portfolio pages (/our-work/ and the
   project pages): tokens, header, buttons, mobile menu, sections,
   contact band, footer and dark mode. Copied from the homepage's
   inline styles so the header and footer match it exactly.
   ============================================================ */
/* Inter, Tinos, Questrial, League Spartan and Poppins load from the stylesheet at
   the end of <head>. To self-host later: drop the .woff2 files beside this file
   and re-add @font-face here. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* paper and ink, taken from the packages deck: warm off-white, charcoal type,
     light grey hairlines. There is no colour accent anywhere. */
  --bg: #f9f8f6;
  --ink: #2b2b2b;
  --muted: #555553;
  --faint: #807f7b;
  --line: #d6d5d1;
  --line-soft: #e3e2de;
  /* a slightly recessed surface for the one-off projects block */
  --panel: #f0eee9;
  /* video and placeholder frames stay dark in both modes */
  --frame: #141414;

  /* the soft off-white used by the "MARKETING INC." lockup over the black
     hero; the header logo and nav reuse it so every mark matches exactly */
  --soft-white: rgba(255,255,255,0.72);

  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Tinos is metric-compatible with Times, the closest web match to the deck's
     TeX Gyre Termes headings */
  --serif: "Tinos", "TeX Gyre Termes", "Times New Roman", Times, serif;
  --brand: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --caps: "Questrial", "Inter", system-ui, sans-serif;          /* spaced capitals */
  --display: "League Spartan", "Poppins", system-ui, sans-serif; /* package names */
  --shell: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* driven by JS — scroll progress + pointer parallax */
  --sy: 0;
  --mx: 0;
}

html, body { background: #f9f8f6; background: var(--bg, #f9f8f6); color: #2b2b2b; color: var(--ink, #2b2b2b); }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, svg, video { display: block; }
ul, ol { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
.site-footer ::selection { background: #f9f8f6; color: #000; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 28px; }

/* readable by search engines and screen readers, invisible on screen */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* paper texture over the whole page */
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
  /* over the black hero the bar is white-on-black */
  --hdr-hi: #fff;
  --hdr-edge: rgba(255,255,255,0.3);
}
.site-header.scrolled {
  background: rgba(249,248,246,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
  /* past the hero it sits on paper, so every mark in it switches to ink */
  --soft-white: rgba(43,43,43,0.86);
  --hdr-hi: #000;
  --hdr-edge: rgba(43,43,43,0.34);
}
.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 0 16px;
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;      /* centre "osnova" over "MARKETING INC." */
  justify-self: start;
  color: var(--soft-white);
  line-height: 1;
}
.logo .mark-text {
  font-family: var(--brand);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
  /* cancels this line's own trailing negative letter-space, so its glyphs sit
     on exactly the same centre as the descriptor below */
  text-indent: -0.035em;
}
.logo .logo-suffix {
  margin-top: 4px;
  font-family: var(--caps);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.22em;
  /* letter-spacing adds a trailing gap after the last letter, which throws the
     optical centre left. Indenting by the same amount cancels it. */
  text-indent: 0.22em;
  color: var(--soft-white);
}

#site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  justify-self: center;
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  color: var(--soft-white);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.nav-link > span { position: relative; }
/* hairline that draws in from the left on hover */
.nav-link > span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover { color: var(--hdr-hi); }
.nav-link:hover > span::after { transform: scaleX(1); }
/* the consultation link only appears inside the mobile menu (id-scoped so the
   later .btn display rule can't bring it back) */
#site-nav .nav-cta { display: none; }

.header-actions { justify-self: end; display: inline-flex; align-items: center; gap: 10px; }

/* header CTA: slim outline, no fill, no shine */
.header-actions .btn-solid {
  height: 36px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--hdr-edge);
  color: var(--hdr-hi);
  font-size: 13px;
  font-weight: 500;
}
.header-actions .btn-solid::after { display: none; }
.header-actions .btn-solid:hover {
  background: rgba(128,128,128,0.10);
  border-color: var(--hdr-hi);
}

/* On desktop the bar spans the full viewport, so the logo sits near the left
   edge and the CTA near the right, with the nav centred on the viewport. */
@media (min-width: 861px) {
  .site-header .bar {
    max-width: none;
    padding: 20px 40px 16px;
  }
  .site-header .logo .mark-text  { font-size: 27px; }
  .site-header .logo .logo-suffix { font-size: 8px; }
  .site-header #site-nav { position: relative; top: 4px; }
}
/* tablet: .bar's padding shorthand zeroes .shell's side padding, so restore it */
@media (min-width: 561px) and (max-width: 860px) {
  .bar {
    padding-left: clamp(20px, 3.6vw, 34px);
    padding-right: clamp(20px, 3.6vw, 34px);
  }
}

/* These pages have no black hero, so the header starts in the page's own
   colours: ink marks in light mode (the dark-mode block below swaps them
   back to white). */
.site-header {
  --soft-white: rgba(43,43,43,0.86);
  --hdr-hi: #000;
  --hdr-edge: rgba(43,43,43,0.34);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, transform 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.4) 48%, transparent 76%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
}
.btn:hover::after { transform: translateX(130%); }

/* ink on paper; on the black hero it inverts to white */
.btn-solid {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
}
.btn-solid:hover { background: #000; border-color: #000; }
.pf-intro .btn-solid:hover { background: #e8e7e4; border-color: #e8e7e4; }

/* translucent outline, only ever used over the hero video */
.btn-ghost {
  background: rgba(0,0,0,0.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: #fff; }

/* secondary action on the page body */
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-outline::after { display: none; }
.btn-outline:hover { background: var(--ink); color: var(--bg); }

/* ============================================================
   BURGER + MOBILE MENU
   ============================================================ */
.burger {
  display: none;
  place-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--hdr-edge);
  background: transparent;
  cursor: pointer;
  z-index: 80;
}
.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--hdr-hi);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger:hover { border-color: var(--hdr-hi); }
body.menu-open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.menu-backdrop { display: none; }

/* ============================================================
   SECTIONS
   ============================================================ */
.panel {
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  padding: 112px 0;
}

/* eyebrow and title on the left, the supporting sentence beside them on the
   right: an editorial split rather than one centred column */
.sec-head { margin-bottom: 56px; }
.sec-eyebrow {
  font-family: var(--caps);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.sec-head h2 {
  margin-top: 14px;
  max-width: 18ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.4vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.sec-head h2 em { font-style: italic; }
.sec-head p { margin-top: 18px; max-width: 520px; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }
@media (min-width: 900px) {
  .sec-head.split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 64px;
    align-items: end;
  }
  .sec-head.split .sec-eyebrow { grid-column: 1 / -1; }
  .sec-head.split p { margin-top: 0; padding-bottom: 6px; }
}

/* ---- Contact ---- */
.cta { position: relative; padding: 128px 0; }
.cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px 72px;
  align-items: end;
}
.cta h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.cta h2 em { font-style: italic; }
.cta p { color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.cta-actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.cta-meta { font-size: 0.92rem; color: var(--faint); }
.cta-mail {
  display: inline-block;
  margin-top: 26px;
  font-size: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}
.cta-mail:hover { border-color: currentColor; }

/* ============================================================
   FOOTER — a black band in both modes, so it keeps
   light-on-dark values of its own
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 2;
  background: #000;
  color: #f3f3f2;
  --muted: #a3a3a0;
  --faint: #7d7d78;
  --line-soft: rgba(255,255,255,0.09);
  padding: 64px 0 40px;
}
.site-footer .logo { color: rgba(255,255,255,0.8); }
.site-footer .logo .logo-suffix { color: rgba(255,255,255,0.8); }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.foot-brand p {
  margin-top: 16px;
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.foot-col h2 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.foot-col a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.foot-col a:hover { color: #fff; }
/* quiet legal link, deliberately not styled as a CTA */
.legal-link { color: var(--muted); border-bottom: 1px solid var(--line-soft); padding-bottom: 1px;
              transition: color 0.25s ease, border-color 0.25s ease; }
.legal-link:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.foot-base {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--faint);
}

/* ============================================================
   REVEAL
   ============================================================ */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  /* --i is the hero's fixed load sequence; --rd is the scroll stagger the
     observer hands to items that cross into view together. */
  transition-delay: calc(var(--i, 0) * 70ms + var(--rd, 0ms));
}
/* below the hero a decelerating cubic reads as motion rather than a flicker */
.js .panel .reveal.in,
.js .cta .reveal.in {
  transition-duration: 0.72s;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  /* six links and the button no longer fit beside the logo */
  #site-nav { display: none; }
  .burger { display: grid; }
  .bar { grid-template-columns: 1fr auto; }
  .header-actions .btn:not(.burger) { display: none; }

  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  body.menu-open .menu-backdrop { opacity: 1; visibility: visible; }
  /* the scrolled header's backdrop-filter would make it the containing block
     for the fixed menu; drop it while the menu is open. The open menu sits on
     black, so the bar goes back to white marks. */
  body.menu-open .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    border-bottom-color: transparent;
    --soft-white: rgba(255,255,255,0.72);
    --hdr-hi: #fff;
    --hdr-edge: rgba(255,255,255,0.3);
  }

  body.menu-open #site-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;          /* tracks Safari's collapsing toolbars */
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 45;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: max(96px, calc(env(safe-area-inset-top) + 88px)) 22px
             max(32px, env(safe-area-inset-bottom));
  }
  body.menu-open #site-nav .nav-link {
    /* full-width row so the whole line is tappable, not just the glyphs */
    width: min(440px, 84vw);
    min-height: 48px;
    justify-content: center;
    font-size: 22px;
    letter-spacing: -0.02em;
    color: rgba(255,255,255,0.88);
  }
  body.menu-open #site-nav .nav-cta {
    display: inline-flex;
    margin-top: 18px;
    width: min(440px, 84vw);
    background: #fff;
    color: #111;
    border-color: #fff;
  }
  /* overflow:hidden alone does not lock scrolling on iOS Safari; pinning the body
     does. JS writes the inline top offset and restores scroll on close. */
  body.menu-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }
}
@media (max-width: 1000px) {
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-col a { overflow-wrap: anywhere; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .cta-inner { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .foot-col a { padding: 11px 0; }
  .legal-link { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell { padding: 0 20px; }
  .panel { padding: 76px 0; }
  .cta { padding: 88px 0; }
  .sec-head { margin-bottom: 40px; }
  .cta-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   DARK MODE
   Visitors whose phone or computer is set to dark mode get the
   page below the hero white-on-black instead of ink-on-paper.
   Same type, layout and spacing; only the palette swaps.
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root,
  body {
    background: #000 !important; color: #f3f3f2;
  }
  :root {
    --bg: #000;
    --ink: #f3f3f2;
    --muted: #a8a8a5;
    --faint: #7d7d78;
    --line: rgba(255,255,255,0.18);
    --line-soft: rgba(255,255,255,0.09);
    --panel: #0e0e0e;
    --frame: #111;
  }
  /* on black, the header marks are white whether scrolled or not */
  .site-header {
    --soft-white: rgba(255,255,255,0.72);
    --hdr-hi: #fff;
    --hdr-edge: rgba(255,255,255,0.3);
  }
  /* the scrolled header stays dark, so its marks stay white */
  .site-header.scrolled {
    background: rgba(0,0,0,0.74);
    --soft-white: rgba(255,255,255,0.72);
    --hdr-hi: #fff;
    --hdr-edge: rgba(255,255,255,0.3);
  }
  /* solid buttons are white with black type everywhere, not just on the hero */
  .btn-solid {
    color: #111;
  }
  .btn-solid:hover {
    background: #e8e7e4; border-color: #e8e7e4;
  }
  /* black footer on a black page: a hairline keeps them apart */
  .site-footer {
    border-top: 1px solid var(--line-soft);
  }
}
