/* ==========================================================================
   Education in an AI-Shaped Future
   A printed-reader aesthetic: warm paper, editorial serif, hairline rules,
   marginal numerals. Calm over loud.
   ========================================================================== */

:root {
  /* Paper & ink */
  --paper:      #f7f3ea;
  --paper-warm: #fffcf5;
  --paper-deep: #f1ece0;
  --ink:        #1b1917;
  --ink-soft:   #3b352e;
  --muted:      #6b6357;
  --rule:       #ddd5c6;
  --rule-soft:  #e7e0d3;
  --accent:     #9c3a2b;
  --accent-ink: #7d2e22;
  --accent-wash:rgba(156, 58, 43, 0.09);

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Measure & rhythm */
  --measure: 34rem;
  --gutter:  clamp(1.25rem, 5vw, 4rem);
  --margin-col: 12.5rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  font-weight: 380;
  line-height: 1.68;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain — a whisper of texture, never a pattern you can name. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

::selection { background: var(--accent-wash); color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   Focus & skip link
   -------------------------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10000;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  scroll-margin-top: 5rem;
  border-top: 1px solid var(--rule-soft);
}

.grid { display: block; }

@media (min-width: 62rem) {
  .grid {
    display: grid;
    grid-template-columns: var(--margin-col) minmax(0, 1fr);
    column-gap: 3rem;
    align-items: start;
  }
}

.col { max-width: var(--measure); }

/* Marginal section marker — the numeral in the margin of a printed page. */
.marker {
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
@media (min-width: 62rem) {
  .marker {
    margin: 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--accent);
    position: sticky;
    top: 5.5rem;
  }
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

.h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.7rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.lede {
  margin: 0 0 1.15rem;
  font-size: 1.16em;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Sub-heading inside a section — borrows the marker's voice. */
.h3 {
  margin: 2.1rem 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.section p { margin: 0 0 1.15rem; color: var(--ink-soft); }
.section p:last-child { margin-bottom: 0; }

/* Prose links — a hairline rule instead of a browser underline. */
.section p a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.section p a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}

.sub {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.pull {
  margin: 0 0 1.4rem;
  padding: 0.15rem 0 0.15rem 1.4rem;
  border-left: 2px solid var(--accent);
  font-size: 1.24em;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Reading progress
   -------------------------------------------------------------------------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 999;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  opacity: 0.75;
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   Sticky top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 900;
  background: rgba(247, 243, 234, 0.86);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease), visibility 0.3s;
}
.topbar.is-shown {
  transform: none;
  opacity: 1;
  visibility: visible;
  border-bottom-color: var(--rule);
}

.topbar__inner {
  max-width: 68rem;
  margin-inline: auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.topbar__title {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar__nav a {
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.topbar__nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.topbar__cta {
  color: var(--paper) !important;
  background: var(--ink);
  padding: 0.5rem 0.9rem !important;
  border-bottom: 0 !important;
}
.topbar__cta:hover { background: var(--accent-ink); }

@media (max-width: 61.99rem) {
  .topbar__nav a:not(.topbar__cta) { display: none; }
}
@media (max-width: 30rem) {
  .topbar__title { font-size: 0.82rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(3rem, 9vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  position: relative;
}

/* A faint arc of light behind the masthead — atmosphere, not decoration. */
.hero::after {
  content: "";
  position: absolute;
  top: -28vw;
  right: -14vw;
  width: 62vw;
  height: 62vw;
  max-width: 780px;
  max-height: 780px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(156, 58, 43, 0.07), rgba(156, 58, 43, 0) 62%);
  pointer-events: none;
  z-index: -1;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 7vw, 4.5rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.masthead__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.hero__title {
  margin: 0 0 1.6rem;
  font-size: clamp(2.9rem, 1.2rem + 7.6vw, 6.5rem);
  font-weight: 350;
  line-height: 0.98;
  letter-spacing: -0.032em;
  max-width: 14ch;
}
.hero__title span { display: block; }
.hero__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.hero__sub {
  margin: 0 0 2.4rem;
  max-width: 30rem;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.42rem);
  line-height: 1.48;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem 2rem;
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

/* Facts strip */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.facts__item {
  padding: 1.05rem 1.25rem 1.05rem 0;
  border-right: 1px solid var(--rule-soft);
}
.facts__item:last-child { border-right: 0; }
.facts__item + .facts__item { padding-left: 1.25rem; }
.facts dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.facts dd {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink);
}
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts__item { border-bottom: 1px solid var(--rule-soft); }
  .facts__item:nth-child(2n) { border-right: 0; }
  /* Keep every row's first cell flush with the text column. */
  .facts__item:nth-child(odd) { padding-left: 0; }
  .facts__item:nth-child(even) { padding-left: 1.25rem; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  background: var(--btn-bg);
  color: var(--paper-warm);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  position: relative;
  transition: background-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { --btn-bg: var(--accent-ink); }
.btn:active { transform: translateY(1px); }

.btn-quiet {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-quiet:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* --------------------------------------------------------------------------
   Questions
   -------------------------------------------------------------------------- */

.questions {
  list-style: none;
  margin: 2.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.q {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: background-color 0.3s var(--ease);
}
.q:last-child { border-bottom: 1px solid var(--rule); }

@media (min-width: 62rem) {
  .q {
    grid-template-columns: var(--margin-col) minmax(0, 1fr);
    column-gap: 3rem;
    padding: 2.4rem 0;
  }
  .q:hover { background: linear-gradient(90deg, var(--accent-wash), rgba(0,0,0,0) 72%); }
  .q:hover .q__num { color: var(--accent); }
}

.q__num {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 0.5rem;
  transition: color 0.3s var(--ease);
}

.q__body { max-width: var(--measure); }

.q__title {
  margin: 0 0 0.55rem;
  font-size: clamp(1.3rem, 1.1rem + 0.85vw, 1.62rem);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.q__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.98em;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Format spec list
   -------------------------------------------------------------------------- */

.spec {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}
.spec li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.spec li:first-child { border-top: 1px solid var(--rule); }
@media (min-width: 34rem) {
  .spec li { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; align-items: baseline; }
}
.spec__k {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec__v { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.section--form { background: var(--paper-deep); }

.formcard {
  margin-top: 2.75rem;
  max-width: 44rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 4.5vw, 3rem);
  box-shadow: 0 1px 0 var(--rule-soft), 0 18px 40px -32px rgba(27, 25, 23, 0.5);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field { margin-bottom: 1.6rem; }
.field:last-of-type { margin-bottom: 1.9rem; }

.field label,
.field legend {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--ink);
  line-height: 1.45;
}

.req, .opt {
  font-size: 0.9em;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  font-weight: 400;
}
.req { color: var(--accent); }
.opt { color: var(--muted); font-style: italic; }

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
textarea { resize: vertical; min-height: 6rem; }

input::placeholder, textarea::placeholder {
  color: #756a5b;
  font-style: italic;
  opacity: 1; /* Firefox dims placeholders by default */
}

input:hover, textarea:hover { border-color: #cdc3b0; }

input:focus, textarea:focus {
  outline: none;
  background: var(--paper-warm);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
input:focus-visible, textarea:focus-visible { outline: none; }

[aria-invalid="true"] { border-color: var(--accent) !important; background: rgba(156, 58, 43, 0.035); }

.err {
  display: none;
  margin: 0.45rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--accent-ink);
}
.err.is-shown { display: block; }

/* Checkbox group */
/* No fieldset border — a legend inside a border gap renders inconsistently.
   The rule hangs off the legend instead, matching the section markers. */
.field--checks {
  border: 0;
  padding: 0;
  margin: 2.4rem 0 1.9rem;
}
.field--checks legend {
  display: block;
  width: 100%;
  padding: 0 0 0.85rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule-soft);
}

.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  margin-bottom: 0.9rem;
}
.check:last-of-type { margin-bottom: 0; }

.check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}
.check label {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0;
  font-weight: 380;
  line-height: 1.55;
  color: var(--ink-soft);
  cursor: pointer;
}

.formfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 0.4rem;
}

.btn--submit { min-width: 13rem; }
.btn[disabled] { opacity: 0.62; cursor: progress; }
.btn[disabled]:hover { --btn-bg: var(--ink); }

.spinner {
  display: none;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid rgba(255, 252, 245, 0.35);
  border-top-color: var(--paper-warm);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.is-sending .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.formnote {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 20rem;
}

.alert {
  margin: 1.4rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  border-left-width: 3px;
  background: rgba(156, 58, 43, 0.05);
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--accent-ink);
}
.alert a { color: inherit; }

/* Success panel */
.done {
  text-align: left;
  padding: 0.5rem 0;
  animation: rise 0.6s var(--ease) both;
}
.done__mark {
  width: 2.75rem;
  height: 2.75rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 1.2rem;
}
.done__mark circle { opacity: 0.4; }
.done__mark path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw 0.5s var(--ease) 0.25s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.done__title {
  margin: 0 0 0.5rem;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.done__text { margin: 0; color: var(--muted); max-width: 28rem; }
.done:focus { outline: none; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  background: var(--paper);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
@media (min-width: 48rem) {
  .footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.6fr);
    gap: 2.5rem;
  }
  .footer__block--wide { grid-column: 3; grid-row: 1; }
}

.footer__label {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer__value { margin: 0; color: var(--ink-soft); }
.footer__value--small { font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.footer__value a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s var(--ease);
}
.footer__value a:hover { border-bottom-color: var(--accent); }

.footer__year {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
@media (min-width: 48rem) {
  .footer__year { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--rule-soft); }
}

/* --------------------------------------------------------------------------
   Motion — one orchestrated load, quiet reveals thereafter
   -------------------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: none; }
}

.js .r {
  animation: rise 0.85s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 90ms);
}

.js .reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .done__mark path { stroke-dashoffset: 0; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  body::before, .topbar, .progress, .skip-link, .section--form { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { border-top: 1px solid #ccc; page-break-inside: avoid; }
}
