/* Project PathBuilder — shared site kit
   Palette: deep navy / warm gold / off-white / navy-charcoal.

   Two kinds of color tokens on purpose:
   - Semantic tokens (--pb-page-bg, --pb-surface, --pb-ink, ...) FLIP
     between light and dark mode — these drive normal page chrome
     (header, body text).
   - Fixed "band" tokens (--pb-band-*, --pb-footer-*) do NOT flip — the
     hero and footer are always a dark navy / near-black band with light
     text, regardless of site theme, the same way they'd look on any
     marketing page. Using the flipping tokens there was an earlier bug:
     in dark mode it made hero/footer text turn dark-on-dark and nearly
     unreadable.

   Where noted, semantic tokens are mirrored onto Jelly UI's documented
   --jelly-color-* custom properties so its components (jelly-badge,
   jelly-theme, etc.) pick up the same palette instead of their own
   defaults. Harmless if the exact property names Jelly ships differ —
   unknown custom properties are simply ignored. */

:root {
  /* semantic — flip with theme */
  --pb-page-bg: #f8f8f6;
  --pb-page-bg-soft: #edeff1;
  --pb-surface: #ffffff;
  --pb-ink: #232430;
  --pb-ink-soft: #5b5d6b;
  --pb-border: #dde1e6;
  --pb-focus: #a97f2e;

  --pb-primary: #1c2b4a;
  --pb-primary-dark: #142138;
  --pb-primary-soft: #e7ebf2;
  --pb-accent: #c99a3e;
  --pb-accent-dark: #a97f2e;
  --pb-accent-soft: #f6ecd4;

  /* fixed — same in light and dark mode */
  --pb-band-start: #14213a;
  --pb-band-end: #1c2b4a;
  --pb-band-text: #f8f5ec;
  --pb-band-text-soft: rgba(248, 245, 236, 0.9);
  --pb-footer-bg: #14131a;
  --pb-footer-text: #cfc9b0;
  --pb-footer-text-strong: #f8f5ec;

  --pb-radius: 12px;
  --pb-radius-sm: 8px;
  --pb-shadow: 0 6px 20px rgba(20, 33, 56, 0.12);
  --pb-max: 1120px;
  --pb-font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;

  --jelly-color-primary: var(--pb-primary);
  --jelly-color-accent: var(--pb-accent);
  --jelly-color-surface: var(--pb-surface);
  --jelly-color-background: var(--pb-page-bg);
  --jelly-color-text: var(--pb-ink);
  --jelly-color-border: var(--pb-border);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --pb-page-bg: #171b26;
  --pb-page-bg-soft: #1e2230;
  --pb-surface: #1c2029;
  --pb-ink: #ece9dc;
  --pb-ink-soft: #b7b3a0;
  --pb-border: #383a48;
  --pb-focus: #e0b04a;

  --pb-primary: #5878b0;
  --pb-primary-dark: #7a94c4;
  --pb-primary-soft: #202840;
  --pb-accent: #e0b04a;
  --pb-accent-dark: #f0c46a;
  --pb-accent-soft: #332a16;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --pb-page-bg: #171b26;
    --pb-page-bg-soft: #1e2230;
    --pb-surface: #1c2029;
    --pb-ink: #ece9dc;
    --pb-ink-soft: #b7b3a0;
    --pb-border: #383a48;
    --pb-focus: #e0b04a;

    --pb-primary: #5878b0;
    --pb-primary-dark: #7a94c4;
    --pb-primary-soft: #202840;
    --pb-accent: #e0b04a;
    --pb-accent-dark: #f0c46a;
    --pb-accent-soft: #332a16;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--pb-font);
  background: var(--pb-page-bg);
  color: var(--pb-ink);
  line-height: 1.6;
}

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

a { color: var(--pb-primary); }
a:hover { color: var(--pb-accent-dark); }

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

.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;
}

.wrap { max-width: var(--pb-max); margin: 0 auto; padding: 0 1.75rem; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--pb-surface);
  color: var(--pb-ink);
  padding: .75rem 1rem;
  border-radius: 0 0 var(--pb-radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / utility bar / hamburger nav ---------- */

.site-header {
  background: var(--pb-surface);
  border-bottom: 1px solid var(--pb-border);
}

.topbar {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.75rem;
}

/* Hamburger sits in the right-side action area. */
.hamburger {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--pb-border);
  border-radius: 50%;
  background: var(--pb-page-bg-soft);
  color: var(--pb-ink-soft);
  cursor: pointer;
}
.hamburger:hover { border-color: var(--pb-accent); color: var(--pb-ink); }

