/* Former Medics of Aggieland — landing page
   Palette is a maroon family; swap the tokens if the group has real brand colors.
   See CONTENT-NEEDED.md #6. */

:root {
  --maroon: #500000;
  --maroon-bright: #7a1010;
  --ink: #1b1614;
  --body: #4a423e;
  --muted: #6a605a;
  --line: #e4dcd8;
  --surface: #ffffff;
  --ground: #faf7f5;
  --ground-alt: #f3edea;
  --focus: #9a2c2c;
  --radius: 10px;
  --maxw: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --maroon: #d98a8a;
    --maroon-bright: #eba5a5;
    --ink: #f4efed;
    --body: #cabfba;
    --muted: #978a84;
    --line: #372e2b;
    --surface: #221c1a;
    --ground: #171312;
    --ground-alt: #1e1917;
    --focus: #e0a0a0;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--maroon); }
a:hover { color: var(--maroon-bright); }
img { max-width: 100%; }
[hidden] { display: none !important; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.wordmark em { font-style: normal; font-weight: 400; color: var(--muted); }

.header-cta {
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.header-cta:hover { border-color: var(--maroon); }

/* ── Layout ─────────────────────────────────────────────────────────────── */

main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.hero { padding-block: clamp(2.5rem, 8vw, 5rem) clamp(2rem, 6vw, 3.5rem); }

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 1rem;
}

.lede { font-size: 1.1rem; color: var(--body); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  margin-bottom: 1.5rem;
}
.panel-head { margin-bottom: 1.5rem; max-width: 40rem; }
.panel-head p { color: var(--muted); margin-bottom: 0; }
.panel-story p { max-width: 42rem; }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  padding: .7rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-bright); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--maroon); color: var(--maroon); }
.btn-wide { width: 100%; padding-block: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--maroon); color: #241110; }
  .btn-primary:hover { background: var(--maroon-bright); color: #241110; }
}

/* ── Form ───────────────────────────────────────────────────────────────── */

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .35rem;
}
.field > span b { color: var(--maroon); }
.field > span i { font-weight: 400; font-style: normal; color: var(--muted); }

input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--ground-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .6rem .7rem;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
.field.invalid input, .field.invalid select { border-color: #c0392b; }

/* Honeypot — off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.privacy-note { font-size: .85rem; color: var(--muted); margin: 1rem 0 1.25rem; }

.form-status { margin: .9rem 0 0; font-size: .92rem; min-height: 1.4em; }
.form-status.ok { color: #1d7a4c; font-weight: 600; }
.form-status.err { color: #c0392b; font-weight: 600; }
@media (prefers-color-scheme: dark) { .form-status.ok { color: #6ad19b; } .form-status.err { color: #f08a7c; } }

/* ── Cards ──────────────────────────────────────────────────────────────── */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }

.card {
  background: var(--ground-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.card p { font-size: .93rem; margin-bottom: .9rem; }

.tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--maroon);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: .15rem .55rem;
}
.tag-muted { color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 20px 2.5rem;
  font-size: .9rem;
  color: var(--muted);
}
.footer-brand { font-weight: 700; color: var(--ink); }
.sep { margin: 0 .5rem; color: var(--line); }
.disclaimer { font-size: .8rem; max-width: 46rem; margin-top: 1rem; }

/* ── Navigation ─────────────────────────────────────────────────────────── */

.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .9rem; }
.site-nav > a:not(.header-cta) {
  font-size: .92rem;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  padding: .3rem .1rem;
  border-bottom: 2px solid transparent;
}
.site-nav > a:not(.header-cta):hover { color: var(--maroon); }
.site-nav > a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--maroon); }

/* ── Inner pages ────────────────────────────────────────────────────────── */

.page-hero { padding-block: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 2rem); max-width: 42rem; }
.page-hero h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); }

.prose h2 { margin-top: 1.75rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 44rem; }
.fine-print { font-size: .82rem; color: var(--muted); }

