/* ==========================================================================
   Lopez Grill Mexican Restaurant — design system and chrome only.
   Tokens, type scale, masthead, bookmark, platter device, opening skeleton,
   ledger rows, figure, rules, links, buttons, footer, consent, offer.
   Page-specific rules belong in each page's own stylesheet.
   ========================================================================== */

/* Tokens: dried-chile ground, oxblood panel, cool white ink, floury masa yellow, brick rule, one angle. */
:root{
  --ground:#3A0F0B;
  --panel:#521A13;
  --ink:#F4F6FC;
  --ink-soft:#E8CFC9;
  --accent:#F2DDA4;
  --rule:#7E3B2E;
  --grid:rgba(244,246,252,.05);
  --label-col:19%;
  --rail:2.75rem;
  --pad:clamp(1rem,4.2vw,3.25rem);
  --band:clamp(2.5rem,9vh,6.5rem);
  --promo-h:3.9rem;
  --angle:-8deg;
  --ease:cubic-bezier(.22,.68,.24,1);
  --dur:520ms;
  --fs-body:clamp(1rem,.35vw + .86rem,1.16rem);
  --fs-lead:clamp(1.22rem,.9vw + 1rem,1.5rem);
  --fs-small:clamp(.95rem,.2vw + .9rem,1rem);
  --fs-h2:clamp(1.875rem,1.7vw + 1.3rem,2.625rem);
  --fs-h3:clamp(1.3rem,.7vw + 1.1rem,1.6rem);
  --fs-slogan:clamp(3.4rem,11vw,9.5rem);
  --z-consent:70; --z-promo:65; --z-call:66; --z-masthead:80;
}

/* Base: the ground is printed with a 14px order-pad grid; every solid panel covers it. */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  margin:0;
  background-color:var(--ground);
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px);
  background-size:14px 14px;
  background-attachment:fixed;
  color:var(--ink);
  font-family:'Alegreya Sans','Segoe UI',system-ui,sans-serif;
  font-size:var(--fs-body);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:clip;
}
img{max-width:100%;display:block}
p{margin:0 0 1em}
p:last-child{margin-bottom:0}

/* Type: headings are Jost 500 mixed case; menu entries stay in Alegreya Sans and are never set as headings. */
h1,h2,h3{font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;line-height:1.08;margin:0 0 .5em}
h2{font-size:var(--fs-h2);letter-spacing:-.012em}
h3{font-size:var(--fs-h3);letter-spacing:-.005em}
.lead{font-size:var(--fs-lead);line-height:1.4;max-width:34ch}
.small{font-size:var(--fs-small)}

/* The angle: display headings lean up eight degrees on a desk screen and stand upright on a phone. */
.on-angle{transform:rotate(var(--angle));transform-origin:0 50%;margin-block:.4em 1em}
@media (max-width:720px){.on-angle{transform:none;margin-block:0 .8em}}

/* Links: masa underline, two pixels, no boxes. */
a{color:var(--ink);text-decoration-color:var(--accent);text-decoration-thickness:2px;text-underline-offset:.18em}
a:hover{color:var(--accent)}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:.25rem}

/* Skip link: out of the way until it is focused. */
.skip{position:absolute;left:1rem;top:-5rem;z-index:120;background:var(--accent);color:var(--ground);padding:.8rem 1.1rem;font-weight:500;text-decoration:none;transition:top 180ms var(--ease)}
.skip:focus{top:.6rem}

/* Masthead: the name as an unboxed linked line at the top left, nothing beside it. */
.masthead{display:flex;justify-content:space-between;align-items:flex-start;padding:clamp(.85rem,2vh,1.35rem) calc(var(--pad) + 5.4rem) 0 var(--pad)}
.masthead__name{font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;font-size:clamp(1.05rem,.9vw + .85rem,1.45rem);line-height:1.1;max-width:18ch;text-decoration:none;color:var(--ink)}
.masthead__name:hover{color:var(--accent)}

/* Bookmark: a masa tab hung from the top edge at the right; it drops the page list down its own strip. */
.bookmark{position:fixed;top:0;right:var(--pad);z-index:var(--z-masthead);width:clamp(4.6rem,6vw,6.1rem);background:var(--accent);color:var(--ground);border-radius:0 0 .55rem .55rem;box-shadow:0 .4rem 0 rgba(0,0,0,.28)}
.bookmark__tab{display:grid;justify-items:center;gap:.2rem;width:100%;min-height:44px;padding:.5rem .3rem .7rem;background:none;border:0;color:var(--ground);font:inherit;font-size:1rem;font-weight:500;cursor:pointer}
.bookmark__tab .mark{width:24px;height:24px;display:block}
.bookmark__menu{display:grid;overflow:hidden;max-height:0;transition:max-height var(--dur) var(--ease)}
.bookmark.is-open .bookmark__menu{max-height:22rem}
.bookmark__menu a{display:flex;align-items:center;min-height:44px;padding:.5rem .6rem;color:var(--ground);font-size:1rem;line-height:1.2;text-decoration:none;border-top:1px solid rgba(58,15,11,.28)}
.bookmark__menu a:hover{color:var(--ground);background:rgba(58,15,11,.1)}
.no-js .bookmark__menu{max-height:none}
.no-js .bookmark__tab{cursor:default}

