:root {
  /* DESIGN typography terms: IBM Plex Sans Condensed instrument labeling labels Condensed** Condensed* Condense Condensedd */
  --design-font-token: "Condensed**";
  --deep: #174B36;
  --shadow: #0B1F18;
  --matcha: #6E9B63;
  --cream: #F4E6C8;
  --tan: #C69C63;
  --red: #E84855;
  --brass: #D9A441;
  --ink: #182B3A;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 18% 10%, rgba(217, 164, 65, .24), transparent 30%),
    radial-gradient(circle at 80% 22%, rgba(232, 72, 85, .13), transparent 22%),
    linear-gradient(135deg, var(--shadow), var(--deep) 48%, #10271e);
  font-family: "IBM Plex Sans Condensed", Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

.stage-light, .grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.stage-light {
  background: linear-gradient(115deg, rgba(244, 230, 200, .1), transparent 35%, rgba(11, 31, 24, .44));
  mix-blend-mode: screen;
}

.grain {
  opacity: .22;
  background-image: repeating-radial-gradient(circle at 30% 20%, rgba(244, 230, 200, .18) 0 1px, transparent 1px 4px);
}

.machine {
  position: relative;
  z-index: 1;
  width: min(1500px, 96vw);
  margin: 0 auto;
  padding: 22px 0 80px;
}

.folder-nav {
  display: flex;
  gap: 8px;
  padding-left: 34px;
  transform: rotateX(8deg) rotateZ(-1deg);
  transform-origin: bottom left;
}

.folder-nav a {
  color: var(--ink);
  background: var(--tan);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  padding: 12px 24px 17px;
  border-radius: 14px 14px 0 0;
  box-shadow: inset 0 -6px 0 rgba(24, 43, 58, .18), 0 10px 22px rgba(0, 0, 0, .26);
}

.console {
  min-height: 86vh;
  display: grid;
  grid-template-columns: 245px minmax(360px, 1fr) 320px;
  gap: 26px;
  align-items: stretch;
  padding: clamp(18px, 3vw, 44px);
  border: 14px solid #0d2f22;
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(244, 230, 200, .07), transparent 38%),
    linear-gradient(90deg, rgba(11, 31, 24, .56), rgba(23, 75, 54, .88)),
    var(--deep);
  box-shadow: 0 46px 90px rgba(0,0,0,.48), inset 0 0 0 3px rgba(217, 164, 65, .26);
  transform: perspective(1200px) rotateX(calc(6deg + var(--tilt-x))) rotateY(var(--tilt-y)) rotateZ(-1.2deg);
  transform-style: preserve-3d;
}

.tilt-card {
  transition: transform .25s ease, box-shadow .25s ease;
  transform-style: preserve-3d;
}

.toggle-bank, .drawer-stack, .nameplate, .gauge, .chapter-panel {
  border: 2px solid rgba(217, 164, 65, .55);
  box-shadow: inset 0 0 0 2px rgba(244, 230, 200, .08), 0 24px 35px rgba(0,0,0,.25);
}

.toggle-bank {
  background: var(--ink);
  border-radius: 24px;
  padding: 18px;
}

.bank-label, .drawer-title, .serial, .kicker, .gauge-label {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 700;
}

.bank-label, .drawer-title { color: var(--brass); margin-bottom: 18px; }

.toggle-module {
  appearance: none;
  width: 100%;
  border: 0;
  color: var(--cream);
  cursor: pointer;
  margin: 0 0 14px;
  padding: 14px 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0B1F18, #174B36);
  display: grid;
  grid-template-columns: 42px 1fr;
  text-align: left;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), 0 10px 20px rgba(0,0,0,.22);
  font-family: inherit;
}

.toggle-module span:last-of-type { font: 700 26px/1 Bungee, sans-serif; color: var(--cream); }
.toggle-module em { grid-column: 2; color: var(--tan); font-style: normal; text-transform: uppercase; letter-spacing: .07em; }
.toggle-module.active { outline: 2px solid var(--red); }
.toggle-module.active .toggle-cap { transform: translateY(10px); background: var(--red); }

.toggle-cap {
  width: 28px;
  height: 48px;
  border-radius: 18px;
  background: var(--cream);
  border: 4px solid var(--tan);
  box-shadow: inset 0 -9px 0 rgba(24,43,58,.2);
  transition: transform .25s ease, background .25s ease;
}

.center-stack { display: grid; grid-template-rows: auto 1fr; gap: 24px; }

.nameplate {
  background: var(--cream);
  color: var(--ink);
  border-radius: 26px;
  padding: clamp(18px, 3vw, 32px);
  position: relative;
  overflow: hidden;
}

