/* ─────────────────────────────────────────────────────────────
   YINGER-STYLE
   bg: pure black · type: cream · accent: soft coral pink
   display: Honk (chunky stencil) · body: DM Sans · meta: JetBrains Mono
   ───────────────────────────────────────────────────────────── */
:root {
  --bg:     #0a0a0a;
  --bg-2:   #141414;
  --cream:  #ece6d5;
  --cream-2:#bcb6a5;
  --dim:    #6f6a5d;
  --coral:  #f0a896;
  --coral-2:#d68470;
  --rule:   rgba(236,230,213,0.10);

  --display: "Honk", "MD IO", system-ui, sans-serif;
  --body:    "DM Sans", -apple-system, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --pad:     clamp(24px, 4vw, 64px);
  --ease:    cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100vh; background: var(--bg); color: var(--cream); }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
::selection { background: var(--coral); color: var(--bg); }
a { color: inherit; text-decoration: none; }

/* ── Honk OUTLINE — local file, stripped of the colour layers so it renders
   as the hollow, cut-detailed outline (empty inside) identically on every
   browser. No rainbow, no in-app-fallback divergence. Colour via CSS `color`. */
@font-face {
  font-family: "Honk";
  src: url("./honk-outline.woff2") format("woff2");
  font-display: swap;
}

/* ── top-left mark (chunky stencil · two-line lockup) ────── */
.mark {
  position: fixed; top: clamp(28px, 4vw, 44px); left: var(--pad);
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: -0.01em;
  color: var(--cream);
  z-index: 10;
  -webkit-font-smoothing: subpixel-antialiased;
  transition: color .3s var(--ease);
  display: flex; flex-direction: column;
}
.mark-fn {
  font-size: clamp(22px, 2.6vw, 36px);
  color: var(--coral);
}
.mark-ln {
  font-size: clamp(36px, 4.5vw, 60px);
}
.mark:hover { color: var(--coral); }
.mark:hover .mark-fn { color: var(--cream); }

/* ── top-right pill ─────────────────────────────────────── */
.menu-pill {
  position: fixed; top: clamp(28px, 4vw, 44px); right: var(--pad);
  z-index: 10;
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--cream);
  border: 1px solid var(--rule);
  background: rgba(20,20,20,0.4);
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(8px);
  transition: all .3s var(--ease);
}
.menu-pill:hover { border-color: var(--coral); color: var(--coral); }
.mp-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 10px var(--coral);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── 3D scene ────────────────────────────────────────────── */
.scene-wrap {
  position: fixed; inset: 0; z-index: 7;   /* above the archive (z6) so it zooms out + fades ON TOP, never abruptly covered */
  pointer-events: none;
}
#cubes { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1s var(--ease); }
#cubes.ready { opacity: 1; }

/* ── bottom-left meta stack ──────────────────────────────── */
.meta-stack {
  position: fixed;
  bottom: clamp(28px, 4vw, 44px);
  left: var(--pad);
  z-index: 5;
  max-width: 640px;
  display: grid; gap: 18px;
}

.top-line, .bottom-line {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cream-2);
  line-height: 1.45;
}

.clock-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.big-clock {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(60px, 7.2vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.ampm-radio {
  display: inline-flex; flex-direction: column; gap: 4px;
  margin-top: 8px;
  font-family: var(--body);
  font-size: 12px;
  color: var(--cream-2);
}
.ar-row { display: inline-flex; align-items: center; gap: 6px; }
.ar-row i {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--cream-2);
  background: transparent;
  transition: background .3s var(--ease), border-color .3s;
}
.ar-row.is-on i { background: var(--coral); border-color: var(--coral); box-shadow: 0 0 8px var(--coral); }
.ar-row.is-on { color: var(--cream); }

.hero-sentence {
  font-family: var(--body);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--cream);
  max-width: 28ch;
  margin-top: 6px;
  flex: 1;
  min-width: 280px;
}
.hero-sentence em {
  font-style: normal;
  color: var(--cream);
}
.hero-sentence sup {
  font-family: var(--mono);
  font-size: 0.45em;
  color: var(--coral);
  vertical-align: super;
  margin: 0 2px;
}
.dim-stats {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--cream-2);
  line-height: 1.3;
  margin-left: 10px;
  vertical-align: top;
  text-transform: uppercase;
}
.dim-stats .arrow { color: var(--coral); }

