/* ============================================================================
   SITTERCHAT DESIGN TOKENS — v2 (warm)
   The single source of truth for colors, type, spacing, radius, and shadow.
   Every other stylesheet should consume these via var(--token-name).
   See /artifact/Q7XpBX5DUHH83VU6v223Aa for the full design-system reference.

   v2 retires the old indigo (#4F46E5) palette for a committed warm
   terracotta-on-cream world. Token NAMES are unchanged so downstream
   stylesheets keep working — only the color VALUES flipped.
   ============================================================================ */

:root {
  /* ─── SURFACES (cream) ─── */
  --surface-canvas:        #FBF4EA;  /* page background */
  --surface-raised:        #FFFCF7;  /* card surfaces */
  --surface-muted:         #F5E6D3;  /* alternate section bands */
  --surface-tint-warm:     #F5D9CB;  /* terracotta tint — pills, parent cards */
  --surface-brand-soft:    #E8DEE4;  /* plum tint — sitter side moments */

  /* ─── BORDERS ─── */
  --border-subtle:         #E6D3BD;
  --border-strong:         #D4BA9C;

  /* ─── INK (text — warm brown scale) ─── */
  --ink-primary:           #2A1810;
  --ink-muted:             #5A4036;
  --ink-subtle:            #8A6E5F;
  --ink-inverse:           #FFFCF7;

  /* ─── BRAND (terracotta primary) ─── */
  --brand-primary:         #C9633F;
  --brand-primary-hover:   #A14B2C;
  --brand-primary-ink:     #FFFFFF;

  /* ─── ACCENT PLUM (secondary — sitter-side differentiation) ─── */
  /* (kept under the --accent-warm name so legacy consumers still render) */
  --accent-warm:           #6B4A5F;
  --accent-warm-hover:     #553B4C;
  --accent-warm-soft:      #E8DEE4;

  /* ─── STATE (warm-biased) ─── */
  --state-success:         #4F7152;
  --state-success-soft:    #D9E5D5;
  --state-warning:         #B88B4F;
  --state-danger:          #B8453A;
  --state-danger-soft:     #F5D9D5;

  /* ─── TYPE — families ─── */
  --font-sans:    "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ─── TYPE — scale (role-based; name maps to purpose, not size) ─── */
  --text-display-hero-size:   56px;
  --text-display-hero-lh:     60px;
  --text-display-hero-weight: 500;

  --text-display-lg-size:   32px;
  --text-display-lg-lh:     36px;
  --text-display-lg-weight: 600;

  --text-display-md-size:   24px;
  --text-display-md-lh:     30px;
  --text-display-md-weight: 600;

  --text-heading-size:   18px;
  --text-heading-lh:     24px;
  --text-heading-weight: 600;

  --text-heading-sm-size:   15px;
  --text-heading-sm-lh:     20px;
  --text-heading-sm-weight: 600;

  --text-body-lg-size:  17px;
  --text-body-lg-lh:    26px;

  --text-body-size:  15px;
  --text-body-lh:    23px;

  --text-body-sm-size:  13px;
  --text-body-sm-lh:    19px;

  --text-label-size:        11px;
  --text-label-lh:          14px;
  --text-label-weight:      500;
  --text-label-spacing:     0.1em;

  /* ─── SPACING (4px grid) ─── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ─── RADIUS ─── */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 999px;

  /* ─── SHADOW (warm-tinted) ─── */
  --shadow-sm: 0 1px 2px rgba(42, 24, 16, 0.06), 0 1px 1px rgba(42, 24, 16, 0.04);
  --shadow-md: 0 4px 12px rgba(42, 24, 16, 0.08), 0 2px 4px rgba(42, 24, 16, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(42, 24, 16, 0.14), 0 8px 16px rgba(42, 24, 16, 0.06);

  /* ─── MOTION ─── */
  --motion-fast:   120ms;
  --motion-normal: 200ms;
  --motion-slow:   320ms;
  --ease:          cubic-bezier(0.2, 0.8, 0.2, 1);


  /* ═══════════════════════════════════════════════════════════════════════
     LEGACY ALIASES — keep existing stylesheets working under the new palette.
     Over time, replace these in consuming files with the canonical tokens
     above, then delete the alias.
     ═══════════════════════════════════════════════════════════════════════ */

  /* old color names → new tokens */
  --color-primary:          var(--brand-primary);
  --color-primary-dark:     var(--brand-primary-hover);
  --color-primary-darker:   var(--brand-primary-hover);
  --color-success:          var(--state-success);
  --color-success-dark:     var(--state-success);
  --color-error:            var(--state-danger);
  --color-warning:          var(--state-warning);

  --color-text-primary:     var(--ink-primary);
  --color-text-secondary:   var(--ink-muted);
  --color-text-tertiary:    var(--ink-subtle);

  --color-bg-primary:       var(--surface-canvas);
  --color-bg-secondary:     var(--surface-muted);
  --color-bg-tertiary:      var(--surface-muted);
  --color-bg-light-purple:  var(--surface-brand-soft);
  --color-bg-info:          var(--surface-brand-soft);
  --color-bg-success:       var(--state-success-soft);
  --color-bg-warning:       #F5E3C8;
  --color-bg-error:         var(--state-danger-soft);

  --color-border-light:     var(--border-subtle);
  --color-border-medium:    var(--border-subtle);

  /* legacy spacing names → new scale */
  --spacing-xs:  var(--space-1);
  --spacing-sm:  var(--space-2);
  --spacing-md:  var(--space-3);
  --spacing-lg:  var(--space-4);
  --spacing-xl:  var(--space-5);
  --spacing-2xl: var(--space-6);
  --spacing-3xl: var(--space-8);

  /* legacy gradients — rebased on warm palette */
  --gradient-purple:        linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
  --gradient-purple-avatar: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
  --gradient-pink:          linear-gradient(135deg, var(--accent-warm) 0%, #8E6378 100%);
  --gradient-family:        linear-gradient(135deg, var(--surface-tint-warm) 0%, var(--brand-primary) 100%);

  /* legacy per-step font sizes — still used in many files; keep literals */
  --font-xs:    12px;
  --font-sm:    13px;
  --font-md:    14px;
  --font-base:  15px;
  --font-lg:    16px;
  --font-xl:    18px;
  --font-2xl:   20px;
  --font-3xl:   24px;

  /* legacy radius extras */
  --radius-round: 50%;
  --radius-pill:  20px;

  /* legacy transitions */
  --transition-fast:   var(--motion-fast);
  --transition-normal: var(--motion-normal);
}


/* ─── DARK THEME ─── */
/* v2 commits to the warm single-theme look. Dark-mode OS viewers still get   */
/* the cream palette — app is locked to [data-theme="light"] in the layout,  */
/* but we keep these blocks defining the same light tokens as a safety net   */
/* in case the attribute is ever removed.                                     */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: light;
    /* v2 is single-theme warm — no dark-mode redefines. If the lock on
       <html data-theme="light"> is ever removed, the page still renders in
       the intended cream palette because no token is redefined here. */
  }
}

