/* ==========================================================================
   ALBI HOME — BASE
   Reset, document defaults, typography, layout primitives, a11y utilities.
   Depends on tokens.css. Loads before components.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;   /* stop iOS inflating text in landscape */
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky header instead of hiding under it. */
  scroll-padding-top: calc(var(--header-h-stuck) + var(--space-5));
}

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

body {
  min-height: 100svh;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  letter-spacing: var(--ls-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;   /* variable font covers 400-700; never fake it */
  overflow-x: hidden;            /* the skewed decor can overhang by design */
}

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

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

ul[class], ol[class] { list-style: none; }
/* Dropping the marker does not reclaim the 40px indent the UA reserves for it,
   which silently pushes any list-based layout off its grid. :where() keeps
   this at zero specificity so a component can still set its own padding —
   a plain `ul[class] { padding: 0 }` would outrank every class selector. */
:where(ul[class], ol[class]) { padding-inline-start: 0; }

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}

h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); line-height: var(--lh-snug); }

p { text-wrap: pretty; }

a {
  color: var(--text-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

b, strong { font-weight: var(--fw-semibold); }

::selection {
  background-color: var(--gold-500);
  color: var(--text-on-gold);
}

/* Numerals in phone numbers, prices and stats must not jitter. */
.tabular { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   3. FOCUS
   Visible for keyboard users, suppressed for mouse. Never removed.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */

/* The single content column: 1296px max, gutters from the token scale. */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--raised { background-color: var(--bg-raised); }

/* Vertical rhythm without margin collapse. */
.stack { display: flex; flex-direction: column; }
.stack-3 { gap: var(--space-3); }
.stack-4 { gap: var(--space-4); }
.stack-5 { gap: var(--space-5); }
.stack-6 { gap: var(--space-6); }
.stack-7 { gap: var(--space-7); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

/* Running copy stays inside a comfortable measure. */
.prose {
  max-width: var(--measure);
  color: var(--text-secondary);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
}

/* Wide content (tables, code) scrolls inside itself, never the page. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* --------------------------------------------------------------------------
   5. ACCESSIBILITY UTILITIES
   -------------------------------------------------------------------------- */

/* Visually hidden but announced by screen readers. */
.visually-hidden {
  position: absolute !important;
  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;
}

/* First tab stop on every page. */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-skiplink);
  transform: translateY(calc(-100% - var(--space-5)));
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--grad-gold);
  color: var(--text-on-gold);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
  color: var(--text-on-gold);
}

/* Locked while the mobile drawer is open. Padding compensates for the
   scrollbar so the page does not shift sideways on desktop. */
body.is-locked {
  overflow: hidden;
  padding-right: var(--scrollbar-w, 0px);
  touch-action: none;
}

/* Kill the 300ms tap delay without disabling pinch-zoom. */
a, button, [role="button"], label, summary {
  touch-action: manipulation;
}
a[href], button:not(:disabled), [role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}
[hidden] { display: none !important; }
