/* ================================================================
   ORIGINAL® — one of one
   palette · type · motion tokens
   ================================================================ */
:root {
  --paper: #F4F2EC;
  --ink:   #171512;
  --soft:  #33302A;   /* body copy */
  --mute:  #565144;   /* secondary text */
  --faint: #8B857A;   /* decorative labels */
  --accent: #C8102E;  /* signal red — the only accent */
  --rule:  rgba(23, 21, 18, 0.14);
  --rule-strong: rgba(23, 21, 18, 0.82);
  --grain-blend: multiply;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Instrument Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono:  "Space Mono", "SF Mono", Consolas, ui-monospace, monospace;

  --head-h: 68px;
  --gutter: clamp(20px, 5vw, 72px);

  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
}

html[data-theme="dark"] {
  --paper: #141210;
  --ink:   #EDE9E1;
  --soft:  #CCC7BD;
  --mute:  #99938A;
  --faint: #6E6860;
  --accent: #FF4D42;
  --rule:  rgba(237, 233, 225, 0.13);
  --rule-strong: rgba(237, 233, 225, 0.8);
  --grain-blend: screen;
  color-scheme: dark;
}

/* water-fill theme wipe (driven by app.js via View Transitions) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.4s ease, color 0.4s ease;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
sup { font-size: 0.55em; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px;
  padding: 10px 16px; transition: top 0.2s;
}
.skip-link:focus-visible { top: 12px; }

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

/* trailing cursor dot — styles live in the cursor/labels block below */

/* ---------------- header ---------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--head-h);
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  justify-self: start;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.wordmark sup {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  margin-left: 2px;
}
.wordmark:hover em { font-style: italic; }
.wordmark { transition: opacity 0.2s; }
.wordmark:hover { opacity: 0.7; }

/* tabs */
.tabs-wrap { min-width: 0; }
.tabs {
  position: relative;
  display: flex;
  gap: 2px;
}
.tab {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 15px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.25s var(--ease-out);
  white-space: nowrap;
}
.tab-num { font-size: 9px; color: var(--rule-strong); opacity: 0.55; transition: inherit; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"] .tab-num { color: var(--accent); opacity: 1; }

.tab-ink {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out);
  will-change: transform, width;
}

.head-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  color: var(--mute);
  transition: color 0.25s, border-color 0.25s, transform 0.5s var(--ease-out);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(180deg);
}
.theme-toggle:active { transform: rotate(180deg) scale(0.88); }
.clock {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.clock::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 9px;
  vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------------- layout / panels ---------------- */
main { flex: 1; display: flex; flex-direction: column; }

.panel { display: none; }
.panel.is-active {
  display: block;
  width: 100%;
  flex: 1;
  animation: panelIn 0.55s var(--ease-out) both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* staggered reveals inside panels */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.is-active .reveal.in { opacity: 1; transform: none; }
.is-active .r1.in { transition-delay: 0.05s; }
.is-active .r2.in { transition-delay: 0.14s; }
.is-active .r3.in { transition-delay: 0.23s; }
.is-active .r4.in { transition-delay: 0.32s; }
.is-active .r5.in { transition-delay: 0.41s; }
.is-active .r6.in { transition-delay: 0.50s; }
.is-active .r7.in { transition-delay: 0.59s; }

/* shared bits */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
}
.tick {
  width: 8px; height: 8px;
  background: var(--accent);
  flex: none;
}

/* ---------------- 01 · hero ---------------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--head-h));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vh, 48px) var(--gutter) clamp(28px, 5vh, 56px);
  overflow: clip;
}

#hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: crosshair;
}

.hero-eyebrow { position: relative; z-index: 2; }

.hero-foot {
  position: relative; z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: clamp(28px, 5vw, 72px);
}

.ledger {
  list-style: none;
  width: min(300px, 42vw);
}
.ledger li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-block: 9px;
  border-top: 1px solid var(--rule);
}
.ledger li:last-child { border-bottom: 1px solid var(--rule); }
.ledger span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.ledger b { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }

.hero-cta { text-align: right; }
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.3vw, 27px);
  line-height: 1.32;
  margin-bottom: 22px;
}
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 999px;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
}
.btn svg { transition: transform 0.3s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: scale(0.97); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); }
.btn-ghost { border: 1px solid var(--rule-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- inner pages ---------------- */
.page {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(52px, 8vh, 92px) var(--gutter) clamp(64px, 9vh, 110px);
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6.5vw, 92px);
  line-height: 0.99;
  letter-spacing: -0.01em;
  margin-top: 26px;
  text-wrap: balance;
}
.page-title em { font-style: italic; color: var(--accent); }

/* origin */
.manifesto {
  margin-top: clamp(44px, 7vh, 76px);
  max-width: 900px;
}
.manifesto blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3.1vw, 40px);
  line-height: 1.28;
  text-indent: -0.42em;
}
.manifesto figcaption {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.prose-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: clamp(36px, 6vw, 96px);
  margin-top: clamp(48px, 8vh, 88px);
  align-items: start;
}
.prose p {
  font-size: 16px;
  line-height: 1.78;
  color: var(--soft);
  max-width: 58ch;
}
.prose p + p { margin-top: 1.2em; }
.prose b { font-weight: 600; color: var(--ink); }

.spec {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}
.spec-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.spec-list div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding-block: 10px;
  border-bottom: 1px solid var(--rule);
}
.spec-list dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.spec-list dd { font-size: 14px; font-weight: 500; text-align: right; }