:root[data-theme="dark"] {
  color-scheme: light;
  /* Same reasoning — honor an explicit dark request by still showing the
     warm palette rather than a half-designed inversion. */
}


/* ═══════════════════════════════════════════════════════════════════════════
   PRIMITIVE RESETS + BASE TYPOGRAPHY
   These apply to every page the moment design_tokens.css loads.
   ═══════════════════════════════════════════════════════════════════════════ */

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  color: var(--ink-primary);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Role-based type utility classes. Prefer these over per-element CSS where
   possible. Components can still set type directly when needed. */
.t-display-hero {
  font-family: var(--font-display);
  font-weight: var(--text-display-hero-weight);
  font-size: var(--text-display-hero-size);
  line-height: var(--text-display-hero-lh);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.t-display-lg {
  font-family: var(--font-sans);
  font-weight: var(--text-display-lg-weight);
  font-size: var(--text-display-lg-size);
  line-height: var(--text-display-lg-lh);
  letter-spacing: -0.025em;
}
.t-display-md {
  font-family: var(--font-sans);
  font-weight: var(--text-display-md-weight);
  font-size: var(--text-display-md-size);
  line-height: var(--text-display-md-lh);
  letter-spacing: -0.02em;
}
.t-heading {
  font-family: var(--font-sans);
  font-weight: var(--text-heading-weight);
  font-size: var(--text-heading-size);
  line-height: var(--text-heading-lh);
  letter-spacing: -0.01em;
}
.t-heading-sm {
  font-family: var(--font-sans);
  font-weight: var(--text-heading-sm-weight);
  font-size: var(--text-heading-sm-size);
  line-height: var(--text-heading-sm-lh);
}
.t-body-lg {
  font-family: var(--font-sans);
  font-size: var(--text-body-lg-size);
  line-height: var(--text-body-lg-lh);
}
.t-body {
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
}
.t-body-sm {
  font-family: var(--font-sans);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
}
.t-label {
  font-family: var(--font-sans);
  font-size: var(--text-label-size);
  line-height: var(--text-label-lh);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-spacing);
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.t-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
}

.t-muted { color: var(--ink-muted); }
.t-subtle { color: var(--ink-subtle); }

/* Focus — visible for keyboard, invisible for mouse */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