/* Platter: the one closed shape. 2.5:1, tilted eight degrees, every photo masked inside it. */
.plate{position:relative;display:block;aspect-ratio:5 / 2;border-radius:50%;overflow:hidden;background:var(--panel);transform:rotate(var(--angle));isolation:isolate}
.plate img,.plate video{width:100%;height:100%;object-fit:cover;transform:rotate(calc(-1 * var(--angle))) scale(1.24)}
.plate--sm{max-width:14rem}
.plate--md{max-width:26rem}
.plate--lg{width:100%}
.plate--still{transform:none}
.plate--still img{transform:none}
@media (max-width:720px){.plate{transform:none}.plate img,.plate video{transform:none}}

/* Plate trace: the masa rim runs once round the oval on load, then stays put. */
@property --trace{syntax:"<number>";inherits:false;initial-value:0}
.plate[data-trace]::after{content:"";position:absolute;inset:0;border-radius:50%;padding:2px;background:conic-gradient(from -90deg,var(--accent) calc(var(--trace) * 1%),transparent 0);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude;opacity:0;transition:opacity 180ms linear;pointer-events:none}
.plate.is-traced::after{opacity:1;animation:trace 1100ms var(--ease) forwards}
@keyframes trace{from{--trace:0}to{--trace:100}}

/* Opening: a full first window. Slogan leans up the angle, the h1 sits on its own oxblood platter, the action sits opposite it. */
.open{position:relative;min-height:100svh;display:grid;grid-template-rows:auto 1fr auto;gap:clamp(.8rem,2vh,1.6rem);padding:clamp(1rem,3vh,2rem) var(--pad) clamp(1.2rem,3vh,2rem);overflow-x:clip}
/* The offer band owns the foot of the first window: its strip is taken out of the composition,
   so nothing of the opening ever ends up underneath it. */
.has-promo .open{padding-bottom:calc(var(--promo-h) + clamp(1.2rem,3vh,2rem))}
.open__slogan{margin:0;font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;font-size:var(--fs-slogan);line-height:.92;letter-spacing:-.02em;transform:rotate(var(--angle));transform-origin:0 50%}
.open__mid{display:flex;align-items:center;justify-content:flex-end;gap:clamp(1rem,4vw,3rem);min-height:0}
.open__foot{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:clamp(.8rem,2vw,1.6rem)}
.open__h1{display:inline-block;margin:0;padding:.7rem 1.6rem;border-radius:50%;background:var(--panel);font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;font-size:1.25rem;line-height:1.2;max-width:22ch}
.open__sub{max-width:38ch;font-size:var(--fs-lead);line-height:1.35;margin:0}
@media (max-width:720px){.open__slogan{transform:none;font-size:var(--fs-slogan)}}

/* Ledger: continuous 19% label column, one vertical divider, rows that rule across both columns. */
.ledger{position:relative;border-top:1px solid var(--rule)}
.ledger::before{content:"";position:absolute;top:0;bottom:0;left:calc(var(--label-col) - 1px);width:1px;background:var(--rule);pointer-events:none}
.row{display:grid;grid-template-columns:var(--label-col) 1fr;align-items:start;border-bottom:1px solid var(--rule);padding-block:clamp(.9rem,2.2vh,1.6rem)}
.row__label{margin:0;padding-right:1.1rem;font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-size:var(--fs-small);font-weight:500;line-height:1.35;color:var(--accent)}
.row__body{min-width:0;padding-left:clamp(1rem,2.6vw,2.25rem)}
.foot .row:first-of-type{border-top:1px solid var(--rule)}

/* Panel: solid oxblood for catalogue copy, receipts and timetables. Kills the grid behind reading text. */
.panel{background:var(--panel);padding:clamp(1.1rem,2.4vw,2rem)}
.panel--tight{padding:clamp(.8rem,1.8vw,1.2rem)}

/* Figure: a plate plus its caption, set tight to the picture and never floating in a band. */
.figure{margin:0;display:grid;gap:.65rem}
.figure figcaption{font-size:var(--fs-small);line-height:1.45;color:var(--ink-soft);max-width:46ch}
.figure__name{font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;font-size:1.1rem;color:var(--ink)}

