/* ==========================================================================
   StudyLink Education Agency — Award-Winning Design System & Tokens (Phase 3)
   Inspired by Linear, Stripe, Apple HIG, and Refactoring UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  /* ------------------------------------------------------------------------
     1. Brand & Semantic Color Palette (Bluish-Bright Default Mode)
     ------------------------------------------------------------------------ */
  --color-navy-dark: #0F3A9D;
  --color-navy: #164EC2;
  --color-navy-light: #2563EB;
  --color-navy-muted: #3B82F6;

  /* Primary Brand Accent (Teal & Bright Sky Blue) */
  --color-teal: #0098A6;
  --color-teal-dark: #007A85;
  --color-teal-light: rgba(2, 132, 199, 0.14);
  --color-teal-subtle: rgba(2, 132, 199, 0.08);
  --color-sky-blue: #0284C7;
  --color-sky-blue-hover: #0369A1;

  /* Atmospheric Hero Surface (Bright Luminous Azure Sky in Light/Bright Mode) */
  --gradient-hero: linear-gradient(95deg, #051329 0%, #071C3D 15%, #0C2B57 30%, #154078 45%, #235C9E 60%, #3F7FC7 73%, #70A8E6 84%, #AECFF6 92%, #E2EEFC 97%, #F6FAFF 100%);
  --gradient-hero-accent: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(56, 189, 248, 0.18));

  /* Semantic Card Accents (Refined from loud fills to precision accents) */
  --color-card-amber: #D97706;
  --color-card-amber-hover: #B45309;
  --color-card-amber-soft: rgba(217, 119, 6, 0.1);
  --color-card-blue: #2563EB;
  --color-card-blue-hover: #1D4ED8;
  --color-card-blue-soft: rgba(37, 99, 235, 0.1);

  /* Bluish-Bright Mode Surfaces & Borders (Default) */
  --color-bg-body: #EDF5FF;
  --color-bg-light: #E1EEFF;
  --color-bg-subtle: #D2E5FF;
  --surface-card: #F7FBFF;
  --surface-elevated: #FFFFFF;
  --surface-muted: #E4F0FF;
  --surface-glass: rgba(237, 245, 255, 0.90);
  --color-border: #C2DAFA;
  --border-hairline: rgba(29, 78, 216, 0.10);
  --border-strong: rgba(29, 78, 216, 0.18);
  --color-border-focus: #0284C7;

  /* Typography Colors */
  --color-text-title: #0B1E40;
  --color-text-body: #1E3A5F;
  --color-text-muted: #476589;
  --color-text-light: #6482A6;

  /* Status & Credential Accents */
  --color-gold: #F59E0B;
  --color-gold-light: #FEF3C7;
  --color-gold-text: #92400E;
  --color-success: #10B981;
  --color-success-bg: #ECFDF5;
  --color-danger: #EF4444;

  /* ------------------------------------------------------------------------
     2. Modular Typography Scale & Pairing
     ------------------------------------------------------------------------ */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: clamp(1.75rem, 2.8vw, 2.25rem);
  --text-4xl: clamp(2.25rem, 4.2vw, 3.35rem);

  /* ------------------------------------------------------------------------
     3. Strict 4px / 8px Spatial Scale
     ------------------------------------------------------------------------ */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5.5rem;  /* 88px */

  /* ------------------------------------------------------------------------
     4. Layered Ambient Shadows & Precision Radii
     ------------------------------------------------------------------------ */
  --shadow-xs: 0 1px 2px rgba(15, 58, 157, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 58, 157, 0.07), 0 1px 2px rgba(15, 58, 157, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 58, 157, 0.08), 0 2px 6px -1px rgba(15, 58, 157, 0.05);
  --shadow-lg: 0 12px 28px -4px rgba(15, 58, 157, 0.11), 0 4px 10px -2px rgba(15, 58, 157, 0.05);
  --shadow-xl: 0 24px 48px -8px rgba(15, 58, 157, 0.15), 0 8px 16px -4px rgba(15, 58, 157, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* ------------------------------------------------------------------------
     5. Physics-Based Motion Curves (150-300ms micro, 400-700ms macro)
     ------------------------------------------------------------------------ */
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 180ms var(--ease-out-expo);
  --transition-normal: 260ms var(--ease-out-expo);
  --transition-slow: 500ms var(--ease-out-expo);

  /* Layout Constants */
  --max-width: 1220px;
  --container-padding: 1.5rem;
  --header-height: 76px;
  --topbar-height: 38px;
}

