/* AI Advisor for Alzheimer's — stylesheet
   Designed for readability: large type, high contrast, generous spacing.
   Shared by every page of the site. */

:root {
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --text: #1f2430;
  --text-muted: #5b6270;
  --border: #dbe3f0;
  --accent: #3b5bdb;
  --accent-strong: #2f49b3;
  --accent-soft: #e8edfb;
  --heart: #c2255c;
  --heart-soft: #fbe4ec;
  --brain: #6741d9;
  --brain-soft: #efe9fb;
  --dna: #0c8599;
  --dna-soft: #e0f4f7;
  --ok: #2b8a3e;
  --ok-soft: #e6f4ea;
  --warn: #b7791f;
  --warn-soft: #fbf1dc;
  --info: #6741d9;
  --info-soft: #efe9fb;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.05), 0 8px 24px rgba(20, 24, 40, 0.06);
  --radius: 14px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171f; --bg-alt: #1b1f29; --surface: #202531; --text: #eef0f4; --text-muted: #a4abb8; --border: #313746;
    --accent: #8ea3ff; --accent-strong: #a7b7ff; --accent-soft: #263055;
    --heart: #ff8fb1; --heart-soft: #3d2230; --brain: #b197fc; --brain-soft: #2d2545; --dna: #66d9e8; --dna-soft: #163a40;
    --ok: #74c69d; --ok-soft: #1f3a2d; --warn: #e9b949; --warn-soft: #3d3220; --info: #b197fc; --info-soft: #2d2545;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #14171f; --bg-alt: #1b1f29; --surface: #202531; --text: #eef0f4; --text-muted: #a4abb8; --border: #313746;
  --accent: #8ea3ff; --accent-strong: #a7b7ff; --accent-soft: #263055;
  --heart: #ff8fb1; --heart-soft: #3d2230; --brain: #b197fc; --brain-soft: #2d2545; --dna: #66d9e8; --dna-soft: #163a40;
  --ok: #74c69d; --ok-soft: #1f3a2d; --warn: #e9b949; --warn-soft: #3d3220; --info: #b197fc; --info-soft: #2d2545;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 18px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; margin-top: 1.2em; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 820px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--accent-strong), var(--accent) 60%, var(--info)); box-shadow: inset 0 0 0 3px var(--surface); flex-shrink: 0; }
.brand-light { font-weight: 400; color: var(--text-muted); }
.nav-list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; justify-content: flex-end; }
.nav-list li { margin: 0; }
.nav-list a { display: block; padding: 6px 9px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 0.86rem; white-space: nowrap; }
.nav-list a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.nav-list a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav-toggle { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font: inherit; color: var(--text); cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .nav-list { display: none; position: absolute; right: 16px; top: 64px; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); min-width: 220px; }
  .nav-list.open { display: flex; }
}

