/* MIDNIGHT TONKOTSU — rain-slick asphalt, neon, broth gold */

:root {
  --asphalt: #07080d;
  --asphalt-2: #0d0f17;
  --panel: #10131d;
  --line: #232838;
  --ink: #e9e6dc;
  --ink-dim: #9aa0af;
  --magenta: #ff3dae;
  --cyan: #28e0ff;
  --red: #ff2b2b;
  --gold: #f0b64a;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --kana: "DotGothic16", monospace;
  --mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background:
    radial-gradient(1100px 500px at 85% -5%, rgba(255, 61, 174, 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(40, 224, 255, 0.05), transparent 55%),
    var(--asphalt);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection { background: var(--magenta); color: #0a0208; }

.kana { font-family: var(--kana); }

a { color: var(--cyan); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--cyan); color: #06232b; padding: 0.6rem 1rem;
  font-family: var(--mono); z-index: 100; text-decoration: none;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

/* ============ TOP BAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 8, 13, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.topbar-brand {
  font-family: var(--display); font-weight: 800; font-size: 1.05rem;
  letter-spacing: 0.14em; display: flex; align-items: center; gap: 0.6rem;
}
.topbar-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px 2px rgba(255, 43, 43, 0.7);
}
.topbar nav { display: flex; gap: 1.4rem; }
.topbar nav a {
  color: var(--ink-dim); text-decoration: none;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.2s;
}
.topbar nav a:hover { color: var(--cyan); }

/* ============ HERO ============ */
.hero { position: relative; overflow: hidden; }

.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(90px); pointer-events: none;
}
.hero-glow--magenta {
  width: 480px; height: 480px; right: -140px; top: -90px;
  background: rgba(255, 61, 174, 0.14);
}

.hero-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 4.5rem 1.5rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 2.5rem; align-items: center;
  position: relative;
}

.kana-strip {
  font-family: var(--kana);
  color: var(--cyan);
  font-size: 1rem;
  letter-spacing: 0.55em;
  margin-bottom: 1rem;
  text-shadow: 0 0 12px rgba(40, 224, 255, 0.55);
}

.sign {
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.92;
  display: flex; flex-direction: column;
}
.sign-line { display: block; }
.sign-midnight {
  font-size: clamp(3rem, 7.2vw, 6rem);
  letter-spacing: 0.06em;
  color: var(--ink);
}
.sign-tonkotsu {
  font-size: clamp(3.6rem, 9vw, 7.6rem);
  letter-spacing: 0.05em;
}

/* neon tube lighting model: core → halo → bloom → cast light */
.neon {
  color: #fff0f7;
  text-shadow:
    0 0 4px #fff,
    0 0 11px var(--magenta),
    0 0 24px var(--magenta),
    0 0 55px rgba(255, 61, 174, 0.65),
    0 0 110px rgba(255, 61, 174, 0.4);
}
@keyframes inverter-stutter {
  0%, 6.9% { opacity: 1; }
  7% { opacity: 0.35; text-shadow: 0 0 3px #fff; }
  7.6% { opacity: 1; }
  24%, 25.9% { opacity: 1; }
  26% { opacity: 0.6; }
  26.4% { opacity: 1; }
  53%, 53.9% { opacity: 1; }
  54% { opacity: 0.25; text-shadow: 0 0 2px #fff; }
  54.3% { opacity: 0.9; }
  54.7% { opacity: 0.45; }
  55.2%, 100% { opacity: 1; }
}
[data-flicker] { animation: inverter-stutter 7.3s infinite steps(1, end); }

/* micro-interaction: the tube buzzes when you get close */
@keyframes neon-buzz {
  0% { opacity: 1; }
  50% { opacity: 0.8; text-shadow: 0 0 4px #fff, 0 0 9px var(--magenta), 0 0 20px var(--magenta), 0 0 44px rgba(255, 61, 174, 0.5); }
  100% { opacity: 1; }
}
[data-flicker]:hover { animation: neon-buzz 0.09s steps(2, end) infinite; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  [data-flicker], [data-flicker]:hover { animation: none; }
}

.hero-sub {
  margin-top: 1.6rem;
  max-width: 44ch;
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.hero-hours { margin-top: 1.4rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }
.hours-chip {
  font-size: 0.82rem; letter-spacing: 0.12em;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.35rem 0.85rem; border-radius: 999px;
}
.hours-chip--dim { border-color: var(--line); color: var(--ink-dim); }

.hero-cta { margin-top: 1.8rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none;
  padding: 0.75rem 1.4rem; border-radius: 3px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn--red {
  background: var(--red); color: #1a0303; font-weight: 600;
  box-shadow: 0 0 18px rgba(255, 43, 43, 0.45);
}
.btn--red:hover { transform: translateY(-2px); box-shadow: 0 0 28px rgba(255, 43, 43, 0.7); }
.btn--ghost {
  border: 1px solid var(--line); color: var(--ink);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* bowl + steam */
.hero-bowl { position: relative; min-height: 480px; }
#steam {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}
.bowl-svg {
  position: absolute; bottom: 2.4rem; left: 50%;
  transform: translateX(-50%);
  width: min(100%, 470px);
  filter: drop-shadow(0 10px 40px rgba(240, 182, 74, 0.12));
}
.bowl-caption {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-dim);
}
.bowl-caption .kana { color: var(--gold); margin-right: 0.5em; }

/* ticker */
.hero-ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 2.5rem;
  overflow: hidden;
  background: rgba(13, 15, 23, 0.7);
}
.ticker-track {
  display: flex; gap: 2.2rem; width: max-content;
  padding: 0.55rem 0;
  font-size: 0.75rem; letter-spacing: 0.22em;
  color: var(--gold);
  animation: ticker 36s linear infinite;
}
.ticker-track span { white-space: nowrap; }
.tick-dot { color: var(--magenta); font-size: 0.6rem; align-self: center; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ============ SECTIONS ============ */
.section { max-width: 1200px; margin: 0 auto; padding: 6rem 1.5rem 2rem; }

.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-eyebrow {
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--magenta); margin-bottom: 0.9rem;
}
.section-eyebrow .kana {
  color: var(--cyan); font-size: 1rem; text-transform: none; letter-spacing: 0.3em;
}
.section-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95; letter-spacing: 0.03em;
  text-transform: uppercase;
}
.section-note { margin-top: 1.2rem; color: var(--ink-dim); font-size: 0.92rem; }

/* ============ TICKET MACHINE ============ */
.machine {
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(40, 224, 255, 0.03), transparent 120px),
    var(--panel);
  padding: 1.6rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.machine-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 1.1rem; margin-bottom: 1.4rem;
}
.machine-title {
  font-family: var(--kana); color: var(--gold);
  letter-spacing: 0.3em; font-size: 0.95rem;
}
.machine-lamp {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 10px 2px rgba(255, 43, 43, 0.6);
}
.machine-lamp--cyan { background: var(--cyan); box-shadow: 0 0 10px 2px rgba(40, 224, 255, 0.6); }

.machine-row-label {
  display: flex; align-items: baseline; gap: 1rem;
  margin: 1.6rem 0 0.9rem;
}
.machine-row-label span {
  font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  letter-spacing: 0.15em; color: var(--cyan);
}
.machine-row-label em {
  font-style: normal; font-size: 0.75rem; letter-spacing: 0.12em;
  color: var(--ink-dim); text-transform: uppercase;
}

.machine-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem;
}
.machine-grid--small { grid-template-columns: repeat(4, 1fr); }

.ticket {
  position: relative;
  text-align: left;
  font-family: var(--mono);
  color: var(--ink);
  background: var(--asphalt-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.1rem 1.1rem 1rem;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 0.45rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.08s;
}
.ticket:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(240, 182, 74, 0.3), 0 0 22px rgba(240, 182, 74, 0.12);
}
.ticket:active { transform: translateY(2px); }
.ticket[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(240, 182, 74, 0.1), rgba(240, 182, 74, 0.02)), var(--asphalt-2);
  box-shadow: 0 0 0 1px var(--gold), 0 0 26px rgba(240, 182, 74, 0.25);
}
.ticket[aria-pressed="true"]::after {
  content: "LIT"; position: absolute; top: 0.7rem; right: 0.8rem;
  font-size: 0.6rem; letter-spacing: 0.2em; color: var(--gold);
}

.ticket-code {
  font-size: 0.68rem; letter-spacing: 0.22em; color: var(--cyan);
}
.ticket-kana {
  position: absolute; top: 0.55rem; right: 0.75rem;
  font-family: var(--kana); font-size: 1.7rem; color: var(--magenta);
  opacity: 0.85; text-shadow: 0 0 10px rgba(255, 61, 174, 0.5);
}
.ticket[aria-pressed="true"] .ticket-kana { opacity: 0.25; }
.ticket-name {
  font-family: var(--display); font-weight: 800;
  font-size: 1.5rem; letter-spacing: 0.06em; line-height: 1;
}
.ticket-desc { font-size: 0.78rem; color: var(--ink-dim); line-height: 1.6; }
.ticket-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.3rem;
}
.ticket-price { color: var(--gold); font-weight: 600; letter-spacing: 0.08em; }
.ticket-tag {
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(40, 224, 255, 0.35);
  padding: 0.15rem 0.5rem; border-radius: 999px;
}
.ticket-tag--hot { color: var(--red); border-color: rgba(255, 43, 43, 0.4); }

