/* ==========================================================================
   YVES & VALÉRIE — BASE
   Owner: UI-1. Modern reset, base typography, buttons, utilities. Consumes
   tokens.css exclusively — no raw colors, no hardcoded easing/duration.

   Contents
     1. Reset
     2. Root & body
     3. Selection
     4. Focus-visible
     5. Scrollbars
     6. Skip link
     7. Typography defaults
     8. Buttons — .btn, .btn--primary, .btn--ghost
     9. Utilities
   ========================================================================== */


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

* {
  margin: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  text-align: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Long unclassed prose stays readable without manual line-break hints */
p,
li,
figcaption,
blockquote {
  text-wrap: pretty;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}


/* --------------------------------------------------------------------------
   2. ROOT & BODY
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}


/* --------------------------------------------------------------------------
   3. SELECTION
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-accent);
  color: var(--color-text-inverse);
}


/* --------------------------------------------------------------------------
   4. FOCUS-VISIBLE
   A single reusable "halo" ring: a surface-colored gap, then an accent
   ring, so it reads on any background without ever needing an outline
   that clips against rounded corners.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-surface), 0 0 0 6px var(--color-accent);
}

a,
button,
input,
textarea,
select,
[tabindex] {
  transition: box-shadow var(--dur-fast) var(--ease-out);
}


/* --------------------------------------------------------------------------
   5. SCROLLBARS
   scrollbar-width/-color are inherited properties — set once on html.
   The ::-webkit-scrollbar family is not inherited, so it targets every
   scrollable element directly.
   -------------------------------------------------------------------------- */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 0.625rem;
  height: 0.625rem;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-muted);
}


/* --------------------------------------------------------------------------
   6. SKIP LINK
   Hidden above the viewport until keyboard focus brings it down.
   -------------------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: 50%;
  z-index: var(--z-skiplink);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-surface-elevated);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -6rem);
  transition: transform var(--dur-base) var(--ease-out-expo);
}

.skip-link::before {
  content: "";
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
}

.skip-link:focus {
  outline: none;
  transform: translate(-50%, 0);
}


/* --------------------------------------------------------------------------
   7. TYPOGRAPHY DEFAULTS
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

/* Unclassed inline links (e.g. the footer credit) get a deliberate
   treatment; componentised links (.site-header__cta, .btn, .lb-btn, …)
   style themselves and are untouched by this selector. */
a:not([class]) {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}
a:not([class]):hover {
  color: var(--color-accent);
}


/* --------------------------------------------------------------------------
   8. BUTTONS
   Shared geometry on .btn; fill/border/label handled per variant. Generous
   pill padding, small tracked-out uppercase label — editorial, not
   default-Bootstrap.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-7);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring-soft),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background-color: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-0.125rem);
}
.btn--primary:active {
  background-color: var(--color-accent-active);
  box-shadow: var(--shadow-sm);
  transform: translateY(0) scale(0.97);
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}
.btn--ghost:hover {
  background-color: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-0.125rem);
}
.btn--ghost:active {
  background-color: var(--color-accent-soft);
  transform: translateY(0) scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* --------------------------------------------------------------------------
   9. UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
