/* QAK — quiet, gallery-like. Paper white, ink, one navy taken from the company profile. */
:root {
  --paper: #fbfaf7;
  --paper-2: #f1efe9;
  --ink: #14212b;
  --ink-soft: #5b6670;
  --navy: #0e4c7a;
  --night: #0c1820;
  --line: rgba(20, 33, 43, 0.14);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(18px, 5vw, 80px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.65;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; width: 100%; height: auto; object-fit: cover; background: var(--paper-2); }
/* Only pictures inside a fixed frame fill its height; everywhere else the caption must stay below the picture. */
.preview-frame img, .rail .ph img, .hero-strip img { height: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

.progress { position: fixed; inset: 0 auto auto 0; height: 2px; width: 0; background: var(--navy); z-index: 40; }

/* The logo is a mask, so it takes whatever colour the text around it has. */
.logo {
  display: inline-block; width: 64px; aspect-ratio: 667 / 524; background: currentColor;
  -webkit-mask: url("img/logo.png") center / contain no-repeat;
          mask: url("img/logo.png") center / contain no-repeat;
}
.logo.small { width: 40px; }

/* ---------- Header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: rgba(251, 250, 247, 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); font-size: 14px; font-weight: 400; }
.top nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.top nav a:hover { border-bottom-color: currentColor; }
.top nav .nav-cta { border: 1px solid currentColor; padding: 7px 16px; border-radius: 999px; }
.top nav .nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- Type ---------- */
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--navy); }
h1, h2 { font-family: var(--serif); font-weight: 300; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: clamp(40px, 7.2vw, 108px); line-height: 1.08; max-width: 15ch; margin: 22px 0 36px; }
h1 em { font-style: italic; color: var(--navy); }
h2 { font-size: clamp(30px, 4.2vw, 58px); line-height: 1.15; }
h3 { font-family: var(--sans); font-weight: 500; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; }
.note { font-size: 13.5px; color: var(--ink-soft); max-width: 52ch; }
.text-link { font-weight: 500; text-underline-offset: 6px; text-decoration-thickness: 1px; white-space: nowrap; }
.text-link::after { content: " →"; }

/* ---------- Hero ---------- */
.hero { padding: clamp(120px, 17vh, 190px) var(--gutter) clamp(56px, 8vw, 110px); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 48px; margin-bottom: clamp(40px, 6vw, 84px); }
.hero-meta p { max-width: 46ch; font-size: clamp(16px, 1.3vw, 19px); color: var(--ink-soft); }
.hero-strip { display: grid; grid-template-columns: 1.55fr 0.8fr 0.8fr; gap: clamp(10px, 1.6vw, 24px); align-items: end; }
.hero-strip figure { position: relative; }
.hero-strip figure:nth-child(1) { aspect-ratio: 16 / 10; }
.hero-strip figure:nth-child(2) { aspect-ratio: 3 / 4.4; }
.hero-strip figure:nth-child(3) { aspect-ratio: 3 / 3.6; }
figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 10px; line-height: 1.5; }

/* ---------- Sections ---------- */
.band { padding: clamp(64px, 9vw, 130px) var(--gutter); border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: baseline; margin-bottom: clamp(32px, 4.5vw, 60px); }
.section-head .num { font-size: 13px; font-weight: 500; letter-spacing: 0.1em; color: var(--navy); }
.section-head .note { grid-column: 2; margin-top: 8px; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 48px); }
.services img { aspect-ratio: 4 / 3; margin-bottom: 20px; }
.services p { margin-top: 8px; color: var(--ink-soft); max-width: 34ch; }