.hamburger-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform .22s ease, opacity .22s ease;
}
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.brand { display: flex; align-items: center; line-height: 1.2; text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.15rem; color: var(--pb-primary); }

.utility-bar { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ---------- Desktop nav (landing page) ----------
   On the home page (.page-home) the topbar becomes a full desktop nav bar
   at wider viewports: left primary links, right action links + menu toggle.
   On mobile, the hamburger and collapsible .site-nav take over instead. */

/* Desktop nav elements — hidden on mobile by default */
.desktop-nav-links,
.desktop-nav-actions {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-direction: row;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

@media (min-width: 768px) {
  /* Show desktop nav elements while keeping the menu toggle on the right. */
  .page-home .desktop-nav-links { display: flex; gap: .25rem; }
  .page-home .desktop-nav-actions { display: flex; gap: .5rem; }

  /* Generous topbar height on desktop */
  .page-home .topbar { padding: 1rem 1.75rem; }
}

/* Desktop nav left links */
.desktop-nav-links a {
  display: block;
  padding: .45rem .75rem;
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  color: var(--pb-ink-soft);
  border-radius: var(--pb-radius-sm);
  transition: color .15s ease, background-color .15s ease;
}
.desktop-nav-links a:hover,
.desktop-nav-links a:focus-visible {
  color: var(--pb-ink);
  background: var(--pb-page-bg-soft);
}

/* Desktop nav right: Student Login / Parent Login as styled buttons */
.nav-login-btn {
  display: inline-flex;
  align-items: center;
  padding: .4rem .95rem;
  border-radius: var(--pb-radius-sm);
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
  border: 2px solid var(--pb-primary);
  color: var(--pb-primary);
  background: transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.nav-login-btn:hover,
.nav-login-btn:focus-visible {
  background: var(--pb-primary);
  color: var(--pb-surface);
}
.nav-login-outline {
  border-color: var(--pb-border);
  color: var(--pb-ink-soft);
}
.nav-login-outline:hover,
.nav-login-outline:focus-visible {
  border-color: var(--pb-primary);
  color: var(--pb-primary);
  background: var(--pb-primary-soft);
}

/* Collapsible nav panel — hidden until the hamburger opens it, on every
   viewport size (not just mobile), per design direction. */
.site-nav {
  display: none;
  border-top: 1px solid var(--pb-border);
}
.site-nav.is-open { display: block; }
.site-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: .4rem 0;
}
.site-nav li { border-bottom: 1px solid var(--pb-border); }
.site-nav li:last-child { border-bottom: 0; }
.site-nav a {
  display: block;
  padding: .7rem .1rem;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  color: var(--pb-ink-soft);
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--pb-accent-dark); }
.site-nav a[aria-current="page"] { color: var(--pb-primary); text-decoration: underline; }

/* ---------- Hero (fixed dark band, same in both themes) ---------- */

.hero {
  background: linear-gradient(160deg, var(--pb-band-start), var(--pb-band-end));
  color: var(--pb-band-text);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  transition: background-color .2s ease;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--pb-accent);
  opacity: .95;
}
.hero h1 {
  margin: .5rem 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.1;
  color: var(--pb-band-text);
}
.hero p.lede {
  max-width: 62ch;
  font-size: 1.1rem;
  color: var(--pb-band-text-soft);
}

.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.75rem; }

