/* =========================================================================
   AcuFlow — public site
   A calm, deep, mission-first aesthetic: warm light emerging from depth.
   Plain CSS, system fonts (no external font requests), WCAG-AA on dark.
   ========================================================================= */

:root {
  /* Depth */
  --navy-900: #0a1826;   /* page base */
  --navy-800: #0e2134;   /* raised panels */
  --navy-700: #16324a;

  /* Ink */
  --ink:      #eaf1f7;   /* primary text  (~15:1 on navy-900) */
  --ink-soft: #aebfce;   /* secondary     (~7.5:1 on navy-900) */
  --ink-faint:#7f93a5;   /* tertiary / meta */

  /* Emergent light */
  --teal:     #58cdbd;   /* links, accents (AA on dark) */
  --cyan:     #7fe6d9;
  --gold:     #efba5e;

  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --measure: 40rem;      /* comfortable reading width */
  --wide: 62rem;         /* header / footer / sections */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --space-section: clamp(3.5rem, 9vw, 6.5rem);
}

/* ------------------------------ reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.7;
  color: var(--ink-soft);
  background-color: var(--navy-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* the emergent glow — deep navy with warm light rising, felt not noticed */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 78% 8%, rgba(239, 186, 94, 0.10), transparent 55%),
    radial-gradient(90% 70% at 30% 30%, rgba(88, 205, 189, 0.07), transparent 60%),
    linear-gradient(180deg, #0b1a2a 0%, var(--navy-900) 40%, #081420 100%);
}

img, svg { max-width: 100%; height: auto; display: block; }

/* ------------------------------ type ----------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); margin-top: 0; }
h3 { font-size: 1.15rem; color: var(--ink); }

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(88, 205, 189, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--cyan); border-color: var(--cyan); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { color: var(--ink); font-weight: 600; }

.lede { font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.4rem); color: var(--ink-soft); }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1.1em;
}
.muted { color: var(--ink-faint); }
.small { font-size: 0.85rem; line-height: 1.6; }

/* ------------------------- layout helpers ------------------------------ */
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: var(--measure); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--navy-800); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 6px; border: 1px solid var(--hairline-strong);
  z-index: 100; transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

hr.rule { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-section) 0; }

/* ------------------------------ header --------------------------------- */
.site-header {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  border: 0; color: var(--ink);
  font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0.01em;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 30px; height: 30px; flex: 0 0 auto; }
.site-nav a {
  border: 0; color: var(--ink-soft); font-size: 0.95rem;
}
.site-nav a:hover { color: var(--teal); }

/* ------------------------------ hero ----------------------------------- */
.hero { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3rem); }
/* min(…, 100%) guarantees these never exceed the container on narrow screens */
.hero h1 { max-width: min(18ch, 100%); }
.hero .lede { max-width: min(46ch, 100%); margin-top: 0.4rem; }
.hero .category {
  margin-top: 1.8rem; padding-top: 1.2rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-faint); font-size: 0.95rem; max-width: min(44ch, 100%);
}

/* ------------------------------ sections ------------------------------- */
main section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
section .prose > * + h2 { margin-top: 0.4rem; }

.section-quiet { border-top: 1px solid var(--hairline); }

/* ------------------------------ buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 1rem; line-height: 1;
  padding: 0.85rem 1.4rem; border-radius: 8px;
  color: var(--navy-900); background: var(--teal);
  border: 1px solid var(--teal); cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--cyan); border-color: var(--cyan); color: var(--navy-900); }
.btn-ghost {
  color: var(--teal); background: transparent; border-color: var(--hairline-strong);
}
.btn-ghost:hover { color: var(--cyan); background: rgba(88, 205, 189, 0.08); border-color: var(--teal); }
@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: translateY(1px); }
}

/* ------------------------- signup form --------------------------------- */
.signup {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.4rem 0 0.8rem;
  max-width: 30rem;
}
.signup input[type="email"] {
  flex: 1 1 14rem; min-width: 0;
  font-family: var(--sans); font-size: 1rem;
  padding: 0.8rem 1rem; border-radius: 8px;
  color: var(--ink); background: var(--navy-800);
  border: 1px solid var(--hairline-strong);
}
.signup input::placeholder { color: var(--ink-faint); }
.signup .btn { flex: 0 0 auto; }

/* --------------------------- discovery embed --------------------------- */
.notice {
  border: 1px solid rgba(239, 186, 94, 0.35);
  background: rgba(239, 186, 94, 0.07);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin: 1.6rem 0;
  color: var(--ink-soft);
}
.notice strong { color: var(--gold); }

.embed-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--hairline-strong);
  padding: 0.5rem;
  margin: 1.4rem 0;
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.6);
}
.tally-embed { width: 100%; min-height: 620px; border: 0; display: block; }
.embed-fallback { margin-top: 0.8rem; }

/* dl for "what participation involves" */
.detail-list { margin: 1.4rem 0; padding: 0; }
.detail-list > div { padding: 1rem 0; border-top: 1px solid var(--hairline); }
.detail-list dt { font-family: var(--serif); color: var(--ink); font-size: 1.1rem; margin-bottom: 0.2rem; }
.detail-list dd { margin: 0; color: var(--ink-soft); }

/* ------------------------------ footer --------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2.5rem 0 3rem;
  margin-top: var(--space-section);
  color: var(--ink-faint);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; align-items: baseline; }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); border: 0; }
.site-footer a:hover { color: var(--teal); }
.site-footer .disclaimer {
  flex-basis: 100%; margin-top: 1rem; max-width: min(52ch, 100%); line-height: 1.6; color: var(--ink-faint);
}

/* ------------------------- mobile hardening ---------------------------- */
@media (max-width: 34rem) {
  .site-nav { font-size: 0.9rem; }
  .signup input[type="email"] { flex-basis: 100%; }
  .signup .btn { width: 100%; justify-content: center; }
}

/* legal pages */
.legal { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.legal .prose h2 { margin-top: 2.2rem; }
.legal .prose h2:first-of-type { margin-top: 1rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.4rem; }
.legal .updated { color: var(--ink-faint); font-size: 0.9rem; }
