/* OBAKE — vinyl spirits, cast in small numbers.
   Static-first: base styles are a normal stacked document.
   html.conductor switches panels to a fixed timeline over the canvas. */

:root {
  --paper: #f4efe6;
  --paper-2: #ece5d7;
  --ink: #1c1a17;
  --ink-soft: #4f4a42;
  --accent: #d9442c;      /* fills, large marks */
  --accent-text: #a03320; /* small text on paper, 4.5:1+ */
  --night: #12121a;
  --night-ink: #e9e4d8;
  --glow: #a9e88b;
  --display: 'Baloo 2', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html, body { overflow-x: clip; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

[id] { scroll-margin-top: 84px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- access chrome ---------- */
.skip-link, .plain-toggle {
  position: fixed; top: 10px; z-index: 60;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px;
  padding: 10px 16px; border-radius: 999px; text-decoration: none;
  transform: translateY(-64px); transition: transform .2s;
}
.skip-link { left: 12px; }
.plain-toggle { left: 170px; }
.skip-link:focus-visible, .plain-toggle:focus-visible { transform: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- loader (conductor only) ---------- */
#loader { display: none; }
html.conductor #loader {
  display: flex; position: fixed; inset: 0; z-index: 50;
  background: var(--paper);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; transition: opacity .6s;
}
html.conductor #loader.done { opacity: 0; pointer-events: none; }
.loader-fig { width: 130px; height: auto; }
.loader-pct {
  font-family: var(--display); font-weight: 800; font-size: 64px;
  line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums;
}
.loader-log { display: flex; gap: 18px; font-size: 11px; color: var(--ink-soft); }
.loader-log span.ok { color: var(--accent-text); }
.loader-log span.ok::after { content: ' ·'; }

/* ---------- canvas + grid ---------- */
#gl { display: none; }
html.conductor #gl { display: block; position: fixed; inset: 0; z-index: 0; }
#gridlayer { display: none; }
html.conductor #gridlayer.on {
  display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100%/12 - 1px), rgba(28,26,23,.06) calc(100%/12 - 1px) calc(100%/12)),
    repeating-linear-gradient(0deg, transparent 0 119px, rgba(28,26,23,.06) 119px 120px);
}

/* ---------- HUD ---------- */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px; font-size: 13px;
}
.mark {
  font-family: var(--display); font-weight: 800; font-size: 24px;
  color: var(--ink); text-decoration: none; letter-spacing: .01em;
}
.mark-glyph::after { content: '◖'; color: var(--accent); margin-left: 6px; }
.hud-top nav { display: flex; gap: 26px; }
.hud-top nav a, .contact-cta { color: var(--ink); text-decoration: none; }
.hud-top nav a:hover, .contact-cta:hover { color: var(--accent-text); }
.contact-cta { font-weight: 700; }

/* rail + readout + console: conductor chrome */
.rail, .readout, .console { display: none; }
html.conductor .rail {
  display: flex; position: fixed; left: 26px; top: 50%; z-index: 40;
  transform: translateY(-50%); flex-direction: column; gap: 14px;
  font-size: 11px;
}
.rail a { color: var(--ink-soft); text-decoration: none; display: flex; gap: 8px; align-items: baseline; }
.rail a i { font-style: normal; font-size: 9px; }
.rail a.active, .rail a:hover { color: var(--accent-text); font-weight: 700; }
.rail-track {
  position: absolute; left: -12px; top: 0; bottom: 0; width: 2px;
  background: rgba(28,26,23,.14);
}
.rail-fill {
  width: 100%; height: 100%; background: var(--accent);
  transform: scaleY(0); transform-origin: top;
}
html.conductor .readout {
  display: flex; position: fixed; left: 26px; bottom: 20px; z-index: 40;
  gap: 20px; font-size: 11px; color: var(--ink-soft);
}
html.conductor .console {
  display: flex; position: fixed; right: 26px; bottom: 20px; z-index: 40;
  gap: 16px; align-items: center; font-size: 11px; color: var(--ink);
  background: rgba(244,239,230,.8); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 10px 18px;
}
.console-title { color: var(--accent-text); font-weight: 700; }
.console label { display: flex; gap: 7px; align-items: center; cursor: pointer; min-height: 26px; }
.console input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); }
.console input[type=range] { width: 74px; height: 24px; accent-color: var(--accent); }

/* ---------- panels: static document ---------- */
.panel {
  min-height: 70vh; padding: 110px 7vw 70px;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1500px; margin: 0 auto;
}
.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .28em;
  color: var(--accent-text); margin-bottom: 18px;
}

/* hero */
.panel-hero { min-height: 92vh; position: relative; }
.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(64px, 13vw, 190px);
  line-height: .95; letter-spacing: .01em;
}
.hero-tag {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(19px, 2.1vw, 27px); line-height: 1.3;
  margin-top: 18px; max-width: 430px;
}
.hero-fig { margin: 26px 0 0; max-width: 420px; }
.hero-fig img { width: 100%; height: auto; display: block; }
.swatches { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.swatch {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  padding: 11px 20px 11px 14px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; gap: 9px;
  min-height: 40px;
}
.swatch::before {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  background: var(--c); border: 1px solid rgba(28,26,23,.35);
}
.swatch[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.swatch:hover { border-color: var(--accent); }
.hero-meta { font-size: 11px; letter-spacing: .18em; color: var(--ink-soft); margin-top: 26px; }
.scroll-hint { display: none; }
html.conductor .scroll-hint {
  display: flex; position: absolute; bottom: 90px; right: 8vw;
  flex-direction: column; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: .3em; color: var(--ink-soft);
}
.scroll-hint i {
  width: 1.5px; height: 44px; background: var(--ink-soft); display: block;
  animation: hint 2.2s ease-in-out 3;
  transform-origin: top;
}
@keyframes hint { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }

/* process */
.process-title, .drops-title, .hotaru-title, .contact-title, .mission-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(34px, 5vw, 74px); line-height: 1.02;
  margin-bottom: 40px;
}
.process-list { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 1050px; }
.process-list h3 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 8px 0 8px; }
.process-list p { color: var(--ink-soft); max-width: 30ch; }
.step-num { font-size: 11px; color: var(--accent-text); font-weight: 700; }