/* Primary CTAs are plain native <a> links, not jelly-button — jelly-button
   has no href, so it can't be a real navigable element without wrapping
   tricks that create nested-interactive-element accessibility problems.
   Jelly's tactile "squish" effect is canvas+JS physics, not CSS, and is
   press-triggered rather than hover-triggered in their own docs, so it
   can't be borrowed as-is either. This is a hand-built approximation:
   a springy hover lift (overshoot easing) that's deliberately quiet on
   click/active, since that was the specific ask — motion on hover, not
   on click. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: var(--pb-radius-sm);
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow .2s ease, background-color .2s ease,
              border-color .2s ease, color .2s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 10px 22px rgba(10, 16, 28, .25);
}
.btn:active {
  transform: translateY(-1px) scale(1.01);
  transition-duration: .06s;
  transition-timing-function: ease-out;
  box-shadow: 0 4px 10px rgba(10, 16, 28, .2);
}
.btn-primary { background: var(--pb-accent); color: var(--pb-band-end); }
.btn-primary:hover { background: var(--pb-accent-dark); }
.btn-outline { background: transparent; color: var(--pb-band-text); border-color: rgba(248, 245, 236, .55); }
.btn-outline:hover { border-color: var(--pb-band-text); }

/* ---------- Sections ---------- */

main section { padding: clamp(2.25rem, 5vw, 3.5rem) 0; }
main section + section { border-top: 1px solid var(--pb-border); }

h2 {
  color: var(--pb-primary);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-top: 0;
}

/* Course info: an editorial accent-rule treatment (no box, no shadow,
   sits directly on the page background) rather than a card. */
.course-info {
  border-left: 4px solid var(--pb-accent);
  padding-left: 1.5rem;
}
.course-title { font-size: 1.3rem; font-weight: 800; color: var(--pb-ink); margin: 0; }
.course-desc { color: var(--pb-ink-soft); margin: .5rem 0 .75rem; line-height: 1.6; }
.course-meta { color: var(--pb-ink-soft); margin: .35rem 0 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
/* Plain styled spans, not jelly-badge — confirmed via testing that
   jelly-badge paints its fill/label to canvas once on load and doesn't
   repaint when those CSS custom properties change later (e.g. our dark
   mode toggle), leaving stale/invisible text. Native markup is fully
   reliable here and looks identical. */
.chip {
  display: inline-block;
  background: var(--pb-accent-soft);
  color: var(--pb-accent-dark);
  border: 1px solid var(--pb-border);
  border-radius: 999px;
  padding: .3rem .75rem;
  font-size: .82rem;
  font-weight: 700;
}
.chip-alt {
  background: var(--pb-primary-soft);
  color: var(--pb-primary);
}

/* Jelly UI custom elements: ensure sane layout even if the script from
   jelly-ui.com fails to load (network blocked, CDN down, etc). Native
   controls (buttons, nav, toggles) never depend on Jelly UI at all. */
jelly-theme { display: block; }

/* Principle / feature list: a plain list with a small accent mark
   instead of a repeated grid of bordered cards. */
.principle-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 2rem;
}
.principle-list li {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  font-weight: 600;
  color: var(--pb-ink);
  padding: .65rem 0;
  border-bottom: 1px solid var(--pb-border);
}
.principle-mark {
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--pb-accent);
  transform: translateY(-2px);
}

/* Promoted statement list: larger, bolder, no bullets/borders — distinct
   from .principle-list (still used as-is on the parents page) since these
   read as short standalone headline statements, not a supporting list.
   Centered flex-wrap rather than a fixed column count so it stays balanced
   regardless of how many statements end up in the list. */
.promo-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem 2.5rem;
}
.promo-list li {
  flex: 0 1 260px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--pb-primary);
}

/* A single statement promoted out of the list above into its own larger,
   more prominent block. */
.promo-feature {
  margin-top: 2rem;
  padding: 1.75rem 2rem;
  background: var(--pb-primary-soft);
  border-radius: var(--pb-radius);
  text-align: center;
}
.promo-feature p {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--pb-primary);
}

.overview-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--pb-accent-dark);
}
.overview-link:hover { color: var(--pb-primary); }

/* Inside .promo-feature it's the sole content of the box, not a small
   trailing link, so it gets the same prominent treatment as the box
   itself was giving a plain statement. */
.promo-feature .overview-link {
  margin-top: 0;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 800;
}

.callout {
  background: var(--pb-primary-soft);
  border-left: 6px solid var(--pb-primary);
  border-radius: var(--pb-radius);
  padding: 1.25rem 1.5rem;
}
.callout p { margin: 0; color: var(--pb-ink); }

/* ---------- Public forms ----------
   Native controls by design: they preserve browser validation, autofill,
   reliable form submission, and no-JavaScript behavior. Jelly UI remains an
   optional enhancement layer for theme/toast feedback, not the form engine. */

