/*
  RedCell. Everything is built from one unit, the cell: the hero is a fluid seen
  through a grid of cells, the covers are drawn in cells, and every section is
  addressed like a cell (B2, C3...). Warm black, bone ink, one signal red.
  Archivo carries everything; its width axis does the expressive work.
  Martian Mono is for labels and metadata.
*/
:root {
  --bg: #0c0b0b;
  --raise: #141212;
  --ink: #f0ebe5;
  --muted: #9a938d;
  --line: rgba(240, 235, 229, 0.12);
  --red: #ff3b24;
  --on-red: #0c0b0b;
  --gut: clamp(32px, 2.2vw, 56px);
  --section: clamp(96px, 10vw, 168px);   /* one vertical gap between sections */   /* page margin; grows on very large screens */
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); }
body { font: 400 17px/1.55 var(--sans); font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
ul { list-style: none; }
.mono { font-family: var(--mono); font-size: clamp(12px, 0.62vw + 3px, 16px); line-height: 1.5; letter-spacing: 0; font-variation-settings: "wdth" 100; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 10px 14px; background: var(--ink); color: var(--bg); font-weight: 500; }
.skip:focus { top: 16px; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; }
.hero-cells { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; touch-action: pan-y; }
.hero-fallback { display: none; }
.no-gl .hero-fallback {
  display: block; position: absolute; left: var(--gut); right: var(--gut); bottom: 64px;
  font: 900 100px/.84 var(--sans); font-variation-settings: "wdth" 125; letter-spacing: 0; color: var(--ink);
}
.hero-fallback span { display: block; width: max-content; }

.bar { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; align-items: center; padding: 24px var(--gut); }
.mark { grid-column: 1 / 4; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: clamp(15px, 0.55vw + 7px, 20px); font-variation-settings: "wdth" 112; text-decoration: none; justify-self: start; }
.mark-cell { width: 11px; height: 11px; background: var(--red); }
.bar-note { grid-column: 5 / 9; color: var(--muted); }
.bar-links { grid-column: 9 / 13; justify-self: end; display: flex; gap: 28px; font-size: clamp(15px, 0.55vw + 7px, 20px); font-weight: 500; }
.bar-links a, .contact-foot a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); padding: 6px 0; }
.bar-links a:hover, .bar-links a:focus-visible, .contact-foot a:hover, .contact-foot a:focus-visible { background-size: 100% 1px; }

