/* tastemaker · macro: Catalogue (poster fold → carta spine → visit) · nav: N-mark+2links+call · hero: poster-fold photo ·
   footer: one-line · mood: warm/light (seed 11 triadic, primary hand-set to chile) · contrast: matrix clean ·
   critique: ShowTell 4 · Phil 4 · Hier 5 · Spec 5 · Restr 4 · Var 5 */
/* La Malinche. Mobile-first. Tokens are the contract: see ../.tastemaker/style-lock.md */
:root {
  /* color contract */
  --c-text: #211813;
  --c-bg: #F7EFE6;
  --c-surface: #EFE4D7;
  --c-border: #CFC0AE;
  --c-muted: #6B574A;
  --c-primary: #B4361F;
  --c-primary-hi: #962B17;
  --c-on-primary: #FFFFFF;
  --c-accent: #10816B;
  --c-dark: #1D1510;
  --c-on-dark: #F5EDE3;
  --c-on-dark-muted: #C9B8A6;
  --c-accent-on-dark: #3FB69A;
  --c-primary-on-dark: #E0603F;
  --c-line-dark: rgba(245, 237, 227, .16);

  /* type */
  --f-display: "Epilogue", "Helvetica Neue", Arial, sans-serif;
  --f-text: "Baskervville", Georgia, "Times New Roman", serif;

  /* space scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-24: 96px; --s-32: 128px; --s-40: 160px;

  --gutter: clamp(16px, 4.5vw, 56px);
  --maxw: 1320px;
  --r: 4px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 60px;
  --bar-h: 60px;
  --index-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--c-dark); color: var(--c-text);
  font: 400 1.125rem/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-style: normal; letter-spacing: -.03em; overflow-wrap: anywhere; min-width: 0; }
p, dl, dd { margin: 0; }
.i { width: 1.1em; height: 1.1em; flex: none; fill: currentColor; }
.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.visit :focus-visible, .hero :focus-visible, .nav :focus-visible, .bar :focus-visible, .foot :focus-visible { outline-color: var(--c-accent-on-dark); }

.skip {
  position: fixed; left: var(--s-3); top: var(--s-3); z-index: 100; background: var(--c-on-dark); color: var(--c-dark);
  padding: var(--s-3) var(--s-4); font: 700 1rem/1 var(--f-display); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* buttons: one shape, flat, signage-square */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 0 var(--s-6); border-radius: var(--r);
  background: var(--c-primary); color: var(--c-on-primary); text-decoration: none; white-space: nowrap;
  font: 700 1rem/1 var(--f-display); letter-spacing: -.005em; border: 2px solid var(--c-primary); cursor: pointer;
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out), transform .12s var(--ease-out);
}
.btn:active { transform: scale(.97); }
@media (hover: hover) { .btn:hover { background: var(--c-primary-hi); border-color: var(--c-primary-hi); } }
.btn--line { background: transparent; color: var(--c-on-dark); border-color: var(--c-on-dark-muted); }
@media (hover: hover) { .btn--line:hover { background: var(--c-on-dark); color: var(--c-dark); border-color: var(--c-on-dark); } }
.btn--sm { min-height: 44px; padding: 0 var(--s-4); font-size: .95rem; }
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px;
  font: 700 1rem/1 var(--f-display); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
  text-decoration-color: rgba(245, 237, 227, .45); transition: text-decoration-color .18s var(--ease-out);
}
@media (hover: hover) { .link-arrow:hover { text-decoration-color: currentColor; } }

/* nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); color: var(--c-on-dark);
  transition: background-color .2s var(--ease-out), transform .25s var(--ease-out);
}
.nav.is-solid { background: var(--c-dark); }
.nav.is-tucked { transform: translateY(-100%); }
.nav__in { height: 100%; display: flex; align-items: center; gap: var(--s-4); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); margin-right: auto; text-decoration: none; min-height: 44px; font: 800 1.15rem/1 var(--f-display); letter-spacing: -.035em; }
.brand__mark { width: 30px; height: 30px; fill: currentColor; flex: none; }
.nav__links { display: none; }
.nav__num { display: none; }

/* hero: poster fold */
.hero { position: relative; z-index: 3; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: var(--c-dark); color: var(--c-on-dark); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(29,21,16,.96) 6%, rgba(29,21,16,.72) 40%, rgba(29,21,16,0) 70%),
              linear-gradient(180deg, rgba(29,21,16,.6) 0%, rgba(29,21,16,0) 18%);
}
.hero__in { position: relative; display: grid; gap: var(--s-4); padding-top: calc(var(--nav-h) + var(--s-6)); padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + var(--s-8)); }
.hero__where { display: inline-flex; align-items: center; gap: var(--s-2); font: 600 .95rem/1.3 var(--f-display); letter-spacing: -.01em; color: var(--c-on-dark-muted); }
.hero__title { font-size: clamp(3.6rem, 19vw, 11.5rem); line-height: 1; font-weight: 800; letter-spacing: -.055em; }
.hero__lede { max-width: 34ch; font-size: 1.2rem; color: var(--c-on-dark); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6); margin-top: var(--s-2); }

/* carta */
.carta { position: relative; background: var(--c-bg); padding: var(--s-24) 0 var(--s-32); }
.carta > .wrap { position: relative; z-index: 2; }
.carta__head { display: grid; gap: var(--s-4); margin-bottom: var(--s-8); }
.carta__head h2 { font-size: clamp(3rem, 13vw, 6rem); line-height: 1; font-weight: 800; }
.carta__lede { font-size: 1.25rem; max-width: 32ch; }
.carta__note { font-size: 1rem; color: var(--c-muted); max-width: 44ch; }

.stage { position: relative; }
.stage--intro { display: none; }
.stage--dock { display: none; }
.stage__poster { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); }
.has-world .stage__poster { visibility: hidden; }
.has-world .stage--intro { display: block; height: min(86vw, 380px); margin-top: var(--s-4); }

.carta__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.carta__body, .index { min-width: 0; }
.carta__aside { display: none; }

/* index: sticky on phones as a chip rail with the docked molcajete */
.index {
  position: sticky; top: 0; z-index: 3; height: var(--index-h);
  margin: 0 calc(var(--gutter) * -1); padding: 0 0 0 var(--gutter);
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--c-bg); border-bottom: 1px solid var(--c-border);
}
.index__list {
  list-style: none; margin: 0; padding: 0 var(--s-4) 0 0; flex: 1; min-width: 0;
  display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
}
.index__list::-webkit-scrollbar { display: none; }
.index__list a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s-3); white-space: nowrap;
  text-decoration: none; font: 600 .95rem/1 var(--f-display); letter-spacing: -.01em; color: var(--c-muted);
  border-radius: var(--r); transition: color .18s var(--ease-out), background-color .18s var(--ease-out);
}
.index__list a span { font-size: .75rem; font-variant-numeric: tabular-nums; }
.index__list a[aria-current="true"] { color: var(--c-on-primary); background: var(--c-text); }
.has-world .stage--dock { display: block; flex: none; width: 64px; height: 100%; border-left: 1px solid var(--c-border); }

/* chapters */
.ch { padding: var(--s-16) 0 var(--s-8); scroll-margin-top: calc(var(--index-h) + var(--s-4)); }
.ch + .ch { border-top: 2px solid var(--c-text); }
.ch__head { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-4); row-gap: var(--s-2); align-items: baseline; margin-bottom: var(--s-8); }
.ch__n { font: 800 1rem/1 var(--f-display); color: var(--c-primary); font-variant-numeric: tabular-nums; }
.ch__head h3 { font-size: clamp(2.2rem, 9vw, 3.4rem); line-height: 1; font-weight: 800; }
.ch__note { grid-column: 2; font-size: 1.05rem; color: var(--c-muted); max-width: 46ch; }

