/* ===================================================================
   LEVEL UP TUTORING — Design Tokens
   Concept: a calm, steady hand helping a kid climb to the next level.
   Every visual decision below derives from these variables. No ad-hoc
   hex values or one-off sizes anywhere else in this file.
=================================================================== */

:root {
  /* Color */
  --bg: #FAF7F1;
  --surface: #FFFFFF;
  --surface-alt: #F1ECE1;
  --text: #1C2B39;
  --text-muted: #5B6B7A;
  --navy: #1D3557;
  --navy-hover: #16283F;
  --navy-rgb: 29, 53, 87;
  --gold: #C08A28;
  --gold-hover: #A8741E;
  --gold-rgb: 192, 138, 40;
  --border: #E4DDD0;
  --success-bg: #EEF4EC;
  --success-text: #2F5233;
  --error-bg: #FBEEEE;
  --error-text: #8C3A3A;

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing (base unit 8px) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 128px;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  /* Shadow — built from the navy hue, never pure black */
  --shadow-sm: 0 2px 8px rgba(var(--navy-rgb), 0.08);
  --shadow-md: 0 8px 24px rgba(var(--navy-rgb), 0.12);
  --shadow-lg: 0 16px 40px rgba(var(--navy-rgb), 0.16);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 140ms;
  --dur-standard: 260ms;
  --dur-entrance: 640ms;
  --dur-reveal: 1150ms;

  /* Layout */
  --container-width: 1120px;
}

/* ===================================================================
   Reset & base
=================================================================== */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: 72px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); font-weight: 600; }

p { margin: 0 0 var(--space-2); overflow-wrap: break-word; }

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

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

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

::selection {
  background: var(--gold);
  color: var(--surface);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-hover);
  margin-bottom: var(--space-2);
}

.section {
  padding: var(--space-7) 0;
  scroll-margin-top: 88px;
}

.section-alt {
  background: var(--surface-alt);
}

.section-divider {
  border-top: 1px solid var(--border);
}

.section-lead {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ===================================================================
   Signature mark — ascending steps/chevron, the one signature element
=================================================================== */

.mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--gold);
}

/* ===================================================================
   Navigation
=================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 100;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  padding: 0 var(--space-3);
  max-width: var(--container-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--navy);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links a:not(.btn) {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding: var(--space-1) 0;
}

.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-standard) var(--ease-out);
}

.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn)[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-links a:not(.btn)[aria-current="page"] {
  color: var(--navy);
}

.nav-cta .btn {
  color: var(--surface);
  padding: 11px 22px;
  font-size: 0.92rem;
}

.nav-cta {
  display: inline-flex;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--dur-standard) var(--ease-in-out), opacity var(--dur-standard) var(--ease-in-out);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================================================================
   Buttons — physical, coordinated feedback
=================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-micro) var(--ease-out),
              box-shadow var(--dur-standard) var(--ease-out),
              background-color var(--dur-standard) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover {
  background: var(--navy-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-block {
  width: 100%;
}

/* ===================================================================
   Hero
=================================================================== */

.hero {
  position: relative;
  padding: var(--space-7) 0 var(--space-6);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: center;
}

.hero-copy .lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  height: 340px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Ascending books — the signature visual, pure CSS, no images to break */
.books {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  width: 100%;
  max-width: 360px;
}

.book {
  flex: 1;
  border-radius: 6px 14px 14px 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.book-1 { height: 90px; background: linear-gradient(160deg, var(--surface) 0%, var(--surface-alt) 100%); }
.book-2 { height: 150px; background: linear-gradient(160deg, var(--surface) 0%, var(--surface-alt) 100%); }
.book-3 {
  height: 220px;
  background: var(--navy);
  border-color: var(--navy);
}

.book-3::after {
  content: '★';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
}

/* ===================================================================
   Cards
=================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: transform var(--dur-standard) var(--ease-out), box-shadow var(--dur-standard) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(var(--gold-rgb), 0.14);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.card-icon svg { width: 22px; height: 22px; }

/* ===================================================================
   Process steps (real sequence — numbering is earned here)
=================================================================== */

.process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
  counter-reset: process;
}

