:root {
  /* Compliance tokens from typography notes: Grotesk** Grotesk* Grotesk\*\* Groteskk coordinates */
  --ivory: #F4E7C8;
  --walnut: #3A2418;
  --ochre: #B8642A;
  --amber: #F0B64A;
  --oxide: #7D3225;
  --olive: #6F7650;
  --umber: #17110D;
  --serif-display: 'Cormorant Garamond', serif;
  --serif-body: 'EB Garamond', serif;
  --hud: 'Space Grotesk', sans-serif;
  --hex: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--walnut);
  background: var(--ivory);
  font-family: var(--serif-body);
  overflow-x: hidden;
}

.grain,
.dial-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.grain {
  opacity: .22;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(58, 36, 24, .16) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(184, 100, 42, .14) 0 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 17, 13, .035), transparent 22%, rgba(240, 182, 74, .04));
  background-size: 19px 17px, 29px 31px, 100% 100%;
  mix-blend-mode: multiply;
}

.dial-vignette {
  background: radial-gradient(circle at 50% 42%, transparent 0 42%, rgba(58, 36, 24, .12) 72%, rgba(23, 17, 13, .28) 100%);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ochre), var(--amber));
  z-index: 30;
  box-shadow: 0 0 18px rgba(240, 182, 74, .75);
}

