/* =========================================================
   PrepTrack — Shared Design System
   Tokens, reset, typography, and reusable components used
   across index.html and company.html
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---------- Color tokens ---------- */
  --bg: #0a0c10;
  --bg-elevated: #0d0f15;
  --surface: #12151b;
  --surface-2: #171b23;
  --surface-hover: #1d212b;
  --border: #232733;
  --border-subtle: #191d26;

  --text-primary: #edeff3;
  --text-secondary: #9aa1b2;
  --text-tertiary: #5c6375;

  --accent: #7c5cfc;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 252, 0.14);
  --accent-border: rgba(124, 92, 252, 0.35);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #f5b942;
  --warning-soft: rgba(245, 185, 66, 0.14);
  --danger: #fb6f6f;
  --danger-soft: rgba(251, 111, 111, 0.14);

  --gradient-signature: linear-gradient(135deg, #7c5cfc 0%, #22d3ee 100%);
  --gradient-warm: linear-gradient(135deg, #f5b942 0%, #fb6f6f 100%);

  /* ---------- Typography ---------- */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---------- Elevation ---------- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px var(--accent-border), 0 8px 32px rgba(124, 92, 252, 0.18);

  /* ---------- Radii ---------- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms;
  --t-med: 280ms;
  --t-slow: 480ms;

  /* ---------- Layout ---------- */
  --content-width: 1240px;
  --nav-height: 72px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -10%, rgba(124, 92, 252, 0.12), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 55%);
  background-repeat: no-repeat;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  animation: page-fade var(--t-slow) var(--ease-out);
}

@keyframes page-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select {
  font-family: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* =========================================================
   Layout shell
   ========================================================= */

.shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 32px 96px;
}

/* ---------- Top navigation ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.topnav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gradient-signature);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(124, 92, 252, 0.35);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.topnav-spacer {
  flex: 1;
}

.topnav-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.topnav-crumbs a {
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease-out);
}

.topnav-crumbs a:hover {
  color: var(--text-primary);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: #2c3140;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-signature);
  border-color: transparent;
  color: #0a0c10;
  box-shadow: 0 6px 20px rgba(124, 92, 252, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 8px 26px rgba(124, 92, 252, 0.4);
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---------- Chips / Tags ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.chip-easy {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(52, 211, 153, 0.28);
}

.chip-medium {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(245, 185, 66, 0.28);
}

.chip-hard {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(251, 111, 111, 0.28);
}

/* ---------- Card primitive ---------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out),
    border-color var(--t-med) var(--ease-out);
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 6px;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-sub {
  font-size: 13.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ---------- Progress bar ---------- */
.pbar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.pbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: var(--r-pill);
  background: var(--gradient-signature);
  transition: width 900ms var(--ease-out);
}

.pbar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.6s var(--ease-out) infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  60%,
  100% {
    transform: translateX(220%);
  }
}

/* ---------- Empty / loading states ---------- */
.state-block {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-tertiary);
}

.state-block .state-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  opacity: 0.5;
}

.state-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ---------- Skeleton loading ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-md);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s linear infinite;
}

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: toast-in var(--t-med) var(--ease-spring);
  max-width: 320px;
}

.toast.leaving {
  animation: toast-out var(--t-fast) var(--ease-out) forwards;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--content-width);
  margin: 40px auto 0;
  padding: 24px 32px 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: 12.5px;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .shell {
    padding: 0 18px 72px;
  }
  .topnav-inner {
    padding: 0 18px;
  }
  .site-footer {
    padding: 20px 18px 0;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