.nameplate:after {
  content: "DON'T MISUNDERSTAND";
  position: absolute;
  right: -16px;
  bottom: 18px;
  color: rgba(232, 72, 85, .22);
  font: 700 46px/1 Bungee, sans-serif;
  transform: rotate(-8deg);
}

h1, h2, h3 { margin: 0; }
h1 {
  position: relative;
  z-index: 1;
  font-family: Bungee, Impact, system-ui, sans-serif;
  font-size: clamp(42px, 7vw, 108px);
  line-height: .9;
  letter-spacing: -.04em;
  text-shadow: 3px 3px 0 rgba(198, 156, 99, .45);
}

.red-note {
  display: inline-block;
  color: var(--red);
  border: 3px solid var(--red);
  padding: 8px 12px;
  transform: rotate(-2deg);
  font: 700 21px/1 "Noto Serif JP", serif;
}

.gauge {
  display: grid;
  place-items: center;
  background: radial-gradient(circle, var(--matcha), var(--deep) 62%, var(--shadow));
  border-radius: 34px;
  padding: 28px;
}

.gauge-ring {
  width: min(460px, 76vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--red) 0deg, var(--red) var(--progress, 0deg), rgba(244,230,200,.18) var(--progress, 0deg), rgba(244,230,200,.18) 360deg);
  border: 18px solid var(--tan);
  box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 24px 42px rgba(0,0,0,.34);
}

.gauge-face {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  display: grid;
  place-items: center;
  position: relative;
  border: 8px solid var(--brass);
}

.percent { font: 700 clamp(50px, 8vw, 100px)/1 Bungee, sans-serif; color: var(--deep); }
.gauge-label { color: var(--red); margin-top: -58px; }
.needle {
  position: absolute;
  width: 7px;
  height: 40%;
  background: var(--red);
  bottom: 50%;
  left: calc(50% - 3px);
  transform-origin: bottom center;
  transform: rotate(-120deg);
  border-radius: 8px;
  box-shadow: 0 0 0 5px rgba(232, 72, 85, .16);
}

