/* Keats Learning Academy — Design Tokens */

/* Route transition tokens — single source of truth. Tune the whole
   transition system from these four variables. */
:root {
  --t-exit-dur: 180ms;
  --t-enter-dur: 240ms;
  --t-exit-ease: cubic-bezier(0.4, 0, 1, 1);
  --t-enter-ease: cubic-bezier(0, 0, 0.2, 1);
}

/* Top progress bar (mounted by shared-assets/RouteTransition.js).
   z-index 100000 so it sits ABOVE the branded loader overlay (99999). */
.route-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 100000; pointer-events: none;
}
.route-progress .route-progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--navy-700, #21346e), var(--gold-500, #d9a24a));
  box-shadow: 0 0 8px rgba(217, 162, 74, 0.5);
  transition: width 250ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
  border-radius: 0 2px 2px 0;
}
.route-progress[data-state="active"] .route-progress-bar { width: 75%; }
.route-progress[data-state="done"]   .route-progress-bar { width: 100%; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .route-progress .route-progress-bar { transition: width 80ms ease, opacity 80ms ease; }
}

/* ====================================================================
   Branded route-loading overlay (#keats-loader). Sits between the page
   and the progress bar (z-index 99999, with progress bar at 100000).
   Markup is injected once per page before </body> — see the codemod in
   shared-assets/RouteTransition.js. JS handlers in that same file
   show/hide the overlay around cross-document navigations.
   ==================================================================== */
:root {
  /* Navy hero gradient — matches the site's heroes */
  --ov-bg: linear-gradient(165deg, #0d1530 0%, #131d3f 55%, #1a2652 100%);
  --ov-fade-in: 80ms;
  --ov-fade-out: 100ms;
  --ov-ease-in: cubic-bezier(0.22, 1, 0.36, 1);
  --ov-ease-out: cubic-bezier(0.4, 0, 1, 1);
}

.keats-loader {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: var(--ov-bg);
  opacity: 0; pointer-events: none;
  transition: opacity var(--ov-fade-out) var(--ov-ease-out);
}
/* .show: animated fade-in (used on the click-source page).
   html.keats-navigating: instant — visible on the new page's first
   paint, so the user sees a continuous branded overlay across the
   page boundary. */
.keats-loader.show {
  opacity: 1; pointer-events: auto;
  transition: opacity var(--ov-fade-in) var(--ov-ease-in);
}
html.keats-navigating .keats-loader {
  opacity: 1; pointer-events: auto;
  transition: none;
}

.keats-loader .stack {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  position: relative; z-index: 1;
  /* Always at rest position. The wordmark itself doesn't move
     (no settle animation, no breathing), so navigation feels snappy. */
}

.keats-loader .wordmark {
  font-family: var(--font-display, 'Rubik', system-ui, sans-serif);
  font-size: 60px; line-height: 1; font-weight: 600;
  letter-spacing: -0.025em;
  color: #fff;
  display: flex; align-items: center;
}
.keats-loader .wordmark .dot {
  color: var(--gold-400, #e6b968);
  margin-left: 2px;
  animation: keatsDotPulse 1.6s ease-in-out infinite;
}
.keats-loader .tagline {
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-300, #f0cf92); font-weight: 600; opacity: 0.85;
  display: flex; align-items: center; gap: 14px;
}
.keats-loader .tagline::before,
.keats-loader .tagline::after {
  content: ""; width: 18px; height: 1px;
  background: var(--gold-300, #f0cf92); opacity: 0.5;
}

@keyframes keatsDotPulse {
  0%, 100% { opacity: 1;    transform: translateY(0);   }
  50%      { opacity: 0.45; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .keats-loader .wordmark .dot { animation: none; }
}

@media (max-width: 600px) {
  .keats-loader .wordmark { font-size: 44px; }
  .keats-loader .tagline  { font-size: 10px; letter-spacing: 0.18em; }
}

html { scroll-behavior: smooth; }
:root {
  /* Primary navy palette */
  --navy-950: #0d1530;
  --navy-900: #131d3f;
  --navy-800: #1a2652;
  --navy-700: #21346e;   /* user-specified brand */
  --navy-600: #2c4389;
  --navy-500: #3d56a8;
  --navy-400: #6c7fc4;
  --navy-300: #a3b0db;
  --navy-200: #cdd4ec;
  --navy-100: #e8ecf7;
  --navy-50:  #f3f5fb;

  /* Warm academic accent — gold */
  --gold-600: #b78838;
  --gold-500: #d9a24a;
  --gold-400: #e6b968;
  --gold-300: #f0cf92;
  --gold-100: #f7e7c5;
  --gold-50:  #fbf3e0;

  /* Neutrals — warm, not pure */
  --ink:      #0a0e1e;
  --ink-soft: #161a20;
  --paper:    #fafaf7;
  --paper-2:  #f2f1ea;
  --line:     rgba(13, 21, 48, 0.10);
  --line-strong: rgba(13, 21, 48, 0.18);

  /* Type */
  --font-display: 'Rubik', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Scale */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(13,21,48,0.06), 0 2px 8px rgba(13,21,48,0.04);
  --shadow:    0 4px 10px rgba(13,21,48,0.08), 0 20px 50px rgba(13,21,48,0.10);
  --shadow-lg: 0 10px 30px rgba(13,21,48,0.14), 0 40px 100px rgba(13,21,48,0.20);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Utility: container */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px) { .container { padding: 0 40px; } }
@media (min-width: 1200px) { .container { padding: 0 64px; } }

/* Display utility */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--navy-500);
}

/* Scroll reveal base */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Selection */
::selection {
  background: var(--gold-300);
  color: var(--ink);
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-200); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-300); }

/* Noise texture for hero */
.noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
  opacity: 0.06;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track { animation: marquee 40s linear infinite; }

/* Float shapes */
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(3deg); }
}
@keyframes floaty2 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(12px) rotate(-4deg); }
}
.floaty { animation: floaty 8s ease-in-out infinite; }
.floaty-2 { animation: floaty2 10s ease-in-out infinite; }

/* Pulse dot */
@keyframes pulse-ring {
  0% { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}
