/* Hallmark · pre-emit critique: P5 H5 E4 S5 R4 V5
 * Hallmark · genre: editorial · macrostructure: Catalogue · theme: Carnival (drop: Aqua Park, logo-tuned)
 * enrichment: none (typography + the client's own badge) · nav: N12 · footer: Ft4
 * N12 knobs: banner-fill=solid · dismiss=yes · bar-scroll=sticky · banner-content=status
 * S2 knobs: head=stacked single-column, left-flush, no eyebrow
 * F3 knobs: columns=2 (day/hours) · rules=every row · numbers=tabular
 * Ft4 knobs: family=mono · layout=single block · includes=address+phone+attribution
 * tone: retro-diner · audience: Nokia locals · anchor hue: 188 (mint) + 25 (coral)
 * Palette sampled from the client's badge — see tokens.css.
 */

@import url("tokens.css");

/* ====================================================================== *
 *  Base
 * ====================================================================== */

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

html {
  overflow-x: clip;              /* never `hidden` — it breaks sticky (gate 34) */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--banner-height) + var(--bar-height) + var(--space-md));
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;              /* Safari fallback */
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

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

img { max-width: 100%; height: auto; display: block; }

/* Headings are roman, always. All-caps display keeps line-height ≥ 1.0 so
   cap-tops of line N+1 clear the baseline of line N (gate 55). */
h1, h2, h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  text-transform: uppercase;
  line-height: 1.04;
  letter-spacing: 0.02em;
  margin: 0;
  overflow-wrap: anywhere;       /* long Finnish compounds wrap in-word (gate 51) */
  min-width: 0;
}

h1 { font-size: var(--text-display-s); letter-spacing: -0.005em; line-height: 1.02; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-md); }

p { margin: 0; max-width: 62ch; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  /* Focus rings appear instantly — never transitioned. */
}

::selection { background: var(--color-accent); color: var(--color-accent-ink); }

/* ====================================================================== *
 *  Shell
 * ====================================================================== */

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section { padding-block: var(--space-3xl); }
.section--tight { padding-block: var(--space-2xl) var(--space-3xl); }

/* Full-bleed colour block — reads as a poster pinned to the wall, not a button
   (Carnival signature 3). Uses 100% + negative inline margin, never 100vw. */
.section--fill {
  padding-block: var(--space-2xl);   /* a filled block needs less air than paper */
  background: var(--color-accent-2);
  color: var(--color-accent-2-ink);
  border-block: var(--border-weight) solid var(--color-ink);
}
.section--fill h2 { color: var(--color-accent-2-ink); }

/* Ornaments — typographic, not emoji (Carnival signature 2). */
.ornament { color: var(--color-accent-2); font-style: normal; }
.section--fill .ornament { color: var(--color-accent); }

.rule-divider {
  border: 0;
  border-top: var(--rule-weight) solid var(--color-rule);
  margin: 0;
}

/* Halftone — pure CSS, no image (Carnival signature 6). */
.halftone {
  background-image: radial-gradient(var(--color-ink) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
}

/* ====================================================================== *
 *  S2 · Hanging section head — stacked single column, left-flush.
 *  Never tag-left / heading-right (gate 54). No eyebrows on this page.
 * ====================================================================== */

.head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-block-end: var(--section-head-gap);
}

.head__note {
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--color-muted);
  text-transform: uppercase;
  max-width: 52ch;
}
.section--fill .head__note { color: var(--color-accent-2-ink); opacity: 0.85; }

/* ====================================================================== *
 *  N12 · Announcement banner + retracting nav
 *  Banner carries live opening status; the bar docks to top on scroll-down.
 * ====================================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-sticky-nav);
  transform: translateY(0);
  transition: transform var(--dur-long) var(--ease-out);
}
.nav.is-compact { transform: translateY(calc(var(--banner-height) * -1)); }
.nav.is-dismissed { transform: none; }
.nav.is-dismissed .nav__banner { display: none; }

.nav__banner {
  height: var(--banner-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding-inline: var(--space-md);
  background: var(--color-accent-2);       /* solid, never gradient */
  color: var(--color-accent-2-ink);
  border-block-end: var(--border-weight) solid var(--color-ink);
}