.ticket--small { padding: 0.9rem 0.9rem 0.8rem; }
.ticket--small .ticket-name { font-size: 1.1rem; }
.ticket--small .ticket-desc { font-size: 0.72rem; }

/* tray */
.machine-tray {
  margin-top: 1.8rem;
  border-top: 1px dashed var(--line);
  padding-top: 1.4rem;
  min-height: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.tray-slot {
  width: 220px; height: 8px; border-radius: 999px;
  background: #05060a;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.9), 0 0 0 1px var(--line);
}
.tray-empty {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim);
}
.stub[hidden] { display: none; }
.stub {
  background: #f4efe2; color: #191408;
  width: min(340px, 100%);
  padding: 0.9rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  border-radius: 2px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  /* perforated edge */
  -webkit-mask: radial-gradient(circle 5px at 5px 50%, transparent 98%, #000) -5px 0 / 100% 14px repeat-y,
    linear-gradient(#000, #000) 8px 0 / calc(100% - 16px) 100% no-repeat,
    radial-gradient(circle 5px at calc(100% - 5px) 50%, transparent 98%, #000) 5px 0 / 100% 14px repeat-y;
  mask: radial-gradient(circle 5px at 5px 50%, transparent 98%, #000) -5px 0 / 100% 14px repeat-y,
    linear-gradient(#000, #000) 8px 0 / calc(100% - 16px) 100% no-repeat,
    radial-gradient(circle 5px at calc(100% - 5px) 50%, transparent 98%, #000) 5px 0 / 100% 14px repeat-y;
  animation: stub-print 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes stub-print {
  from { transform: translateY(-14px) scaleY(0.5); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .stub { animation: none; }
}
.stub-head {
  font-family: var(--kana); font-size: 0.72rem; letter-spacing: 0.22em;
  border-bottom: 1px dashed #b9ad8d; padding-bottom: 0.4rem;
}
.stub-name {
  font-family: var(--display); font-weight: 900; font-size: 1.7rem;
  letter-spacing: 0.05em; line-height: 1;
}
.stub-row {
  display: flex; justify-content: space-between; font-size: 0.85rem;
  font-weight: 600;
}
.stub-row [lang="ja"] { font-family: var(--kana); }
.stub-foot {
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #6b6049; border-top: 1px dashed #b9ad8d; padding-top: 0.4rem;
}

/* ============ RULES ============ */
.rules {
  list-style: none;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
}
.rule {
  background: var(--asphalt-2);
  padding: 1.8rem;
  display: flex; gap: 1.3rem; align-items: flex-start;
}
.rule-num {
  font-family: var(--display); font-weight: 900;
  font-size: 2.4rem; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--magenta);
  flex-shrink: 0;
}
.rule h3 {
  font-family: var(--display); font-weight: 800;
  font-size: 1.35rem; letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.rule p { font-size: 0.85rem; color: var(--ink-dim); }

/* ============ DOOR ============ */
.section--door { padding-bottom: 5rem; }
.door-grid {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 3rem; align-items: start;
}

.riddle { list-style: none; margin-top: 2.2rem; display: flex; flex-direction: column; }
.riddle li {
  padding: 1.2rem 0 1.2rem 1.4rem;
  border-left: 2px solid var(--line);
  position: relative;
  font-size: 0.9rem; color: var(--ink);
  max-width: 58ch;
}
.riddle li::before {
  content: ""; position: absolute; left: -6px; top: 1.55rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--asphalt); border: 2px solid var(--cyan);
}
.riddle li:last-child::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 10px rgba(255,43,43,0.8); }
.riddle-step {
  display: block; font-size: 0.68rem; letter-spacing: 0.24em;
  color: var(--cyan); margin-bottom: 0.35rem;
}

.door-warning {
  margin-top: 1.8rem;
  border: 1px solid rgba(255, 43, 43, 0.4);
  border-radius: 6px;
  background: rgba(255, 43, 43, 0.06);
  padding: 1rem 1.2rem;
  color: #ffb3ab; font-size: 0.88rem;
  max-width: 52ch;
}

.door-scene {
  position: sticky; top: 5rem;
  text-align: center;
}
.lantern-svg { width: min(100%, 300px); }
.lantern-swing { transform-origin: 160px 64px; animation: sway 6.5s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .lantern-swing { animation: none; }
}
.lantern-caption {
  margin-top: 0.6rem;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-dim); line-height: 2;
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--line);
  background: var(--asphalt-2);
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}
.footer-sign {
  font-family: var(--kana); font-size: 1.5rem;
  color: var(--red);
  text-shadow: 0 0 16px rgba(255, 43, 43, 0.6);
  margin-bottom: 1rem; letter-spacing: 0.4em;
}
.footer-line { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.footer-dim { margin-top: 0.8rem; font-size: 0.75rem; color: var(--ink-dim); }
.footer-dim a { color: var(--cyan); text-decoration: none; }
.footer-dim a:hover { text-decoration: underline; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 3rem; }
  .hero-bowl { min-height: 400px; }
  .machine-grid--small { grid-template-columns: repeat(2, 1fr); }
  .rules { grid-template-columns: 1fr; }
  .door-grid { grid-template-columns: 1fr; }
  .door-scene { position: static; }
}
@media (max-width: 560px) {
  .machine-grid { grid-template-columns: 1fr; }
  .machine { padding: 1.1rem; }
  .topbar-inner { padding: 0.65rem 1rem; }
  .topbar-brand { font-size: 0.82rem; letter-spacing: 0.1em; white-space: nowrap; }
  .topbar nav { gap: 0.75rem; }
  .topbar nav a { font-size: 0.65rem; white-space: nowrap; }
  .section { padding-top: 4.5rem; }
  .rule { padding: 1.3rem; }
  .hero-glow--magenta { width: 340px; height: 340px; right: -160px; opacity: 0.75; }
}
