/* One stylesheet, no framework. Tokens first, then the few layouts this site needs. */
:root {
  --ink: #12100d;
  --ink-soft: rgba(18, 16, 13, 0.62);
  --ink-faint: rgba(18, 16, 13, 0.38);
  --paper: #efe9dd;
  --paper-deep: #e6dfd1;
  --accent: #c8451b;
  --line: rgba(18, 16, 13, 0.16);
  --line-soft: rgba(18, 16, 13, 0.08);
  --serif: InstrumentSerif, Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: IBMPlexMono, ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(20px, 4vw, 64px);
  --max: 1440px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@font-face {
  font-family: InstrumentSerif;
  src: url(/assets/fonts/InstrumentSerif-Regular.woff2) format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: InstrumentSerif;
  src: url(/assets/fonts/InstrumentSerif-Italic.woff2) format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/assets/fonts/Inter-Variable.woff2) format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/assets/fonts/Inter-Variable.woff2) format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/assets/fonts/Inter-Variable.woff2) format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: IBMPlexMono;
  src: url(/assets/fonts/IBMPlexMono-Regular.woff2) format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(15px, 0.55vw + 13px, 17px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(22px, 1.6vw, 27px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 32px);
}

.site-nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 200ms var(--ease);
  padding: 6px 0;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] { color: var(--ink); }

.pill,
.site-nav a.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.pill:hover,
.site-nav a.pill:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}


/* ---------------------------------------------------------------- stage */
/* The hero is the one place the site is allowed to be loud: an ink panel with a
   raymarched chrome knot behind the statement. Everything below stays editorial. */
.hero.is-stage {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  min-height: min(86vh, 900px);
  display: flex;
  align-items: flex-end;
  padding: clamp(110px, 16vh, 180px) 0 clamp(36px, 6vh, 64px);
}
.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.hero.is-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(18, 16, 13, 0.94) 0%, rgba(18, 16, 13, 0.4) 46%, rgba(18, 16, 13, 0.12) 100%),
    linear-gradient(to right, rgba(18, 16, 13, 0.82) 0%, rgba(18, 16, 13, 0.55) 42%, rgba(18, 16, 13, 0) 72%);
}
.hero.is-stage .wrap {
  position: relative;
  z-index: 2;
  width: 100%;
}
.hero.is-stage .display {
  color: var(--paper);
  /* Fit the statement, the lead and the two CTAs above the fold on a 900px viewport. */
  font-size: clamp(40px, 7.2vw, 104px);
}
.hero.is-stage .hero-foot { margin-top: clamp(22px, 3vw, 40px); }
.hero.is-stage .hero-actions { margin-top: 18px; }
.hero.is-stage .display em { color: var(--accent); }
.hero.is-stage .mono { color: rgba(239, 233, 221, 0.62); }
.hero.is-stage .lead { color: rgba(239, 233, 221, 0.92); }
.hero.is-stage .hero-foot { border-top-color: rgba(239, 233, 221, 0.24); }
.hero.is-stage .pill { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.hero.is-stage .pill:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.hero.is-stage .ghost { color: var(--paper); border-color: rgba(239, 233, 221, 0.34); }
.hero.is-stage .ghost:hover { border-color: var(--paper); background: rgba(239, 233, 221, 0.08); }
.hero.is-stage .system-box { border-color: rgba(239, 233, 221, 0.5); }
.hero.is-stage .system-row:nth-child(2) .system-box { background: var(--accent); border-color: var(--accent); }
.hero.is-stage .system-line { background: rgba(239, 233, 221, 0.2); }
.hero.is-stage .hero-meta { color: rgba(239, 233, 221, 0.62); }
.stage-cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(18px, 3vh, 30px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(239, 233, 221, 0.55);
}
.stage-cue::after {
  content: '';
  display: block;
  width: 46px;
  height: 1px;
  background: rgba(239, 233, 221, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .stage-cue::after { animation: hx-cue 2600ms var(--ease) infinite; transform-origin: left center; }
  @keyframes hx-cue {
    0%, 100% { transform: scaleX(0.4); opacity: 0.4; }
    50% { transform: scaleX(1); opacity: 1; }
  }
}

/* No WebGL, or motion reduced: the panel keeps its contrast without the canvas. */
.hero.is-stage.is-stage-fallback,
.hero.is-stage.is-stage-static {
  background:
    radial-gradient(120% 90% at 72% 18%, rgba(200, 69, 27, 0.22), transparent 62%),
    var(--ink);
}
.hero.is-stage.is-stage-static .stage-canvas { display: none; }

/* ---------------------------------------------------------------- marquee */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 24px;
  animation: hx-marquee 42s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.marquee-track span::after { content: '·'; margin-left: 24px; color: var(--ink-faint); }
@keyframes hx-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
}

/* ---------------------------------------------------------------- cursor */
.hx-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  transition: width 260ms var(--ease), height 260ms var(--ease), opacity 260ms var(--ease);
  will-change: transform;
}
.hx-cursor.is-visible { opacity: 1; }
.hx-cursor.is-active { width: 42px; height: 42px; }
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .hx-cursor { display: none; }
}