.content-section {
  background: var(--pb-page-bg);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

.content-copy {
  max-width: 74ch;
}

.content-copy h2 {
  margin-top: 2rem;
}

.content-copy h2:first-child {
  margin-top: 0;
}

.content-copy ul {
  padding-left: 1.25rem;
}

.contact-form {
  max-width: 720px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field,
.form-actions {
  margin-top: 1rem;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label,
.form-label {
  display: block;
  margin-bottom: .35rem;
  color: var(--pb-ink);
  font-weight: 800;
  font-size: .92rem;
}

.form-hint {
  margin: .35rem 0 0;
  color: var(--pb-ink-soft);
  font-size: .88rem;
  line-height: 1.45;
}

.form-boundary-note {
  max-width: 72ch;
  margin-top: .85rem;
}

.form-control {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-sm);
  background: var(--pb-surface);
  color: var(--pb-ink);
  padding: .72rem .85rem;
  font: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(20, 33, 56, .06);
}

.form-control:focus {
  border-color: var(--pb-focus);
  outline: 3px solid color-mix(in srgb, var(--pb-focus) 32%, transparent);
  outline-offset: 1px;
}

textarea.form-control {
  min-height: 11rem;
  resize: vertical;
}

.form-feedback {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-radius: var(--pb-radius-sm);
  border: 1px solid var(--pb-border);
  background: var(--pb-primary-soft);
  color: var(--pb-ink);
}

.form-feedback.is-success {
  border-color: color-mix(in srgb, var(--pb-primary) 45%, var(--pb-border));
  background: var(--pb-primary-soft);
}

.form-feedback.is-error {
  border-color: color-mix(in srgb, #b42318 55%, var(--pb-border));
  background: color-mix(in srgb, #b42318 9%, var(--pb-surface));
}

.contact-extra-field {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.info-panel {
  border-left: 4px solid var(--pb-accent);
  padding-left: 1rem;
}

.info-panel h2 {
  margin-top: 0;
}

.info-panel ul {
  margin: .75rem 0 0;
  padding-left: 1.1rem;
}

/* ---------- Feature card grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  padding: 1.5rem;
  box-shadow: var(--pb-shadow);
}

.feature-card h3 {
  color: var(--pb-primary);
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 .6rem;
  line-height: 1.3;
}

.feature-card p {
  color: var(--pb-ink-soft);
  margin: 0;
  font-size: .93rem;
  line-height: 1.6;
}

/* ---------- Project Overview / Initiative section ----------
   Dark navy band — always fixed, same visual weight as the hero. */

.initiative-section {
  background: linear-gradient(160deg, var(--pb-band-start), var(--pb-band-end));
  color: var(--pb-band-text);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.initiative-section h2 {
  color: var(--pb-band-text);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-top: 0;
}

.initiative-section p {
  max-width: 70ch;
  color: var(--pb-band-text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

/* Override the default section border-top — the dark band provides its
   own visual separation from adjacent sections. */
main section.initiative-section { border-top: none; }

/* ---------- Footer (fixed dark band, same in both themes) ---------- */

.site-footer {
  background: var(--pb-footer-bg);
  color: var(--pb-footer-text);
  padding: 2rem 0;
  margin-top: 1rem;
}
.site-footer p { margin: .2rem 0; font-size: .9rem; }
.site-footer strong { color: var(--pb-footer-text-strong); }
.site-footer a { color: var(--pb-accent); text-decoration: underline; }
.site-footer a:hover { color: var(--pb-accent-dark); }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
}
.footer-license {
  margin-top: .85rem !important;
  padding-top: .85rem;
  border-top: 1px solid rgba(216, 208, 184, .2);
  font-size: .8rem !important;
  opacity: .85;
}

/* Compact footer variant used on the landing page */
.footer-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1.5rem;
}
.footer-compact p { margin: 0; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

[data-motion="reduced"] * {
  transition-duration: .001ms !important;
  animation-duration: .001ms !important;
  scroll-behavior: auto !important;
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .content-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .wrap { padding: 0 1.1rem; }
  .feature-card { padding: 1.1rem; }
}

.parent-portal-doorway {
  max-width: 760px;
}

.portal-preview-notice {
  margin-top: 2rem;
}