/* ==========================================================================
   Dark Mode Theme Tokens ([data-theme="dark"])
   ========================================================================== */
[data-theme="dark"] {
  --color-navy-dark: #07111E;
  --color-navy: #0F233C;
  --color-navy-light: #1E3A5F;
  --color-navy-muted: #334E68;

  --gradient-hero: linear-gradient(95deg, #051329 0%, #071C3D 15%, #0C2B57 30%, #154078 45%, #235C9E 60%, #3F7FC7 73%, #70A8E6 84%, #AECFF6 92%, #E2EEFC 97%, #F6FAFF 100%);

  --color-bg-body: #070D17;
  --color-bg-light: #0B1322;
  --color-bg-subtle: #111C30;
  --surface-card: #0F1829;
  --surface-elevated: #152238;
  --surface-muted: #0B1322;
  --surface-glass: rgba(11, 19, 34, 0.84);
  --color-border: rgba(255, 255, 255, 0.09);
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --color-text-title: #F8FAFC;
  --color-text-body: #CBD5E1;
  --color-text-muted: #94A3B8;
  --color-text-light: #64748B;

  --color-teal-light: rgba(0, 152, 166, 0.2);
  --color-teal-subtle: rgba(0, 152, 166, 0.12);
  --color-gold-light: rgba(245, 158, 11, 0.16);
  --color-gold-text: #FCD34D;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 28px 56px -8px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  font-family: var(--font-body);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  color: var(--color-text-body);
  background-color: var(--color-bg-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

main {
  flex: 1 0 auto;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   Typography Hierarchy & Measure Discipline
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.032em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.425rem);
  letter-spacing: -0.018em;
}

h4 {
  font-size: 1.075rem;
  letter-spacing: -0.01em;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* Tabular numerals for metrics, phone numbers, badges, and tables */
.tabular-nums,
.hero-trust-value,
.top-bar-badge,
.badge,
.dest-comparison-table td,
.journey-step-number {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Layout Containers & Section Rhythm
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding: var(--space-20) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

.section-bg-light {
  background-color: var(--color-bg-light);
}

.section-bg-navy {
  background-color: var(--color-navy);
  color: #FFFFFF;
}

.page-hero-banner {
  border-bottom: none !important;
  background: linear-gradient(
    95deg,
    #051329 0%,
    #071C3D 15%,
    #0C2B57 30%,
    #154078 45%,
    #235C9E 60%,
    #3F7FC7 73%,
    #70A8E6 84%,
    #AECFF6 92%,
    #E2EEFC 97%,
    #F6FAFF 100%
  ) !important;
  color: #FFFFFF !important;
  padding: 4rem 0 4.5rem !important;
  position: relative;
  overflow: hidden;
}

.page-hero-title {
  color: #FFFFFF !important;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-3);
}

.page-hero-lead {
  color: #E2EEFC !important;
  font-size: var(--text-lg);
  max-width: 72ch;
  line-height: 1.7;
}

.page-hero-banner .badge,
.page-hero-banner .badge-teal {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5EEAD4 !important;
  background: rgba(94, 234, 212, 0.12) !important;
  border: 1px solid rgba(94, 234, 212, 0.28) !important;
  padding: 0.42rem 1.1rem !important;
  border-radius: var(--radius-full) !important;
  display: inline-block;
  margin-bottom: 1.25rem;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-12);
}

.section-header.text-left {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-teal);
  background: var(--color-teal-subtle);
  border: 1px solid rgba(0, 152, 166, 0.18);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.section-title {
  margin-bottom: var(--space-4);
  position: relative;
}

.section-title.accent-bar::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-teal), var(--color-sky-blue));
  border-radius: var(--radius-full);
  margin-top: var(--space-3);
}

.section-header.text-center .section-title.accent-bar::after {
  margin-left: auto;
  margin-right: auto;
}

.section-description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 64ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.section-header.text-left .section-description {
  margin-left: 0;
}

.section-bg-navy .section-description {
  color: rgba(255, 255, 255, 0.82);
}

