/* The Alabama Math Clinic — design system
 *
 * Register: a Swiss medical journal crossed with a mathematics textbook.
 * Clinical, precise, unhurried. The "clinic" in the name is taken literally:
 * consultation, diagnosis, treatment plan. Nothing cute, no chalkboards, no
 * cartoon pencils, no primary-colour "learning is fun" register — that is the
 * visual language of cheap tutoring and it is exactly what this must not be.
 *
 * Built to be read by machines as easily as by people: semantic HTML, text in
 * the first response, headings that mean rank rather than size.
 */

:root {
  /* Ink. Warm near-black, never pure #000 — pure black reads as cheap on screen. */
  --ink-950: #14161a;
  --ink-800: #2b2f36;
  --ink-600: #545a63;
  --ink-400: #8b919b;
  --ink-200: #d6d9de;
  --ink-100: #e8eaee;

  /* Paper. Warm, very slightly off-white, like good text stock. */
  --paper: #fbfaf8;
  --paper-sunk: #f4f2ee;

  /* The one accent. Deep clinical blue — the blue of a fountain pen and a
     radiology department, not the blue of a tech startup. Used for marks,
     rules and the single call to action. Never for decoration. */
  --clinic-700: #17385c;
  --clinic-500: #24568c;

  --rule: 1px solid var(--ink-200);
  --rule-strong: 2px solid var(--ink-950);

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --band: clamp(3.5rem, 9vw, 8rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-950);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 1.6rem + 4.2vw, 5.25rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 3rem); }
h3 { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); }

p { margin: 0 0 1.15em; max-width: var(--measure); }
a { color: inherit; }

.wrap { max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }

/* An eyebrow with a rule, used to label every band. The rule is the graph
   paper motif reduced to one line. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-600);
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--ink-200); }
.eyebrow.light { color: var(--ink-200); }
.eyebrow.light::after { background: rgba(255,255,255,0.22); }

/* ---------- Proof banner. Honest, unmissable, never dismissed. ---------- */
.proof-banner {
  background: var(--ink-950);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.7rem var(--gutter);
  text-align: center;
}
.proof-banner strong { letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.proof-banner a { color: var(--paper); text-underline-offset: 0.25em; }

/* ---------- Masthead ---------- */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0 1.5rem;
  border-bottom: var(--rule);
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark em { font-style: italic; color: var(--clinic-700); }
.masthead nav { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.masthead nav a {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--ink-600);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.masthead nav a:hover { color: var(--ink-950); border-bottom-color: var(--ink-950); }
.masthead .tel {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-950);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-200);
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 6.5rem) var(--band); }
.hero h1 { max-width: 16ch; margin-bottom: 1.75rem; }
.hero h1 em { font-style: italic; color: var(--clinic-700); }
.hero .lede {
  font-size: clamp(1.125rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-800);
  max-width: 40ch;
  margin-bottom: 2.5rem;
}

.actions { display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap; }
.button {
  display: inline-block;
  background: var(--clinic-700);
  color: var(--paper);
  text-decoration: none;
  padding: 0.9rem 1.6rem;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  border: 0;
}
.button:hover { background: var(--ink-950); }
.button-quiet {
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--ink-950);
  border-bottom: 1px solid var(--ink-400);
  padding-bottom: 2px;
}

/* ---------- The three-step clinical spine ---------- */
.spine { padding-block: var(--band); border-top: var(--rule); }
.spine ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3rem; }
@media (min-width: 62rem) { .spine ol { grid-template-columns: repeat(3, 1fr); gap: 3.5rem; } }
.spine li { border-top: var(--rule-strong); padding-top: 1.25rem; }
.spine .step {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--clinic-700);
  display: block;
  margin-bottom: 1rem;
}
.spine h3 { margin-bottom: 0.75rem; }
.spine p { color: var(--ink-600); font-size: 0.9375rem; margin: 0; }

/* ---------- Dark band ---------- */
.band-dark {
  background: var(--ink-950);
  color: var(--paper);
  padding-block: var(--band);
}
.band-dark h2 { max-width: 22ch; margin-bottom: 1.5rem; }
.band-dark p { color: var(--ink-200); }
.band-dark .figure {
  font-family: var(--font-display);
  font-size: clamp(3rem, 2rem + 5vw, 6rem);
  line-height: 1;
  display: block;
}

/* ---------- Subjects ---------- */
.subjects { padding-block: var(--band); border-top: var(--rule); }
.subject-grid { display: grid; gap: 0; border-top: var(--rule); }
@media (min-width: 48rem) { .subject-grid { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; } }
.subject-grid div {
  border-bottom: var(--rule);
  padding: 1.4rem 0;
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
}
.subject-grid dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--clinic-700);
  min-width: 3.5rem;
  letter-spacing: 0.08em;
}
.subject-grid dd { margin: 0; font-size: 0.9375rem; }
.subject-grid dd b { font-weight: 500; display: block; }
.subject-grid dd span { color: var(--ink-600); }

/* ---------- Photography slot, honestly marked ---------- */
.plate {
  background: var(--paper-sunk);
  border: var(--rule);
  aspect-ratio: 4 / 3;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
img.plate {
  display: block;
  width: 100%;
  height: auto;
  padding: 0;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.98);
}

/* ---------- Close ---------- */
.close { padding-block: var(--band); border-top: var(--rule-strong); }
.close h2 { max-width: 18ch; margin-bottom: 1.5rem; }

footer {
  border-top: var(--rule);
  padding-block: 3rem 4rem;
  color: var(--ink-600);
  font-size: 0.875rem;
}
footer .cols { display: grid; gap: 2.5rem; }
@media (min-width: 48rem) { footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
footer a { color: var(--ink-600); text-decoration: none; border-bottom: 1px solid var(--ink-200); }
footer a:hover { color: var(--ink-950); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.colophon {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: var(--rule);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-400);
  max-width: 70ch;
}

:focus-visible { outline: 3px solid var(--clinic-500); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
