/* ==========================================================================
   Ramen Noir — Base / Reset / Typography defaults
   ========================================================================== */

/* Page-to-page crossfade, progressive enhancement (v1.1). Opts every
   same-origin internal navigation into the browser's default cross-fade of
   the outgoing/incoming document — this is what removes the header/footer
   "pop" feeling on navigation, on top of the header/footer/cart-drawer now
   being inlined into every page (no fetch-and-inject flash — see js/nav.js
   + docs/). Chromium supports this today; Safari/Firefox simply ignore the
   at-rule and fall back to a normal instant navigation. No JS, no polyfill,
   zero added bundle weight. */
@view-transition {
  navigation: auto;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

  /* Hover/focus scale, translate and zoom transforms are disabled outright
     (not just sped up) under reduced motion: "hover scale/translate/zoom" is
     the one category of hover feedback removed entirely, since color/border
     transitions don't trigger vestibular discomfort the way motion does
     and stay active as-is via the transition-duration override above. */
  .btn:hover,
  .btn:focus-visible,
  .btn__arrow,
  .menu-card,
  .menu-card:hover,
  .menu-card__image,
  .menu-card:hover .menu-card__image,
  .merch-card,
  .merch-card:hover,
  .merch-card__image,
  .merch-card:hover .merch-card__image,
  .gallery-tile img,
  .gallery-tile:hover img,
  .gallery-tile:focus-visible img {
    transform: none !important;
  }
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  /* Compensates for .site-header now being position: fixed (see
     css/components/header.css) so it no longer occupies flow space. On
     Home, .hero-carousel cancels this out with an equal negative
     margin-top so the hero photo still starts at viewport y=0, visible
     behind the transparent header — see css/components/hero-carousel.css. */
  padding-top: var(--header-height);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
}

/* ---- Headings ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  color: var(--color-text);
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: var(--ls-h1);
  line-height: var(--lh-h1);
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-h2);
  line-height: var(--lh-h2);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-h3);
}

h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-h4);
  line-height: var(--lh-h4);
}

/* ---- Heading size utilities ----
   Lets a heading's semantic level (h1-h6, for a correct, non-skipping
   document outline) move independently of its visual size. Apply one of
   these alongside the tag whenever a heading needs to keep reading at a
   smaller size than its level would otherwise give it. */
.text-style-h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-h3);
}

.text-style-h4 {
  margin: 0;
  font-size: var(--fs-h4);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-h4);
  line-height: var(--lh-h4);
}

p {
  max-width: var(--max-line-length);
}

.text-body-lg {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
}

.text-caption {
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-caption);
  line-height: var(--lh-caption);
  font-weight: var(--fw-medium);
}

.text-caption--label {
  text-transform: uppercase;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-faint {
  color: var(--color-text-faint);
}

.text-price {
  font-family: var(--font-body);
  font-size: var(--fs-price);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-price);
  color: var(--color-text);
}

.text-price--accent {
  color: var(--color-primary);
}

/* ---- Focus states: visible everywhere, never color-only ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---- Screen-reader only utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  z-index: 1000;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--ls-nav);
  transition: top var(--duration-base) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: var(--font-heading);
  font-size: var(--fs-button);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  line-height: var(--lh-button);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transform: scale(1);
  transition: background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
  white-space: nowrap;
}

.btn:focus-visible {
  transform: scale(1.03);
}

/* v1.2 — restrained hover scale(1.03) on Primary + Secondary only (never
   .btn--full — see below), gated to pointer devices via
   @media (hover: hover) so touch never gets a "stuck" hover; focus-visible
   above keeps the same scale for keyboard parity regardless of pointer
   type. */
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover,
  .btn--secondary:hover {
    transform: scale(1.03);
  }
}

/* v1.1 — Primary CTAs no longer use a filled background anywhere in the
   system: transparent, amber text only, with a sliding underline on
   hover/focus (the same motion pattern as the nav link underline and the
   Category Sub-nav active tab). Supersedes the earlier filled-Primary
   treatment used on this component in older versions of the template.
   --color-on-primary remains in
   active use elsewhere (selected spice-level chip, "Signature" badge fill,
   toast accent), it is simply no longer used on this component. */
.btn--primary {
  position: relative;
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
}

.btn--primary::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--duration-base) var(--ease-standard);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  color: var(--color-primary-hover);
}

.btn--primary:hover::after,
.btn--primary:focus-visible::after {
  width: 100%;
}

.btn--primary:active {
  color: var(--color-primary-active);
}

.btn--primary:active::after {
  background: var(--color-primary-active);
}

/* Full-width variant (Cart Drawer "Checkout", Mobile Nav Overlay "Order
   Now"): same no-fill/amber-text rule, plus a thin top+bottom rule so the
   tap target still reads as a discrete row. The rule brightens in sync
   with the text/underline on hover/focus — an extension of the "no fill"
   mandate, not an exception to it. No scale on this variant (v1.2 — a
   full-width row scaling up would visually collide with its own container
   edge); color/underline/rule motion only. */