/* ==========================================================================
   Buttons & Tactile Micro-Interactions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  padding: 0.78rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--color-teal);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(0, 152, 166, 0.24);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-teal-dark);
  color: #FFFFFF;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(0, 152, 166, 0.34);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #FFFFFF;
  color: var(--color-navy-dark);
  border-color: #FFFFFF;
  transform: translateY(-1.5px);
}

.btn-navy {
  background-color: var(--color-navy);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .btn-navy {
  background-color: #1E3A5F;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-navy:hover:not(:disabled) {
  background-color: var(--color-navy-dark);
  color: #FFFFFF;
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-navy:hover:not(:disabled) {
  background-color: #254773;
}

.btn-amber {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.28);
}

.btn-amber:hover:not(:disabled) {
  background: linear-gradient(180deg, #D97706 0%, #B45309 100%);
  color: #FFFFFF;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.38);
}

.btn-outline-navy {
  background-color: transparent;
  color: var(--color-text-title);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-outline-navy:hover:not(:disabled) {
  background-color: var(--color-text-title);
  color: var(--color-bg-body);
  border-color: var(--color-text-title);
  transform: translateY(-1.5px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.925rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* ==========================================================================
   Badges & Micro Components
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}

.badge-teal {
  background-color: var(--color-teal-light);
  color: var(--color-teal-dark);
  border-color: rgba(0, 152, 166, 0.2);
}

[data-theme="dark"] .badge-teal {
  color: #5EEAD4;
}

.badge-gold {
  background-color: var(--color-gold-light);
  color: var(--color-gold-text);
  border-color: rgba(245, 158, 11, 0.28);
}

.badge-qeac {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #78350F;
  border: 1px solid #F59E0B;
  font-weight: 800;
  padding: 0.38rem 0.9rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}

/* ==========================================================================
   Keyframe Animations & Reduced Motion Accessibility
   ========================================================================== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* ==========================================================================
   Helper Utilities
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ==========================================================================
   Bluish-Bright Mode Enhancements (Default / [data-theme="light"])
   Toggled via the Header Theme Switcher Button
   ========================================================================== */
html:not([data-theme="dark"]) .top-bar {
  background: linear-gradient(90deg, #0F3A9D 0%, #1D5ED8 50%, #0284C7 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

html:not([data-theme="dark"]) .top-bar-item {
  color: #DBEAFE;
}

html:not([data-theme="dark"]) .top-bar-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #FEF08A;
  border-color: rgba(254, 240, 138, 0.4);
}

html:not([data-theme="dark"]) .hero-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

html:not([data-theme="dark"]) .hero-aurora-orb.orb-teal {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.65) 0%, transparent 70%);
  opacity: 0.55;
}

html:not([data-theme="dark"]) .hero-aurora-orb.orb-amber {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.55) 0%, transparent 70%);
  opacity: 0.50;
}

html:not([data-theme="dark"]) .hero-aurora-orb.orb-sky {
  background: radial-gradient(circle, rgba(125, 211, 252, 0.55) 0%, transparent 70%);
  opacity: 0.55;
}

html:not([data-theme="dark"]) .hero-eyebrow-welcome {
  color: #FEF08A;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 4px 16px rgba(15, 58, 157, 0.2);
}

html:not([data-theme="dark"]) .hero-cycling-dest {
  background: linear-gradient(90deg, #A5F3FC 0%, #FEF08A 55%, #FCD34D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom-color: rgba(254, 240, 138, 0.65);
}

html:not([data-theme="dark"]) .hero-bottom-bar {
  background: rgba(12, 48, 128, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 18px 40px rgba(11, 38, 102, 0.28);
}

html:not([data-theme="dark"]) .hero-dest-switcher-label {
  color: #E0F2FE;
}

html:not([data-theme="dark"]) .hero-dest-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #FFFFFF;
}

html:not([data-theme="dark"]) .hero-dest-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #BAE6FD;
}

html:not([data-theme="dark"]) .hero-dest-pill.active {
  background: linear-gradient(135deg, #0098A6 0%, #0284C7 100%);
  border-color: #FEF08A;
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.45);
}

html:not([data-theme="dark"]) .dest-spotlight-card {
  background: linear-gradient(135deg, #1344AE 0%, #1E64E8 55%, #0284C7 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 48px -8px rgba(21, 78, 194, 0.28);
}

html:not([data-theme="dark"]) .dest-spotlight-right {
  background: rgba(11, 36, 98, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

html:not([data-theme="dark"]) .site-footer {
  background: linear-gradient(180deg, #0F3A9D 0%, #0A2770 100%);
}
