/* ==========================================================================
   BRAND SETTINGS: change these first. Colours, fonts and the page width.
   ========================================================================== */
:root {
  --paper: #f1ece2;        /* page ground. Also the clear colour of the WebGL field (js/field.js, PAPER) */
  --paper-2: #e8e1d3;      /* raised panels */
  --ink: #14120f;          /* text and dark sections */
  --muted: #5f5a50;        /* secondary text (4.5:1 on paper) */
  --accent: #d93a14;       /* vermilion: actions, numbers, markers */
  --accent-on-ink: #ff6a3d;/* the accent when it sits on the dark case study */
  --line: rgba(20, 18, 15, .22);
  --line-ink: rgba(241, 236, 226, .22);

  --display: 'Syne', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1520px;
  --nav-h: 56px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

@font-face { font-family: 'Syne'; src: url('../fonts/syne-latin-wght-normal.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('../fonts/playfair-display-latin-wght-italic.woff2') format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url('../fonts/space-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
html.lenis, html.lenis body { height: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.sec { position: relative; z-index: 1; background: var(--paper); padding-block: clamp(72px, 10vw, 150px); }

.h2 { font: 700 clamp(36px, 5.6vw, 92px)/.98 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.h2.big { font-size: clamp(40px, 7.4vw, 130px); font-weight: 700; letter-spacing: -.045em; }

.sec-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: clamp(28px, 5vw, 72px); font: 400 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 9px; vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); font: 600 15px/1 var(--body); letter-spacing: .01em; text-decoration: none; cursor: pointer; border-radius: 0; transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--ease); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Nav ---------- */
.nav { position: fixed; z-index: 50; inset: 0 0 auto 0; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-inline: var(--gutter); background: rgba(241, 236, 226, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-brand { font: 800 24px/1 var(--display); letter-spacing: -.04em; text-decoration: none; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: clamp(16px, 3vw, 40px); }
.nav-links a { font: 500 14px/1 var(--body); text-decoration: none; padding: 8px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .4s var(--ease); }
.nav-links a:hover, .nav-links a.on { background-size: 100% 1.5px; }
.nav-cta { font: 600 13px/1 var(--body); text-decoration: none; display: inline-flex; align-items: center; padding: 10px 14px; border: 1.5px solid var(--ink); transition: background .3s, color .3s; white-space: nowrap; }
.nav-cta .dot { margin-right: 8px; }
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- 1. Hero ---------- */
.hero { position: relative; z-index: 1; height: 100vh; height: 100svh; min-height: 620px; background: var(--paper); overflow: hidden; display: flex; align-items: flex-end; padding: calc(var(--nav-h) + 20px) var(--gutter) var(--gutter); }
.hero .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero.live { background: transparent; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.hero.live .poster { display: none; }
.hero.live.dragging { cursor: grabbing; }
.hero.live.hovering:not(.dragging) { cursor: pointer; }
.hero-card { position: relative; width: min(600px, 100%); background: var(--paper); padding: clamp(20px, 2.6vw, 36px); border: 1.5px solid var(--ink); pointer-events: none; }
.hero-card a { pointer-events: auto; }
.hero.live .hero-card { box-shadow: 10px 10px 0 var(--ink); }
.eyebrow { font: 400 12.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.display { font: 800 clamp(56px, 7.4vw, 112px)/.9 var(--display); letter-spacing: -.055em; margin: 14px 0 18px -.04em; }
.lede { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-hint { position: absolute; right: var(--gutter); top: calc(var(--nav-h) + 20px); font: 400 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; background: var(--ink); color: var(--paper); padding: 10px 14px; display: none; pointer-events: none; }
.hero.live .hero-hint { display: block; }
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-drag { display: none; } .hint-touch { display: inline; } }
.hero-label { position: absolute; right: var(--gutter); bottom: var(--gutter); max-width: 360px; background: var(--paper); border: 1.5px solid var(--ink); padding: 12px 16px; font: 500 14px/1.35 var(--body); display: none; pointer-events: none; transition: background .3s, color .3s; }
.hero.live .hero-label { display: block; }
.hero.hovering .hero-label { background: var(--accent); border-color: var(--accent); color: #fff; }
.hl-n { font-family: var(--mono); font-size: 12.5px; margin-right: 10px; }
.hl-t strong { font: 800 18px/1 var(--display); letter-spacing: -.02em; margin-right: 8px; }

/* ---------- 2. Work index ---------- */
.work-top { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: clamp(32px, 5vw, 64px); }
.intro { color: var(--muted); max-width: 44ch; font-size: 18px; }
@media (min-width: 900px) { .work-top { grid-template-columns: 1fr minmax(260px, 380px); align-items: end; } }
.index { border-top: 1px solid var(--ink); counter-reset: none; }
.row { position: relative; display: grid; grid-template-columns: 34px 48px 1fr; column-gap: 14px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); cursor: default; isolation: isolate; transition: padding .5s var(--ease), color .35s; }
.row::before { content: ''; position: absolute; inset: 0 calc(var(--gutter) * -1); background: var(--ink); z-index: -1; transform: scaleY(0); transform-origin: 50% 100%; transition: transform .5s var(--ease); }
.row:hover::before, .row:focus-visible::before, .row.flash::before { transform: scaleY(1); }
.row:hover, .row:focus-visible, .row.flash { color: var(--paper); padding-left: 16px; }
.row:focus-visible { outline-offset: -3px; }
.r-n { font: 400 13px/1 var(--mono); color: var(--muted); transition: color .3s; }
.row:hover .r-n, .row.flash .r-n, .row:focus-visible .r-n { color: var(--accent-on-ink); }
.r-thumb { width: 48px; height: 60px; background: var(--paper-2); }
.r-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r-name { font: 700 clamp(24px, 4vw, 60px)/1 var(--display); letter-spacing: -.035em; }
.r-desc { font-size: 14.5px; line-height: 1.4; color: var(--muted); transition: color .3s; }
.row:hover .r-desc, .row.flash .r-desc, .row:focus-visible .r-desc { color: rgba(241, 236, 226, .75); }
.r-desc a { color: inherit; text-underline-offset: 3px; }
.r-disc, .r-year { grid-column: 3; font: 400 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.r-disc { margin-top: 8px; }
.r-year { display: none; }
@media (min-width: 900px) {
  .row { grid-template-columns: 44px 56px minmax(0, 1fr) 200px 70px; column-gap: 24px; padding-block: 18px; }
  .r-thumb { width: 56px; height: 70px; }
  .r-disc, .r-year { grid-column: auto; margin: 0; }
  .r-year { display: block; text-align: right; }
}
.preview { position: fixed; z-index: 40; left: 0; top: 0; width: 230px; height: 287px; pointer-events: none; opacity: 0; transform: translate3d(0, 0, 0) scale(.9); transition: opacity .25s, scale .3s var(--ease); box-shadow: 0 24px 60px rgba(20, 18, 15, .35); border: 1.5px solid var(--ink); background: var(--paper-2); }
.preview.on { opacity: 1; }
@media (hover: none), (max-width: 899px) { .preview { display: none; } }

/* ---------- 3. Case study ---------- */
.case { background: var(--ink); color: var(--paper); }
.case .sec-head { border-color: var(--paper); }
.case .dot { background: var(--accent-on-ink); }
.case-top { display: grid; gap: 36px; margin-bottom: clamp(48px, 7vw, 100px); }
.case-top .h2 { max-width: 15ch; }
.meta { display: grid; gap: 0; border-top: 1px solid var(--line-ink); align-self: end; }
.meta div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-ink); font-size: 15px; }
.meta dt { font: 400 12.5px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: rgba(241, 236, 226, .65); }
@media (min-width: 1000px) { .case-top { grid-template-columns: 1.5fr 1fr; align-items: end; } }

.case-text { display: grid; gap: 40px; margin-bottom: clamp(48px, 7vw, 96px); }
.case-text article { border-top: 1px solid var(--line-ink); padding-top: 18px; }
.case-text h3 { font: 700 clamp(26px, 3vw, 40px)/1 var(--display); letter-spacing: -.03em; margin-bottom: 20px; display: flex; align-items: baseline; gap: 14px; }
.case-text h3 span { font: 400 14px/1 var(--mono); color: var(--accent-on-ink); }
.case-text p { max-width: 56ch; color: rgba(241, 236, 226, .86); margin-bottom: 14px; }
@media (min-width: 900px) { .case-text { grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 100px); } }

.case-figs { display: grid; gap: clamp(28px, 3vw, 44px) clamp(14px, 2vw, 28px); grid-template-columns: repeat(12, 1fr); }
.fig { grid-column: 1 / -1; }
.fig svg { width: 100%; height: auto; transition: transform .8s var(--ease); }
.fig:hover svg { transform: scale(1.012); }
.fig .svgbox { overflow: hidden; }
.fig figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: rgba(241, 236, 226, .72); max-width: 54ch; }
@media (min-width: 900px) {
  .f1 { grid-column: 1 / span 8; } .f2 { grid-column: 9 / span 4; }
  .f3 { grid-column: 1 / span 5; } .f4 { grid-column: 6 / span 7; }
  .f2 { align-self: end; } .f2 svg { height: 100%; width: 100%; }
}
.fig svg { overflow: hidden; }

.results { margin-top: clamp(64px, 9vw, 130px); border-top: 1px solid var(--paper); padding-top: 18px; }
.r-h { font: 400 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-bottom: clamp(24px, 4vw, 48px); }
.stats { display: grid; gap: 36px 24px; grid-template-columns: 1fr 1fr; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 14px; }
.num { font: 700 clamp(28px, 3.3vw, 56px)/1 var(--display); letter-spacing: -.045em; color: var(--accent-on-ink); }
.stats dt { font-size: 14.5px; line-height: 1.45; color: rgba(241, 236, 226, .8); max-width: 28ch; padding-top: 4px; }
.stats div { border-top: 1px solid var(--line-ink); padding-top: 18px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 4. Services ---------- */
.svc-list { border-top: 1px solid var(--ink); margin-top: clamp(32px, 5vw, 72px); }
.svc { position: relative; display: grid; gap: 18px 24px; padding: 28px 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr 1fr; transition: background .4s var(--ease), padding .5s var(--ease); }
.svc:hover { background: var(--paper-2); padding-inline: 14px; }
.s-title { grid-column: 1 / -1; position: relative; padding-left: 36px; }
.s-title h3 { display: block; font: 700 clamp(28px, 3.6vw, 52px)/1.05 var(--display); letter-spacing: -.035em; }
.s-n { position: absolute; left: 0; top: .5em; width: 36px; font: 400 13px/1 var(--mono); color: var(--accent); }
.s-title p { color: var(--muted); margin-top: 8px; }
.s-inc { grid-column: 1 / -1; padding-left: 36px; display: grid; gap: 6px; font-size: 15.5px; }
.s-inc li { position: relative; padding-left: 18px; }
.s-inc li::before { content: ''; position: absolute; left: 0; top: .72em; width: 8px; height: 1.5px; background: var(--accent); }
.s-time { font: 400 13px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .05em; padding-left: 36px; align-self: end; }
.s-price { font: 700 clamp(26px, 2.3vw, 34px)/1 var(--display); letter-spacing: -.04em; text-align: right; white-space: nowrap; align-self: end; }
.s-price small { display: block; font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
@media (min-width: 1000px) {
  .svc { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 140px 170px; align-items: start; padding-block: 36px; }
  .s-title { grid-column: auto; } .s-inc { grid-column: auto; padding-left: 0; } .s-time { padding-left: 0; align-self: start; padding-top: 10px; } .s-price { align-self: start; }
}
.svc-note { margin-top: 28px; color: var(--muted); max-width: 64ch; }

/* ---------- 5. About ---------- */
.about { background: var(--paper-2); }
.about-grid { display: grid; gap: 44px; }
.about-text .h2 { margin-bottom: 32px; max-width: 14ch; }
.about-text p { max-width: 54ch; margin-bottom: 16px; font-size: 18px; }
.about-card { border: 1.5px solid var(--ink); background: var(--paper); align-self: start; }
.about-card svg { width: 100%; height: auto; border-bottom: 1.5px solid var(--ink); }
.about-card dl div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.about-card dl div:last-child { border: 0; }
.about-card dt { font: 400 12.5px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 7vw, 120px); } }

.clients { margin-top: clamp(56px, 8vw, 110px); display: grid; gap: 18px; border-top: 1px solid var(--ink); padding-top: 16px; }
.clients h3 { font: 400 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.clients ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.clients li { font: 700 clamp(19px, 2.2vw, 30px)/1.1 var(--display); letter-spacing: -.025em; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .clients ul { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .clients { grid-template-columns: 220px 1fr; } .clients ul { grid-template-columns: repeat(4, 1fr); } }

.quotes { margin-top: clamp(56px, 8vw, 110px); display: grid; gap: 20px; }
.quote { background: var(--paper); border: 1.5px solid var(--ink); padding: clamp(22px, 3vw, 44px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; position: relative; }
.quote::before { content: '“'; position: absolute; top: 4px; right: 22px; font: italic 400 120px/1 'Playfair Display', Georgia, serif; color: var(--accent); }
.quote p { font: 600 clamp(20px, 2vw, 28px)/1.3 var(--display); letter-spacing: -.02em; max-width: 30ch; }
.quote figcaption { font-size: 14.5px; color: var(--muted); }
.quote figcaption strong { display: block; color: var(--ink); font-size: 16px; }
@media (min-width: 900px) { .quotes { grid-template-columns: 1fr 1fr; } }

/* ---------- 6. Contact ---------- */
.contact .h2.big { max-width: 12ch; }
.avail { display: inline-flex; align-items: center; }
.contact-grid { display: grid; gap: 44px; margin-top: clamp(32px, 5vw, 72px); }
.mail { display: inline-block; font: 700 clamp(22px, 3.3vw, 50px)/1.05 var(--display); letter-spacing: -.04em; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 4px no-repeat; padding-bottom: 6px; margin-bottom: 28px; word-break: break-word; transition: background-size .4s var(--ease), color .3s; }
.mail:hover { background-size: 100% 100%; color: #fff; }
.contact-side p { max-width: 44ch; margin-bottom: 14px; }
.small { font-size: 14px; color: var(--muted); }
.form { display: grid; gap: 22px; grid-template-columns: 1fr; align-content: start; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font: 400 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select, .field textarea { font: 400 17px/1.4 var(--body); color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 10px 0 12px; width: 100%; transition: border-color .3s, background .3s; }
.field select { appearance: none; -webkit-appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2314120f' stroke-width='2'/%3E%3C/svg%3E") right 4px center no-repeat; }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: rgba(217, 58, 20, .06); }
.field.bad input, .field.bad textarea { border-color: var(--accent); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.form-msg { font-weight: 500; max-width: 40ch; }
@media (min-width: 700px) { .form { grid-template-columns: 1fr 1fr; } .field.wide, .form-foot { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 120px); } }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 1; background: var(--ink); color: var(--paper); padding: clamp(40px, 6vw, 80px) 0 28px; overflow: hidden; }
.foot-mark { font: 800 clamp(80px, 19vw, 300px)/.78 var(--display); letter-spacing: -.055em; margin: 0 0 clamp(24px, 4vw, 56px) -.05em; color: var(--paper); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; border-top: 1px solid var(--line-ink); padding-top: 18px; font-size: 14.5px; }
.foot a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.foot a:hover { background-size: 100% 1px; }
.foot-note { margin-top: 14px; font-size: 13px; color: rgba(241, 236, 226, .6); }

/* ---------- Reveal on scroll (classes are added by js/scroll.js) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-cta span { display: none; }
  .nav-cta { padding: 10px 13px; }
  .nav-cta::after { content: 'Contact'; }
  .nav-cta .dot { margin-right: 8px; }
  .hero { padding-bottom: 18px; }
  .hero-card { padding: 18px; }
  .hero.live .hero-card { box-shadow: 6px 6px 0 var(--ink); }
  .display { font-size: clamp(52px, 16.5vw, 84px); margin: 8px 0 12px; }
  .lede { font-size: 15.5px; }
  .actions { margin-top: 18px; }
  .btn { min-height: 48px; padding: 0 22px; }
  .hero-label { display: none !important; }
  .hero-hint { top: calc(var(--nav-h) + 12px); right: 12px; }
  .row { grid-template-columns: 26px 44px 1fr; column-gap: 12px; }
  .r-thumb { width: 44px; height: 55px; }
  .meta div { grid-template-columns: 76px 1fr; }
  .about-card dl div { grid-template-columns: 124px 1fr; }
}

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

/* The fixed WebGL canvas sits behind every section; the hero is transparent, later sections cover it. */
.field-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; background: var(--paper); }
