/* Tokens mirror the "Paiki Menú Ramen" design system (tokens.json). */
:root {
  --paper: #eceae5;
  --paper-rule: #c9c5bc;
  --ink: #161412;
  --ink-muted: #5c5850;
  --leader: #8a857c;
  --ramen-red: #d91a21;
  --ramen-red-deep: #b0121a;

  --font-display: Archivo, system-ui, sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Sans", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-5: 20px;
  --space-6: 24px;
  --space-10: 40px;

  --radius-sm: 4px;
  --stroke-heavy: 2px;
  --stroke-hairline: 1px;
  --stroke-leader: 2px;
  --row-min: 52px;
  --page-max: 480px;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-block: 32px var(--space-10);
  padding-left: max(var(--space-6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

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

/* Masthead */

.masthead {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding-bottom: var(--space-2);
  border-bottom: var(--stroke-heavy) solid var(--ink);
}

.bar .jp {
  letter-spacing: 0.2em;
}

.wordmark {
  margin: 0;
  line-height: 0;
}

.wordmark img {
  width: 260px;
  max-width: 100%;
  height: auto;
}

.illustration {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.illustration img {
  height: 180px;
  width: auto;
  max-width: 100%;
}

.illustration figcaption {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--ink-muted);
}

.listen-by-show {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Menu sections */

.menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-bottom: var(--space-1);
  border-bottom: var(--stroke-heavy) solid var(--ink);
}

.section-number {
  font-size: 14px;
  font-weight: 800;
  color: var(--ramen-red-deep);
  font-variant-numeric: tabular-nums;
}

.section-title {
  margin: 0;
  flex: 1;
  font-style: italic;
  font-weight: 900;
  font-size: 32px;
  line-height: 38px;
}

.section-gloss {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-muted);
}

.subhead {
  margin: var(--space-1) 0 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ramen-red-deep);
}

.subhead ~ .subhead {
  margin-top: var(--space-3);
}

/* Link rows */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  min-height: var(--row-min);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: var(--stroke-hairline) solid var(--paper-rule);
  color: var(--ink);
  text-decoration: none;
}

.row:hover .label,
.row:focus-visible .label {
  color: var(--ramen-red-deep);
}

.row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.label {
  font-weight: 800;
  font-size: 17px;
  line-height: 24px;
}

.label-show {
  font-style: italic;
  font-size: 18px;
}

.leader {
  flex: 1;
  min-width: var(--space-3);
  border-bottom: var(--stroke-leader) dotted var(--leader);
  transform: translateY(4px);
}

.meta {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Footer */

.footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding-top: var(--space-2);
  border-top: var(--stroke-heavy) solid var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .label,
  .platform-link {
    transition: color 120ms ease-out;
  }
}

/* Desktop: a menu board, with the cover pinned on the left */

@media (min-width: 900px) {
  .page {
    --page-pad-y: clamp(32px, 6vh, 56px);
    max-width: 1120px;
    min-height: 0;
    padding-block: var(--page-pad-y);
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "cover menu"
      "cover footer";
    column-gap: clamp(48px, 7vw, 96px);
    row-gap: var(--space-6);
  }

  /* The cover fills the window, framed by the MENÚ bar and the credit bar,
     and the monster takes whatever height is left between them. */
  .masthead {
    grid-area: cover;
    align-self: start;
    position: sticky;
    top: var(--page-pad-y);
    height: calc(100vh - 2 * var(--page-pad-y));
    min-height: 560px;
    max-height: 880px;
  }

  /* The menu matches the cover's height: a tighter rhythm than on phones,
     with the leftover space spread between sections. */
  .menu {
    grid-area: menu;
    max-width: 640px;
    gap: var(--space-6);
    justify-content: space-between;
  }

  .section {
    gap: var(--space-2);
  }

  .section-title {
    font-size: 28px;
    line-height: 32px;
  }

  .row {
    min-height: 40px;
  }

  .footer {
    grid-area: footer;
    max-width: 640px;
    margin-top: 0;
  }

  .wordmark img {
    width: 340px;
  }

  .illustration {
    flex: 1 1 auto;
    min-height: 0;
    gap: var(--space-5);
  }

  .illustration img {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: none;
    height: auto;
    object-fit: contain;
  }

  .illustration figcaption {
    align-self: stretch;
    padding-top: var(--space-2);
    border-top: var(--stroke-heavy) solid var(--ink);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
  }

  .listen-by-platform {
    display: none;
  }

  .listen-by-show {
    display: table;
    width: 100%;
    border-collapse: collapse;
  }

  .listen-by-show thead th {
    padding: var(--space-1) 0;
    text-align: left;
    font-size: 12px;
    line-height: 16px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--ramen-red-deep);
  }

  .listen-by-show tbody tr {
    border-bottom: var(--stroke-hairline) solid var(--paper-rule);
  }

  .listen-by-show tbody th {
    height: 40px;
    padding: 0 var(--space-6) 0 0;
    text-align: left;
    font-weight: inherit;
  }

  .listen-by-show td {
    width: 150px;
    padding: 0;
  }

  .show-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
  }

  .platform-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--leader);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
  }

  .platform-link:hover,
  .platform-link:focus-visible {
    color: var(--ramen-red-deep);
    text-decoration-color: currentColor;
  }

  .platform-link:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
}

/* Very tall screens: the cover stops growing, so centre the board. */
@media (min-width: 900px) and (min-height: 1000px) {
  body {
    min-height: 100vh;
    display: flex;
    align-items: center;
  }

  .page {
    flex: 1;
  }
}

/* Short laptop windows: tighten rows a little more so nothing scrolls. */
@media (min-width: 900px) and (max-height: 760px) {
  .section-title {
    font-size: 24px;
    line-height: 28px;
  }

  .row,
  .listen-by-show tbody th {
    min-height: 36px;
    height: 36px;
  }
}
