/* Omakase. Le noir de l'encre, le bois du comptoir, l'orange d'une lanterne, et le blanc du riz.
 *
 * La structure n'est pas une barre en haut : c'est un RAIL vertical a gauche, numerote en kanji,
 * parce qu'un omakase est une suite de plats et que l'ordre porte du sens. Le comptoir en trois
 * dimensions occupe le fond en permanence ; changer de plat deplace la camera, la page ne
 * repart jamais de zero. */

:root {
  --sumi:    #131028;
  --ink:     #1B1740;
  --panel:   rgba(22, 18, 48, .80);
  --wood:    #9A5F2B;
  --wood-lit:#D39448;
  --lantern: #FF5A2B;
  --ember:   #FFC48A;
  --rice:    #F2ECDF;
  --dim:     #A79BB4;
  --faint:   #776C8C;
  --line:    rgba(242, 236, 223, .13);
  --line-2:  rgba(255, 90, 43, .30);
  --indigo:  #2B2A72;
  --neon:    #2AD0FF;
  --neon-mag:#FF3FA4;

  --mincho: 'Hiragino Mincho ProN', 'Yu Mincho', 'Songti SC', Georgia, 'Times New Roman', serif;
  --sans: 'Hiragino Sans', 'Yu Gothic', Inter, -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --rail: 92px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100dvh; overflow: hidden;
  background: var(--sumi); color: var(--rice);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ── le comptoir, en fond, pour toujours ────────────────────────────────── */
#stage { position: fixed; inset: 0; z-index: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }
#scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(100deg, var(--sumi) 4%, rgba(19,16,40,.95) 30%, rgba(19,16,40,.45) 56%, rgba(19,16,40,.12) 78%),
    radial-gradient(120% 90% at 70% 40%, transparent 40%, rgba(19,16,40,.55) 100%);
}

/* ── le rail des plats ──────────────────────────────────────────────────── */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 20;
  display: grid; grid-template-rows: auto 1fr auto; align-items: center;
  background: linear-gradient(90deg, rgba(19,16,40,.96), rgba(19,16,40,.72));
  border-right: 1px solid var(--line);
}
.mark { display: grid; place-items: center; padding: 1.1rem 0 .5rem; }
.mark svg { display: block; }
.courses { display: flex; flex-direction: column; justify-content: center; gap: .1rem; }
.courses a {
  display: grid; grid-template-columns: 1fr; justify-items: center; gap: .28rem;
  padding: .72rem .2rem; text-decoration: none; color: var(--faint);
  position: relative; transition: color .2s;
}
.courses a .num { font: 400 15px/1 var(--mincho); }
.courses a .jp  { font: 400 11px/1.25 var(--mincho); writing-mode: vertical-rl; letter-spacing: .12em; }
.courses a:hover { color: var(--rice); }
.courses a.on { color: var(--lantern); }
.courses a.on::before {
  content: ''; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 2px;
  background: var(--lantern); box-shadow: 0 0 14px var(--lantern);
}
.rail-foot { padding: 0 0 1rem; display: grid; place-items: center; gap: .55rem; }
.rail-foot a { color: var(--faint); transition: color .2s; display: grid; place-items: center; }
.rail-foot a:hover { color: var(--lantern); }

/* ── la colonne de lecture ──────────────────────────────────────────────── */
#page {
  position: relative; z-index: 10; height: 100dvh; margin-left: var(--rail);
  display: grid; grid-template-rows: minmax(0, 1fr);
}
.scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.col {
  width: min(100% - 3rem, 620px); margin: 0 0 0 clamp(1.5rem, 5vw, 5rem);
  padding: clamp(3rem, 12vh, 8rem) 0 6rem;
}