/* Price line: the menu entry, name and figure level in Alegreya Sans. */
.entry{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.4rem 1rem;font-size:var(--fs-body)}
.entry__price{font-weight:500;white-space:nowrap}

/* Rule: a brick hairline, and the drawn version that runs left to right once when it enters. */
.rule{height:1px;border:0;margin:0;background:var(--rule)}
[data-draw]{transform:scaleX(0);transform-origin:left center;transition:transform 700ms var(--ease)}
[data-draw].is-drawn{transform:scaleX(1)}

/* Reveal: blocks lift a little and settle, once, when they come into view. */
[data-reveal]{opacity:0;transform:translateY(.7rem);transition:opacity 600ms var(--ease),transform 600ms var(--ease)}
[data-reveal].is-in{opacity:1;transform:none}
.no-js [data-reveal]{opacity:1;transform:none}

/* Buttons: one masa platter each, chile-red ink, 48px minimum. Never a browser default shape. */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:3rem;padding:.85rem 1.7rem;border:0;border-radius:50%;background:var(--accent);color:var(--ground);font-family:'Alegreya Sans','Segoe UI',system-ui,sans-serif;font-size:1.0625rem;font-weight:500;line-height:1.2;text-align:center;text-decoration:none;cursor:pointer;transition:background-color 240ms var(--ease),color 240ms var(--ease)}
.btn:hover{background:#F8EBC8;color:var(--ground)}
.btn--quiet{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 2px var(--rule)}
.btn--quiet:hover{background:var(--panel);color:var(--accent)}
.btn-row{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}

/* Footer: an oxblood timetable that carries the ledger's label column to the end of the page. */
.foot{margin-top:var(--band);background:var(--panel);padding:var(--band) var(--pad) calc(var(--band) + 1rem)}
.foot__name{margin:0 0 1.1rem;font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;font-size:clamp(1.24rem,.8vw + 1.05rem,1.55rem);max-width:24ch}
.foot__row{padding-block:clamp(.6rem,1.6vh,1rem)}
.foot__val{display:grid;gap:.2rem;font-size:1.125rem;line-height:1.4}
.foot__links{display:flex;flex-wrap:wrap;gap:.1rem 1.2rem;font-size:1.0625rem}
.foot__links a,.foot__links button{display:inline-flex;align-items:center;min-height:44px}
.foot__links button{background:none;border:0;padding:0;color:var(--accent);font:inherit;cursor:pointer;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.18em}
.foot__links button:hover{color:var(--ink)}

/* Consent: a narrow oxblood receipt hung below the name, its two ruled rows the choices. */
#consent{position:fixed;z-index:var(--z-consent);left:var(--pad);top:clamp(3.4rem,6vh,4.6rem);width:min(21rem,calc(100vw - 2 * var(--pad)));background:var(--panel);border:1px solid var(--rule);padding:.9rem 1rem 0;box-shadow:0 .6rem 1.4rem rgba(0,0,0,.35)}
#consent[hidden]{display:none}
#consent p{margin:0 0 .55rem;font-size:1rem;line-height:1.35;max-width:26ch}
#consent button{display:block;width:100%;min-height:44px;padding:.5rem .1rem;background:none;border:0;border-top:1px solid var(--rule);color:var(--ink);font-family:'Alegreya Sans','Segoe UI',system-ui,sans-serif;font-size:1rem;font-weight:500;text-align:left;cursor:pointer}
#consent button:hover,#consent button:focus-visible{color:var(--accent)}

/* Offer: one masa band across the foot of the window, wiped in, dismissible. */
#promo{position:fixed;left:0;right:0;width:100%;max-width:100vw;bottom:0;z-index:var(--z-promo);min-height:var(--promo-h);display:flex;flex-wrap:wrap;align-items:center;gap:.3rem .9rem;padding:.55rem max(var(--pad),.9rem);background:var(--accent);color:var(--ground);transform:translateX(-102%);opacity:0;transition:transform 720ms var(--ease),opacity 220ms linear}
#promo.is-in{transform:none;opacity:1}
#promo[hidden]{display:none}
.promo__text{margin:0;flex:1 1 16rem;min-width:0;font-family:'Jost','Trebuchet MS',system-ui,sans-serif;font-weight:500;font-size:clamp(1rem,.8vw + .82rem,1.18rem);line-height:1.3;color:var(--ground)}
.promo__link{display:inline-flex;align-items:center;min-height:44px;color:var(--ground);font-size:1rem;font-weight:500;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.16em}
.promo__link:hover{color:var(--ground);text-decoration-color:var(--ground);background:rgba(58,15,11,.1)}
#promo button{min-width:44px;min-height:44px;padding:0 .8rem;border:2px solid rgba(58,15,11,.4);border-radius:50%;background:transparent;color:var(--ground);font-family:'Alegreya Sans','Segoe UI',system-ui,sans-serif;font-size:1rem;font-weight:500;cursor:pointer}
#promo button:hover{background:rgba(58,15,11,.12)}
#promo:focus-visible{outline-offset:-4px}

/* On a desk screen the band is part of the first window at rest: it stands in its reserved strip
   from the first paint, before any script or timer, and stays until the visitor closes it. */
@media (min-width:721px){
  #promo,#promo[hidden]{display:flex;transform:none;opacity:1}
}
/* Closed by the visitor: gone, whatever the width. */
#promo.is-closed,#promo.is-closed[hidden]{display:none}

/* Call control: on a phone, one masa platter pinned clear of the offer band and the bookmark. */
.call{display:none}
@media (max-width:760px){
  .call{display:inline-flex;position:fixed;z-index:var(--z-call);left:var(--pad);bottom:calc(var(--promo-h) + .7rem);align-items:center;min-height:44px;padding:.6rem 1.2rem;border-radius:50%;background:var(--accent);color:var(--ground);font-family:'Alegreya Sans','Segoe UI',system-ui,sans-serif;font-size:1rem;font-weight:500;text-decoration:none;box-shadow:0 .35rem .9rem rgba(0,0,0,.4)}
  .call:hover{background:#F8EBC8;color:var(--ground)}
}

/* Phone: the rail narrows to chapter numbers, the timetable stacks, the notices become slim bands. */
@media (max-width:720px){
  :root{--label-col:2.75rem;--promo-h:6.4rem;--pad:1rem}
  .masthead{padding-right:calc(var(--pad) + 5.6rem)}
  .row__label{padding-right:.6rem;font-size:.95rem}
  .row__body{padding-left:.9rem}
  .foot .row{display:block}
  .foot .row__label{padding-right:0;padding-bottom:.35rem}
  .foot .row__body{padding-left:0}
  .foot__links a,.foot__links button{min-height:44px}
  .open__foot{gap:.7rem}

  /* The receipt stops hanging over the opening: it becomes a band in the page's own flow at the
     top, so the name, the slogan and the h1 all start below it, and it scrolls away with the page.
     Its right padding keeps the sentence and the choices clear of the pinned Menu bookmark. */
  #consent{position:relative;left:auto;right:auto;top:auto;width:auto;max-width:none;margin:0;
    display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .4rem;
    padding:.55rem calc(var(--pad) + 4.6rem + .5rem) .6rem .9rem;border:0;border-bottom:1px solid var(--rule);box-shadow:none}
  #consent p{flex:1 1 100%;min-width:0;margin:0;max-width:none;font-size:1rem;line-height:1.25;overflow-wrap:break-word}
  #consent button{display:inline-flex;align-items:center;justify-content:center;width:auto;
    min-height:44px;padding:.35rem .9rem;border:1px solid var(--rule);border-radius:1.5rem;
    font-size:1rem;text-align:center}

  /* The offer band: pinned to both window edges with its own inside padding, one run of text,
     the link and the Close control on the row beneath, nothing wider than the phone. */
  #promo{left:0;right:0;width:auto;max-width:100vw;padding:.45rem .9rem .55rem;gap:.2rem .5rem;
    align-items:center;overflow:hidden;transform:translateY(112%);opacity:0}
  #promo.is-in{transform:translateY(0);opacity:1}
  .promo__text{flex:1 1 100%;font-size:1rem;line-height:1.22}
  .promo__link{flex:1 1 auto;min-height:36px;font-size:1rem}
  #promo button{flex:0 0 auto;margin-left:auto}
}

/* Reduced motion: everything stands in its finished position, nothing travels. */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important}
  [data-reveal]{opacity:1;transform:none}
  [data-draw]{transform:scaleX(1)}
  #promo{transform:none;opacity:1}
  .plate.is-traced::after{--trace:100}
}

/* A page never scrolls sideways. */
html, body { overflow-x: clip; }
/* Past a full-HD window the whole page grows with the window - type, gaps and pictures
   together - so a very wide screen (or a page zoomed far out) shows the same composition,
   not a small column of text lost in an enormous picture. */
@media (min-width: 1921px) { html { font-size: calc(100vw / 120); } }
/* What can be pressed in the chrome lies above the page: a huge headline's line box reaching
   into the navigation must not swallow the clicks meant for the links. */
header a, header button, nav a, nav button { position: relative; z-index: 2; }
/* A visitor who asked the system for less motion gets none, whatever a page forgot. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