/* Cross-document view transitions where the browser supports them. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: hx-page-out 260ms var(--ease) both; }
::view-transition-new(root) { animation: hx-page-in 380ms var(--ease) both; }
@keyframes hx-page-out { to { opacity: 0; } }
@keyframes hx-page-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------------------------------------------------------------- layout */
main { display: block; }

.section {
  padding: clamp(56px, 8vw, 128px) 0;
  border-top: 1px solid var(--line-soft);
}
.section:first-of-type { border-top: 0; }

h2.eyebrow {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 clamp(24px, 3vw, 44px);
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.eyebrow .rule-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.015em;
}

.display {
  font-size: clamp(44px, 9vw, 132px);
  line-height: 0.94;
  letter-spacing: -0.025em;
}
.display em { font-style: italic; }

.title {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.32;
  max-width: 46ch;
  margin: 0;
  color: var(--ink);
}

.body-copy p { max-width: 62ch; color: var(--ink-soft); }
.body-copy p + p { margin-top: 1.1em; }


/* Signature device: the three layers this site keeps talking about, drawn once and
   repeated. Left label, hairline, and a square that fills with the accent on the
   middle row. It appears in the hero, in the about header and on each case study. */
.system-diagram {
  display: grid;
  gap: 10px;
  margin: 0;
  max-width: 520px;
}
.system-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 14px;
}
.system-row .system-line {
  height: 1px;
  background: var(--line);
}
.system-row .system-box {
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
}
.system-row:nth-child(2) .system-box {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------- hero */
.hero { padding-top: clamp(48px, 7vw, 104px); }

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
}

.hero-meta {
  display: grid;
  gap: 6px;
  text-align: right;
}

.hero .display { max-width: 16ch; }

.hero-foot {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero-foot .lead { max-width: 34ch; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.ghost:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }

.stack-strip {
  margin-top: clamp(36px, 5vw, 64px);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.stack-strip .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

/* ---------------------------------------------------------------- work */
.work-list { display: grid; gap: 0; }

.work-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 460px);
  gap: clamp(16px, 3vw, 48px);
  align-items: start;
  padding: clamp(24px, 3vw, 40px) 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background 240ms var(--ease);
}
.work-item:last-child { border-bottom: 1px solid var(--line); }
.work-item:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }

.work-index { padding-top: 8px; }
.work-name {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 58px);
  line-height: 1;
  margin: 0 0 10px;
}
.work-item:hover .work-name { color: var(--accent); }
.work-tag { margin: 0 0 14px; max-width: 46ch; color: var(--ink-soft); }
.work-stack { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

.work-plate {
  border: 1px solid var(--line);
  background: var(--paper-deep);
  overflow: hidden;
}
.work-plate img { width: 100%; transition: transform 700ms var(--ease); }
.work-item:hover .work-plate img { transform: scale(1.03); }

/* ---------------------------------------------------------------- process */
.process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
}
.process-step { border-top: 1px solid var(--line); padding-top: 18px; }
.process-step .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.process-step h3 { font-size: clamp(22px, 2.2vw, 30px); margin: 12px 0 10px; }
.process-step p { margin: 0; color: var(--ink-soft); max-width: 34ch; }

/* ---------------------------------------------------------------- rows */
.rows { display: grid; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 40px);
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.rows .row:last-child { border-bottom: 1px solid var(--line); }
.row dt,
.row h3 { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 26px); }
.row dd,
.row p { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* ---------------------------------------------------------------- facts */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
}
.fact { border-top: 1px solid var(--line); padding-top: 16px; }
.fact .value { font-family: var(--serif); font-size: clamp(44px, 6vw, 84px); line-height: 1; }
.fact .label { margin-top: 8px; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 6vw, 96px) 0 32px;
}
.footer-cta {
  font-family: var(--serif);
  font-size: clamp(38px, 7vw, 108px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(28px, 4vw, 52px);
  text-decoration: none;
  display: block;
}
.footer-cta:hover { color: var(--accent); }
.footer-cta em { font-style: italic; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

/* ---------------------------------------------------------------- project page */
.project-hero { padding-top: clamp(40px, 6vw, 88px); }
.project-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(28px, 4vw, 48px);
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.project-meta dt { margin-bottom: 6px; }
.project-meta dd { margin: 0; }

.plate-wide { margin: clamp(28px, 4vw, 56px) 0; border: 1px solid var(--line); }
.chapters { display: grid; gap: 0; }
.chapter {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: clamp(12px, 2vw, 32px);
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .work-item:hover .work-plate img { transform: none; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .work-item { grid-template-columns: 44px minmax(0, 1fr); }
  .work-plate { grid-column: 1 / -1; }
  .hero-foot { grid-template-columns: 1fr; }
  .project-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-nav a:not(.pill) { display: none; }
  .process { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .hero-meta { text-align: left; }
  .footer-cta { font-size: clamp(34px, 11vw, 64px); }
}