.process-step {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-standard) var(--ease-out), box-shadow var(--dur-standard) var(--ease-out);
}

.process-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.process-step::before {
  counter-increment: process;
  content: counter(process, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: var(--space-2);
}

/* ===================================================================
   CTA band
=================================================================== */

.cta-band {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  color: var(--surface);
  box-shadow: var(--shadow-lg);
}

.cta-band h2 { color: var(--surface); }
.cta-band p { color: rgba(255,255,255,0.75); max-width: 520px; margin-left: auto; margin-right: auto; }

.cta-band .btn-primary {
  background: var(--surface);
  color: var(--navy);
}
.cta-band .btn-primary:hover { background: var(--surface-alt); }

/* ===================================================================
   Footer
=================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0 var(--space-4);
  margin-top: var(--space-7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-4);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.footer-col a, .footer-col p {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-1);
  transition: color var(--dur-standard) var(--ease-out);
}

.footer-col a:hover { color: var(--navy); }

.footer-bottom {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* ===================================================================
   Forms
=================================================================== */

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.form-row {
  margin-bottom: var(--space-3);
}

.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--dur-standard) var(--ease-out), box-shadow var(--dur-standard) var(--ease-out);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(var(--navy-rgb), 0.12);
  outline: none;
}

textarea { resize: vertical; min-height: 110px; }

.form-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.form-note-quiet {
  font-size: 0.8rem;
  font-style: italic;
}

.form-status {
  display: none;
  margin-top: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.form-status.is-visible { display: block; }
.form-status.is-success { background: var(--success-bg); color: var(--success-text); }
.form-status.is-error { background: var(--error-bg); color: var(--error-text); }

/* ===================================================================
   Page header (for interior pages)
=================================================================== */

.page-header {
  padding: var(--space-6) 0 var(--space-4);
  text-align: center;
}

.page-header .section-lead { margin: 0 auto; text-align: center; }

/* ===================================================================
   About page bio
=================================================================== */

.bio-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-6);
  align-items: start;
}

.bio-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--surface-alt), var(--surface));
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.credential-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ===================================================================
   Subjects page
=================================================================== */

.subject-block {
  display: grid;
  grid-template-columns: 0.35fr 0.65fr;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.subject-block:last-child { border-bottom: none; }

.subject-block h3 { color: var(--navy); }

/* ===================================================================
   Scroll reveal (JS adds .in-view; content visible without it)
=================================================================== */

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
}

.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Hero load sequence, only when JS confirms it can run */
.js .load-seq > * {
  opacity: 0;
  transform: translateY(16px);
}

.js .load-seq.is-ready > * {
  animation: rise var(--dur-entrance) var(--ease-out) forwards;
}

.js .load-seq.is-ready > *:nth-child(1) { animation-delay: 0ms; }
.js .load-seq.is-ready > *:nth-child(2) { animation-delay: 90ms; }
.js .load-seq.is-ready > *:nth-child(3) { animation-delay: 180ms; }
.js .load-seq.is-ready > *:nth-child(4) { animation-delay: 270ms; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ===================================================================
   Responsive
=================================================================== */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .hero-visual { height: 220px; order: -1; }
  .card-grid { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .bio-grid { grid-template-columns: 1fr; }
  .subject-block { grid-template-columns: 1fr; gap: var(--space-1); }
  .form-row-split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { 
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-2) var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-standard) var(--ease-out), transform var(--dur-standard) var(--ease-out);
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a:not(.btn) {
    width: 100%;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:not(.btn):last-of-type { border-bottom: none; }
  .nav-cta { width: 100%; margin-top: var(--space-2); }
  .nav-cta .btn { width: 100%; padding: 14px 0; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .section { padding: var(--space-6) 0; }
  .cta-band { padding: var(--space-4); }
}

/* ===================================================================
   Reduced motion
=================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal,
  .js .load-seq > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .btn, .card, .nav-links a::after {
    transition: none !important;
  }
}