.hero-intro {
  position: absolute; left: var(--gut); top: clamp(104px, 17vh, 180px); max-width: calc(20ch + 32px);
  font-size: clamp(22px, 2.35vw, 38px); line-height: 1.12; font-weight: 400; font-variation-settings: "wdth" 104; letter-spacing: -0.012em;
  pointer-events: none;
}
/* the tagline sits on a solid plate so the stirred field passes behind it, never through it */
.hero-intro { background: var(--bg); padding: 12px 16px; margin: -12px -16px; }
.hero.poster .hero-intro { left: var(--intro-x); top: auto; bottom: var(--intro-bottom, 72px); max-width: calc(19ch + 32px); font-size: clamp(20px, 1.9vw, 32px); }
.hero-foot { position: absolute; left: var(--gut); right: var(--gut); bottom: 18px; display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); pointer-events: none; }
.hero-foot > * { background: var(--bg); }
.motion { pointer-events: auto; font: inherit; color: var(--muted); background: var(--bg); border: 0; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.motion:hover { color: var(--ink); }
.paused .hero-scroll::after { animation-play-state: paused; }
.hero-scroll::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; background: var(--red); animation: drop 2.4s var(--ease) infinite; }
@keyframes drop { 0%, 30% { transform: translateY(-3px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(5px); opacity: 0; } }

/* load choreography */
.intro-pending .bar, .intro-pending .hero-intro, .intro-pending .hero-foot { opacity: 0; }
.intro-run .bar { animation: rise 1s var(--ease) .15s both; }
.intro-run .hero-intro { animation: rise 1.2s var(--ease) 1.1s both; }
.intro-run .hero-foot { animation: rise 1s var(--ease) 1.5s both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* anything focused during the intro shows at once (WCAG 2.4.7) */
.intro-pending :is(.bar, .hero-foot):focus-within,
.intro-run :is(.bar, .hero-foot):focus-within { opacity: 1; animation: none; }
.coord { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; color: var(--bg); background: var(--red); padding: 2px 6px; opacity: 0; transition: opacity .3s; will-change: transform; }
.coord.on { opacity: 1; }

/* ---------- sections ---------- */
.section, .contact { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; padding: 0 var(--gut); }
.label { grid-column: 1 / 2; color: var(--red); padding-top: 22px; }
.label-title { grid-column: 2 / 4; color: var(--muted); font-weight: 400; padding-top: 22px; }
.section { border-top: 1px solid var(--line); padding-bottom: var(--section); }

.statement {
  grid-column: 4 / 13; padding-top: 16px;
  font-size: clamp(30px, 4.15vw, 72px); line-height: 1.04; font-weight: 400; letter-spacing: -0.022em; font-variation-settings: "wdth" 96;
  text-wrap: pretty;
}
.studio { padding-top: 0; }
/* the statement lights word by word as it scrolls through; key words are set wide */
.statement em { font-style: normal; white-space: nowrap; font-weight: 500; font-variation-settings: "wdth" 125; letter-spacing: -0.03em; }
.statement em::before { content: ""; display: inline-block; width: .32em; height: .32em; margin: 0 .16em .1em 0; background: var(--red); vertical-align: middle; }
.js-words .statement .w { color: var(--muted); transition: color .5s ease; }
.js-words .statement .w.lit { color: var(--ink); }

/* work: an uneven grid of covers */
.work-grid { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--section) clamp(24px, 2.8vw, 48px); padding-top: clamp(48px, 6vw, 96px); align-items: end; }   /* captions in a row share a baseline */
.w1 { grid-column: 1 / 9; }
.w2 { grid-column: 9 / 13; }
.w3 { grid-column: 1 / 6; }   /* rhythm: large + small, then mirrored; bottoms align */
.w4 { grid-column: 6 / 13; }
.cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--raise); clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease); }
.w2 .cover { aspect-ratio: 3 / 4; }
.w3 .cover { aspect-ratio: 1 / 1; }
.cover canvas { position: absolute; top: -5%; left: 0; width: 100%; height: 110%; display: block; transform: scale(1.06); transition: transform 1.8s var(--ease); }
.in .cover { clip-path: inset(0 0 0 0); }
.in .cover canvas { transform: none; }
.work-item:hover .cover canvas { transform: scale(1.015); transition-duration: .9s; }
.caption { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 14px; }
.caption .num { color: var(--red); }
.caption h3 {
  font-size: clamp(24px, 2.3vw, 38px); line-height: 1; font-weight: 600; letter-spacing: -0.015em;
  font-variation-settings: "wdth" 100; transition: font-variation-settings .8s var(--ease);
}
.work-item:hover h3 { font-variation-settings: "wdth" 125; }
.caption .meta { color: var(--muted); transition: color .5s var(--ease); }
.work-item:hover .caption .meta { color: var(--ink); }

/* capabilities: an index of large rows; a red fill wipes across the row under the pointer */
.caps-grid { grid-column: 1 / 13; margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); }
.cap { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; align-items: baseline; padding: clamp(18px, 2vw, 28px) 12px clamp(22px, 2.4vw, 34px); border-bottom: 1px solid var(--line); transition: color .5s var(--ease); }
.cap-fill { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; pointer-events: none; }
.cap-n { grid-column: 1 / 2; white-space: nowrap; color: var(--red); transition: color .5s var(--ease); }
.cap h3 { grid-column: 2 / 9; font-size: clamp(40px, 7.2vw, 124px); font-weight: 500; line-height: .9; letter-spacing: -0.035em; font-variation-settings: "wdth" 108; transition: font-variation-settings .8s var(--ease); }
.cap ul { grid-column: 9 / 13; display: flex; flex-direction: column; align-items: flex-end; }
.cap li { color: var(--muted); padding: 2px 0; transition: color .5s var(--ease); }
@media (hover: hover) {
  /* text darkens a beat after the red fill starts, so it never sits dark on dark */
  .cap:hover, .cap:hover .cap-n, .cap:hover li { transition-delay: .22s; }
  .cap:hover { color: var(--on-red); }
  .cap:hover .cap-n, .cap:hover li { color: var(--on-red); }
  .cap:hover h3 { font-variation-settings: "wdth" 125; }
}

