/* sccux avatars: the shared look for the landing page (/avatar) and the editor (/portrait).
   Warm charcoal dark, aged-paper light, Inter, and Inkfolk's yellow: a warm cousin of sccux.design's (dark text on
   yellow fills; --av-accent-text where the yellow is the text itself, deepened to ochre on the light page).
   The theme is set on <html data-theme="dark|light"> by theme.js (the visitor's choice, else dark). */

:root {
  color-scheme: light;
  --av-bg: #faf7f1;
  --av-bg-soft: #f3eee4;
  --av-bg-tint: #ece5d7;
  --av-surface: #fdfbf7;
  --av-ink: #2b2521;
  --av-ink-2: #5a4f45;
  --av-muted: #6b5e52;
  --av-line: #e8e1d3;
  --av-line-strong: #d4c8b2;
  --av-accent: #f0c445;
  --av-accent-hover: #f5d164;
  --av-accent-ink: #2a2420;
  --av-accent-text: #8a6610;
  --av-accent-soft: #f6e9bf;
  --av-yellow: #ecc95a;
  --av-code-bg: #24201c;
  --av-header-bg: rgba(250, 247, 241, 0.88);
  --av-shadow-sm: 0 1px 2px rgba(42, 36, 32, 0.06), 0 2px 8px rgba(42, 36, 32, 0.05);
  --av-shadow-md: 0 2px 6px rgba(42, 36, 32, 0.06), 0 12px 32px rgba(42, 36, 32, 0.09);

  /* the avatar itself: a warm white cut-out with off-black lines, in both themes */
  --av-face-paper: #fffaf2;
  --av-face-ink: #1f1b18;
  --av-face-circle: #f6e9bf;

  --av-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --av-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --av-radius-sm: 8px;
  --av-radius: 14px;
  --av-radius-lg: 22px;
  --av-gutter: clamp(16px, 5vw, 48px);
  --av-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --av-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --av-bg: #1a1918;
  --av-bg-soft: #2b2927;
  --av-bg-tint: #3b3836;
  --av-surface: #211f1e;
  --av-ink: #f1eee9;
  --av-ink-2: #d2cdc6;
  --av-muted: #a29d96;
  --av-line: #33302e;
  --av-line-strong: #46423f;
  --av-accent: #f2c94c;
  --av-accent-hover: #f7d76f;
  --av-accent-ink: #221d18;
  --av-accent-text: #f2c94c;
  --av-accent-soft: #3a3222;
  --av-yellow: #efcc58;
  --av-code-bg: #141312;
  --av-header-bg: rgba(26, 25, 24, 0.88);
  --av-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.18);
  --av-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.3);
  --av-face-circle: #3a3222;
}

/* ---------- base (only on pages that opt in with <body class="av-page">, so shadcn/Tailwind pages keep theirs) ---------- */
.av-page, .av-page *, .av-page *::before, .av-page *::after { box-sizing: border-box; }
body.av-page {
  margin: 0; background: var(--av-bg); color: var(--av-ink);
  font: 400 17px/1.6 var(--av-font); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s ease, color .35s ease;
}
:where(.av-page) a { color: inherit; }
:where(.av-page) :is(code, pre, kbd) { font-family: var(--av-mono); }
.av-page :focus-visible { outline: 2px solid var(--av-accent-text); outline-offset: 3px; border-radius: 6px; }
.av-page ::selection { background: var(--av-accent); color: var(--av-accent-ink); }
:where(.av-page) input[type='range'] { accent-color: var(--av-accent-text); }

/* ---------- type ---------- */
.av-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--av-accent-text); margin: 0; }
.av-h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 650; letter-spacing: -0.04em; line-height: 1.04; margin: 0; text-wrap: balance; }
.av-h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 650; letter-spacing: -0.03em; line-height: 1.08; margin: 0; text-wrap: balance; }
.av-h3 { font-size: 19px; font-weight: 620; letter-spacing: -0.015em; line-height: 1.3; margin: 0; }
.av-lede { font-size: clamp(18px, 2vw, 21px); color: var(--av-ink-2); max-width: 34em; margin: 0; text-wrap: pretty; }
.av-muted { color: var(--av-muted); }

/* ---------- buttons ---------- */
.av-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 16px var(--av-font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .25s var(--av-ease-out);
}
.av-btn:hover { transform: translateY(-1px); }
.av-btn-primary { background: var(--av-accent); color: var(--av-accent-ink); box-shadow: inset 0 1px 0 rgba(255, 250, 225, .6), inset 0 -1px 0 rgba(90, 64, 10, .14); }
.av-btn-primary:hover { background: var(--av-accent-hover); }
.av-btn-ghost { background: transparent; color: var(--av-ink); border-color: var(--av-line-strong); }
.av-btn-ghost:hover { background: var(--av-bg-soft); }
.av-btn-sm { min-height: 38px; padding: 0 16px; font-size: 14.5px; }

/* round icon button (the theme toggle) */
.av-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%;
  background: var(--av-surface); color: var(--av-ink); border: 1px solid var(--av-line); cursor: pointer;
  box-shadow: var(--av-shadow-sm); transition: transform .3s var(--av-ease-spring), border-color .2s;
}
.av-icon-btn:hover { transform: scale(1.06); border-color: var(--av-line-strong); }
.av-icon-btn svg { grid-area: 1 / 1; transition: opacity .3s, transform .5s var(--av-ease-spring); }
.av-theme .sun { color: var(--av-yellow); opacity: 0; transform: rotate(90deg) scale(.4); }
.av-theme .moon { color: var(--av-accent-text); transform: rotate(-15deg); }
:root[data-theme='dark'] .av-theme .sun { opacity: 1; transform: none; }
:root[data-theme='dark'] .av-theme .moon { opacity: 0; transform: rotate(-90deg) scale(.4); }

/* ---------- controls (shared with the editor) ---------- */
.av-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.av-chips button {
  font: 500 14px var(--av-font); color: var(--av-ink); background: var(--av-surface);
  border: 1px solid var(--av-line-strong); border-radius: 999px; padding: 6px 13px; min-height: 34px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.av-chips button:hover { border-color: var(--av-ink-2); }
.av-chips button[aria-pressed='true'] { background: var(--av-ink); color: var(--av-bg); border-color: var(--av-ink); }
.av-seg { display: inline-flex; border: 1px solid var(--av-line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--av-bg-soft); }
.av-seg button { font: 500 13.5px var(--av-font); color: var(--av-muted); background: none; border: 0; border-radius: 999px; padding: 5px 13px; min-height: 28px; cursor: pointer; }
.av-seg button[aria-pressed='true'] { background: var(--av-surface); color: var(--av-ink); box-shadow: var(--av-shadow-sm); }
.av-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 14px; }
.av-switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--av-line-strong); position: relative; cursor: pointer; margin: 0; transition: background .15s; flex: none; }
.av-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--av-surface); transition: transform .2s var(--av-ease-out); }
.av-switch input:checked { background: var(--av-accent-text); }
.av-switch input:checked::after { transform: translateX(16px); }
.av-input, .av-select { font: 14.5px var(--av-font); color: var(--av-ink); background: var(--av-surface); border: 1px solid var(--av-line-strong); border-radius: 999px; padding: 7px 14px; min-height: 36px; }
/* ---------- card ---------- */
.av-card { background: var(--av-surface); border: 1px solid var(--av-line); border-radius: var(--av-radius-lg); }

@media (prefers-reduced-motion: reduce) {
  .av-page *, .av-page *::before, .av-page *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