/* works / colorways */
.works-counter {
  font-family: var(--display); font-weight: 800; font-size: 15vw;
  line-height: 1; color: rgba(28,26,23,.07);
  position: absolute; right: 4vw; top: 12vh; display: none;
}
html.conductor .works-counter { display: block; }
.panel-works { position: relative; }
.works-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 46px; max-width: 1050px; }
.work-card .work-fig { background: var(--paper-2); border-radius: 26px; overflow: hidden; margin-bottom: 14px; }
.work-card img { width: 100%; height: auto; display: block; }
.work-date { font-size: 11px; letter-spacing: .16em; color: var(--accent-text); font-weight: 700; }
.work-title { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.1; }
.work-fact { color: var(--ink-soft); max-width: 40ch; }

/* hotaru: the dark flip */
.panel-hotaru.dark {
  background: var(--night); color: var(--night-ink);
  border-radius: 0;
}
.panel-hotaru .kicker { color: var(--glow); }
.hotaru-title { color: var(--glow); }
.hotaru-body { max-width: 44ch; color: var(--night-ink); }

/* drops */
.drops-list { list-style: none; max-width: 560px; }
.drops-list li {
  font-family: var(--display); font-weight: 500; font-size: clamp(18px, 2vw, 24px);
  padding: 20px 0; border-bottom: 1.5px solid rgba(28,26,23,.16);
}
.drops-list li:first-child { border-top: 1.5px solid rgba(28,26,23,.16); }

/* contact */
.contact-line { font-size: 17px; margin-top: 6px; }
.site-foot { margin-top: 70px; font-size: 12px; color: var(--ink-soft); max-width: 60ch; }
.site-foot a { color: var(--accent-text); }
.foot-legal { margin-top: 12px; letter-spacing: .14em; }

/* ---------- conductor mode overrides ---------- */
html.conductor .spacer { height: 1050vh; }
html.conductor main { position: relative; }
html.conductor .panel {
  position: fixed; inset: 0; z-index: 10;
  opacity: 0; visibility: hidden;
  max-width: none; margin: 0;
  padding: 110px clamp(150px, 13vw, 230px) 90px;
  min-height: 0;
}
/* directional scrim keeps the copy on dark while the figure glows beside it */
html.conductor .panel-hotaru.dark {
  background: linear-gradient(90deg, rgba(18,18,26,.72) 0 36%, rgba(18,18,26,0) 62%);
}
@media (max-width: 760px) {
  html.conductor .panel-hotaru.dark { background: rgba(18,18,26,.58); }
}
html.conductor .hero-fig { display: none; }         /* the canvas IS the figure */
html.conductor .works-list { grid-template-columns: 1fr; max-width: 430px; margin-left: auto; }
html.conductor .work-card { opacity: .18; transition: opacity .3s; }
html.conductor .work-card.on { opacity: 1; }
html.conductor .work-card .work-fig { display: none; } /* canvas figure re-tints instead */
html.conductor .panel-hero { justify-content: flex-end; padding-bottom: 120px; }

/* night flip recolors chrome */
html.on-light body-placeholder { color: inherit; } /* (unused guard) */
html.conductor.on-night body { background: var(--night); }
html.conductor.on-night .hud-top a,
html.conductor.on-night .mark { color: var(--night-ink); }
html.conductor.on-night .rail a { color: rgba(233,228,216,.6); }
html.conductor.on-night .rail a.active { color: var(--glow); }
html.conductor.on-night .rail-fill { background: var(--glow); }
html.conductor.on-night .readout { color: rgba(233,228,216,.6); }
html.conductor.on-night .console {
  background: rgba(18,18,26,.8); border-color: var(--night-ink); color: var(--night-ink);
}
html.conductor.on-night .console-title { color: var(--glow); }

/* reticle */
#reticle { display: none; }
html.conductor #reticle {
  display: block; position: fixed; left: 0; top: 0; z-index: 45;
  pointer-events: none;
}
#reticle i {
  display: block; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1.5px solid var(--accent); border-radius: 50%;
  transition: border-color .2s;
}
#reticle.hot i { border-color: var(--ink); }
html.conductor.on-night #reticle i { border-color: var(--glow); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  html.conductor .panel { padding: 96px 7vw 130px; }
  .works-list { grid-template-columns: 1fr; }
  .process-list { grid-template-columns: 1fr; gap: 26px; }
}
@media (pointer: coarse) {
  html.conductor #reticle { display: none; }
}
@media (max-width: 760px) {
  .rail, .readout, .scroll-hint, #reticle { display: none !important; }
  html.conductor .console { right: 12px; bottom: 12px; padding: 9px 14px; gap: 10px; }
  label.console-fx { display: none; }
  .hud-top { padding: 14px 16px; }
  .hud-top nav { display: none; }
  .panel { padding: 96px 6vw 60px; }
  .plain-toggle { left: auto; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint i { animation: none; }
}
