/* ==========================================================================
   BONACIEUX: Base: reset, document defaults, typography
   ========================================================================== */

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

* { margin: 0; }

/* The `hidden` attribute must win over any layout `display` a component sets.
   Its UA rule is author-overridable, so a block styled `display: flex` (the
   checkout confirmation, the empty-bag state) stayed laid out while hidden and
   reserved its padding. One baseline rule beats patching each component. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

body {
  /* Column flex so the footer sits at the foot of a short page (404, an empty
     bag) instead of leaving a band of paper beneath it. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
}

img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--gold-deep); }

::selection { background: var(--ink); color: var(--paper); }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* --- Headings ------------------------------------------------------------- */
/* The house sets display type light and large rather than bold and small, so
   every heading level shares weight 300 and differs only in size. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: var(--leading-tight);
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { max-width: 64ch; text-wrap: pretty; }

/* --- Reusable utility primitives ----------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-7); }
.section--tight { padding-block: var(--space-6); }

/* Uppercase micro-label used for eyebrows above headings */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: var(--tracking-mega);
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* The wordmark. Only ever "Bonacieux". */
.script {
  font-family: var(--font-script);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.lede { font-size: var(--step-1); font-style: italic; color: var(--ink-soft); }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* Accessible visually-hidden helper (kept reachable by screen readers) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -3rem;
  z-index: var(--z-toast);
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-3); color: var(--paper); }

/* Visible focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

/* Scroll reveal: elements tagged [data-reveal] fade/rise in once on screen.
   JS adds .is-in via IntersectionObserver; reduced-motion users skip the
   transition entirely (rule below + the global reduced-motion block). */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