/* editions — editorial index, not cards */
.works {
  list-style: none;
  margin-top: clamp(44px, 7vh, 72px);
}
.work > a {
  --bleed: var(--gutter);
  display: grid;
  grid-template-columns: 76px minmax(0, 1.1fr) minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: clamp(14px, 2.5vw, 32px);
  padding: clamp(20px, 3.4vh, 30px) 0;
  border-top: 1px solid var(--rule);
  margin-inline: calc(-1 * var(--bleed));
  padding-inline: var(--bleed);
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out),
              padding-left 0.35s var(--ease-out);
}
.work:last-child > a { border-bottom: 1px solid var(--rule); }
.work > a:hover,
.work > a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  padding-left: calc(var(--bleed) + 20px);
}
.w-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  transition: color 0.35s;
}
.work > a:hover .w-no { color: var(--accent); }
.w-name {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.05;
  transition: letter-spacing 0.35s var(--ease-out);
}
.work > a:hover .w-name { font-style: italic; letter-spacing: 0.005em; }
.w-medium {
  font-size: 13px;
  color: var(--mute);
  transition: color 0.35s;
}
.work > a:hover .w-medium { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.w-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
  transition: color 0.35s;
}
.work > a:hover .w-year { color: color-mix(in srgb, var(--paper) 62%, transparent); }
.w-arrow {
  font-size: 22px;
  justify-self: end;
  transition: transform 0.35s var(--ease-out);
}
.work > a:hover .w-arrow { transform: translate(4px, -4px); color: var(--accent); }

.works-note {
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

/* contact */
.page-contact { display: flex; flex-direction: column; }
.mailto {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--serif);
  font-size: clamp(32px, 6vw, 82px);
  line-height: 1.05;
  margin-top: clamp(40px, 7vh, 72px);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  transition: color 0.3s, border-color 0.3s;
  overflow-wrap: anywhere;
}
.mailto:hover { color: var(--accent); border-color: var(--accent); font-style: italic; }

.contact-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 96px);
  margin-top: clamp(48px, 8vh, 88px);
}
.channels { list-style: none; border-top: 2px solid var(--ink); padding-top: 16px; }
.channels li + li { margin-top: 2px; }
.channels a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
  padding-block: 8px;
  transition: color 0.25s, transform 0.3s var(--ease-out);
}
.channels a sup { color: var(--faint); transition: color 0.25s; }
.channels a:hover { color: var(--accent); transform: translateX(6px); }
.channels a:hover sup { color: var(--accent); }

.availability { border-top: 2px solid var(--ink); padding-top: 16px; }
.availability p { font-size: 15px; color: var(--soft); margin-top: 8px; }
.availability b { color: var(--ink); font-weight: 600; }

/* ---------------- preloader ---------------- */
.loader {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: var(--paper);
  transition: transform 0.85s var(--ease-out);
}
.loader.is-done { transform: translateY(-101%); }
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.loader-brand {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.04em;
}
.loader-brand sup { font-family: var(--mono); font-size: 10px; color: var(--accent); }
.loader-bar {
  width: 150px;
  height: 1px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.loader-fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.loader-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ---------------- trailing cursor + chat hints ---------------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 95;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  opacity: 0; pointer-events: none;
  transform: translate(-100px, -100px);
  display: flex; align-items: center; justify-content: center;
}
.cursor.is-on { opacity: 0.55; }
.cursor.is-big { opacity: 0.85; transform-origin: center; }
.cursor-bubble { display: none; }
.cursor.is-label .cursor-bubble {
  display: flex;
  align-items: center;
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 10px;
  border-radius: 7px;
  animation: bubbleIn 0.26s var(--ease-out) both;
}
.cursor.is-label.flipped .cursor-bubble { left: auto; right: 14px; }
.cursor.is-label { background: var(--accent); opacity: 1; }
.cursor-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  min-height: 1em;
}
.cursor.is-label .cursor-label { display: inline; }
.cursor.is-label .cursor-bubble::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  background: var(--ink);
  transform: rotate(45deg);
  left: -2px;
  top: 50%;
  margin-top: -2.5px;
}
.cursor.is-label.flipped .cursor-bubble::after { left: auto; right: -2px; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(7px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}
body.has-cursor #hero-canvas { cursor: none; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------------- ticker ---------------- */
.ticker {
  border-block: 1px solid var(--rule);
  overflow: hidden;
  padding-block: 13px;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 30s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------------- colophon ---------------- */
.colophon {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px var(--gutter) 24px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------------- responsive ---------------- */
@media (max-width: 920px) {
  .site-head {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding-block: 14px 0;
    row-gap: 4px;
  }
  .wordmark { grid-column: 1; grid-row: 1; }
  .head-meta { grid-column: 2; grid-row: 1; }
  .tabs-wrap { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; }
  .tabs-wrap::-webkit-scrollbar { display: none; }
  .tabs { width: max-content; padding-bottom: 0; }
  .tab { padding: 12px 14px 14px; }
  .tab-ink { bottom: 0; }

  .hero { min-height: calc(100svh - 150px); }
  .hero-foot {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 30px;
  }
  .hero-cta { text-align: left; }
  .cta-row { justify-content: flex-start; }
  .ledger { width: 100%; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .ledger li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }

  .prose-grid, .contact-cols { grid-template-columns: 1fr; }
  .work > a { grid-template-columns: auto 1fr auto; }
  .w-medium, .w-arrow { display: none; }
}

/* large screens breathe more */
@media (min-width: 1600px) {
  :root { --gutter: clamp(72px, 6vw, 120px); }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel.is-active { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ticker-track { animation: none; }
  .clock::before { animation: none; }
  .cursor { display: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