/* ── bottom-right pill nav ──────────────────────────────── */
.pill-nav {
  position: fixed;
  bottom: clamp(28px, 4vw, 44px);
  right: var(--pad);
  z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end;
}
.pill {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--cream-2);
  background: rgba(20,20,20,0.5);
  border: 1px solid var(--rule);
  padding: 7px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all .3s var(--ease);
}
.pill:hover {
  color: var(--cream);
  border-color: var(--coral);
  background: rgba(240,168,150,0.08);
  transform: translateX(-3px);
}

/* ── switcher (super tiny) ──────────────────────────────── */
.switch {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dim);
  opacity: 0.5;
  transition: opacity .4s var(--ease), color .3s, transform .4s var(--ease);
}
.switch:hover { opacity: 1; color: var(--coral); }
body.scrolled .switch { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }

/* ── scroll-driven hero collapse ─────────────────────────── */
.meta-stack, .pill-nav {
  transition: opacity .55s var(--ease), transform .7s var(--ease);
}
body.scrolled .meta-stack {
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
}
body.scrolled .pill-nav {
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
}
.scene-wrap {
  transition: transform 1.2s var(--ease), opacity 1s var(--ease);
  transform-origin: 75% 50%;
  will-change: transform, opacity;
}
body.scrolled .scene-wrap {
  opacity: 0;
  transform: scale(0.18) translate(60vw, -34vh);
}

/* ── archive notebook ────────────────────────────────────── */
.archive {
  position: relative; z-index: 6;   /* above fixed hero (z5) so it cleanly covers it on scroll */
  background: var(--bg);
  padding: 80px var(--pad) 200px;
  max-width: 1180px;
  margin: 100vh auto 0;       /* push below the hero viewport */
}
.ar-eyebrow {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 80px;
  display: inline-flex; align-items: center; gap: 12px;
}
.ar-eyebrow i {
  width: 28px; height: 1px;
  background: var(--coral);
  display: inline-block;
}

.ar-sect {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 56px;
  padding: 100px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform 1s var(--ease);
}
.ar-sect.in {
  opacity: 1;
  transform: translateY(0);
}
.ar-sect:last-child { border-bottom: 1px solid var(--rule); }

.ar-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1;
  color: var(--coral);
  letter-spacing: -0.02em;
  position: sticky;
  top: 120px;
  align-self: start;
}

.ar-h {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  color: var(--cream);
  margin-bottom: 32px;
}
.ar-h em {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  color: var(--coral);
  letter-spacing: -0.01em;
}

.ar-prose {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  color: var(--cream-2);
  max-width: 60ch;
  margin-bottom: 32px;
  letter-spacing: -0.005em;
}
.ar-prose em { font-style: normal; color: var(--cream); }

.ar-list {
  list-style: none;
  border-top: 1px solid var(--rule);
  margin-top: 16px;
}
.ar-list li {
  display: grid;
  grid-template-columns: 60px 1fr 140px;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--cream);
  transition: padding .35s var(--ease), background .35s var(--ease);
}
.ar-list li:hover { padding-left: 12px; padding-right: 12px; background: rgba(240,168,150,0.05); }
.ar-li-n { color: var(--coral); font-size: 11px; letter-spacing: 0.12em; }
.ar-li-t { color: var(--cream); }
.ar-li-d { color: var(--cream-2); font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase; text-align: right; white-space: nowrap; }

.ar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 24px;
}
.ar-cell {
  background: var(--bg);
  padding: 22px 22px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.ar-cell-k {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--coral);
}
.ar-cell ul { list-style: none; display: grid; gap: 6px; }
.ar-cell li {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--cream-2);
  line-height: 1.45;
  padding-left: 16px; position: relative;
}
.ar-cell li::before { content: "→"; position: absolute; left: 0; color: var(--coral); }
.ar-cell li em { color: var(--cream); font-style: normal; }

