/* ─────────────────────────────────────────────────────────────────────────────
   Zehnly design tokens — extracted from zehnly-mobile (colors.dart, text_styles.dart).
   Dark-first, brand purple #8849FF / #742CFF, blue accent #068FFF, radius 12, DM Sans.
   ───────────────────────────────────────────────────────────────────────────── */

/* Self-hosted DM Sans (variable) — no render-blocking external Google Fonts request */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Surfaces (dark theme — Zehnly defaults to dark) */
  --bg: #121212;
  --bg-elevated: #1a1b1d;
  --surface: #212121;          /* background.primary */
  --surface-2: #2b2b2b;        /* answer card fill (from mockups) */
  --card: #1a1e23;             /* cards.whiteBg */
  --card-2: #252932;           /* cards.bg */
  --card-border: #2d323b;      /* border.primary */
  --card-border-2: #374151;    /* border.secondary */

  /* Text */
  --text: #ffffff;             /* text.primary */
  --text-2: #e1e3e6;           /* foreground.tertiary */
  --text-dim: #9ca3af;         /* text.paragraph */
  --text-muted: #6b7280;       /* foreground.disabled */
  --on-brand: #ffffff;

  /* Brand + accents */
  --brand: #8849ff;            /* buttons.primary.base.button */
  --brand-2: #742cff;          /* foreground.brand */
  --brand-border: #5c24c9;
  --brand-soft: rgba(136, 73, 255, 0.14);
  --accent: #068fff;           /* blue (selected / focused) */
  --accent-soft: rgba(6, 143, 255, 0.12);
  --gold: #fac515;             /* Zehnly logo gold (sparkle / wordmark) */

  /* Semantic */
  --success: #10b981;
  --success-2: #22c55e;        /* bright green border in mockups */
  --success-soft: rgba(34, 197, 94, 0.12);
  --error: #ef4444;
  --error-2: #ff6b6b;
  --error-soft: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-2: #ff9500;

  /* Kahoot-style answer colors (harmonised with the Zehnly palette) */
  --ans-0: #ef4444;            /* red    ▲ */
  --ans-1: #068fff;            /* blue   ◆ */
  --ans-2: #f59e0b;            /* amber  ● */
  --ans-3: #10b981;            /* green  ■ */

  /* Progress gradient (orange, from mockups) */
  --progress-grad: linear-gradient(90deg, #ff9500 0%, #ffc17a 100%);
  --brand-grad: linear-gradient(135deg, #8849ff 0%, #742cff 100%);

  /* Geometry */
  --radius: 12px;              /* kAppBorderRadius */
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows — deliberately few & soft (one ambient layer at most) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  --shadow-pop: 0 10px 22px rgba(0, 0, 0, 0.34);
  --shadow-brand: 0 4px 14px rgba(116, 44, 255, 0.26);

  /* 3D depth — Zehnly chunky solid-edge style (no blur, just a colored lip) */
  --edge: 4px;                 /* resting drop height of pressable surfaces */
  --edge-brand: #5c24c9;       /* brand button bottom lip */
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.14); /* subtle top highlight */

  /* Typography (DM Sans scale from text_styles.dart) */
  --font: "DM Sans", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI",
    system-ui, sans-serif;
  --fw-title: 800;
  --fw-bold: 700;
  --fw-semibold: 600;
  --fw-medium: 500;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle ambient brand glow behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55% 45% at 18% -5%, rgba(136, 73, 255, 0.1), transparent 60%),
    radial-gradient(45% 45% at 102% 8%, rgba(6, 143, 255, 0.06), transparent 55%);
  pointer-events: none;
}

/* ── Typography helpers ─────────────────────────────────────────────────────── */
.t-title1 { font-weight: var(--fw-title); font-size: 32px; line-height: 40px; letter-spacing: -0.5px; }
.t-title2 { font-weight: var(--fw-title); font-size: 28px; line-height: 36px; letter-spacing: -0.4px; }
.t-title3 { font-weight: var(--fw-title); font-size: 24px; line-height: 32px; letter-spacing: -0.3px; }
.t-title4 { font-weight: var(--fw-title); font-size: 20px; line-height: 28px; }
.t-sub    { font-weight: var(--fw-bold);  font-size: 18px; line-height: 26px; }
.t-body   { font-weight: var(--fw-medium); font-size: 16px; line-height: 24px; }
.t-small  { font-weight: var(--fw-medium); font-size: 14px; line-height: 20px; }
.t-dim    { color: var(--text-dim); }
.t-muted  { color: var(--text-muted); }
.center   { text-align: center; }
