@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400..700&family=Fraunces:opsz,wght@9..144,400..700&display=swap");

:root {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: #FFFFFF;
  --foreground: #1E1233;
  --card: #FFFFFF;
  --card-foreground: #1E1233;
  --popover: #FFFFFF;
  --popover-foreground: #1E1233;
  --primary: #754DC1;
  --primary-foreground: #FFFFFF;
  --secondary: #C5B3E8;
  --secondary-foreground: #4C2787;
  --muted: #F2F2F4;
  --muted-foreground: #5E5473;
  --accent: #F2F2F4;
  --accent-foreground: #4C2787;
  --destructive: oklch(0.52 0.21 25);
  --destructive-foreground: oklch(0.99 0.01 80);
  --border: #E4DCF3;
  --input: #CDBFE8;
  --ring: #A83B94;
  --success: oklch(0.52 0.12 155);
  --warning: oklch(0.72 0.15 62);
  --chart-1: oklch(0.36 0.13 335);
  --chart-2: oklch(0.52 0.22 350);
  --chart-3: oklch(0.68 0.19 20);
  --chart-4: oklch(0.8 0.13 55);
  --chart-5: oklch(0.5 0.17 310);
  --sidebar: oklch(0.955 0.025 60);
  --sidebar-foreground: oklch(0.24 0.07 340);
  --sidebar-primary: oklch(0.45 0.19 350);
  --sidebar-primary-foreground: oklch(0.99 0.01 80);
  --sidebar-accent: oklch(0.92 0.045 30);
  --sidebar-accent-foreground: oklch(0.28 0.08 340);
  --sidebar-border: oklch(0.88 0.035 55);
  --sidebar-ring: oklch(0.55 0.2 350);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: #F2F2F4;
  --surface-hover:   color-mix(in srgb, var(--primary) 7%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--primary) 12%, var(--background));
  --surface-elevated: #FFFFFF;

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: #EFEAF8;
  --border-muted: #E9E2F5;
  --border-strong: #B9A6E0;

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: #3E2F5C;

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: color-mix(in srgb, var(--primary) 88%, var(--foreground));
  --primary-muted: color-mix(in srgb, var(--primary) 16%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 9%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 5%,  var(--background));

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: color-mix(in srgb, #A83B94 40%, transparent);

  /* ── error (form validation — distinct from destructive) ─────── */
  --error: oklch(0.52 0.21 25);
  --error-foreground: oklch(0.99 0.01 80);

  /* ── Swell Recovery brand accents ──────────────────────────── */
  --brand-dark-purple: #4C2787;
  --brand-light-purple: #C5B3E8;
  --brand-raspberry: #A83B94;
  --brand-light-raspberry: #EAB7E3;
  --brand-tangerine: #FF9773;
  /* Text and border on white for the outlined orange button: 5.3:1 on white. */
  --brand-tangerine-deep: #B8461E;

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 1rem;
  --radius-none: 0rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: 'Termina', sans-serif;
  --font-sans: 'OpenSans', sans-serif;
  /* Accent script, two places only: the welcome tagline and the Snapshot subtitle. */
  --font-accent: 'Monoliner', 'OpenSans', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 600;
  --line-height-display: 1.12;
  --tracking-display: -0.02em;
  --font-weight-body: 400;
  --line-height-body: 1.6;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px oklch(0.3 0.12 295 / 0.07);
  --shadow-md: 0 6px 18px oklch(0.3 0.12 295 / 0.1);
  --shadow-lg: 0 18px 44px oklch(0.3 0.12 295 / 0.14);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

.dark {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: oklch(0.19 0.04 335);
  --foreground: oklch(0.96 0.015 80);
  --card: oklch(0.235 0.048 335);
  --card-foreground: oklch(0.96 0.015 80);
  --popover: oklch(0.235 0.048 335);
  --popover-foreground: oklch(0.96 0.015 80);
  --primary: #C5B3E8;
  --primary-foreground: #1E1233;
  --secondary: oklch(0.31 0.055 340);
  --secondary-foreground: oklch(0.96 0.015 80);
  --muted: oklch(0.27 0.045 335);
  --muted-foreground: oklch(0.78 0.04 340);
  --accent: oklch(0.29 0.05 350);
  --accent-foreground: oklch(0.96 0.015 80);
  --destructive: oklch(0.7 0.19 22);
  --destructive-foreground: oklch(0.18 0.05 335);
  --border: oklch(0.34 0.05 335);
  --input: oklch(0.38 0.055 335);
  --ring: #EAB7E3;
  --success: oklch(0.74 0.13 155);
  --warning: oklch(0.82 0.14 65);
  --chart-1: oklch(0.62 0.15 325);
  --chart-2: oklch(0.7 0.2 350);
  --chart-3: oklch(0.74 0.17 20);
  --chart-4: oklch(0.84 0.12 60);
  --chart-5: oklch(0.66 0.16 305);
  --sidebar: oklch(0.215 0.045 335);
  --sidebar-foreground: oklch(0.96 0.015 80);
  --sidebar-primary: oklch(0.74 0.16 350);
  --sidebar-primary-foreground: oklch(0.18 0.05 335);
  --sidebar-accent: oklch(0.29 0.05 350);
  --sidebar-accent-foreground: oklch(0.96 0.015 80);
  --sidebar-border: oklch(0.34 0.05 335);
  --sidebar-ring: oklch(0.74 0.16 350);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.215 0.045 335);
  --surface-hover:   color-mix(in srgb, var(--foreground) 7%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 12%, var(--background));
  --surface-elevated: oklch(0.28 0.052 335);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.27 0.045 335);
  --border-muted: oklch(0.3 0.048 335);
  --border-strong: oklch(0.48 0.07 340);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.86 0.03 60);

  /* ── primary depth ────────────────────────────────────────────── */
  --primary-hover: color-mix(in srgb, var(--primary) 88%, var(--foreground));
  --primary-muted: color-mix(in srgb, var(--primary) 22%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 13%, var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 8%,  var(--background));

  /* ── focus ring ───────────────────────────────────────────────── */
  --focus-ring: color-mix(in srgb, #EAB7E3 50%, transparent);

  /* ── error ────────────────────────────────────────────────────── */
  --error: oklch(0.72 0.18 22);
  --error-foreground: oklch(0.18 0.05 335);

  /* ── Swell Recovery brand accents ──────────────────────────── */
  --brand-dark-purple: #C5B3E8;
  --brand-light-purple: #C5B3E8;
  --brand-raspberry: #EAB7E3;
  --brand-light-raspberry: #EAB7E3;
  --brand-tangerine: #FF9773;
  --brand-tangerine-deep: #FF9773;

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 1rem;
  --radius-none: 0rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 600;
  --line-height-display: 1.12;
  --tracking-display: -0.02em;
  --font-weight-body: 450;
  --line-height-body: 1.65;
  --tracking-body: 0.01em;
  --font-weight-mono: 400;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px oklch(0.08 0.03 335 / 0.4);
  --shadow-md: 0 6px 18px oklch(0.08 0.03 335 / 0.5);
  --shadow-lg: 0 18px 44px oklch(0.08 0.03 335 / 0.6);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

/* Stencil Tweaks */
@font-face {
  font-family: 'Termina';
  src: url('/assets/fonts/Termina-Demi.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Termina';
  src: url('/assets/fonts/Termina-Heavy.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'OpenSans';
  src: url('/assets/fonts/OpenSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Open Sans SemiBold, used by name only on the welcome page's length pill. */
@font-face {
  font-family: 'OpenSansSemiBold';
  src: url('/assets/fonts/OpenSans-SemiBold.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Monoliner has one upright file. It is declared for italic too, so the italic fallback
   (Open Sans) never makes the browser slant the script itself. */
@font-face {
  font-family: 'Monoliner';
  src: url('/assets/fonts/monoliner-webfont.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Monoliner';
  src: url('/assets/fonts/monoliner-webfont.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* /Stencil Tweaks */