.ar-contact {
  list-style: none;
  border-top: 1px solid var(--cream);
  margin-top: 16px;
}
.ar-contact li {
  border-bottom: 1px solid var(--rule);
  transition: background .3s, padding .35s var(--ease);
}
.ar-contact li:hover { background: rgba(240,168,150,0.06); padding-left: 12px; padding-right: 12px; }
.ar-contact a {
  display: grid;
  grid-template-columns: 140px 1fr 30px;
  gap: 18px;
  padding: 22px 0;
  align-items: baseline;
  font-family: var(--mono);
}
.ar-contact .ar-c-k { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral); }
.ar-contact .ar-c-v {
  font-family: var(--body);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -0.015em;
  color: var(--cream);
}
.ar-contact .ar-c-a { color: var(--cream-2); text-align: right; transition: color .3s, transform .3s; }
.ar-contact a:hover .ar-c-v { color: var(--coral); }
.ar-contact a:hover .ar-c-a { color: var(--coral); transform: translate(3px,-3px); }

/* archive footer */
.ar-foot {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ── scroll progress strip · right edge ──────────────────── */
.progress {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 8;
  display: flex; flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
body.scrolled .progress { opacity: 1; pointer-events: auto; }
.prog-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dim);
  transition: color .3s var(--ease);
}
.prog-link i {
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--dim);
  transition: width .35s var(--ease), background .35s var(--ease);
}
.prog-link.is-on { color: var(--coral); }
.prog-link.is-on i { width: 36px; background: var(--coral); }
.prog-link:hover { color: var(--cream); }

@media (max-width: 980px) {
  .progress { display: none; }
  .ar-sect { grid-template-columns: 1fr; gap: 16px; padding: 60px 0; }
  .ar-num { position: relative; top: auto; }
  .ar-list li { grid-template-columns: 40px 1fr; }
  .ar-li-d { grid-column: 2; text-align: left; padding-top: 4px; }
  .ar-grid { grid-template-columns: 1fr; }
}

/* ── responsive · single-column phone layout ─────────────── */
@media (max-width: 980px) {
  body { overflow-y: auto; height: auto; min-height: 100vh; padding-bottom: 120px; }

  /* name sits at the very top, in flow */
  .mark { position: static; padding: 76px var(--pad) 0; }
  .menu-pill { top: 26px; right: var(--pad); }

  /* sphere is an IN-FLOW band between the name and the text (DOM order:
     mark → scene-wrap → meta-stack), so it can never paint over the text.
     The sphere itself is seated on the RIGHT inside the band (see main.js). */
  .scene-wrap {
    position: relative; inset: auto;
    width: 100%; height: 58vh;
    transform-origin: 80% 40%;
  }
  #cubes.ready { opacity: 1; }
  /* soft fade so the band edges dissolve into the page bg */
  .scene-wrap::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(80% 78% at 72% 38%, transparent 0%, transparent 54%, var(--bg) 100%),
      linear-gradient(180deg, transparent 62%, var(--bg) 100%);
  }

  /* text flows directly below the sphere band — no overlap, no big padding hack */
  .meta-stack { position: static; padding: 14px var(--pad) 44px; max-width: none; gap: 22px; }
  .pill-nav { position: static; flex-direction: row; flex-wrap: wrap; padding: 0 var(--pad) 8px; align-items: flex-start; }
  .clock-row { flex-direction: column; gap: 18px; }
  .hero-sentence { min-width: 0; margin-top: 0; }
  .dim-stats { margin-left: 0; display: block; margin-top: 14px; }

  .archive { margin-top: 0; }

  /* hero text is real content — never fade it on scroll */
  body.scrolled .meta-stack,
  body.scrolled .pill-nav,
  body.scrolled .mark { opacity: 1; transform: none; pointer-events: auto; }
  /* but the sphere zooms out + disappears as you scroll (in place, no layout shift) */
  body.scrolled .scene-wrap { opacity: 0; transform: scale(0.3); }
  body.scrolled .switch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
