:root {
  /* DESIGN typography tokens: IBM Plex Sans** from Google Fonts for tiny build labels */
  --lacquer: #080506;
  --azuki: #8F1D2C;
  --paper: #FFF2D8;
  --gold: #D8A441;
  --amber: #FFB23E;
  --matcha: #314B35;
  --blue: #A9D8E8;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--lacquer);
}

body {
  margin: 0;
  color: var(--paper);
  font-family: "Noto Sans JP", Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 58% 22%, rgba(255, 178, 62, .10), transparent 32rem),
    radial-gradient(circle at 38% 78%, rgba(143, 29, 44, .22), transparent 28rem),
    linear-gradient(115deg, #080506 0%, #12090a 48%, #080506 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(90deg, transparent 0 47%, rgba(216,164,65,.18) 49% 50%, transparent 52%),
    repeating-linear-gradient(90deg, rgba(255,242,216,.025) 0 1px, transparent 1px 6px);
  mix-blend-mode: screen;
  z-index: 1;
}

.lacquer-sheen {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(125deg, transparent 25%, rgba(255,242,216,.055) 34%, transparent 45%);
  animation: sheenDrift 13s ease-in-out infinite alternate;
}

.recipe-rail {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: 22px;
  width: 74px;
  transform: translateY(-50%);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.recipe-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--gold), var(--amber), var(--gold), transparent);
  box-shadow: 0 0 18px rgba(216,164,65,.42);
}

.rail-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--gold);
  text-decoration: none;
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 10px;
  letter-spacing: .08em;
  border: 1px solid rgba(216,164,65,.62);
  background: rgba(8,5,6,.86);
  clip-path: polygon(50% 0, 88% 20%, 88% 80%, 50% 100%, 12% 80%, 12% 20%);
  transition: color .45s ease, background .45s ease, box-shadow .45s ease, transform .45s ease;
}