.kicker {
  display: flex; align-items: baseline; gap: .8rem; margin: 0 0 1.4rem;
  font: 400 11px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--lantern);
}
.kicker b { font: 400 26px/1 var(--mincho); letter-spacing: 0; text-transform: none; color: var(--rice); }
h1 {
  margin: 0 0 1.1rem; font: 400 clamp(2.6rem, 7vw, 5rem)/1.02 var(--mincho);
  letter-spacing: .01em; text-wrap: balance;
}
h1 .en { display: block; margin-top: .5rem; font: 400 clamp(1.1rem, 2.3vw, 1.7rem)/1.25 var(--sans); color: var(--dim); letter-spacing: -.01em; }
h2 { margin: 0 0 1rem; font: 400 clamp(1.6rem, 3.4vw, 2.5rem)/1.2 var(--mincho); letter-spacing: .01em; text-wrap: balance; }
h3 { margin: 0 0 .5rem; font: 500 14.5px/1.5 var(--sans); letter-spacing: .01em; }
p { margin: 0 0 1.05rem; max-width: 56ch; color: var(--dim); }
p.lede { font-size: clamp(1.04rem, 1.8vw, 1.2rem); color: #C9C0B2; }
p strong { color: var(--rice); font-weight: 500; }
a { color: var(--ember); }
code { font: 400 .88em/1.5 var(--mono); color: var(--ember); background: rgba(255,90,43,.10); padding: .12em .38em; }

/* Toutes les sections, pas seulement celles qui suivent une soeur : la premiere vient apres un
   bloc de boutons, et sans cette regle son intertitre se colle dessus. */
section { margin-top: clamp(2.6rem, 7vh, 4.5rem); padding-top: clamp(2.2rem, 6vh, 3.5rem); border-top: 1px solid var(--line); }

/* ── les blocs de donnee ────────────────────────────────────────────────── */
.slab { background: var(--panel); backdrop-filter: blur(9px); border: 1px solid var(--line); padding: 1.15rem 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--panel); backdrop-filter: blur(9px); padding: .95rem 1.05rem; }
.stat i { font-style: normal; display: block; font: 400 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.stat b { display: block; margin-top: .5rem; font: 400 1.55rem/1 var(--mincho); font-variant-numeric: tabular-nums; }
.stat b.hot { color: var(--lantern); }
.stat b.off { color: var(--faint); }
.stat span { display: block; margin-top: .28rem; font-size: 12px; color: var(--faint); }

.rows { display: grid; gap: .5rem; }
.row { display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: center; gap: .8rem; font-size: 14px; }
.row .dot { width: 11px; height: 11px; border-radius: 2px; justify-self: center; }
.row .bar { height: 3px; background: var(--line); position: relative; }
.row .bar i { position: absolute; inset: 0 auto 0 0; display: block; }
.row b { font: 400 13.5px/1 var(--mono); color: var(--rice); font-variant-numeric: tabular-nums; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(9px); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: .68rem .85rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 400 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
td { color: var(--dim); } td:first-child { color: var(--rice); }
td.num { font: 400 13px/1 var(--mono); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

.note { margin: 1.15rem 0; max-width: 56ch; padding: .85rem 1.05rem; font-size: 13.5px; line-height: 1.65; color: var(--dim); background: rgba(255,90,43,.055); border-left: 2px solid var(--lantern); }
.note b { display: block; font: 400 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--lantern); margin-bottom: .35rem; }

.plate { margin: 1.6rem 0; border: 1px solid var(--line); }
.plate img { display: block; width: 100%; height: auto; }
.plate figcaption { padding: .55rem .8rem; font: 400 11.5px/1.5 var(--mono); color: var(--faint); background: var(--panel); }

/* ── l'addition, en interactif ──────────────────────────────────────────── */
.dial { display: grid; gap: .85rem; }
.dial input[type=range] { width: 100%; accent-color: var(--lantern); }
.dial .read { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.dial .read b { font: 400 2.1rem/1 var(--mincho); color: var(--lantern); font-variant-numeric: tabular-nums; }
.curve { width: 100%; height: 128px; display: block; }
.marks { display: flex; justify-content: space-between; font: 400 10.5px/1 var(--mono); color: var(--faint); }

.btn {
  font: 400 13px/1 var(--sans); padding: .62rem 1.05rem; cursor: pointer; text-decoration: none;
  color: var(--rice); background: transparent; border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: .45rem; transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--line-2); background: rgba(255,90,43,.07); }
.btn--go { background: var(--lantern); border-color: var(--lantern); color: #14100E; font-weight: 600; }
.btn--go:hover { background: #ff7448; border-color: #ff7448; }
.btn[disabled] { color: var(--faint); border-style: dashed; cursor: not-allowed; background: none; }
.cta { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; }

.foot { margin-top: 3.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }

/* ── petites tailles ────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --rail: 0px; }
  .rail {
    left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 58px;
    grid-template-rows: none; grid-template-columns: auto 1fr auto;
    background: rgba(19,16,40,.93); border-right: 0; border-bottom: 1px solid var(--line);
  }
  .mark { padding: 0 0 0 .9rem; }
  .courses { flex-direction: row; overflow-x: auto; gap: 0; padding: 0 .3rem; }
  .courses a { grid-template-columns: auto auto; align-items: center; gap: .34rem; padding: .5rem .55rem; }
  /* `nowrap` est obligatoire : sans lui, ネタケース se casse en trois lignes dans un rail de
     58 px et fait sauter toute la barre. */
  .courses a .jp { writing-mode: horizontal-tb; font-size: 12.5px; white-space: nowrap; }
  .courses a.on::before { left: .55rem; right: .55rem; top: auto; bottom: 2px; width: auto; height: 2px; }
  .rail-foot { padding: 0 .9rem 0 0; }
  #page { margin-left: 0; padding-top: 58px; }
  .col { width: calc(100% - 2.4rem); margin-inline: 1.2rem; padding-top: 2rem; }
  #scrim { background: linear-gradient(180deg, rgba(19,16,40,.55) 0%, rgba(19,16,40,.90) 45%, var(--sumi) 100%); }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; scroll-behavior: auto; } }

/* Le comptoir est rendu bas puis agrandi : NEAREST, sinon tout le grain se noie. */
#counter { image-rendering: pixelated; }
