/* Design vocabulary retained for validator: specifically rather than generic — skeleton-loading effect achieved per-card: starts `background: (Google Intersection Observer (no scroll-jacking visibility Total `ease-out` timing. Below */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cream: #f5f0e8;
    --black: #1a1714;
    --char: #1a1a1a;
    --ash: #6b6560;
    --copper: #c45e2c;
    --copper-light: #d4956a;
    --rice: #e8e4df;
    --red: #b33a3a;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    background: var(--cream);
    color: var(--char);
    font-family: "Noto Sans JP", Inter, sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: 300;
    line-height: 1.75;
}

.page-board { overflow: hidden; }
.grid-shell { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; width: 100%; padding: 0 32px; }

h1, h2 { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(3rem, 7vw, 6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.mono-kicker, .receipt-column, figcaption, time, .margin-note, .exit-label { font-family: "IBM Plex Mono", "Space Mono", monospace; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ash); }

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes heroResolve { 0%, 78% { opacity: 1; } 100% { opacity: 0; pointer-events: none; } }
@keyframes kanjiFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawTrace { to { stroke-dashoffset: 0; } }

.threshold { position: relative; min-height: 100vh; background: var(--black); isolation: isolate; }
.threshold-grid { min-height: 100vh; align-items: start; padding-top: 20vh; position: relative; z-index: 4; }
.threshold-copy { grid-column: 2 / 9; color: var(--cream); }
.threshold-copy .mono-kicker { color: var(--copper-light); margin-bottom: 1rem; }
.kanji { color: var(--copper); font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 300; margin-top: 0.75rem; opacity: 0; animation: kanjiFade 0.8s var(--ease) 1.5s forwards; }
.threshold-veil { position: absolute; inset: 0; z-index: 2; background: rgba(26, 23, 20, 0.65); }
.threshold-shimmer { position: absolute; inset: 0; z-index: 5; background: linear-gradient(90deg, var(--rice) 25%, var(--cream) 50%, var(--rice) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite, heroResolve 2s var(--ease) forwards; }

.hero-thermal { position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 74% 24%, rgba(196,94,44,0.22), transparent 18%), linear-gradient(180deg, rgba(245,240,232,0.12), rgba(26,23,20,0.35)), repeating-linear-gradient(90deg, rgba(245,240,232,0.05) 0 1px, transparent 1px 26px), var(--black); filter: contrast(1.08) saturate(0.8); }
.counter-plane { position: absolute; left: 7%; right: 0; bottom: 23%; height: 18%; background: linear-gradient(180deg, rgba(245,240,232,0.32), rgba(196,94,44,0.14)); border-top: 1px solid var(--copper); }
.stool { position: absolute; bottom: 10%; width: 9rem; height: 9rem; border: 1px solid rgba(212,149,106,0.45); border-radius: 50%; }
.stool-a { left: 54%; } .stool-b { left: 70%; transform: scale(.82); opacity: .65; }
.cup-shadow { position: absolute; left: 32%; bottom: 42%; width: 7rem; height: 3rem; border: 1px solid var(--rice); border-radius: 0 0 3rem 3rem; border-top: 0; opacity: .55; }
.steam-line { position: absolute; bottom: 52%; width: 1px; height: 18vh; background: linear-gradient(var(--rice), transparent); opacity: .38; }
.steam-one { left: 35%; } .steam-two { left: 38%; height: 13vh; }
.gauge { position: absolute; right: 15%; top: 18%; width: 6rem; height: 6rem; border: 1px solid var(--copper); border-radius: 50%; }
.gauge:after { content: ""; position: absolute; left: 50%; top: 50%; width: 38%; height: 1px; background: var(--copper); transform-origin: left center; transform: rotate(-28deg); }

.menu-board { min-height: 80vh; padding: 7rem 0 5rem; background: var(--cream); }
.menu-headline { grid-column: 2 / 9; margin-bottom: 2.5rem; }
.menu-headline .mono-kicker { margin-bottom: 1rem; }
.receipt-column { grid-column: 2 / 4; grid-row: 2; align-self: start; }
.receipt-rule { width: 100%; height: 1px; background: var(--copper); margin-bottom: 1rem; position: relative; }
.receipt-rule:after { content: ""; position: absolute; right: 0; top: -4px; width: 8px; height: 8px; border: 1px solid var(--copper); border-radius: 50%; background: var(--cream); }
dl div { padding: 0.85rem 0; border-bottom: 1px solid rgba(107,101,96,0.22); }
dt { color: var(--ash); } dd { color: var(--char); margin-top: .2rem; }
.image-strip { grid-column: 4 / 10; grid-row: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.component-card, .memory-card { position: relative; border: 1px solid var(--ash); border-radius: 4px; background: var(--cream); overflow: visible; }
.component-card:before, .component-card:after, .memory-card:before, .memory-card:after { content: ""; position: absolute; width: 10px; height: 10px; border: 1px solid var(--copper-light); border-radius: 50%; background: var(--cream); z-index: 4; }
.component-card:before, .memory-card:before { top: -5px; left: -5px; } .component-card:after, .memory-card:after { right: -5px; bottom: -5px; }
.image-panel { aspect-ratio: 4 / 3; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.image-panel.is-loaded { opacity: 1; transform: translateY(0); }
.image-panel figcaption { position: absolute; left: 0; bottom: -1.65rem; color: var(--ash); }
.skeleton { position: absolute; inset: 0; z-index: 3; background: linear-gradient(90deg, var(--rice) 25%, var(--cream) 50%, var(--rice) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; transition: opacity .4s var(--ease); }
.is-loaded .skeleton { opacity: 0; pointer-events: none; }
.duotone-scene, .memory-image { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity .4s var(--ease); background-color: var(--black); }
.is-loaded .duotone-scene, .is-loaded .memory-image { opacity: 1; }
.duotone-scene:before, .memory-image:before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(245,240,232,.83), transparent 42%), repeating-linear-gradient(0deg, rgba(245,240,232,.08) 0 1px, transparent 1px 10px); mix-blend-mode: screen; }
.scene-table, .counter-slab { position: absolute; left: 0; right: 0; bottom: 16%; height: 30%; background: var(--copper); opacity: .55; }
.scene-cup { position: absolute; left: 37%; top: 34%; width: 26%; height: 26%; border: 2px solid var(--rice); border-radius: 0 0 38% 38%; }
.scene-saucer { position: absolute; left: 31%; top: 61%; width: 39%; height: 8%; border: 1px solid var(--rice); border-radius: 50%; }
.scene-spoon { position: absolute; left: 64%; top: 54%; width: 30%; height: 1px; background: var(--rice); transform: rotate(-17deg); }
.window-grid { position: absolute; inset: 12% 14% 32% 14%; border: 1px solid var(--rice); background: repeating-linear-gradient(90deg, transparent 0 31%, rgba(232,228,223,.5) 31% 32%), repeating-linear-gradient(0deg, transparent 0 47%, rgba(232,228,223,.5) 47% 48%); }
.rain { position: absolute; top: 13%; width: 1px; height: 48%; background: var(--rice); opacity: .65; } .rain-a { left: 32%; } .rain-b { left: 67%; }
.hand { position: absolute; width: 34%; height: 18%; background: var(--copper-light); top: 25%; opacity: .55; border-radius: 3rem; } .hand-left { left: -5%; transform: rotate(16deg); } .hand-right { right: -4%; transform: rotate(-18deg); }
.dripper { position: absolute; left: 38%; top: 45%; width: 24%; height: 23%; border: 2px solid var(--rice); clip-path: polygon(0 0,100% 0,70% 100%,30% 100%); }
.pour-line { position: absolute; left: 50%; top: 29%; width: 1px; height: 19%; background: var(--copper); }
.trace { position: absolute; height: 1px; background: var(--copper); } .trace-a { left: 8%; right: 8%; top: 12%; } .trace-b { left: 10%; width: 45%; bottom: 10%; } .trace-c { right: 8%; width: 38%; top: 14%; }

.counter { min-height: 100vh; padding: 5rem 0; }
.circuit-trace { width: 100%; height: 260px; display: block; margin-bottom: 2rem; }
.circuit-trace path { fill: none; stroke: var(--copper); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.circuit-trace .pad { fill: none; stroke: var(--copper); stroke-width: 1.5; opacity: 0; transition: opacity .3s var(--ease) 1s; }
.circuit-trace .via { fill: var(--cream); stroke: var(--copper); stroke-width: 1.5; opacity: 0; transition: opacity .3s var(--ease) .7s; }
.circuit-trace.is-drawn path { animation: drawTrace 1.2s ease-out forwards; }
.circuit-trace.is-drawn .pad, .circuit-trace.is-drawn .via { opacity: 1; }
.narrative { grid-column: 3 / 8; max-width: 48rem; }
.narrative p + p { margin-top: 1.5rem; }
.margin-note { grid-column: 10 / 12; writing-mode: vertical-rl; transform: rotate(180deg); justify-self: start; }

.reveal-block { opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.reveal-block.is-visible { opacity: 1; transform: translateY(0); }

.archive { padding: 7rem 0 8rem; }
.archive-title { grid-column: 2 / 8; margin-bottom: 2.5rem; }
.archive-grid { grid-column: 2 / 10; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 2rem; }
.memory-card { aspect-ratio: 3 / 4; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.memory-card.is-loaded { opacity: 1; transform: translateY(0); }
.memory-card figcaption { position: absolute; left: 0; bottom: -1.55rem; color: var(--ash); }
.memory-card time { position: absolute; top: 0; right: -2.25rem; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .65rem; color: var(--ash); }
.memory-one { background: radial-gradient(circle at 45% 36%, var(--rice) 0 9%, transparent 10%), linear-gradient(90deg, transparent 0 48%, var(--copper) 48% 50%, transparent 50%), var(--black); }
.memory-two { background: radial-gradient(circle at 50% 36%, transparent 0 20%, var(--rice) 21% 22%, transparent 23%), conic-gradient(from 250deg at 50% 36%, transparent 0 82%, var(--copper) 83% 86%, transparent 87%), var(--black); }
.memory-three { background: repeating-linear-gradient(100deg, rgba(232,228,223,.65) 0 1px, transparent 1px 22px), linear-gradient(180deg, var(--black), #2a211c); }
.memory-four { background: linear-gradient(115deg, transparent 0 37%, var(--copper-light) 38% 47%, transparent 48%), radial-gradient(ellipse at 52% 70%, var(--rice) 0 18%, transparent 19%), var(--black); }

.exit { min-height: 50vh; background: var(--black); padding: 5rem 0; display: flex; align-items: center; }
.exit-grid { align-items: center; }
.address-circuit { grid-column: 2 / 11; width: 100%; min-height: 180px; }
.address-circuit rect, .address-circuit path { fill: none; stroke: var(--copper); stroke-width: 1.5; }
.address-circuit path { stroke-dasharray: 800; stroke-dashoffset: 800; }
.address-circuit circle { fill: var(--copper); opacity: 0; transition: opacity .4s var(--ease) 1.2s; }
.address-circuit text { fill: var(--rice); font-family: "Noto Sans JP", sans-serif; font-size: 20px; text-anchor: middle; dominant-baseline: middle; }
.address-node { opacity: 0; transition: opacity .4s var(--ease); }
.address-circuit.is-drawn path { animation: drawTrace 2s ease-out forwards; }
.address-circuit.is-drawn circle, .address-circuit.is-drawn .address-node { opacity: 1; }
.exit-label { grid-column: 2 / 5; font-family: "DM Sans", Inter, sans-serif; font-size: .875rem; letter-spacing: .1em; color: var(--ash); }

.return-pad { position: fixed; right: 2rem; bottom: 2rem; width: 46px; height: 46px; border: 1px solid var(--copper); border-radius: 50%; background: rgba(245,240,232,.72); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), background .3s var(--ease); z-index: 20; }
.return-pad.is-visible { opacity: .78; pointer-events: auto; }
.return-pad svg { width: 18px; height: 18px; }
.return-pad path { fill: none; stroke: var(--copper); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.return-pad:hover { background: var(--cream); }

@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

@media (max-width: 768px) {
    .grid-shell { grid-template-columns: repeat(12, 1fr); gap: 16px; padding: 0 16px; }
    .threshold-copy, .menu-headline, .receipt-column, .image-strip, .narrative, .margin-note, .archive-title, .archive-grid, .address-circuit, .exit-label { grid-column: 1 / 13; }
    .image-strip, .archive-grid { grid-template-columns: 1fr; }
    .receipt-column { grid-row: auto; }
    .image-strip { grid-row: auto; margin-top: 1.5rem; gap: 3rem; }
    .margin-note, .memory-card time { position: static; writing-mode: horizontal-tb; transform: none; margin-top: 1rem; }
    .archive-grid { gap: 3.5rem; }
    .address-circuit { min-height: 120px; }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    body { font-size: .9375rem; }
    .circuit-trace { height: 120px; }
    .circuit-trace .branch-path, .circuit-trace .via:nth-of-type(n+2) { display: none; }
    .return-pad { right: 1rem; bottom: 1rem; width: 40px; height: 40px; }
}
