/* =========================================================================
   El Bonita Motel — base layer
   Reset, element defaults (from the design system's tokens/base.css, as the
   HIFI pages render it), small utilities and the reveal-on-scroll states.
   Load order on every page: tokens.css → base.css → components.css → pages/<page>.css
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keyboard focus and #anchor jumps stop below the fixed navbar (WCAG 2.4.11):
     the bar's height plus ~12px — 76/84px desktop bar, two-row bar at 761–900px,
     64px phone bar. Page targets that set their own scroll-margin-top subtract
     --eb-nav-clear, so their landing position is unchanged. */
  --eb-nav-clear: 96px;
  scroll-padding-top: var(--eb-nav-clear);
}
@media (min-width: 761px) and (max-width: 900px) {
  html { --eb-nav-clear: 104px; }
}
@media (max-width: 760px) {
  html { --eb-nav-clear: 76px; }
}

/* The design renders text glyphs such as ↗︎ as text, never as emoji. */
html, body, body * { font-variant-emoji: text; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-size-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-wrap: pretty;
  /* Clip sideways overflow without turning <body> into a scroll container:
     the window stays the scroller, so position:sticky and scroll listeners work. */
  overflow-x: clip;
}

main { display: block; min-height: 100vh; }
main:focus { outline: none; }

/* ---- Headings ----------------------------------------------------------- */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-variation-settings: 'opsz' var(--font-display-opsz);
  letter-spacing: var(--tracking-display);
  color: var(--text-heading);
}
h1 { font-size: var(--text-display-2); line-height: var(--lh-display-2); }
h2 { font-size: var(--text-display-3); line-height: var(--lh-display-3); }
h3 { font-size: var(--text-title); line-height: var(--lh-title); }
h4, h5, h6 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
}

p, figure, blockquote, dl, dd { margin: 0; }
:where(ul[class], ol[class]) { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }

/* ---- Links -------------------------------------------------------------- */
a {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: var(--transition-color);
}
a:hover { color: var(--text-link-hover); text-decoration-thickness: 2px; }

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

/* ---- Forms -------------------------------------------------------------- */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

/* ---- Selection + focus -------------------------------------------------- */
::selection { background: var(--clay-100); color: var(--ink-900); }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

[hidden] { display: none; }

/* =========================================================================
   Utilities
   ========================================================================= */

/* Content container: 1080px centred column with the standard 24px gutter. */
.eb-container {
  width: 100%;
  max-width: var(--container-content);
  margin-inline: auto;
}
.eb-container--wide { max-width: var(--container-wide); }
.eb-container--narrow { max-width: 760px; }

.eb-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  /* Inside an uppercase button, Chrome would otherwise pass "(OPENS IN A NEW TAB)" to screen readers in capitals. */
  text-transform: none;
}

/* Skip link: first element in <body>, slides in on keyboard focus. */
.eb-skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: var(--stucco-50);
  font: 600 14px/1 var(--font-sans);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-out-soft);
}
.eb-skip-link:focus,
.eb-skip-link:hover { color: var(--stucco-50); }
.eb-skip-link:focus { top: 16px; outline: 3px solid var(--pool-500); outline-offset: 2px; }

/* Photo treatment used on every content photo. */
.eb-photo-tone { filter: sepia(.10) saturate(1.04); }

/* =========================================================================
   Reveal on scroll
   Markup:  data-reveal on an element (or data-reveal-stagger on a parent).
   site.js sets data-reveal-state="pending" (hidden) only on elements below
   60% of the viewport, then "in" when they scroll into view, then "done".
   Without JavaScript, or with reduced motion, nothing is ever hidden.
   Tune per element with custom properties:
     --reveal-y (38px)  --reveal-scale (.985)  --reveal-fade (720ms)
     --reveal-move (780ms)  --reveal-ease (ease-out-soft)
   The hide is instant (transition: none), so a stagger delay set on the
   element never postpones it; the "in" rule brings the real transition.
   ========================================================================= */
[data-reveal-state="pending"] {
  opacity: 0;
  transform: translateY(var(--reveal-y, 38px)) scale(var(--reveal-scale, .985));
  transition: none;
}
[data-reveal-state="in"] {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--reveal-fade, 720ms) var(--ease-out-soft),
    transform var(--reveal-move, 780ms) var(--reveal-ease, var(--ease-out-soft));
}
/* Spring "pop" used by the cards that sit on photo bands. */
[data-reveal="pop"] {
  --reveal-y: 28px;
  --reveal-scale: .96;
  --reveal-fade: 620ms;
  --reveal-move: 620ms;
  --reveal-ease: cubic-bezier(.34,1.3,.64,1);
}
@media (max-width: 560px) {
  [data-reveal]:not([data-reveal="pop"]),
  [data-reveal-stagger] > * { --reveal-y: 24px; --reveal-scale: .99; }
}

/* =========================================================================
   Reduced motion: no reveals, no entrance animations.
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  [data-reveal-state] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .eb-skip-link { transition: none; }
}