.nav__status {
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.nav__banner-x {
  position: absolute;
  inset-inline-end: var(--space-xs);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: inherit;
  font-family: var(--font-outlier);
  font-size: var(--text-md);
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--dur-micro) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.nav__banner-x:hover { opacity: 0.7; }
.nav__banner-x:active { transform: translateY(1px); }
.nav__banner-x:disabled { opacity: 0.4; cursor: not-allowed; }

.nav__bar {
  height: var(--bar-height);
  background: var(--color-paper);
  border-block-end: var(--border-weight) solid var(--color-ink);
}

.nav__bar-inner {
  height: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  font-size: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.04;
  white-space: nowrap;
  margin-inline-end: auto;
}
.nav__brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;            /* the badge is a disc; the file is a square */
  flex: none;
}
.nav__brand-text { display: none; }

.nav__links {
  display: none;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;           /* affordances never wrap (gate 49) */
  padding-block: var(--space-2xs);
  border-block-end: var(--rule-weight) solid transparent;
  transition: border-color var(--dur-micro) var(--ease-out);
}
.nav__link:hover { border-block-end-color: var(--color-accent-2); }

/* ====================================================================== *
 *  Buttons — Carnival CTAs fill with an accent and carry a hard offset.
 * ====================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  min-height: 44px;
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: var(--border-weight) solid var(--color-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-variant-numeric: tabular-nums;
  transition:
    transform var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out),
    background-color var(--dur-micro) var(--ease-out);
}

.btn--coral { background: var(--color-accent-2); color: var(--color-accent-2-ink); }

.btn--lg { padding: var(--space-md) var(--space-lg); font-size: var(--text-base); box-shadow: var(--shadow-hard); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--color-shadow); }
  .btn--lg:hover { box-shadow: 5px 5px 0 var(--color-shadow); }
}
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--color-shadow); }

@media (pointer: coarse) { .btn { min-height: 48px; } }

/* ====================================================================== *
 *  Masthead — Catalogue opens on the mark + the tagline, not a big display.
 * ====================================================================== */

/* Bottom-heavy on purpose: the hero should pull into the band below it rather
   than float. Top padding is mostly nav clearance, not visual air. */
.masthead {
  padding-block: calc(var(--banner-height) + var(--bar-height) + var(--space-2xl)) var(--space-3xl);
  display: grid;
  gap: var(--space-lg);
  justify-items: start;
}

/* The badge already carries its own black ring — an extra border plus a hard
   shadow reads as a muddy double edge. Clip to the disc and let it stand. */
.masthead__badge {
  width: clamp(9rem, 26vw, 15rem);
  height: auto;
  border-radius: 50%;
}

.masthead__name {
  font-size: var(--text-display);
  letter-spacing: -0.01em;
  line-height: 1.02;
}

/* Display-size <p>, so it needs the same in-word wrap guard as the headings. */
.masthead__claim {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  font-size: var(--text-xl);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.04;
  color: var(--color-accent-2);
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}

.masthead__tagline {
  font-size: var(--text-md);
  max-width: 34ch;
  line-height: 1.5;
}

.masthead__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.masthead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }

/* ====================================================================== *
 *  Menu — the catalogue. One slab per category, duo-tone alternating.
 *  Never both accents inside one slab (Carnival signature 1).
 * ====================================================================== */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-md);
  padding-inline-end: var(--space-xs);   /* room for the hard shadow at the edge */
  list-style: none;
  margin: 0;
  padding-block: 0;
  padding-inline-start: 0;
}

.cat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
  padding: var(--space-md);
  border: var(--border-weight) solid var(--color-ink);
  box-shadow: var(--shadow-hard);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  transition:
    transform var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out);
}
.menu-grid > .cat:nth-child(even) {
  background: var(--color-accent-2);
  color: var(--color-accent-2-ink);
}

@media (hover: hover) and (pointer: fine) {
  .cat:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--color-shadow); }
}

.cat__name {
  font-size: var(--text-lg);
  color: inherit;
  letter-spacing: 0.01em;
}

.cat__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2xs);
  font-size: var(--text-sm);
}

