/* Shared by every page. Page-specific styles stay inline in each page. */

/* Fonts are served from this site (public/fonts) instead of Google Fonts,
   so visitors' browsers don't contact a third party just to show text. */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/space-grotesk-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

/* Fonts: make Inter the default for everything, so no text can fall back
   to the browser's serif font. Form controls don't inherit fonts by default. */
body { font-family: Inter, system-ui, sans-serif; color: #0F1B2D; }
button, input, select, textarea { font-family: inherit; }

/* Smooth page-to-page transitions (Chrome, Edge, Safari 18.2+; other browsers
   just navigate normally).
   - The old page stays solid underneath while the new one fades in on top,
     so the light page background never shows through mid-fade.
   - The header stays put, on a solid navy backing.
   - The dark hero box at the top of each page resizes smoothly from one
     page's height to the next, and its text crossfades inside it. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-old(page-hero), ::view-transition-new(page-hero) { mix-blend-mode: normal; }
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) { animation: re-page-in 300ms cubic-bezier(.2, .7, .2, 1) both; }

  ::view-transition-group(page-hero) { animation-duration: 340ms; animation-timing-function: cubic-bezier(.2, .7, .2, 1); background-color: #0F1B2D; background-image: radial-gradient(rgba(255,255,255,0.07) 1.2px, transparent 1.6px); background-size: 28px 28px; }
  ::view-transition-image-pair(page-hero) { overflow: clip; }
  ::view-transition-old(page-hero) { animation: re-fade-out 150ms ease-out both; }
  ::view-transition-new(page-hero) { animation: re-fade-in 260ms cubic-bezier(.2, .7, .2, 1) 70ms both; }
}
[data-site-header] { view-transition-name: site-header; }
[data-site-header] + section.dots { view-transition-name: page-hero; }
::view-transition-group(site-header) { animation: none; background-color: #0F1B2D; }
::view-transition-old(site-header) { display: none; }
::view-transition-new(site-header) { animation: none; }
@keyframes re-page-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes re-fade-out { to { opacity: 0; } }
@keyframes re-fade-in { from { opacity: 0; } }

/* Form status messages */
[data-note][data-kind="ok"] { background: #E3F3EF; color: #0F1B2D; }
[data-note][data-kind="error"] { background: #FDECEC; color: #7A1F1F; }
button[disabled] { opacity: .65; cursor: progress; transform: none !important; box-shadow: none !important; }
.re-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* School name suggestions under the school fields (see site.js) */
.re-ac { position: relative; }
.re-ac-list {
  position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin: 6px 0 0; padding: 6px;
  list-style: none; background: #FFFFFF; border: 1.5px solid #C5CCD3; border-radius: 14px;
  box-shadow: 0 22px 44px -20px rgba(15,27,45,.38); max-height: min(340px, 55vh); overflow-y: auto;
  overscroll-behavior: contain; font-weight: 400;
}
.re-ac-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.re-ac-list li[aria-selected="true"] { background: #E3F3EF; }
@media (hover: hover) { .re-ac-list li[role="option"]:hover { background: #F0F7F5; } .re-ac-list li[aria-selected="true"]:hover { background: #E3F3EF; } }
.re-ac-name { font-size: 15px; font-weight: 600; line-height: 1.35; color: #0F1B2D; }
.re-ac-meta { font-size: 14px; line-height: 1.4; color: #4A5568; }
.re-ac-list .re-ac-empty { cursor: default; font-size: 14px; color: #4A5568; }
.re-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Phones and small tablets ---------- */

html { -webkit-text-size-adjust: 100%; }
a, button, label { -webkit-tap-highlight-color: transparent; }

/* Menu button: only shown on small screens */
.re-menu {
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
  width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
  background: transparent; color: #FFFFFF; cursor: pointer;
}
.re-menu span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .32s cubic-bezier(.2,.7,.2,1), opacity .2s; }
[data-open] .re-menu span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
[data-open] .re-menu span:nth-child(2) { opacity: 0; }
[data-open] .re-menu span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1060px) {
  [data-site-header] > div { padding: 12px 20px !important; gap: 0 8px !important; flex-wrap: nowrap !important; }
  [data-site-header][data-open] > div { flex-wrap: wrap !important; }
  [data-site-header] > div > a:first-child { min-width: 0; }
  [data-site-header] > div > a:first-child { gap: 10px !important; }
  [data-site-header] > div > a:first-child svg { width: 34px; height: 34px; }
  [data-site-header] > div > a:first-child span { font-size: 17px !important; white-space: nowrap; }
  [data-site-header] nav { margin-left: auto; flex-wrap: nowrap !important; gap: 8px !important; }
  [data-site-header] nav .btn { padding: 9px 14px !important; font-size: 14px; }
  html.js .re-menu { display: inline-flex; }
  html.js [data-site-header] .navl { display: none !important; }

  /* Open menu: links drop down as full-width rows under the top bar */
  html.js [data-site-header][data-open] nav {
    order: 3; flex: 1 1 100%; flex-direction: column; align-items: stretch !important;
    gap: 0 !important; margin: 8px 0 6px;
  }
  html.js [data-site-header][data-open] .navl {
    display: block !important; padding: 15px 2px !important; font-size: 17px;
    border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: none !important;
  }
  html.js [data-site-header][data-open] nav .btn { margin-top: 14px; padding: 15px !important; font-size: 16px; text-align: center; }
}
@media (max-width: 379px) {
  /* Narrow phones: the name may take two lines so everything fits */
  [data-site-header] > div > a:first-child span { white-space: normal; line-height: 1.1; }
}
@media (max-width: 339px) {
  /* Very narrow phones: Donate lives in the menu so the top bar fits */
  html.js [data-site-header]:not([data-open]) nav .btn { display: none; }
}

@media (max-width: 640px) {
  /* Page edges and section spacing */
  section > div[style*="margin: 0 auto; padding:"] {
    padding: 60px 20px !important; gap: 32px !important;
  }
  section.dots > div[style*="margin: 0 auto; padding:"] { padding: 40px 20px 56px !important; gap: 22px !important; }
  footer > div[style*="margin: 0 auto"] { padding: 48px 20px 32px !important; gap: 32px !important; }
  section.dots p[style*="font-size: 20px"] { font-size: 18px !important; }

  /* Cards and forms: a little less inner padding */
  [style*="border-radius: 22px; padding: 3"], [style*="border-radius: 22px; padding: 28px"] { padding: 24px !important; }
  form[style*="padding: 3"] { padding: 22px !important; }
  [style*="border-radius: 28px; padding: 24px"] { padding: 16px !important; }

  /* Buttons stack full-width */
  section a.btn { flex: 1 1 100%; text-align: center; }
  section form button.btn[type="submit"] { width: 100%; }


  /* Decorative rings sit behind the text: quieter */
  .ring { opacity: .22 !important; }

  /* Donate amounts: three across, "Other" spans two */
  [style*="minmax(90px, 1fr)"] { grid-template-columns: repeat(3, 1fr) !important; }
  [style*="minmax(90px, 1fr)"] .amt:last-child { grid-column: span 2; }

  /* Seminar calendar: each row becomes a small stacked entry */
  .re-cal { min-width: 0 !important; }
  .re-cal thead { display: none; }
  .re-cal tr { display: block; padding: 16px 20px; border-bottom: 1px solid #EEF0EC; }
  .re-cal tr:last-child { border-bottom: 0; }
  .re-cal td { display: block; padding: 2px 0 !important; border: 0 !important; white-space: normal !important; }
  .re-cal td:nth-child(3) { color: #4A5568; }

  /* About page details: label above value */
  dl[style*="minmax(140px, auto)"] { grid-template-columns: 1fr !important; }
  dl[style*="minmax(140px, auto)"] dt { padding: 16px 20px 0 !important; border-bottom: 0 !important; font-size: 14px; }
  dl[style*="minmax(140px, auto)"] dd { padding: 2px 20px 16px !important; }
}

/* Home hero DNA animation: shown only when it sits beside the headline.
   On narrower screens it would drop below the text, so it's left out. */
@media (max-width: 983px) {
  #top div[aria-hidden="true"][style*="min-height: 480px"] { display: none !important; }
}

/* Short screens (phones held sideways): slimmer header */
@media (max-height: 500px) and (orientation: landscape) {
  [data-site-header] > div { padding-top: 8px !important; padding-bottom: 8px !important; }
  [data-site-header] nav a { padding-top: 8px !important; padding-bottom: 8px !important; }
  [data-site-header] nav .btn { padding: 8px 18px !important; }
  [data-site-header] > div > a:first-child svg { width: 32px; height: 32px; }
  html { scroll-padding-top: 64px !important; }
}

/* A card left alone on the last row stretches to fill it (see site.js) */
.re-fill { grid-column: span var(--re-span) !important; }

/* Notched phones: backgrounds run edge to edge (viewport-fit=cover), and
   content stays clear of the notch and rounded corners. */
@supports (padding: max(0px)) {
  section > div[style*="margin: 0 auto"], footer > div[style*="margin: 0 auto"], [data-site-header] > div {
    padding-left: max(32px, env(safe-area-inset-left)) !important;
    padding-right: max(32px, env(safe-area-inset-right)) !important;
  }
  @media (max-width: 1060px) {
    [data-site-header] > div {
      padding-left: max(20px, env(safe-area-inset-left)) !important;
      padding-right: max(20px, env(safe-area-inset-right)) !important;
    }
  }
  @media (max-width: 640px) {
    section > div[style*="margin: 0 auto"], footer > div[style*="margin: 0 auto"] {
      padding-left: max(20px, env(safe-area-inset-left)) !important;
      padding-right: max(20px, env(safe-area-inset-right)) !important;
    }
  }
  footer > div[style*="margin: 0 auto"] { padding-bottom: max(40px, env(safe-area-inset-bottom)) !important; }
}

/* Form hints under a label */
.fld .hint { font-size: 14px; font-weight: 400; line-height: 1.5; color: #4A5568; margin-top: -2px; }

/* Questions and answers (FAQ page and the chapter guide) */
.qa { border-bottom: 1px solid #D9DED8; }
.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 22px 0; font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600; font-size: 20px; line-height: 1.3; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%; background: #E3F3EF; color: #085C5C; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; transition: transform .2s; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa .a { padding: 0 0 24px; display: flex; flex-direction: column; gap: 12px; font-size: 17px; line-height: 1.65; color: #3D4756; max-width: 760px; }
.qa .a a, .prose a { color: #085C5C; }

/* Long-form text (resources, privacy policy, chapter guide) */
.prose { display: flex; flex-direction: column; gap: 16px; font-size: 17px; line-height: 1.7; color: #3D4756; max-width: 760px; }
.prose h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -0.02em; color: #0F1B2D; margin-top: 28px; }
.prose h3 { font-size: 21px; line-height: 1.3; color: #0F1B2D; margin-top: 14px; }
.prose ul, .prose ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.prose strong { font-weight: 600; color: #0F1B2D; }
.prose .box { background: #FFFFFF; border: 1px solid #D9DED8; border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.prose .mail { font-family: 'IBM Plex Mono', monospace; font-size: 15px; line-height: 1.7; white-space: pre-wrap; background: #FFFFFF; border: 1px solid #D9DED8; border-left: 4px solid #0B6E6E; border-radius: 12px; padding: 20px 22px; color: #0F1B2D; }
.toc { display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.toc a { color: #0F1B2D; text-decoration: none; padding: 7px 0; border-bottom: 1px solid #E4E8E3; }
.toc a:hover { color: #085C5C; }
@media (min-width: 981px) { .toc-wrap { position: sticky; top: 104px; } }

/* ---------- Smooth motion (all of it switches off with reduced motion) ---------- */

/* Links, nav, and form controls change color smoothly instead of snapping */
a { transition: color .2s ease; }
.navl { transition: color .2s ease, box-shadow .25s ease; }
.fld input, .fld select, .fld textarea { transition: border-color .2s ease, background-color .2s ease; }
.amt { transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease; }
.amt:active { transform: scale(.97); }

/* Header: a soft shadow fades in once the page scrolls (see site.js) */
[data-site-header] { transition: box-shadow .3s ease, background-color .3s ease; }
[data-site-header][data-scrolled] { box-shadow: 0 12px 32px -20px rgba(0,0,0,.7); background-color: rgba(15,27,45,.94) !important; }

/* Things that appear: form messages, the donate "Other" box, school suggestions */
@keyframes re-appear { from { opacity: 0; transform: translateY(-6px); } }
@keyframes re-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
[data-note]:not([hidden]), [data-other-wrap]:not([hidden]) { animation: re-appear .32s cubic-bezier(.2,.7,.2,1); }
.re-ac-list:not([hidden]) { animation: re-pop .18s cubic-bezier(.2,.7,.2,1); transform-origin: top center; }

/* FAQ answers: the +/x turns as soon as a question starts closing */
.qa[data-closing] summary::after { transform: none; }
.qa summary { transition: color .2s ease; }
.qa summary:hover { color: #085C5C; }

/* "On this page" lists: the current section is marked as you scroll (site.js) */
.toc a { transition: color .2s ease, padding-left .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease; }
.toc a[aria-current] { color: #085C5C; font-weight: 600; padding-left: 12px; box-shadow: inset 3px 0 #0B6E6E; }

/* Sections fade up as they scroll in. Chrome does this in CSS (.rv in each
   page); other browsers get the same effect from site.js. */
html.js .re-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
html.js .re-reveal.re-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  a, .navl, .fld input, .fld select, .fld textarea, .amt, [data-site-header], .toc a, .qa summary { transition: none !important; }
  [data-note], [data-other-wrap], .re-ac-list { animation: none !important; }
  html.js .re-reveal { opacity: 1; transform: none; transition: none; }
}
@media print {
  html.js .re-reveal { opacity: 1 !important; transform: none !important; }
}
