/* =========================================================================
   Miramar Brewing: base
   Reset, body, utilities (grid, mono), loader, cursor. Tokens live in tokens.css.
   ========================================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
/* No grey box flashing over what a finger taps (iPhone, Android): the whole beer card is a tap
   target, so it flashed over the card (2026-10-19). Buttons and links show their own state. */
html { -webkit-tap-highlight-color: transparent; }
body {
  background: var(--page);
  color: var(--on-page);
  font-family: var(--f-text);
  font-weight: 500;
  font-size: var(--t-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--parcha); color: var(--ink); }
:focus-visible { outline: 3px solid var(--parcha); outline-offset: 4px; border-radius: 12px; }
:is(.bcard, .bpanel, .menu, .ffold) :focus-visible, .menu-open .burger:focus-visible { outline-color: var(--ink); }   /* on a colored field the yellow ring vanishes (1:1 on Día Libre); ink is 6.3:1 or more on every one */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.is-off, .is-off * { animation-play-state: paused !important; }   /* js/ui.js pauseOffscreen */
/* Sections out of view skip their rendering (Miguel, 2026-10-15: "performance issues on mobile"):
   every frame something moves (a can turning, the gallery drifting), the browser re-sorts the whole
   page's drawing into layers, and on a phone that was 8-10ms of each frame; with the far sections
   skipped it's 0.2ms, and nothing looks different. Each section's real height is recorded while the
   loader is up (contain-intrinsic-size: auto), and js/main.js turns the skipping on (html.cv) only
   after, and off and on again when a resize, the language or the site test changes heights, so jumps
   and a reload's place land exactly. Not the tapes (their bands hang outside their box) nor the
   gallery (its review switch is fixed inside it). */
:is(.hero, .beers, .story, .where, .contact) { contain-intrinsic-size: auto 1000px; }
html.cv :is(.hero, .beers, .story, .where, .contact) { content-visibility: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 400; background: var(--parcha); color: var(--ink); padding: 12px 18px; border-radius: 99px; font-weight: 800; transition: top .3s var(--ease-out); }
.skip:focus { top: 16px; }

.mono {
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-weight: 500;
  font-size: max(12px, var(--t--1));   /* 10.7px on phones was too small to read */
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* Grid: the page's 12 / 8 / 4 columns. Children place themselves with grid-column. */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}

html.is-loading { overflow: hidden; }
html.is-held { overflow: hidden; }   /* js/lite.js: the page holds still under the menu or an open photo */
/* Reloaded page: what you'd already seen comes back finished, without replaying (js/place.js) */
html.is-settling [data-scroll], html.is-settling [data-scroll] * { transition: none !important; }

/* Language swap: quick fade on every translated node */
[data-i18n], [data-i18n-list] { transition: opacity .28s var(--ease-soft); }
html.is-lang-out [data-i18n], html.is-lang-out [data-i18n-list] { opacity: 0 !important; }
html.is-lang-in [data-i18n], html.is-lang-in [data-i18n-list] { transition: none; }


/* =========================================================================
   Loader
   ========================================================================= */
.loader {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
  background: var(--page);
  transition: transform 1.15s var(--ease-io), border-radius 1.15s var(--ease-io), visibility 0s 1.2s;
}
.loader__mark { position: relative; width: min(34vw, 190px); aspect-ratio: 513 / 350; display: grid; place-items: center; }
.loader__sun {
  position: absolute; left: 50%; top: 62%;
  width: 138%; aspect-ratio: 1; border-radius: 50%;
  background: var(--mar);
  translate: -50% -50%;
  scale: 0;
  animation: loaderSun .9s var(--ease-spring) .1s forwards;
}
.loader__iso { position: relative; width: 100%; color: var(--ink); clip-path: inset(100% 0 0 0); animation: loaderIso .9s var(--ease-out) .45s forwards; }
@keyframes loaderSun { to { scale: 1; } }
@keyframes loaderIso { to { clip-path: inset(0 0 0 0); } }
html.is-loaded .loader { transform: translateY(-100%); border-radius: 0 0 50% 50% / 0 0 22vh 22vh; visibility: hidden; }
/* Light profile (touch screens, html.lite): the mark is there at once and the loader slides up by a
   transform alone, sooner and quicker; its bottom curve morphing was a full-screen repaint a frame */
.lite .loader__sun { animation: none; scale: 1; }
.lite .loader__iso { animation: none; clip-path: none; }
.lite .loader { transition: transform .6s var(--ease-io), visibility 0s .65s; }
html.lite.is-loaded .loader { border-radius: 0; }

/* =========================================================================
   Cursor
   ========================================================================= */
.cursor { position: fixed; left: 0; top: 0; z-index: 450; pointer-events: none; display: none; opacity: 0; transition: opacity .3s; }
.cursor.is-on { opacity: 1; }
.has-cursor .cursor { display: block; }
.cursor::before {
  content: ''; position: absolute; left: 0; top: 0;
  width: 12px; height: 12px; border-radius: 50%;
  translate: -50% -50%;
  background: var(--inv);
  transition: width .55s var(--ease-out), height .55s var(--ease-out), background-color .3s;
}
.cursor.is-label::before { width: 108px; height: 108px; background: var(--parcha); }
.cursor.is-dark:not(.is-label)::before { background: var(--ink); }   /* the dot over a cream field (the A–Z folder), where cream would vanish */
.cursor__label {
  position: absolute; left: 0; top: 0; translate: -50% -50%;
  font: 700 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap;
  opacity: 0; scale: .6;
  transition: opacity .3s, scale .5s var(--ease-out);
}
.cursor.is-label .cursor__label { opacity: 1; scale: 1; }
.cursor.is-down::before { scale: .8; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor [data-can] { cursor: none; }
.has-cursor input { cursor: text; }

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