/* Page head + update stamp */
.page-head { padding: clamp(40px, 7vw, 80px) 0 clamp(16px, 3vw, 28px); background: radial-gradient(900px 400px at 10% -10%, rgba(59, 91, 219, 0.14), transparent 70%); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.lead { font-size: 1.22rem; color: var(--text-muted); max-width: 720px; }
.updated { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; margin: 4px 0 0; }
.updated::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* Update divider: new material above, older material below */
.update-divider { display: flex; align-items: center; gap: 14px; margin: 44px 0 28px; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.update-divider::before, .update-divider::after { content: ""; flex: 1; border-top: 2px solid var(--border); }
.new-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 2px 8px; vertical-align: middle; margin-left: 8px; }

/* Sections */
.section { padding: clamp(32px, 5vw, 56px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-intro { color: var(--text-muted); font-size: 1.08rem; }
.prose { max-width: 820px; }
.prose h2 { padding-top: 0.3em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1.5em; background: var(--surface); }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-alt); font-weight: 600; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.5em; }
.prose .table-wrap table { margin: 0; }
.note { padding: 14px 18px; border-radius: 12px; background: var(--warn-soft); border-left: 4px solid var(--warn); margin: 0 0 1.4em; font-size: 0.97rem; }
.note.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.note.info { background: var(--info-soft); border-left-color: var(--info); }
.sources { font-size: 0.92rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 30px; }
.sources ol { padding-left: 1.3em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform 0.12s ease, background 0.12s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-link { background: transparent; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.btn:focus-visible, .choice:focus-visible, .nav-toggle:focus-visible, summary:focus-visible, .resource:focus-visible, .pillar:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Home hero */
.hero { padding: clamp(40px, 7vw, 90px) 0 clamp(32px, 5vw, 60px); background: radial-gradient(900px 400px at 10% -10%, rgba(59, 91, 219, 0.14), transparent 70%), radial-gradient(700px 350px at 100% 10%, rgba(116, 143, 252, 0.16), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 18px; }
.hero-note { font-size: 0.95rem; color: var(--text-muted); }
.hero-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 24px rgba(20, 24, 40, 0.12)); }
.hero-art .label { font-family: var(--font-sans); font-size: 15px; font-weight: 600; fill: var(--text); }

/* Pillars (home) */
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.pillar { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 22px 20px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform 0.12s ease, border-color 0.12s ease; }
.pillar:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.pillar h3 { margin-bottom: 6px; }
.pillar p { color: var(--text-muted); font-size: 0.98rem; flex: 1; }
.pillar .go { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.pillar-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.pillar-icon svg { width: 26px; height: 26px; }
.pi-brain { background: var(--brain-soft); color: var(--brain); }
.pi-heart { background: var(--heart-soft); color: var(--heart); }
.pi-dna { background: var(--dna-soft); color: var(--dna); }
.pi-meta { background: var(--warn-soft); color: var(--warn); }

/* Cards and status (shared) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 22px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card p { color: var(--text-muted); font-size: 0.98rem; }
.card-status { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 0.88rem !important; font-weight: 500; display: flex; align-items: center; gap: 8px; margin-bottom: 0 !important; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-available { color: var(--ok) !important; } .status-available .dot { background: var(--ok); }
.status-mixed { color: var(--warn) !important; } .status-mixed .dot { background: var(--warn); }
.status-research { color: var(--info) !important; } .status-research .dot { background: var(--info); }

/* Reference lists (research, trials, other sites) */
.ref-list { list-style: none; padding: 0; margin: 0; }
.ref-list li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
.ref-list .ref-title { font-weight: 600; font-size: 1.04rem; }
.ref-list .ref-meta { color: var(--text-muted); font-size: 0.9rem; margin: 2px 0 6px; }
.ref-list p { margin: 0; font-size: 0.97rem; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; margin-right: 6px; vertical-align: middle; }
.tag-journal { background: var(--accent-soft); color: var(--accent-strong); }
.tag-preprint { background: var(--warn-soft); color: var(--warn); }
.tag-trial { background: var(--dna-soft); color: var(--dna); }
.tag-us { background: var(--ok-soft); color: var(--ok); }
.tag-eu { background: var(--brain-soft); color: var(--brain); }

/* Resources */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.resource { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 16px; text-decoration: none; color: var(--text); transition: border-color 0.12s ease, transform 0.12s ease; }
.resource:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.resource h3 { font-size: 1.12rem; margin-bottom: 6px; }
.resource p { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.resource-link { color: var(--accent); font-weight: 600; font-size: 0.93rem; }

/* Advisor */
.advisor { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); max-width: 900px; }
.advisor-question { margin-bottom: 20px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.choice { text-align: left; background: var(--bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.choice-title { font-weight: 600; font-size: 1.05rem; }
.choice-sub { color: var(--text-muted); font-size: 0.92rem; }
.result-card h3 { font-size: 1.6rem; }
.result-card .result-body h4 { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin: 24px 0 8px; }
.result-card ul { margin: 0 0 8px; }
.callout { margin-top: 20px; padding: 14px 18px; border-radius: 12px; background: var(--warn-soft); border-left: 4px solid var(--warn); font-size: 0.97rem; }
.callout.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-weight: 600; font-size: 1.08rem; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-body { padding: 0 20px 18px; color: var(--text-muted); }
.faq-body p:last-child, .faq-body ul:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-muted); font-size: 0.92rem; margin-top: 40px; }
.footer-inner p { margin-bottom: 6px; }

/* ---------- Home illustration: animation ---------- */
.hero-art { overflow: visible; }
.hero-art .label { font-family: var(--font-sans); font-size: 15px; font-weight: 600; fill: var(--text); }

/* Brain: neurons glow in turn, signals travel along the axons */
.hero-art .neuron { fill: #ffffff; opacity: 0.55; animation: neuron-glow 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes neuron-glow { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.35); } }
.hero-art .pulse { fill: #fff3bf; filter: drop-shadow(0 0 3px #ffe066); offset-rotate: 0deg; animation: signal-flow 2.4s linear infinite; }
@keyframes signal-flow { 0% { offset-distance: 0%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }

/* DNA: base pairs shimmer in sequence down the helix */
.hero-art .rung { animation: rung-shimmer 2.4s ease-in-out infinite; }
@keyframes rung-shimmer { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Heart: beats with a lub-dub rhythm; the ECG trace is drawn continuously */
.hero-art .heart { transform-box: fill-box; transform-origin: 50% 55%; animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.09); } 28% { transform: scale(1); } 42% { transform: scale(1.06); } 60% { transform: scale(1); } }
.hero-art .ecg { stroke-dasharray: 90 320; stroke-dashoffset: 410; animation: ecg-run 2.2s linear infinite; }
@keyframes ecg-run { to { stroke-dashoffset: 0; } }

/* Flow between the three: dashes move along the arcs */
.hero-art .arc { stroke-dasharray: 7 9; opacity: 0.55; animation: arc-flow 1.6s linear infinite; }
@keyframes arc-flow { to { stroke-dashoffset: -32; } }

@media (prefers-reduced-motion: reduce) {
  .hero-art .pulse { display: none; }
  .hero-art .neuron { opacity: 0.85; }
  .hero-art .ecg { stroke-dasharray: none; }
}

/* ---------- Login and account forms ---------- */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); margin-bottom: 20px; }
.auth-card h2 { margin-top: 0; }
.auth-card label { display: block; font-weight: 600; font-size: 0.95rem; margin: 14px 0 6px; }
.auth-card input[type="text"], .auth-card input[type="email"], .auth-card select { width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); }
.auth-card input:focus, .auth-card select:focus { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.auth-card fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px 6px; margin: 16px 0; }
.auth-card legend { font-weight: 600; font-size: 0.95rem; padding: 0 6px; }
.auth-card label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; margin: 10px 0; }
.auth-card label.check input { margin-top: 5px; }
.form-msg { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); margin: 12px 0 0; font-size: 0.95rem; }
.form-msg.ok { background: var(--ok-soft); color: var(--ok); }
.form-msg.err { background: var(--heart-soft); color: var(--heart); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.small-print { font-size: 0.88rem; color: var(--text-muted); margin-top: 16px; }
.danger-zone { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; }
.btn-danger { background: var(--heart); color: #fff; }
.btn-danger:hover { background: #a61e4d; color: #fff; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--bg-alt); padding: 1px 6px; border-radius: 6px; }