.ch__photo { margin: 0 0 var(--s-8); overflow: hidden; border-radius: var(--r); background: var(--c-surface); aspect-ratio: 4 / 5; }
.ch__photo img { width: 100%; height: 100%; object-fit: cover; }
.ch__photo--wide { aspect-ratio: 4 / 3; }
.ch__photo--land { aspect-ratio: 16 / 9; }
.ch__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-8); }
.ch__pair .ch__photo { margin: 0; }

/* the one rule-break: an oversized price that bleeds over the photo's edge */
.ch__feature { position: relative; }
.bigprice {
  position: absolute; right: calc(var(--s-2) * -1); bottom: calc(var(--s-8) - .14em); margin: 0;
  font: 800 clamp(7rem, 40vw, 15rem)/.8 var(--f-display); letter-spacing: -.07em; color: var(--c-primary);
  pointer-events: none; text-shadow: 0 2px 0 var(--c-bg);
}
.bigprice span { font-size: .42em; vertical-align: top; margin-right: .04em; letter-spacing: 0; }

/* bill of fare */
.bill { list-style: none; margin: 0; padding: 0; }
.bill li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-4);
  padding: var(--s-4) 0; border-bottom: 1px solid var(--c-border);
}
.bill__n { font: 700 1.15rem/1.25 var(--f-display); letter-spacing: -.02em; }
.bill__d { grid-column: 1; grid-row: 2; font-size: 1.02rem; color: var(--c-muted); margin-top: 2px; }
.bill__p { grid-column: 2; grid-row: 1; font: 700 1.15rem/1.25 var(--f-display); font-variant-numeric: tabular-nums; color: var(--c-primary); }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: var(--s-2); padding: 3px var(--s-2); border-radius: 3px;
  font: 700 .75rem/1.3 var(--f-display); letter-spacing: .04em; text-transform: uppercase;
  color: var(--c-accent); border: 1.5px solid var(--c-accent);
}
.ch .btn { margin-top: var(--s-8); }
.btn--block-sm { width: 100%; }

/* visit */
.visit { position: relative; background: var(--c-dark); color: var(--c-on-dark); padding: var(--s-24) 0 var(--s-24); }
.visit > .wrap { position: relative; z-index: 2; }
.visit__addr { font-size: clamp(3.4rem, 17vw, 12rem); line-height: 1; font-weight: 800; letter-spacing: -.06em; margin-bottom: var(--s-12); }
.visit__grid { display: grid; gap: var(--s-8); }
.facts { display: grid; gap: var(--s-6); border-top: 1px solid var(--c-line-dark); padding-top: var(--s-6); }
.facts dt { font: 700 .95rem/1.2 var(--f-display); color: var(--c-accent-on-dark); margin-bottom: var(--s-1); }
.facts dd { color: var(--c-on-dark-muted); max-width: 40ch; }
.visit__cta { display: grid; gap: var(--s-3); margin-top: var(--s-10); }
.stage--visit { display: none; }
.has-world .stage--visit { display: block; height: min(80vw, 360px); order: -1; }

/* footer */
.foot { position: relative; z-index: 3; background: var(--c-dark); color: var(--c-on-dark-muted); border-top: 1px solid var(--c-line-dark); padding: var(--s-10) 0; font-size: 1rem; }
.foot__in { display: grid; gap: var(--s-2); }
.foot__brand { display: inline-flex; align-items: center; gap: var(--s-2); font: 800 1.2rem/1 var(--f-display); letter-spacing: -.035em; color: var(--c-on-dark); }
.foot a { text-underline-offset: 3px; }

/* mobile action bar */
.bar {
  position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--c-dark); border-top: 1px solid var(--c-line-dark);
}
.bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1); text-decoration: none; color: var(--c-on-dark); font: 700 .8rem/1 var(--f-display); }
.bar a:first-child { background: var(--c-primary); }
.bar .i { width: 22px; height: 22px; }

/* WebGL world: between section grounds and section content */
.world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; display: block; }
.world:not(.is-live) { visibility: hidden; }
/* docked in the phone index rail: the rail is opaque, so the canvas steps in front (it only paints inside the dock box) */
.world.is-front { z-index: 4; }

