/* Facet — base + primitives */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

.account-logout { flex: none; white-space: nowrap; }
.account-logout:not(.btn) { padding: 10px 0; font-size: inherit; }
.account-logout:hover { color: var(--primary); }
.account-logout:disabled { cursor: wait; opacity: .6; }
.account-logout[hidden] { display: none; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Ambient dotted texture used by dark stages (mirrors the references) */
.dotfield {
  background-image: radial-gradient(oklch(1 0 0 / 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ---- Typography scale ---- */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
h1, h2, h3 { text-wrap: balance; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; }
p { text-wrap: pretty; }

/* ---- Buttons ---- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 44px; padding: 0 var(--sp-5);
  border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 0.95rem; font-weight: 500;
  border: 1px solid var(--line);
  transition: transform var(--dur-fast) var(--ease-out-quart),
              background var(--dur-fast), border-color var(--dur-fast),
              box-shadow var(--dur-mid), filter var(--dur-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  --btn-bg: var(--gradient-brand);
  --btn-fg: var(--primary-ink);
  border-color: transparent;
  font-weight: 600;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.4), 0 2px 8px oklch(0 0 0 / 0.12);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { filter: brightness(0.95); }

.btn-ghost { --btn-bg: transparent; }
.btn-ghost:hover { background: var(--surface); }

.btn-lg { height: 54px; padding: 0 var(--sp-6); font-size: 1.05rem; }
.btn-icon { width: 44px; padding: 0; justify-content: center; }

/* ---- Chip / eyebrow (used sparingly, once) ---- */
.pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 30px; padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }

/* ---- Utility ---- */
.container { width: min(1200px, 100% - 2 * var(--sp-5)); margin-inline: auto; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.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;
}

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