/* Atelier Azure — base primitives.
   Owner: Landing/Design. Shop + Admin reuse these classes; keep them generic.
   Consumes tokens from /css/tokens.css only. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 68px; /* header height + breathing room for anchor jumps */
}
body {
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.47;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: var(--tracking-tight); text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
::selection { background: var(--azure-100); color: var(--azure-900); }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid transparent; /* stays visible in forced-colors mode */
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.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;
}
.skip-link {
  position: fixed;
  top: var(--s-3); left: var(--s-3);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--s-3) var(--s-4);
  background: var(--ink); color: var(--surface);
  border-radius: var(--r-pill);
  font-size: var(--fs-callout); font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-2) var(--ease-ios);
}
.skip-link:focus-visible { transform: none; }

.icon {
  width: 22px; height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 28px; height: 28px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: var(--fs-footnote);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--azure-700);
}
.title-display { font-size: var(--fs-display); letter-spacing: var(--tracking-display); line-height: 1.04; }
.title { font-size: var(--fs-title); letter-spacing: var(--tracking-tight); }
.lead { font-size: var(--fs-headline); line-height: 1.42; color: var(--ink-2); letter-spacing: -0.01em; }
.serif-accent { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.muted { color: var(--ink-2); }
.fine { font-size: var(--fs-footnote); color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--mist);
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-5);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-callout);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease, transform var(--dur-2) var(--ease-ios);
}
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }

.btn--primary { --btn-bg: var(--azure-600); --btn-fg: #fff; }
.btn--primary:hover { --btn-bg: var(--azure-700); }
.btn--primary::before { /* soft, tinted elevation on a primitive pseudo element */
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  box-shadow: 0 1px 2px rgba(6, 50, 94, 0.18), 0 8px 20px rgba(11, 107, 203, 0.22);
  opacity: 0.9;
}
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--azure-700); }
.btn--ghost:hover { --btn-bg: var(--azure-50); }
.btn--glass {
  --btn-bg: var(--glass-strong);
  --btn-fg: var(--ink);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.btn--glass:hover { --btn-bg: #fff; }
.btn--quiet { --btn-bg: var(--mist); }
.btn--quiet:hover { --btn-bg: var(--haze); }

.btn--sm { min-height: 36px; padding: 0 var(--s-4); font-size: var(--fs-footnote); }
.btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-body); }
.btn--icon { width: 44px; padding: 0; }
.btn--block { width: 100%; }

/* Invisible 44px hit area for compact controls */
.hit-44 { position: relative; }
.hit-44::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }

/* ---------- Segmented control (EN/DE etc.) ---------- */
.seg {
  --seg-count: 2;
  --seg-index: 0;
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 2px;
  border-radius: var(--r-pill);
  background: rgba(10, 26, 43, 0.06);
  isolation: isolate;
}
.seg::before { /* sliding thumb */
  content: "";
  position: absolute; z-index: -1;
  top: 2px; bottom: 2px; left: 2px;
  width: calc((100% - 4px) / var(--seg-count));
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(6, 50, 94, 0.12), 0 2px 6px rgba(6, 50, 94, 0.08);
  transform: translateX(calc(100% * var(--seg-index)));
  transition: transform var(--dur-2) var(--ease-ios);
}
.seg__btn {
  min-width: 36px; min-height: 28px;
  padding: 0 var(--s-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  transition: color var(--dur-1) ease;
}
.seg__btn[aria-pressed="true"] { color: var(--ink); }
.seg__btn:hover { color: var(--ink); }

/* ---------- Badge ---------- */
.badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--azure-600);
  color: #fff;
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ---------- Surfaces ---------- */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.hairline { height: 1px; background: var(--hairline); border: 0; }

/* ---------- Reduced motion ---------- */
@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;
  }
}