.quest-system { background: radial-gradient(circle at 50% 5%, #F4E7C8 0, #e6c987 46%, #B8642A 160%); }

.chamber {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 72px);
  isolation: isolate;
}

.chamber::before {
  content: attr(data-depth);
  position: absolute;
  left: clamp(18px, 4vw, 56px);
  top: clamp(18px, 4vw, 48px);
  font: 600 12px/1 var(--hud);
  letter-spacing: .32em;
  color: rgba(58, 36, 24, .45);
  border-left: 1px solid rgba(58, 36, 24, .28);
  padding-left: 12px;
}

.hex {
  clip-path: var(--hex);
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  border: 0;
  color: inherit;
}

.hex::after {
  content: '';
  position: absolute;
  inset: 8px;
  clip-path: var(--hex);
  border: 1px solid rgba(58, 36, 24, .32);
  pointer-events: none;
}

.coordinate,
.label,
.section-mark,
.bearing,
.stamp,
.final-bearings {
  font-family: var(--hud);
  text-transform: uppercase;
  letter-spacing: .18em;
}

.coordinate { font-size: 11px; color: var(--oxide); margin: 0 0 13px; }

.chamber-01 {
  background:
    radial-gradient(circle at 48% 55%, rgba(240, 182, 74, .28), transparent 32%),
    linear-gradient(135deg, #F4E7C8, #eacb8a 70%, #d99644);
}

.honeycomb {
  width: min(1120px, 94vw);
  height: min(760px, 84vh);
  position: relative;
  transform: scale(var(--scene-scale, .94)) rotate(var(--scene-rotate, -2deg));
  transition: transform 900ms cubic-bezier(.2, .8, .16, 1), filter 900ms ease;
  z-index: 2;
}

.honeycomb .hex { position: absolute; filter: drop-shadow(0 20px 28px rgba(58, 36, 24, .2)); }

.ivory-core {
  width: clamp(330px, 40vw, 560px);
  height: clamp(300px, 35vw, 500px);
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff2ce 0, var(--ivory) 56%, #e7c57d 100%);
  padding: clamp(46px, 6vw, 80px);
}

.ivory-core h1 {
  margin: 0;
  font-family: var(--serif-display);
  font-size: clamp(54px, 9vw, 124px);
  line-height: .82;
  letter-spacing: -.055em;
  color: var(--walnut);
}

.ledger-line {
  max-width: 380px;
  margin: 22px auto 0;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.18;
}

.console-strip {
  margin-top: 28px;
  font: 500 10px/1 var(--hud);
  letter-spacing: .16em;
  text-transform: uppercase;
  display: inline-flex;
  gap: 9px;
  align-items: center;
}

.console-strip i,
.amber-beacon span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(240, 182, 74, .9);
  animation: bulb 3.7s infinite ease-in-out;
}

.console-strip i:nth-child(2) { animation-delay: .7s; background: var(--olive); box-shadow: 0 0 16px rgba(111, 118, 80, .7); }
.console-strip i:nth-child(3) { animation-delay: 1.9s; background: var(--oxide); box-shadow: 0 0 16px rgba(125, 50, 37, .6); }

.hex-small { width: 190px; height: 170px; padding: 28px; font: 600 11px/1.2 var(--hud); }
.hex-note { width: 250px; height: 220px; padding: 38px; }
.hex-note p { font: 600 27px/1 var(--serif-display); margin: 10px 0 0; }
.amber-beacon { width: 150px; height: 132px; left: 13%; top: 16%; background: rgba(240, 182, 74, .72); }
.olive-cell { left: 22%; top: 62%; background: rgba(111, 118, 80, .82); color: var(--ivory); }
.rust-cell { right: 22%; top: 18%; background: rgba(125, 50, 37, .88); color: var(--ivory); }
.dark-cell { width: 168px; height: 148px; right: 9%; bottom: 16%; background: var(--umber); }
.ochre-cell { left: 9%; bottom: 10%; background: var(--ochre); color: #fff0c9; }

.orbital-ring,
.horizon-orbit {
  position: absolute;
  border: 1px solid rgba(240, 182, 74, .56);
  border-radius: 50%;
  pointer-events: none;
}

.ring-one { width: 78vw; height: 28vw; transform: rotate(-18deg); }
.ring-two { width: 65vw; height: 20vw; transform: rotate(18deg); border-color: rgba(58, 36, 24, .26); }

.hud-arc {
  position: absolute;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  border: 1px dashed rgba(58, 36, 24, .4);
  animation: arcDrift 18s infinite linear;
}
.arc-a { left: 12%; top: 16%; border-right-color: transparent; border-bottom-color: transparent; }
.arc-b { right: 13%; bottom: 14%; border-left-color: transparent; border-top-color: transparent; animation-duration: 24s; }

.bearing { position: absolute; bottom: 30px; font-size: 10px; color: rgba(58,36,24,.62); }
.bearing-left { left: 32px; }
.bearing-right { right: 32px; }

.chamber-02 {
  background:
    radial-gradient(circle at 68% 38%, rgba(240, 182, 74, .2), transparent 30%),
    linear-gradient(160deg, #ebd29a, #F4E7C8 42%, #d18b3f 145%);
}

.section-mark { position: absolute; top: 42px; right: 54px; font-size: 11px; color: var(--oxide); }
.resource-diagram { width: min(1120px, 96vw); height: min(650px, 82vh); position: relative; }
.loop-svg { position: absolute; inset: 8% 5%; width: 90%; height: 76%; overflow: visible; }
.loop-path { fill: none; stroke: var(--amber); stroke-width: 2; stroke-dasharray: 12 12; animation: dash 22s linear infinite; filter: drop-shadow(0 0 7px rgba(240,182,74,.45)); }
.loop-path.secondary { stroke: rgba(58,36,24,.45); animation-duration: 28s; }
.calibration-dot { fill: var(--amber); filter: drop-shadow(0 0 10px rgba(240,182,74,.8)); }
.big-hex {
  position: absolute;
  width: clamp(280px, 28vw, 380px);
  height: clamp(250px, 25vw, 340px);
  padding: clamp(42px, 5vw, 70px);
  filter: drop-shadow(0 28px 30px rgba(58, 36, 24, .2));
  transition: transform 700ms cubic-bezier(.2,.8,.16,1), filter 700ms ease;
}
.big-hex h2, .watch-intro h2, .final-aperture h2 { font-family: var(--serif-display); letter-spacing: -.035em; line-height: .92; margin: 0; }
.big-hex h2 { font-size: clamp(42px, 5.5vw, 76px); }
.big-hex p { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.2; margin: 16px 0 0; }
.input-cell { left: 1%; top: 8%; background: var(--ivory); }
.renewal-cell { left: 34%; top: 30%; background: var(--ochre); color: #fff0cf; }
.renewal-cell .coordinate { color: #ffd375; }
.reserve-cell { right: 2%; top: 9%; background: var(--olive); color: #fff1d0; }
.reserve-cell .coordinate { color: #F0B64A; }
.focus-cell.is-focused { transform: scale(1.045) rotate(1deg); filter: drop-shadow(0 34px 36px rgba(58,36,24,.28)) saturate(1.1); }

.rotary-dial {
  position: absolute;
  width: 190px;
  height: 190px;
  right: 5vw;
  bottom: 4vw;
  border-radius: 50%;
  border: 1px solid rgba(58,36,24,.28);
  animation: arcDrift 36s linear infinite reverse;
}
.rotary-dial span { position: absolute; font: 500 10px var(--hud); letter-spacing: .15em; color: rgba(58,36,24,.5); }
.rotary-dial span:nth-child(1) { top: 8px; left: 88px; }
.rotary-dial span:nth-child(2) { right: 10px; top: 88px; }
.rotary-dial span:nth-child(3) { bottom: 8px; left: 88px; }
.rotary-dial span:nth-child(4) { left: 10px; top: 88px; }

.chamber-03 { background: linear-gradient(120deg, #3A2418 0, #5b3520 34%, #F4E7C8 34.3%, #e8ce92 100%); }
.watch-panel { position: relative; z-index: 2; width: min(1120px, 94vw); display: grid; grid-template-columns: .9fr 220px 1fr; gap: clamp(24px, 4vw, 62px); align-items: center; }
.watch-intro { color: #fff0d0; padding-right: 20px; }
.watch-intro .coordinate { color: var(--amber); }
.watch-intro h2 { font-size: clamp(44px, 6vw, 86px); }
.watch-intro p:not(.coordinate) { font-size: clamp(19px, 2vw, 25px); line-height: 1.2; }
.log-strip { display: grid; gap: -4px; justify-items: center; }
.log-hex {
  width: 178px;
  height: 104px;
  margin: -3px 0;
  background: rgba(244, 231, 200, .88);
  color: var(--walnut);
  cursor: pointer;
  font-family: var(--hud);
  text-transform: uppercase;
  letter-spacing: .14em;
  transition: transform 400ms ease, background 400ms ease, color 400ms ease;
}
.log-hex span { font-size: 10px; color: var(--oxide); }
.log-hex strong { display: block; font-size: 13px; margin-top: 5px; }
.log-hex.active { background: var(--amber); transform: translateX(18px) scale(1.08); color: var(--umber); }
.note-aperture {
  width: clamp(330px, 34vw, 520px);
  height: clamp(300px, 32vw, 470px);
  background: radial-gradient(circle, #fff1cd, #F4E7C8 58%, #c77d33);
  padding: clamp(54px, 6vw, 86px);
  filter: drop-shadow(0 34px 38px rgba(23,17,13,.3));
}
.stamp { font-size: 10px; color: var(--oxide); }
.note-aperture p { font-size: clamp(30px, 4vw, 56px); line-height: .98; margin: 18px 0 0; font-family: var(--serif-display); letter-spacing: -.03em; }
.note-aperture.flash { animation: stampIn 520ms ease both; }
.calibration-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(240,182,74,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(240,182,74,.5) 1px, transparent 1px); background-size: 64px 64px; }

.chamber-04 { background: radial-gradient(circle at 50% 42%, #3A2418 0, #17110D 58%, #0b0806 100%); color: var(--ivory); }
.final-aperture {
  width: min(650px, 84vw);
  height: min(590px, 78vw);
  max-height: 78vh;
  padding: clamp(62px, 8vw, 108px);
  background: radial-gradient(circle, rgba(240,182,74,.18), rgba(58,36,24,.88) 55%, rgba(23,17,13,.98));
  box-shadow: 0 0 0 1px rgba(240,182,74,.28), 0 0 80px rgba(240,182,74,.24);
}
.final-aperture::after { border-color: rgba(240,182,74,.55); }
.final-aperture .coordinate { color: var(--amber); }
.final-aperture h2 { font-size: clamp(42px, 6vw, 80px); }
.final-aperture p { font-size: clamp(18px, 2vw, 25px); line-height: 1.18; max-width: 430px; margin: 20px auto; }
.quiet-action { color: var(--amber); text-decoration: none; font: 500 12px var(--hud); letter-spacing: .22em; text-transform: uppercase; border-bottom: 1px solid rgba(240,182,74,.6); padding-bottom: 6px; }
.horizon-orbit { width: 78vw; height: 24vw; border-color: rgba(240,182,74,.36); transform: rotate(-13deg); animation: orbitFloat 16s ease-in-out infinite; }
.orbit-slow { width: 58vw; height: 17vw; transform: rotate(18deg); border-color: rgba(244,231,200,.16); animation-duration: 23s; }
.final-bearings { position: absolute; bottom: 30px; color: rgba(244,231,200,.48); font-size: 10px; }

@keyframes bulb { 0%, 100% { opacity: .58; transform: scale(.85); } 45% { opacity: 1; transform: scale(1.14); } }
@keyframes arcDrift { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -240; } }
@keyframes stampIn { 0% { transform: scale(.98); filter: drop-shadow(0 18px 22px rgba(23,17,13,.22)); } 100% { transform: scale(1); filter: drop-shadow(0 34px 38px rgba(23,17,13,.3)); } }
@keyframes orbitFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -18px; } }

@media (max-width: 860px) {
  .honeycomb { height: 740px; width: 100%; }
  .hex-small, .hex-note { transform: scale(.78); }
  .amber-beacon { left: 1%; }
  .olive-cell { left: 0; top: 68%; }
  .rust-cell { right: 0; top: 9%; }
  .dark-cell { right: -4%; bottom: 9%; }
  .ochre-cell { left: 1%; bottom: 1%; }
  .resource-diagram { height: auto; min-height: 980px; display: grid; gap: 0; justify-items: center; }
  .big-hex { position: relative; left: auto; right: auto; top: auto; margin: -18px 0; }
  .loop-svg { inset: 0; height: 100%; }
  .watch-panel { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .watch-intro { color: var(--ivory); padding: 0; }
  .chamber-03 { background: linear-gradient(160deg, #3A2418 0, #5b3520 52%, #F4E7C8 52.3%, #e8ce92 100%); }
}