/* intro gate */
.anim:not(.anim-done):not(.anim-ready) [data-hero-title],
.anim:not(.anim-done):not(.anim-ready) [data-hero-fade] { visibility: hidden; }

/* tablet */
@media (min-width: 700px) {
  .nav__num { display: inline; }
  .nav__call { display: none; }
  .nav__links { display: flex; gap: var(--s-1); }
  .nav__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3); text-decoration: none; font: 600 1rem/1 var(--f-display); text-underline-offset: 6px; text-decoration-thickness: 2px; }
  .nav__links a:hover { text-decoration-line: underline; }
  .visit__cta { display: flex; flex-wrap: wrap; }
  .btn--block-sm { width: auto; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-8); }
}

/* desktop */
@media (min-width: 1100px) {
  :root { --nav-h: 72px; }
  body { padding-bottom: 0; }
  .bar { display: none; }
  .hero { align-items: flex-end; }
  .hero__media img { object-position: 60% 50%; }
  .hero__media::after {
    background: linear-gradient(90deg, rgba(29,21,16,.94) 0%, rgba(29,21,16,.7) 34%, rgba(29,21,16,0) 62%),
                linear-gradient(0deg, rgba(29,21,16,.8) 0%, rgba(29,21,16,0) 34%),
                linear-gradient(180deg, rgba(29,21,16,.55) 0%, rgba(29,21,16,0) 16%);
  }
  .hero__in { padding-bottom: var(--s-16); }

  .carta { padding: var(--s-32) 0 var(--s-40); }
  .carta__head { grid-template-columns: 200px minmax(0, 1fr); column-gap: var(--s-12); margin-bottom: var(--s-12); }
  .carta__head > * { grid-column: 2; }
  .has-world .stage--intro { display: none; }

  .carta__grid { grid-template-columns: 200px minmax(0, 1fr) minmax(300px, 34%); column-gap: var(--s-12); align-items: start; }
  .index {
    top: calc(var(--nav-h) + var(--s-8)); height: auto; margin: 0; padding: 0; border: 0; background: none;
    display: block;
  }
  .index__list { display: grid; gap: 2px; overflow: visible; padding: 0; }
  .index__list a { width: 100%; justify-content: flex-start; padding: 0 var(--s-3); font-size: 1.02rem; }
  .index__list a span { width: 2ch; }
  .index__list a:hover { color: var(--c-text); }
  .has-world .stage--dock { display: none; }

  .carta__aside { display: block; position: sticky; top: calc(var(--nav-h) + var(--s-8)); height: calc(100vh - var(--nav-h) - var(--s-16)); }
  .stage--aside { height: 100%; }
  .stage__poster { height: auto; aspect-ratio: 1; }

  .ch { padding: var(--s-24) 0 var(--s-12); }
  .ch:first-child { padding-top: 0; }
  .ch__head h3 { font-size: clamp(2.6rem, 3.6vw, 3.6rem); }
  .ch__feature { max-width: 78%; }
  .bigprice { right: -38%; font-size: clamp(10rem, 15vw, 16rem); }
  .ch__photo--wide { aspect-ratio: 16 / 10; }
  .bill li { padding: var(--s-5) 0; }

  .visit { padding: var(--s-32) 0; }
  .visit__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s-16); align-items: stretch; }
  .facts { grid-template-columns: 1fr; }
  .has-world .stage--visit { height: auto; min-height: 420px; order: 0; }
  .foot__in { grid-template-columns: 1fr auto; align-items: center; }
}

@media (max-width: 1099px) and (orientation: landscape) and (max-height: 500px) {
  .hero { align-items: center; }
  .hero__in { padding-bottom: var(--s-4); gap: var(--s-2); }
  .hero__title { font-size: clamp(2.6rem, 18vh, 4.5rem); }
  .hero__lede { display: none; }
  .has-world .stage--intro, .has-world .stage--visit { height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .index__list { scroll-behavior: auto; }
}