.lamp-row { display: flex; align-items: center; gap: 12px; margin-top: 20px; text-transform: uppercase; letter-spacing: .08em; }
.lamp { width: 18px; height: 18px; border-radius: 50%; background: #3b3b3b; box-shadow: inset 0 2px 5px #000; }
.lamp.red.active { background: var(--red); box-shadow: 0 0 18px var(--red); animation: blink .9s infinite; }
.lamp.amber.active { background: var(--brass); box-shadow: 0 0 18px var(--brass); }
.lamp.green.active { background: #6E9B63; box-shadow: 0 0 22px #6E9B63; }

.drawer-stack {
  background: linear-gradient(160deg, var(--cream), var(--tan));
  color: var(--ink);
  border-radius: 24px;
  padding: 18px;
}

.drawer {
  position: relative;
  min-height: 126px;
  margin-bottom: 14px;
  padding: 18px 18px 18px 74px;
  background: rgba(244, 230, 200, .62);
  border: 2px solid rgba(24, 43, 58, .28);
  border-radius: 14px;
  transform: translateX(0);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s;
}
.drawer.open { transform: translateX(-28px); box-shadow: 20px 18px 25px rgba(24,43,58,.2); }
.drawer h3 { font-family: Bungee, sans-serif; color: var(--deep); }
.drawer p { margin: 8px 0 0; font-weight: 600; }

.leaf-tab {
  position: absolute;
  left: 18px;
  top: 24px;
  width: 38px;
  height: 58px;
  background: var(--matcha);
  border-radius: 90% 0 90% 0;
  transform: rotate(-28deg);
  box-shadow: inset 10px 0 rgba(11,31,24,.14);
}
.camellia { background: var(--red); border-radius: 50%; }
.maple { background: var(--brass); clip-path: polygon(50% 0, 62% 25%, 88% 15%, 75% 45%, 100% 58%, 66% 64%, 68% 100%, 50% 73%, 32% 100%, 34% 64%, 0 58%, 25% 45%, 12% 15%, 38% 25%); border-radius: 0; }

.paper-feed {
  margin: 26px auto;
  width: 93%;
  background: var(--cream);
  color: var(--ink);
  padding: 16px 26px;
  border-left: 24px solid var(--tan);
  border-right: 24px solid var(--tan);
  box-shadow: 0 20px 35px rgba(0,0,0,.28);
  transform: rotate(1deg);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

.chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 36px;
}

.chapter-panel {
  min-height: 470px;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(244,230,200,.95), rgba(198,156,99,.86));
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.chapter-panel h2 {
  font-family: Bungee, sans-serif;
  font-size: clamp(27px, 4vw, 52px);
  line-height: .95;
  color: var(--deep);
}
.chapter-panel p { font-size: 20px; line-height: 1.35; font-weight: 600; }
.kicker { color: var(--red); margin: 0 0 12px; }
.stamp {
  position: absolute;
  top: 28px;
  right: 22px;
  color: var(--red);
  border: 4px solid currentColor;
  padding: 7px 13px;
  font: 700 24px/1 Bungee, sans-serif;
  transform: rotate(12deg);
  opacity: .82;
}
.prepared { font-size: 18px; top: 18px; }

.index-card, .download-slip {
  background: repeating-linear-gradient(0deg, var(--cream) 0 28px, rgba(110,155,99,.28) 29px 31px);
  border: 2px solid rgba(24,43,58,.3);
  padding: 22px;
  display: grid;
  gap: 8px;
  box-shadow: inset 0 0 0 7px rgba(198,156,99,.22);
}
.index-card span, .download-slip span, .meta-grid span { color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.index-card b, .download-slip strong { font: 700 30px/1 Bungee, sans-serif; color: var(--deep); }
.index-card em, .download-slip em { font: 700 18px/1 "Noto Serif JP", serif; color: var(--ink); }

.photo-strip { display: flex; gap: 14px; margin: 24px 0; }
.prop-photo {
  height: 170px;
  flex: 1;
  border: 9px solid var(--cream);
  box-shadow: 0 15px 20px rgba(24,43,58,.24);
  transform: rotate(-4deg);
}
.prop-photo:nth-child(2) { transform: rotate(3deg) translateY(16px); }
.prop-photo:nth-child(3) { transform: rotate(-1deg); }
.enamel { background: radial-gradient(circle at 20% 20%, rgba(244,230,200,.45), transparent 12%), linear-gradient(135deg, #0B1F18, #174B36 55%, #6E9B63); }
.paper { background: repeating-linear-gradient(90deg, rgba(24,43,58,.12) 0 2px, transparent 2px 18px), linear-gradient(#F4E6C8, #C69C63); }
.brass { background: radial-gradient(circle at 55% 45%, #F4E6C8 0 10%, #D9A441 11% 34%, #182B3A 35% 38%, #C69C63 39%); }
.secret-note { font-family: "Noto Serif JP", Lora, serif; color: var(--red); }

.leaf-diagram {
  height: 265px;
  margin: 24px 0;
  position: relative;
  background: radial-gradient(ellipse at center, rgba(110,155,99,.38), transparent 70%);
  border-radius: 55% 0 55% 0;
  border: 3px solid var(--matcha);
  transform: rotate(-8deg);
}
.vein { position: absolute; background: var(--deep); height: 5px; transform-origin: left center; border-radius: 10px; }
.vein.main { left: 15%; top: 52%; width: 72%; transform: rotate(-14deg); }
.v1 { left: 40%; top: 44%; width: 30%; transform: rotate(-48deg); }
.v2 { left: 38%; top: 54%; width: 34%; transform: rotate(34deg); }
.v3 { left: 56%; top: 47%; width: 26%; transform: rotate(52deg); }
.signal { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 18px var(--red); animation: pulse 1.4s infinite ease-in-out; }
.s1 { left: 45%; top: 24%; } .s2 { left: 62%; top: 60%; animation-delay: .25s; } .s3 { left: 76%; top: 35%; animation-delay: .5s; }
.meta-grid { display: grid; grid-template-columns: 90px 1fr; gap: 10px 18px; font-size: 20px; }

.release-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  margin: 16px 0 24px;
  padding: 22px 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 25%, #ff8a91, var(--red) 58%, #9e2430);
  color: var(--cream);
  font: 700 28px/1 Bungee, sans-serif;
  box-shadow: inset 0 -9px 0 rgba(11,31,24,.35), 0 18px 28px rgba(232,72,85,.28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.release-button:active, .release-button.pressed { transform: translateY(8px); box-shadow: inset 0 -2px 0 rgba(11,31,24,.35), 0 8px 12px rgba(232,72,85,.2); }
.download-slip { transform: translateY(80px); opacity: .2; transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .7s; }
.download-slip.released { transform: translateY(0); opacity: 1; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes pulse { 50% { transform: scale(1.7); opacity: .5; } }

@media (max-width: 980px) {
  .console { grid-template-columns: 1fr; transform: none; }
  .chapters { grid-template-columns: 1fr; }
  .paper-feed { flex-direction: column; }
  .folder-nav { overflow-x: auto; padding-left: 8px; }
  .drawer.open { transform: translateX(0); }
}