.rail-mark span { font-family: Limelight, serif; }
.rail-mark em {
  position: absolute;
  left: 50px;
  top: 50%;
  min-width: 118px;
  transform: translateY(-50%) translateX(-8px);
  opacity: 0;
  color: var(--paper);
  font-style: normal;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.rail-mark:hover em, .rail-mark.active em { opacity: 1; transform: translateY(-50%); }
.rail-mark.active {
  color: var(--lacquer);
  background: linear-gradient(135deg, var(--gold), var(--amber));
  box-shadow: 0 0 22px rgba(255,178,62,.55);
  transform: scale(1.08);
}

.scene {
  position: relative;
  min-height: 100vh;
  padding: 9vh 8vw 9vh 15vw;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.deco-window, .wave-frame, .collage, .lacquer-tray, .receipt {
  position: relative;
  width: min(980px, 100%);
  min-height: 62vh;
  border: 1px solid rgba(216,164,65,.72);
  background: rgba(8,5,6,.76);
  box-shadow: inset 0 0 0 8px rgba(216,164,65,.08), 0 34px 90px rgba(0,0,0,.52);
}

.deco-window::before, .wave-frame::before, .collage::before, .lacquer-tray::before, .receipt::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(216,164,65,.48);
  clip-path: polygon(7% 0, 93% 0, 100% 13%, 100% 87%, 93% 100%, 7% 100%, 0 87%, 0 13%);
  pointer-events: none;
}

.door-window { overflow: hidden; }
.gold-seam {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 3px;
  background: var(--gold);
  box-shadow: 0 0 22px var(--amber), 0 0 58px rgba(255,178,62,.7);
  animation: seamOpen 2.8s cubic-bezier(.2,.8,.16,1) both;
}
.amber-spill {
  position: absolute;
  inset: 0 43%;
  background: radial-gradient(ellipse at center, rgba(255,178,62,.46), rgba(255,178,62,.13) 36%, transparent 70%);
  filter: blur(18px);
  opacity: 0;
  animation: spillGlow 3s 1s ease forwards;
}
.bell-ripple {
  position: absolute;
  width: 210px;
  height: 210px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  left: calc(50% - 105px);
  top: calc(50% - 105px);
  opacity: 0;
  animation: bellRipple 3.8s 1.5s ease-out infinite;
}

.vertical-sign {
  position: absolute;
  inset: 7vh 0 auto 0;
  display: grid;
  justify-items: center;
  gap: 18px;
  opacity: 0;
  animation: signReveal 1.7s 1.1s ease forwards;
}
.vertical-sign h1 {
  margin: 0;
  font-family: Limelight, "Times New Roman", serif;
  font-size: clamp(4rem, 10vw, 9.5rem);
  line-height: .86;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
  color: transparent;
  background: linear-gradient(90deg, #8a651e, var(--gold), var(--paper), var(--amber), #6f4a10);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 35px rgba(255,178,62,.32);
}
.vertical-sign p {
  margin: 0;
  color: var(--paper);
  letter-spacing: .22em;
}

.opening-note { position: absolute; right: 8%; bottom: 11%; max-width: 310px; }
.rice-slip {
  padding: 24px;
  color: var(--lacquer);
  background:
    linear-gradient(92deg, rgba(143,29,44,.08), transparent 34%),
    repeating-linear-gradient(0deg, rgba(8,5,6,.045) 0 1px, transparent 1px 7px),
    var(--paper);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.code-label {
  display: block;
  margin-bottom: 12px;
  color: var(--azuki);
  font: 600 11px/1 "IBM Plex Sans", sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.scene-title {
  position: absolute;
  top: 8vh;
  left: 15vw;
  display: flex;
  align-items: baseline;
  gap: 18px;
  color: var(--gold);
}
.scene-title span { font: 2rem Limelight, serif; }
.scene-title h2 {
  margin: 0;
  font: clamp(2.2rem, 6vw, 5.6rem)/.9 Limelight, serif;
  letter-spacing: .08em;
}

.workshop-grid {
  position: relative;
  width: min(980px, 100%);
  min-height: 58vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 32px;
  align-items: center;
}
.slip-one { transform: rotate(-4deg); animation: slipDrift 7s ease-in-out infinite; }
.slip-two { transform: rotate(3deg); animation: slipDrift 8s ease-in-out infinite reverse; }
.progress-mold {
  position: relative;
  height: 380px;
  padding: 36px;
  display: grid;
  align-content: end;
  color: var(--paper);
  border: 1px solid var(--gold);
  clip-path: polygon(18% 0, 82% 0, 100% 22%, 100% 100%, 0 100%, 0 22%);
  background: linear-gradient(180deg, rgba(49,75,53,.82), rgba(8,5,6,.88));
}
.mold-fill {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  height: 62%;
  background: linear-gradient(180deg, rgba(255,178,62,.94), rgba(143,29,44,.72));
  box-shadow: 0 -12px 36px rgba(255,178,62,.42);
  animation: fillMold 4.8s ease-in-out infinite alternate;
}
.mold-steps { position: absolute; inset: 50px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mold-steps span { border-left: 1px solid rgba(255,242,216,.5); border-right: 1px solid rgba(255,242,216,.16); }
.hanko {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  color: var(--azuki);
  border: 3px solid var(--azuki);
  border-radius: 12px;
  font: 700 1.8rem "Noto Sans JP", sans-serif;
  background: rgba(255,242,216,.75);
}
.seal-press { position: absolute; right: 18vw; bottom: 12vh; animation: sealPress 5s ease-in-out infinite; }

.wave-frame { padding: 64px; overflow: hidden; background: radial-gradient(circle at center, rgba(49,75,53,.5), rgba(8,5,6,.9)); }
.syrup-wave { width: 100%; height: 360px; overflow: visible; }
.syrup-wave path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wave-shadow { stroke: rgba(143,29,44,.52); stroke-width: 34; filter: blur(7px); }
.wave-main { stroke: var(--amber); stroke-width: 12; stroke-dasharray: 1500; stroke-dashoffset: 1500; filter: drop-shadow(0 0 18px rgba(255,178,62,.72)); animation: drawWave 5.5s ease-in-out infinite; }
.wave-cool { stroke: var(--blue); stroke-width: 3; stroke-dasharray: 16 18; opacity: .82; animation: waveFloat 6s ease-in-out infinite alternate; }
.signal-label {
  position: absolute;
  color: var(--paper);
  font: 500 12px "IBM Plex Sans", sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.label-sweet { left: 90px; top: 92px; }
.label-temp { right: 90px; bottom: 92px; color: var(--blue); }
.scene-copy { max-width: 620px; margin: 28px auto 0; color: rgba(255,242,216,.78); line-height: 1.8; text-align: center; }

.collage { min-height: 70vh; overflow: hidden; background: linear-gradient(145deg, rgba(8,5,6,.95), rgba(49,75,53,.52)); }
.foil { position: absolute; background: linear-gradient(115deg, #755414, var(--gold), var(--paper), var(--blue), #6b4b11); box-shadow: 0 0 36px rgba(216,164,65,.25); transition: transform .25s ease; }
.shard-a { width: 270px; height: 130px; left: 12%; top: 20%; clip-path: polygon(0 16%, 100% 0, 82% 100%, 12% 80%); }
.shard-b { width: 210px; height: 260px; right: 16%; top: 12%; clip-path: polygon(24% 0, 100% 20%, 72% 100%, 0 76%); }
.shard-c { width: 330px; height: 150px; left: 36%; bottom: 13%; clip-path: polygon(10% 0, 88% 18%, 100% 82%, 0 100%); }
.wrapper-lines { position: absolute; inset: 12%; background: repeating-linear-gradient(90deg, transparent 0 38px, rgba(216,164,65,.42) 39px 40px); transform: rotate(-8deg); }
.receipt-fragment { position: absolute; left: 18%; bottom: 19%; max-width: 330px; transform: rotate(5deg); }
.dev-seal { position: absolute; right: 26%; bottom: 25%; transform: rotate(-12deg); font-family: "IBM Plex Sans", sans-serif; }

.lacquer-tray {
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 5vw, 72px);
  background: radial-gradient(ellipse at center, rgba(255,178,62,.18), transparent 52%), linear-gradient(180deg, #130809, #050303);
}
.sweet { position: relative; display: grid; place-items: end center; width: 170px; height: 170px; filter: drop-shadow(0 28px 24px rgba(0,0,0,.55)); }
.sweet span { position: absolute; bottom: -38px; color: var(--paper); font: 12px "IBM Plex Sans", sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.moon-mochi { border-radius: 50%; background: radial-gradient(circle at 38% 28%, #fff8e9, var(--paper) 38%, #c7a96c); }
.amber-jelly { border-radius: 36% 64% 44% 56%; background: radial-gradient(circle at 36% 28%, rgba(255,242,216,.8), transparent 22%), linear-gradient(145deg, var(--amber), var(--azuki)); animation: jellyPulse 4s ease-in-out infinite; }
.matcha-leaf { clip-path: ellipse(42% 50% at 50% 50%); background: linear-gradient(135deg, var(--matcha), #5f7c3e); }
.matcha-leaf::before { content: ""; position: absolute; width: 80%; height: 1px; background: var(--gold); transform: rotate(-28deg); top: 50%; }

.receipt { max-width: 540px; min-height: auto; padding: 56px 44px; text-align: center; color: var(--lacquer); background: var(--paper); }
.receipt h2 { margin: 0 0 26px; color: var(--azuki); font: 3.2rem Limelight, serif; letter-spacing: .08em; }
.receipt p { margin: 12px 0; font-size: 1.08rem; }
.commit-line { margin-top: 28px; padding-top: 18px; border-top: 1px dashed rgba(8,5,6,.45); font: 12px "IBM Plex Sans", sans-serif; letter-spacing: .12em; }
.final-seal { margin: 28px auto 0; animation: sealPress 5.5s ease-in-out infinite; }

@keyframes sheenDrift { to { transform: translateX(9%) translateY(-4%) rotate(4deg); } }
@keyframes seamOpen { 0% { transform: scaleY(.18); opacity: .2; } 65% { width: 3px; } 100% { width: 12px; transform: scaleY(1); opacity: 1; } }
@keyframes spillGlow { to { opacity: 1; inset: 0 32%; } }
@keyframes bellRipple { 0% { transform: scale(.35); opacity: .6; } 100% { transform: scale(2.35); opacity: 0; } }
@keyframes signReveal { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes slipDrift { 50% { translate: 0 -10px; } }
@keyframes fillMold { from { height: 34%; } to { height: 72%; } }
@keyframes sealPress { 0%, 70%, 100% { transform: scale(1) rotate(-4deg); opacity: .86; } 78% { transform: scale(1.16) rotate(-4deg); opacity: 1; filter: blur(.4px); } }
@keyframes drawWave { 0% { stroke-dashoffset: 1500; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes waveFloat { to { transform: translateY(-18px); } }
@keyframes jellyPulse { 50% { transform: scale(1.05) skewX(-2deg); } }

@media (max-width: 820px) {
  .recipe-rail { left: 8px; width: 52px; }
  .rail-mark em { display: none; }
  .scene { padding-left: 72px; padding-right: 20px; }
  .scene-title { left: 72px; }
  .workshop-grid { grid-template-columns: 1fr; padding-top: 120px; }
  .lacquer-tray { flex-direction: column; padding: 90px 0; gap: 64px; }
  .vertical-sign h1 { font-size: 4.2rem; }
}