.checklist, .steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.checklist li, .steps li { margin-bottom: .6rem; padding-left: .2rem; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 1.4rem; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .5rem;
  height: .5rem;
  border-radius: 2px;
  background: var(--maroon);
}

.card-link { margin: 0 0 .8rem; font-size: .9rem; font-weight: 600; }
.card-link a { text-decoration: none; }

/* Timeline: year on the left, event on the right; stacks on phones. */
.timeline { list-style: none; margin: 0 0 1rem; padding: 0; border-left: 2px solid var(--line); }
.timeline li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: .25rem 1rem;
  padding: 0 0 1.25rem 1.1rem;
  position: relative;
  max-width: none;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -.42rem;
  top: .45em;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--maroon);
}
.timeline .when { font-weight: 700; color: var(--maroon); }
.timeline .gap::before { background: var(--line); }
.timeline .gap .what { color: var(--muted); font-style: italic; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; } }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--ground-alt);
}
.empty-state p:last-child { margin-bottom: 0; }
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: .35rem; }

.callout { border-left: 4px solid var(--maroon); }
.callout h2 { font-size: 1.15rem; }
.callout p:last-child { margin-bottom: 0; }

/* ── Refinements: accessibility, phones, new pages ──────────────────────── */

body { overflow-wrap: break-word; }
main:focus { outline: none; } /* main is focus target of the skip link only */

.skip-link {
  position: absolute;
  left: 12px;
  top: -4rem;
  z-index: 10;
  background: var(--maroon);
  color: #fff;
  padding: .7rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }
@media (prefers-color-scheme: dark) { .skip-link, .skip-link:focus { color: #241110; } }

/* Keep content clear of notches / rounded corners in landscape (viewport-fit=cover). */
.site-header, main, .footer-inner {
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

::placeholder { color: var(--muted); opacity: 1; }

/* 44px is the comfortable minimum touch target on phones. */
.btn, .header-cta { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.site-nav > a:not(.header-cta) { min-height: 44px; display: inline-flex; align-items: center; padding-inline: .15rem; }
input[type="text"], input[type="email"], select, textarea { font-size: max(16px, 1rem); min-height: 44px; } /* 16px stops iOS zooming on focus */
textarea { min-height: 5.5rem; }

.field.invalid input, .field.invalid select, [aria-invalid="true"] { border-color: #c0392b; }
.field-error { display: block; margin-top: .3rem; font-size: .85rem; font-weight: 600; color: #b03123; }
@media (prefers-color-scheme: dark) { .field-error { color: #f08a7c; } }

/* Hero: text plus a small factual badge; stacks on phones. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 2rem 3rem; align-items: center; }
.hero-copy { max-width: 42rem; }
.hero-badge {
  color: var(--maroon);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem;
  text-align: center;
}
.hero-badge svg { display: block; margin: 0 auto .6rem; }
.badge-year { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.badge-text { margin: .35rem 0 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-badge { display: flex; align-items: center; gap: 1rem; text-align: left; padding: 1rem; }
  .hero-badge svg { margin: 0; flex: none; width: 3rem; height: 3rem; }
  .badge-text { margin: 0; }
  .badge-year { font-size: 1.4rem; }
}

.why-join { margin: 0 0 1.25rem; }

/* Phone header/nav: full-width row of comfortably tappable links. */
@media (max-width: 640px) {
  .site-header { padding-block: .75rem; gap: .25rem 1rem; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0 .35rem; }
  .site-nav > a:not(.header-cta) { flex: 1 1 auto; justify-content: center; font-size: .95rem; }
  .header-cta { flex: 1 1 100%; margin-top: .25rem; }
}

.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0 0 .5rem; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }

/* FAQ: native <details>, no script. */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: .6rem 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.faq summary::marker { color: var(--maroon); }
.faq details p { margin: 0 0 1rem; max-width: 44rem; }

@media (max-width: 520px) {
  .panel { padding: 1.1rem; }
  .cards { grid-template-columns: 1fr; }
}

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

@media print {
  .site-header, .site-footer, .hp, form, .skip-link, .hero-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border: 0; padding: 0; }
}

.wordmark { min-height: 44px; }
