/* ==========================================================================
   OCP Java 17 Prep — Design Tokens (Premium Dark & Refined Light)
   ========================================================================== */

:root {
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  /* Font scale */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-md: 1.08rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.85rem;

  /* Layout dimensions */
  --container-max: 1180px;
  --header-height: 60px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Premium Dark Theme (Default) */
  --bg: #090d16;
  --surface: #0f172a;
  --surface-elevated: #162036;
  --surface-hover: #1c2944;
  --surface-active: #223252;
  --card-bg: #0f172a;
  --card-border: #1e293b;

  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --border: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: #334155;

  /* Electric Indigo / Blue Brand Accent */
  --primary: #4f6df5;
  --primary-hover: #637ef8;
  --primary-active: #3e5be0;
  --primary-soft: rgba(79, 109, 245, 0.15);
  --primary-border: rgba(79, 109, 245, 0.35);
  --primary-glow: rgba(79, 109, 245, 0.25);
  --on-primary: #ffffff;

  /* Semantics */
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.15);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;

  /* Code & Highlighter */
  --code-bg: #060911;
  --code-border: #182236;
  --code-text: #e2e8f0;
  --hl: rgba(251, 191, 36, 0.28);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 20px -3px rgba(79, 109, 245, 0.35);

  color-scheme: dark;
  accent-color: var(--primary);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: #f1f5f9;
  --surface-hover: #f1f5f9;
  --surface-active: #e2e8f0;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;

  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-strong: #cbd5e1;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-active: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: rgba(59, 130, 246, 0.3);
  --primary-glow: rgba(59, 130, 246, 0.15);
  --on-primary: #ffffff;

  --code-bg: #0f172a;
  --code-border: #e2e8f0;
  --code-text: #e2e8f0;
  --hl: rgba(245, 158, 11, 0.25);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.12);

  color-scheme: light;
}

/* User configurable highlight choices */
:root[data-highlight="amber"] { --hl: rgba(251, 191, 36, 0.28); }
:root[data-highlight="sky"] { --hl: rgba(56, 189, 248, 0.25); }
:root[data-highlight="mint"] { --hl: rgba(52, 211, 153, 0.25); }
:root[data-highlight="rose"] { --hl: rgba(251, 113, 133, 0.28); }
:root[data-highlight="none"] { --hl: transparent; }

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

html {
  scroll-padding-top: 76px;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
}

select option {
  background: var(--surface);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* #app receives programmatic .focus() after every route render for
   accessibility (screen-reader + scroll anchoring). It is a container,
   not a keyboard target — the ring here is noise, not information. */
main:focus,
main:focus-visible {
  outline: none;
}