.btn--full {
  width: 100%;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transform: none !important;
  transition: border-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.btn--full:hover,
.btn--full:focus-visible {
  border-color: var(--color-primary);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  border-color: var(--color-primary);
}

/* Trailing arrow glyph (e.g. "View Full Menu →") on a Primary/text-link CTA
   — the arrow shifts translateX(4px) on hover/focus, reinforcing the "go"
   direction, on the same timing as the parent's own hover transition. Wrap
   the glyph in <span class="btn__arrow"> to opt in (see index.html /
   js/menu.js for the handful of usages). */
.btn__arrow {
  display: inline-block;
  transition: transform var(--duration-base) var(--ease-standard);
}

.btn--text:focus-visible .btn__arrow,
.btn--primary:focus-visible .btn__arrow {
  transform: translateX(4px);
}

@media (hover: hover) and (pointer: fine) {
  .btn--text:hover .btn__arrow,
  .btn--primary:hover .btn__arrow {
    transform: translateX(4px);
  }
}

.btn--text {
  padding: 0;
  color: var(--color-primary);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
}

.btn--text:hover,
.btn--text:focus-visible {
  text-decoration: underline;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Form fields (shared base — extended in components/contact-form.css) ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field__label {
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.field__input {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  padding: var(--space-2);
  border-radius: var(--radius);
  transition: border-color var(--duration-base) var(--ease-standard);
}

.field__input::placeholder {
  color: var(--color-text-faint);
}

.field__input:focus-visible {
  border-color: var(--color-border-strong);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.field__error {
  font-size: var(--fs-caption);
  color: var(--color-error);
}

.field__error:empty {
  display: none;
}

/* ---- Utility ---- */
.visually-hidden-until-loaded {
  opacity: 0;
}

/* ==========================================================================
   Scroll Reveal Playbook (v1.2)
   --------------------------------------------------------------------------
   Every [data-animate] element defaults to the "fade-up" treatment below
   (body/paragraph text, FAQ rows, contact form fields). An optional
   [data-reveal="…"] value on the same element swaps in a different,
   content-appropriate treatment so the page
   doesn't read as one fade-up effect repeated top to bottom:
     - data-reveal="heading"  → text-reveal (clip-path rise), section H2s
     - data-reveal="image"    → image-reveal (scale + clip "uncover")
     - data-reveal="cards"    → slide-in, Menu/Merch/Gallery/Signature cards
     - data-reveal="footer"   → fade-only, the footer only
   js/scroll-animations.js only ever toggles ".is-visible" — every visual
   difference between the variants lives here.
   ========================================================================== */

/* ---- Default: fade-up (body/paragraph text, FAQ rows, contact fields) ---- */
[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-400) var(--ease-standard),
    transform var(--duration-400) var(--ease-standard);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Text reveal: section headings (H2) rise up from behind a hard edge ---- */
[data-reveal="heading"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 550ms var(--ease-standard);
}

[data-reveal="heading"].is-visible {
  clip-path: inset(0 0 0% 0);
}

/* ---- Image reveal: standalone/editorial photos "uncover" from a slightly
   scaled/inset state, slower and more deliberate than a plain fade. Applied
   directly to the <img> (its parent already clips via overflow: hidden on
   every image-wrap component in this system), so the wrap itself never
   moves or fades — only the photo inside it does. ---- */
[data-reveal="image"] {
  opacity: 1;
  transform: scale(1.06);
  clip-path: inset(3%);
  transition: transform 700ms var(--ease-standard),
    clip-path 700ms var(--ease-standard);
}

[data-reveal="image"].is-visible {
  transform: scale(1);
  clip-path: inset(0%);
}

/* ---- Slide-in: Menu/Merch/Gallery/Signature Picks card grids. Direction
   follows reading order — horizontal on wider grids, vertical once a grid
   has collapsed to a single column on narrow viewports. ---- */
[data-reveal="cards"] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms var(--ease-standard),
    transform 400ms var(--ease-standard);
}

@media (min-width: 600px) {
  [data-reveal="cards"] {
    transform: translateX(24px);
  }
}

[data-reveal="cards"].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

/* ---- Fade-only: the footer, deliberately the quietest treatment (utility/
   wayfinding area, not a narrative beat) ---- */
[data-reveal="footer"] {
  opacity: 0;
  transform: none;
  transition: opacity 350ms var(--ease-standard);
}

[data-reveal="footer"].is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  [data-animate],
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
}

.tone-match {
  filter: brightness(0.82) saturate(0.92) contrast(1.05);
}

/* Applied to <body> whenever a drawer/modal/overlay is open, to lock background scroll */
.no-scroll {
  overflow: hidden;
}

/* ---- Shared option chip (spice level / topping / variant selectors) ---- */
.option-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.option-chip {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  border-radius: var(--radius);
  transition: border-color var(--duration-base) var(--ease-standard),
    background-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.option-chip__delta {
  color: var(--color-text-faint);
}

/* Single-select (radio-like): selected = solid fill */
.option-chip--radio[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.option-chip--radio[aria-pressed="true"] .option-chip__delta {
  color: var(--color-on-primary);
}

/* Multi-select (checkbox-like): selected = outlined + check prefix */
.option-chip--check[aria-pressed="true"] {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.option-chip--check[aria-pressed="true"]::before {
  content: "✓ ";
  color: var(--color-primary);
}

.option-chip:hover,
.option-chip:focus-visible {
  border-color: var(--color-border-strong);
}

/* ---- Shared quantity stepper ---- */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
}

.qty-stepper__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text);
  transition: background-color var(--duration-base) var(--ease-standard);
}

.qty-stepper__btn:hover,
.qty-stepper__btn:focus-visible {
  background: var(--color-surface);
}

.qty-stepper__value {
  min-width: 32px;
  text-align: center;
  font-weight: var(--fw-medium);
}

.qty-stepper--sm .qty-stepper__btn {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.qty-stepper--sm .qty-stepper__value {
  min-width: 24px;
  font-size: var(--fs-caption);
}
