/* Pendi design tokens, reset and base type.
   Brand is violet (committed): #6D28D9 primary, #FBBE3C amber accent.
   Colors in OKLCH. Light and dark via prefers-color-scheme, with a
   data-theme override so a manual toggle can win in either direction. */

:root {
  color-scheme: light dark;

  /* Brand anchors (fixed identity, do not shift per theme) */
  --violet: #6d28d9;
  --violet-600: #7c3aed;
  --violet-500: #8b5cf6;
  --amber: #fbbe3c;

  /* Semantic ramp, light mode */
  --bg: oklch(0.988 0.004 293);
  --bg-tint: oklch(0.966 0.01 293);
  --surface: oklch(1 0 0);
  --ink: oklch(0.24 0.03 293);
  --muted: oklch(0.455 0.03 293);
  --hairline: oklch(0.9 0.012 293);
  --brand: var(--violet);
  --brand-strong: #5b21b6;
  --on-brand: #ffffff;
  --accent: var(--amber);
  --accent-ink: oklch(0.32 0.07 74); /* readable text on amber */
  --focus: var(--violet-600);

  /* Type */
  --sans: "Segoe UI Variable Text", "Segoe UI", -apple-system,
    BlinkMacSystemFont, "SF Pro Text", Roboto, Ubuntu, Cantarell, "Noto Sans",
    system-ui, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system,
    BlinkMacSystemFont, "SF Pro Display", Roboto, system-ui, sans-serif;

  /* Rhythm and shape (one radius scale) */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --shadow: 0 1px 2px oklch(0.4 0.05 293 / 0.06),
    0 12px 34px oklch(0.4 0.08 293 / 0.09);
  --shadow-brand: 0 14px 40px oklch(0.5 0.24 293.5 / 0.28);
  --maxw: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.175 0.022 293);
    --bg-tint: oklch(0.215 0.028 293);
    --surface: oklch(0.225 0.03 293);
    --ink: oklch(0.955 0.008 293);
    --muted: oklch(0.735 0.028 293);
    --hairline: oklch(0.34 0.03 293);
    --brand: var(--violet-600);
    --brand-strong: var(--violet-500);
    --on-brand: #ffffff;
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 16px 40px oklch(0 0 0 / 0.42);
    --shadow-brand: 0 16px 46px oklch(0.5 0.24 293.5 / 0.5);
    --focus: var(--violet-500);
  }
}

/* Explicit overrides so a toggle can force either theme. */
:root[data-theme="light"] {
  --bg: oklch(0.988 0.004 293);
  --bg-tint: oklch(0.966 0.01 293);
  --surface: oklch(1 0 0);
  --ink: oklch(0.24 0.03 293);
  --muted: oklch(0.455 0.03 293);
  --hairline: oklch(0.9 0.012 293);
  --brand: var(--violet);
  --brand-strong: #5b21b6;
  --shadow: 0 1px 2px oklch(0.4 0.05 293 / 0.06),
    0 12px 34px oklch(0.4 0.08 293 / 0.09);
  --shadow-brand: 0 14px 40px oklch(0.5 0.24 293.5 / 0.28);
  --focus: var(--violet-600);
}
:root[data-theme="dark"] {
  --bg: oklch(0.175 0.022 293);
  --bg-tint: oklch(0.215 0.028 293);
  --surface: oklch(0.225 0.03 293);
  --ink: oklch(0.955 0.008 293);
  --muted: oklch(0.735 0.028 293);
  --hairline: oklch(0.34 0.03 293);
  --brand: var(--violet-600);
  --brand-strong: var(--violet-500);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 16px 40px oklch(0 0 0 / 0.42);
  --shadow-brand: 0 16px 46px oklch(0.5 0.24 293.5 / 0.5);
  --focus: var(--violet-500);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: clamp(1rem, 0.97rem + 0.2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  font-weight: 680;
}

p {
  text-wrap: pretty;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