/* Each item row: name left, price right, tabular so prices align. */
.cat__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  border-block-start: 1px solid currentColor;
  padding-block-start: var(--space-2xs);
}
.cat__item:first-child { border-block-start: 0; padding-block-start: 0; }
.cat__item-name { min-width: 0; }
.cat__item-price {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* A running sentence — body face, not the mono label register. */
.menu-note {
  margin-block-start: var(--space-lg);
  padding: var(--space-md);
  border: var(--border-weight) dashed var(--color-rule);
  font-size: var(--text-base);
  line-height: 1.55;
  max-width: 56ch;
}

/* ====================================================================== *
 *  Hours — day / range rows, today filled.
 * ====================================================================== */

.hours {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
  align-items: start;
}

.hours__table {
  width: 100%;
  border-collapse: collapse;
  border: var(--border-weight) solid var(--color-ink);
  box-shadow: var(--shadow-hard);
  background: var(--color-paper-2);
  font-variant-numeric: tabular-nums;
}

.hours__table th,
.hours__table td {
  text-align: start;
  padding: var(--space-sm) var(--space-md);
  border-block-start: 1px solid var(--color-ink);
  font-size: var(--text-base);
}
.hours__table tr:first-child th,
.hours__table tr:first-child td { border-block-start: 0; }

.hours__day {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-md);
  line-height: 1.04;
}

/* Element+class so it beats `.hours__table td { text-align: start }`. */
.hours__table td.hours__range {
  font-family: var(--font-outlier);
  text-align: end;
  white-space: nowrap;
}

.hours__table tr.is-today {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

.hours__aside {
  display: grid;
  gap: var(--space-md);
  justify-items: start;
  padding: var(--space-lg);
  border: var(--border-weight) solid var(--color-ink);
  box-shadow: var(--shadow-hard);
  background: var(--color-paper);
}

.hours__state {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  font-size: var(--text-xl);
  text-transform: uppercase;
  line-height: 1.04;
  letter-spacing: 0.02em;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}
.hours__state[data-open="true"]  { color: var(--color-ink); }
.hours__state[data-open="false"] { color: var(--color-accent-2); }

.hours__detail {
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
  max-width: 34ch;
}

/* ====================================================================== *
 *  Find us
 * ====================================================================== */

.find {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
}

.find__block {
  display: grid;
  gap: var(--space-sm);
  justify-items: start;
}

.find__label {
  font-family: var(--font-outlier);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.find__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  font-size: var(--text-lg);
  text-transform: uppercase;
  line-height: 1.06;
  letter-spacing: 0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}

.find__value a { text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Halftone band between folds — a printed texture, not decoration for its own
   sake (Carnival signature 6). Full-bleed via 100%, never 100vw. */
.band {
  height: var(--space-lg);
  width: 100%;
  border-block: var(--rule-weight) solid var(--color-ink);
  background-color: var(--color-paper-3);
}

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

/* ====================================================================== *
 *  Ft4 · Dense colophon
 * ====================================================================== */

.foot {
  border-block-start: var(--rule-weight) solid var(--color-ink);
  padding-block: var(--space-xl);
  background: var(--color-paper-2);
}

.foot__block {
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-ink-2);
  max-width: 72ch;
  margin: 0;
}

.foot__block a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.foot__mark { color: var(--color-accent-2); }

/* ====================================================================== *
 *  Page-load orchestration — one sequence, capped stagger.
 * ====================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal var(--dur-long) var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .reveal { transform: none; }
  .nav { transition-duration: 150ms !important; }
}

/* ====================================================================== *
 *  Up from mobile
 * ====================================================================== */

@media (min-width: 40rem) {
  .nav__brand-text { display: inline; }
  .hours { grid-template-columns: 1.35fr 1fr; }
  .find { grid-template-columns: 1.2fr 1fr; align-items: start; }

  /* One tile breaks the uniform grid so the board doesn't read as a template.
     Guarded above 40rem — at 1 column a span-2 would invent a second track
     and push the page into horizontal scroll. */
  .cat--wide { grid-column: span 2; }
  .cat--wide .cat__name { font-size: var(--text-xl); }
}

@media (min-width: 60rem) {
  .nav__links { display: flex; }
  .masthead {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-2xl);
  }
  .masthead__badge { grid-row: span 5; }
}