/* the seam into contact: cells grow into solid red */
.edge { position: relative; height: 168px; margin-top: -1px; }
.edge canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 600px) { .edge { height: 112px; } }

/* contact: the page turns red */
.contact {
  position: relative; isolation: isolate; overflow: hidden;
  background-color: var(--red); color: var(--on-red);
  min-height: 100vh; min-height: 100svh; grid-template-rows: auto auto 1fr; row-gap: 0;
}
.contact .label, .contact .label-title { color: var(--on-red); }
/* text keeps a knockout of the page red so the ink passes behind it */
.contact-lead, .contact-mail, .contact-foot, .contact .label, .contact .label-title { background-color: var(--red); }
.contact-lead { justify-self: start; }
.contact-cells { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; touch-action: pan-y; }
.contact-lead { grid-column: 4 / 13; padding-top: 16px; font-size: clamp(30px, 4.15vw, 72px); line-height: 1.04; letter-spacing: -0.022em; font-variation-settings: "wdth" 96; }
.contact-mail {
  grid-column: 1 / 13; margin-top: clamp(80px, 16vh, 200px); justify-self: start; align-self: start;
  font-size: clamp(30px, 7.1vw, 140px); line-height: .9; font-weight: 800; letter-spacing: -0.03em; font-variation-settings: "wdth" 118;
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 .06em no-repeat var(--red); padding-bottom: .08em; transition: background-size .9s var(--ease), font-variation-settings .9s var(--ease);
}
.contact-mail:hover, .contact-mail:focus-visible { background-size: 100% .06em; font-variation-settings: "wdth" 125; }
.contact-mail:focus-visible { outline-color: var(--on-red); }
.contact-foot { grid-column: 1 / 13; align-self: end; display: flex; justify-content: space-between; align-items: baseline; padding: 20px 0 24px; margin-top: clamp(80px, 14vh, 160px); border-top: 1px solid rgba(12, 11, 11, .25); }
.contact a:focus-visible { outline-color: var(--on-red); }

/* reveal */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.3s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal]:focus-visible, [data-reveal]:focus-within { opacity: 1; transform: none; transition: none; }
.work-item[data-reveal] { opacity: 1; transform: none; }
.work-item[data-reveal] .caption { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease) .35s, transform 1.2s var(--ease) .35s; }
.work-item.in .caption { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .work-item[data-reveal] .caption, .cover, .cover canvas, .cap, .cap h3 { transition: none; }
  .hero-scroll::after { animation: none; opacity: 1; }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .bar-note { display: none; }
  .label { grid-column: 1 / 3; }
  .label-title { grid-column: 3 / 13; }
  .statement, .contact-lead { grid-column: 1 / 13; padding-top: 40px; }
  .cap h3 { grid-column: 2 / 13; }
  .cap ul { grid-column: 2 / 13; flex-direction: row; flex-wrap: wrap; gap: 0 16px; align-items: baseline; margin-top: 12px; }
  .w1, .w2, .w3, .w4 { grid-column: 1 / 13; margin-top: 0; }
  .w2 { grid-column: 4 / 13; }
  .w3 { grid-column: 1 / 10; }
}
@media (max-width: 600px) {
  :root { --gut: 16px; }
  .bar { padding: 18px var(--gut); }
  .mark { grid-column: 1 / 7; }
  .bar-links { grid-column: 7 / 13; gap: 16px; font-size: 14px; }
  .hero-intro { top: 88px; }
  .hero-foot > :first-child { display: none; }
  .w2, .w3 { grid-column: 1 / 13; }
  .w2 .cover { aspect-ratio: 4 / 3; }
  .cap { padding-left: 0; padding-right: 0; }
  .cap-n { grid-column: 1 / 3; }
  .cap h3, .cap ul { grid-column: 3 / 13; }
  .contact-foot { flex-direction: column; gap: 12px; }
  /* phones: the email is set narrow (wdth 75) so it can be the largest line in the section */
  .contact-mail { font-size: max(10.6vw, 2.125rem); font-variation-settings: "wdth" 75; letter-spacing: -0.035em; overflow-wrap: anywhere; }   /* rem floor so browser zoom enlarges it (WCAG 1.4.4) */
  .contact-mail:hover, .contact-mail:focus-visible { font-variation-settings: "wdth" 75; }
}