/* Work: index on the left, one large preview on the right */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filters button {
  font: inherit; font-size: 13.5px; font-weight: 400; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink);
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); gap: clamp(24px, 4vw, 72px); align-items: start; }
.index { list-style: none; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index button {
  width: 100%; display: grid; grid-template-columns: 2.2em 1fr auto; gap: 4px 14px; align-items: baseline;
  padding: 18px 0; background: none; border: 0; cursor: pointer; text-align: left; color: inherit; font: inherit;
  transition: padding 0.3s ease, color 0.3s;
}
.index .n { font-size: 12.5px; font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.index .t { font-family: var(--serif); font-size: clamp(21px, 2.3vw, 32px); line-height: 1.25; }
.index .p { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.index .s { grid-column: 2 / -1; font-size: 13.5px; color: var(--ink-soft); }
.index .thumb { display: none; }
.index button:hover, .index button:focus-visible, .index li.on button { padding-left: 12px; color: var(--navy); }

.preview { position: sticky; top: 96px; }
.preview-frame { position: relative; aspect-ratio: 4 / 4.4; overflow: hidden; background: var(--paper-2); }
.preview-frame img { position: absolute; inset: 0; opacity: 0; transition: opacity 0.55s ease, transform 1.4s ease; transform: scale(1.04); }
.preview-frame img.show { opacity: 1; transform: none; }
.preview-cap { font-size: 13px; color: var(--ink-soft); margin-top: 12px; min-height: 1.5em; }

/* Experience: dark, sideways rail */
.dark { background: var(--night); color: #f3f1ec; border-top: 0; }
.dark .num, .dark .eyebrow { color: #9cc3df; }
.dark .note, .dark figcaption { color: rgba(243, 241, 236, 0.68); }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 560px); gap: clamp(14px, 2vw, 28px);
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 18px; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter);
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}
.rail figure { scroll-snap-align: start; }
.rail .ph { aspect-ratio: 4 / 3; overflow: hidden; }
.rail img { background: #16252f; }
.rail strong { display: block; font-family: var(--serif); font-weight: 300; font-size: 26px; line-height: 1.25; color: #f3f1ec; margin-bottom: 2px; }
.collab { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid rgba(255, 255, 255, 0.16); padding-top: 26px; }
.collab li { display: grid; gap: 2px; font-size: 14px; color: rgba(243, 241, 236, 0.68); }
.collab strong { font-family: var(--serif); font-weight: 300; font-size: 22px; color: #f3f1ec; }

/* Studio */
.people { display: grid; gap: clamp(18px, 3vw, 48px); }
.people img { filter: grayscale(1); aspect-ratio: 4 / 5; }
.people figcaption strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.3; color: var(--ink); }
.people figcaption small { display: block; font-size: 12.5px; margin-top: 4px; }
.founders { grid-template-columns: repeat(2, minmax(0, 420px)); margin-bottom: clamp(36px, 5vw, 72px); }
.team { grid-template-columns: repeat(3, minmax(0, 300px)); }

.partners { margin-top: clamp(48px, 7vw, 100px); padding-top: 32px; border-top: 1px solid var(--line); }
.partners > p { color: var(--ink-soft); margin-top: 6px; }
.partners ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
.partners li { display: grid; gap: 12px; justify-items: start; font-size: 13.5px; color: var(--ink-soft); }
/* Partner logos come as flat JPEGs on white; multiply drops the white onto the paper. */
.partners img { width: auto; height: 54px; object-fit: contain; background: none; mix-blend-mode: multiply; }

/* Contact */
.contact { background: var(--paper-2); }
.phone { display: inline-block; font-family: var(--serif); font-weight: 300; font-size: clamp(38px, 6.4vw, 92px); line-height: 1.15; text-decoration: none; color: var(--navy); margin-bottom: clamp(36px, 5vw, 64px); }
.phone:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 10px; }
.offices { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 3vw, 48px); }
.offices img { aspect-ratio: 16 / 10; }
.offices strong { display: block; font-weight: 500; color: var(--ink); letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; margin-bottom: 2px; }

footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 26px var(--gutter); font-size: 13px; color: var(--ink-soft); background: var(--paper-2); border-top: 1px solid var(--line); }
footer .logo { color: var(--ink); }

/* Project sheet */
dialog {
  width: min(1180px, 100vw - 24px); max-height: calc(100dvh - 24px); margin: auto; border: 0; padding: clamp(20px, 3.4vw, 48px);
  background: var(--paper); color: var(--ink); overflow-y: auto;
}
dialog::backdrop { background: rgba(12, 24, 32, 0.72); }
dialog header { margin-bottom: 26px; max-width: 70ch; }
dialog h2 { margin: 8px 0; }
dialog #sheetMeta { color: var(--ink-soft); }
dialog .close { position: sticky; top: 0; float: right; z-index: 2; font: inherit; font-size: 13.5px; cursor: pointer; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.gallery { columns: 2; column-gap: 14px; clear: both; }
.gallery img { height: auto; margin-bottom: 14px; break-inside: avoid; }
.gallery img:first-child { column-span: all; }
dialog .note { margin-top: 10px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .top nav a:not(.nav-cta) { display: none; }
  .hero-strip { grid-template-columns: 1fr 1fr; }
  .hero-strip figure:nth-child(1) { grid-column: 1 / -1; }
  .hero-strip figure:nth-child(n + 2) { aspect-ratio: 3 / 3.6; }
  .services, .collab, .partners ul, .offices { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; }
  .preview { display: none; }
  .index button { grid-template-columns: 1fr; padding: 16px 0 20px; }
  .index .n { display: none; }
  .index .p, .index .s { grid-column: 1; white-space: normal; }
  .index .thumb { display: block; aspect-ratio: 16 / 10; margin-bottom: 12px; }
  .index button:hover, .index li.on button { padding-left: 0; }
  .founders, .team { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .preview-frame img, .index button { transition: none; }
}

/* ---------- Scroll film ---------- */
/* While the film is on screen the header sits on the picture: no plate, white ink. */
.top { transition: border-color 0.3s, background 0.4s, color 0.4s; }
.top.over-film { background: transparent; backdrop-filter: none; color: #fff; }
.top.over-film nav .nav-cta:hover { background: #fff; color: var(--night); }

.film { position: relative; height: calc(var(--n) * 170vh); background: var(--night); }
.film-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; color: #fff; }
.film-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 16, 22, 0.55), rgba(8, 16, 22, 0) 22%), linear-gradient(90deg, rgba(8, 16, 22, 0.78) 0%, rgba(8, 16, 22, 0.45) 45%, rgba(8, 16, 22, 0.08) 80%), linear-gradient(0deg, rgba(8, 16, 22, 0.55), rgba(8, 16, 22, 0) 40%); }
.cap {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(64px, 13vh, 150px); max-width: 780px;
  opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; pointer-events: none;
}
.cap.on { opacity: 1; transform: none; }
.cap .eyebrow { color: #a9cde6; margin-bottom: 14px; }
.cap h1 { font-size: clamp(34px, 5.4vw, 80px); line-height: 1.12; max-width: 17ch; margin: 0 0 18px; }
.cap h2 { font-size: clamp(44px, 7.4vw, 112px); line-height: 1.08; margin-bottom: 16px; }
.cap .sub { font-size: clamp(16px, 1.4vw, 21px); color: rgba(255, 255, 255, 0.86); max-width: 40ch; }
.logo.big { width: clamp(84px, 9vw, 132px); margin-bottom: 26px; }
.film-hint { position: absolute; right: var(--gutter); bottom: 30px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); transition: opacity 0.4s; }

/* ---------- Sections added to follow the profile ---------- */
.partner-list { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.partner-list li { display: grid; gap: 12px; justify-items: start; font-size: 14px; color: var(--ink-soft); }
.partner-list img { width: auto; height: clamp(54px, 7vw, 92px); object-fit: contain; background: none; mix-blend-mode: multiply; }
.note.after { margin-top: 28px; }
/* The logo sheet is cut in two halves: side by side on wide screens, stacked on phones so the logos stay readable. */
.clients { display: grid; grid-template-columns: 1fr 1fr; max-width: 1180px; }
.clients img { height: auto; object-fit: contain; background: none; mix-blend-mode: multiply; }
.section-head.second { margin-top: clamp(48px, 7vw, 96px); }
.dark .collab { margin-top: 0; border-top: 0; padding-top: 0; }
.contact { text-align: center; }
.contact .logo.big { color: var(--ink); }
.contact .eyebrow { margin-bottom: 18px; }
.addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 20px 48px; justify-content: center; font-size: 14.5px; color: var(--ink-soft); }
.addresses strong { display: block; font-weight: 500; color: var(--ink); }

@media (max-width: 860px) {
  .partner-list, .addresses { grid-template-columns: 1fr; }
  .scrim { background: linear-gradient(180deg, rgba(8, 16, 22, 0.6), rgba(8, 16, 22, 0) 20%), linear-gradient(0deg, rgba(8, 16, 22, 0.86) 0%, rgba(8, 16, 22, 0.5) 45%, rgba(8, 16, 22, 0.15) 100%); }
  .cap { bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) { .cap { transition: none; } }

/* ---------- Phones held upright ----------
   A wide film frame stretched to full screen height shows only a sliver of it.
   So the picture takes the upper part of the screen and the words sit below. */
@media (max-width: 860px) and (orientation: portrait) {
  .film-stage canvas { height: 56%; }
  .scrim { inset: 0 0 44% 0; background: linear-gradient(180deg, rgba(8, 16, 22, 0.6), rgba(8, 16, 22, 0) 24%), linear-gradient(0deg, var(--night) 0%, rgba(12, 24, 32, 0) 30%); }
  .film-stage { background: var(--night); }
  .cap { top: 56%; bottom: auto; padding-top: 22px; }
  .cap h1 { font-size: clamp(27px, 7.6vw, 38px); margin-bottom: 12px; }
  .cap h2 { font-size: clamp(38px, 11vw, 56px); margin-bottom: 10px; }
  .cap .eyebrow { margin-bottom: 10px; }
  .logo.big { width: 64px; margin-bottom: 16px; }
  .cap-title .logo.big { display: none; }
  .film-hint { bottom: 18px; }
  .clients { grid-template-columns: 1fr; }
}

/* People on phones: one person per row, portrait on the left and words on the right,
   so three people never leave an odd one out and no caption is covered. */
@media (max-width: 860px) {
  .people.founders, .people.team { grid-template-columns: 1fr; gap: 22px; margin-bottom: 0; }
  .people figure { display: grid; grid-template-columns: 42% 1fr; gap: 18px; align-items: center; }
  .people figcaption { margin-top: 0; }
  .people figcaption strong { font-size: 21px; margin-bottom: 4px; }
  .people figcaption small { margin-top: 10px; }
}
