/* =============================================================
   ML4HF™ — Marketing site
   Design system: Apple-restraint + clinical authority
   ============================================================= */

/* ---- 1. Design tokens ---- */

:root {
    /* Brand */
    --pac-lavender:      #8a7ddc;
    --pac-lavender-soft: #b3a9ea;
    --pac-lavender-deep: #6c5ed1;
    --accent-gold:       #c8a961;

    /* Light theme */
    --bg:         #ffffff;
    --bg-soft:    #f7f7fa;
    --bg-card:    #ffffff;
    --ink:        #0b0e1a;
    --ink-2:      #3a3f4f;
    --ink-3:      #6c7184;
    --line:       #e5e7ee;
    --line-strong:#c9ccd6;

    /* Layout */
    --max:        1180px;
    --gutter:     24px;
    --radius:     16px;
    --radius-lg:  24px;

    /* Type scale (mobile-first; scaled up at md) */
    --t-display: clamp(2.4rem, 7vw, 4.6rem);
    --t-h1:      clamp(2rem, 5.5vw, 3.2rem);
    --t-h2:      clamp(1.5rem, 3.5vw, 2.2rem);
    --t-h3:      clamp(1.15rem, 2vw, 1.4rem);
    --t-body:    1rem;
    --t-small:   0.875rem;
    --t-micro:   0.75rem;

    /* Motion */
    --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg:         #0a0b12;
    --bg-soft:    #11131c;
    --bg-card:    #161826;
    --ink:        #ecedf3;
    --ink-2:      #b6bac9;
    --ink-3:      #7d8294;
    --line:       #232636;
    --line-strong:#2d3041;
}

/* ---- 2. Reset + base ---- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--t-body);
    line-height: 1.55;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--pac-lavender); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--pac-lavender-deep); }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--pac-lavender-soft); color: var(--ink); }

/* ---- 3. Typography ---- */

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}
h1.display { font-size: var(--t-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
h2          { font-size: var(--t-h2); line-height: 1.15; }
h3          { font-size: var(--t-h3); line-height: 1.25; }
.eyebrow {
    font-size: var(--t-micro);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pac-lavender);
}
.lede { font-size: 1.15rem; color: var(--ink-2); line-height: 1.6; max-width: 56ch; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; }

/* ---- 4. Layout primitives ---- */

.wrap     { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section  { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--hero  { padding: 56px 0 96px; }
@media (max-width: 720px) {
    .section { padding: 64px 0; }
    .section--hero { padding: 32px 0 56px; }
}
.grid     { display: grid; gap: 24px; }
.grid-2   { grid-template-columns: 1fr; }
.grid-3   { grid-template-columns: 1fr; }
.grid-4   { grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---- 5. Header / nav ---- */

.nav {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.brand-mark {
    width: 28px; height: 28px;
    object-fit: contain;
    /* Crisp rendering at small raster sizes; harmless on SVGs */
    image-rendering: -webkit-optimize-contrast;
}
.nav-links { display: none; gap: 28px; }
.nav-links a { color: var(--ink-2); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
    width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%;
    background: transparent; color: var(--ink-2);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
@media (min-width: 760px) { .nav-links { display: flex; } }

/* ---- 6. Buttons ---- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px;
    font-weight: 600; font-size: 0.95rem; line-height: 1;
    border-radius: 999px; border: 0;
    transition: all 0.2s var(--ease);
    cursor: pointer; text-decoration: none;
    white-space: nowrap;
}
.btn--primary  { background: var(--ink); color: var(--bg); }
.btn--primary:hover  { background: var(--pac-lavender-deep); color: white; transform: translateY(-1px); }
.btn--ghost    { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--bg-soft); border-color: var(--ink); }
.btn--accent   { background: var(--pac-lavender); color: white; }
.btn--accent:hover { background: var(--pac-lavender-deep); transform: translateY(-1px); }
.btn--lg       { padding: 16px 30px; font-size: 1rem; }
.btn .arrow { display: inline-block; transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- 7. Hero ---- */

.hero {
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(900px 500px at 85% 10%, color-mix(in srgb, var(--pac-lavender) 22%, transparent), transparent 60%),
        radial-gradient(700px 400px at 10% 90%, color-mix(in srgb, var(--accent-gold) 14%, transparent), transparent 60%);
    pointer-events: none;
}
.hero-inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) {
    .hero-inner { grid-template-columns: 1.15fr 1fr; gap: 64px; }
}
.hero h1 { margin-bottom: 18px; }
.hero .lede { margin-bottom: 32px; }
.hero-cta-row { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
@media (min-width: 540px) {
    .hero-cta-row { flex-direction: row; align-items: center; }
}
.hero-microcopy { color: var(--ink-3); font-size: var(--t-small); margin-top: 14px; }

/* Stevenson quadrant — animated visual hero (CSS-only) */
.stevenson {
    aspect-ratio: 1 / 1;
    max-width: 460px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--line);
    box-shadow: 0 20px 50px -20px color-mix(in srgb, var(--pac-lavender) 30%, transparent);
}
.stev-cell {
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
    color: var(--ink-2);
    transition: all 0.6s var(--ease);
    position: relative;
}
.stev-cell .letter { font-size: 3rem; font-weight: 900; line-height: 1; letter-spacing: -0.04em; }
.stev-cell .sub    { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; opacity: 0.8; }
.stev-cell.active {
    background: color-mix(in srgb, var(--pac-lavender) 18%, var(--bg-card));
    border-color: var(--pac-lavender);
    color: var(--pac-lavender-deep);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pac-lavender) 12%, transparent);
}
[data-theme="dark"] .stev-cell.active { color: var(--pac-lavender-soft); }

/* ---- 8. Email capture ---- */

.email-form {
    display: flex; flex-direction: column; gap: 10px;
}
.email-row {
    display: flex; gap: 8px; flex-direction: column;
}
@media (min-width: 540px) {
    .email-row { flex-direction: row; align-items: stretch; }
}
.email-input {
    flex: 1;
    padding: 14px 18px;
    font-family: inherit; font-size: 1rem;
    background: var(--bg-card); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: 999px;
    transition: border-color 0.15s var(--ease);
}
.email-input:focus { outline: none; border-color: var(--pac-lavender); }
.email-form .btn { white-space: nowrap; }
.email-status { font-size: var(--t-small); color: var(--ink-3); min-height: 1.4em; }
.email-status.ok  { color: #2c8a4a; }
.email-status.err { color: #c0392b; }
/* Netlify Forms spam honeypot — invisible to humans, bots fill it. */
.netlify-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- 9. Section: Problem ---- */

.problem {
    background: var(--bg-soft);
    border-block: 1px solid var(--line);
}
.problem-grid { display: grid; gap: 32px; }
@media (min-width: 760px) { .problem-grid { grid-template-columns: 0.85fr 1.15fr; gap: 64px; } }
.problem h2 { margin-bottom: 12px; }
.problem-body p { color: var(--ink-2); margin: 0 0 16px; font-size: 1.05rem; }

/* ---- 10. Feature cards ---- */

.feature-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: all 0.2s var(--ease);
}
.feature-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.feature-icon {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--pac-lavender) 12%, transparent);
    color: var(--pac-lavender-deep);
    margin-bottom: 18px;
}
[data-theme="dark"] .feature-icon { color: var(--pac-lavender-soft); }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p  { color: var(--ink-2); margin: 0; }

/* Compact index chips */
.index-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.index-chip {
    padding: 8px 14px;
    background: var(--bg-card); border: 1px solid var(--line);
    border-radius: 999px;
    font-size: var(--t-small); font-weight: 600; color: var(--ink-2);
}

/* ---- 11. Product showcase ---- */

.product {
    background: var(--bg-soft); border-block: 1px solid var(--line);
}
.product-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .product-grid { grid-template-columns: 1fr 1.1fr; } }
.product h2 { margin-bottom: 16px; }
.product-feature-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.product-feature-list li {
    display: flex; gap: 12px; align-items: flex-start;
    color: var(--ink-2);
}
.product-feature-list .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--pac-lavender); flex-shrink: 0; margin-top: 9px;
}

/* iPhone mockup frame */
.mockup {
    margin: 0 auto;
    aspect-ratio: 9 / 19;
    max-width: 320px;
    background: var(--bg-card);
    border: 8px solid var(--ink);
    border-radius: 44px;
    overflow: hidden;
    box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--pac-lavender) 35%, transparent);
    position: relative;
}
.mockup-screen {
    width: 100%; height: 100%;
    background: linear-gradient(160deg, #f3f7ff 0%, #b9caea 60%, #6f8cc9 100%);
    display: flex; flex-direction: column; gap: 18px;
    padding: 36px 22px 22px;
    color: #0b0e1a;
}
[data-theme="dark"] .mockup-screen {
    background: linear-gradient(160deg, #1a2236 0%, #2a3556 100%);
    color: #ecedf3;
}
.mock-row { display: flex; gap: 6px; }
.mock-bar { background: rgba(255,255,255,0.55); border-radius: 4px; height: 8px; }
[data-theme="dark"] .mock-bar { background: rgba(255,255,255,0.12); }

/* ---- 12. Programs (institutional) ---- */

.programs h2 { margin-bottom: 18px; }
.programs-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .programs-grid { grid-template-columns: 1fr 1fr; } }

/* ---- 13. Methodology teaser ---- */

.method {
    background: var(--bg-soft); border-block: 1px solid var(--line);
}
.citations {
    display: grid; gap: 10px; margin-top: 18px;
    font-size: var(--t-small); color: var(--ink-3);
}
.citation { padding-left: 18px; border-left: 2px solid var(--pac-lavender); }

/* ---- 14. Founder ---- */

.founder-card {
    display: grid; gap: 24px; align-items: center;
    padding: 36px; background: var(--bg-card); border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
@media (min-width: 720px) { .founder-card { grid-template-columns: 120px 1fr; } }
.founder-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, var(--pac-lavender), var(--accent-gold));
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 2rem;
    box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--pac-lavender) 50%, transparent);
}
.founder-card h3 { margin-bottom: 4px; }
.founder-card .role { color: var(--ink-3); font-size: var(--t-small); margin-bottom: 12px; }

/* ---- 15. Final CTA ---- */

.final-cta {
    text-align: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--pac-lavender) 8%, var(--bg-soft)), var(--bg-soft));
    border-block: 1px solid var(--line);
}
.final-cta .email-form { max-width: 480px; margin: 28px auto 0; }

/* ---- 16. Footer ---- */

.footer {
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: 56px 0 36px;
}
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer h4 { font-size: var(--t-small); font-weight: 700; margin-bottom: 14px; letter-spacing: 0.02em; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--ink-2); font-size: var(--t-small); font-weight: 500; }
.footer ul a:hover { color: var(--ink); }
.footer-bottom {
    margin-top: 40px; padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 12px;
    color: var(--ink-3); font-size: var(--t-micro);
}
@media (min-width: 760px) {
    .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---- 16b. Pillar list (accent-bar minimalism) ---- */
/* Vertical list with a thick lavender bar on the left + concise text on the
   right. Inspired by the citations block — same visual language, scaled up
   for headline content. Each pillar makes one point in one breath. */

.pillars {
    display: grid;
    gap: 36px;
    margin-top: 56px;
}
@media (min-width: 760px) {
    .pillars { grid-template-columns: 1fr 1fr; column-gap: 64px; row-gap: 48px; }
}
.pillar {
    padding-left: 22px;
    border-left: 3px solid var(--pac-lavender);
}
.pillar h3 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    line-height: 1.2;
}
.pillar p {
    margin: 0;
    color: var(--ink-2);
    font-size: 1rem;
    line-height: 1.55;
}

/* ---- 16c. Screenshot gallery (full-bleed horizontal filmstrip) ---- */

.gallery-section {
    background: var(--bg-soft);
    border-block: 1px solid var(--line);
    padding: 80px 0;
    overflow: hidden;
}
.gallery-header { max-width: var(--max); margin: 0 auto 40px; padding: 0 var(--gutter); }
.gallery-scroll {
    display: flex;
    gap: 24px;
    padding: 8px var(--gutter) 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.gallery-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 1240px) {
    /* When the wrap can fit them all, center the row instead of left-aligning. */
    .gallery-scroll { justify-content: center; }
}
.gallery-item {
    flex: 0 0 220px;
    scroll-snap-align: start;
}
.gallery-phone {
    aspect-ratio: 9 / 19;
    background: linear-gradient(160deg, #f3f7ff 0%, #b9caea 60%, #6f8cc9 100%);
    border: 8px solid var(--ink);
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 30px 60px -25px color-mix(in srgb, var(--pac-lavender) 40%, transparent);
    position: relative;
}
.gallery-phone img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
.gallery-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; text-align: center;
    color: rgba(11, 14, 26, 0.55);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.04em;
}
.gallery-caption {
    margin-top: 18px;
    font-size: var(--t-small);
    color: var(--ink-2);
    line-height: 1.5;
}
.gallery-caption strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

/* ---- 16d. PubMed link badge for citations ---- */
.cite-link {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
    color: var(--pac-lavender-deep);
    background: color-mix(in srgb, var(--pac-lavender) 12%, transparent);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.15s var(--ease);
    white-space: nowrap;
    vertical-align: middle;
}
.cite-link:hover { background: color-mix(in srgb, var(--pac-lavender) 24%, transparent); color: var(--pac-lavender-deep); }
[data-theme="dark"] .cite-link { color: var(--pac-lavender-soft); }

/* ---- 16e. Long-form pages (methodology, privacy, terms, press) ---- */

.doc-hero {
    padding: 64px 0 32px;
    border-bottom: 1px solid var(--line);
}
.doc-hero h1 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    margin: 0 0 12px;
    letter-spacing: -0.025em;
}
.doc-meta { color: var(--ink-3); font-size: var(--t-small); }
.doc-meta strong { color: var(--ink-2); font-weight: 600; }

.prose {
    max-width: 720px; margin: 0 auto;
    font-size: 1.05rem; color: var(--ink); line-height: 1.7;
    padding: 48px 0 80px;
}
.prose h2 {
    margin-top: 56px; margin-bottom: 16px;
    font-size: 1.5rem; scroll-margin-top: 84px;
}
.prose h2:first-of-type { margin-top: 0; }
.prose h3 { margin-top: 32px; margin-bottom: 8px; font-size: 1.15rem; }
.prose p { margin: 0 0 18px; color: var(--ink-2); }
.prose ul, .prose ol { color: var(--ink-2); padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--pac-lavender-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
[data-theme="dark"] .prose a { color: var(--pac-lavender-soft); }
.prose code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em; background: var(--bg-soft); padding: 2px 6px; border-radius: 4px;
}
.prose blockquote {
    margin: 24px 0; padding: 12px 20px;
    border-left: 3px solid var(--pac-lavender);
    color: var(--ink-2); font-style: italic;
}
.prose .callout {
    margin: 24px 0; padding: 20px 24px;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 0.98rem;
}
.prose .callout p:last-child { margin-bottom: 0; }
.prose .toc {
    background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 24px;
    margin: 0 0 40px;
}
.prose .toc h4 {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px;
}
.prose .toc ul { list-style: none; padding: 0; margin: 0; columns: 1; }
@media (min-width: 600px) { .prose .toc ul { columns: 2; column-gap: 32px; } }
.prose .toc li { margin-bottom: 6px; break-inside: avoid; }
.prose .toc a {
    color: var(--ink-2); font-size: 0.92rem; font-weight: 500;
    text-decoration: none;
}
.prose .toc a:hover { color: var(--pac-lavender-deep); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

/* ---- 17. Reveal on scroll ---- */

[data-reveal] {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal], [data-reveal].revealed { opacity: 1; transform: none; transition: none; }
    .stev-cell { transition: none !important; }
    html { scroll-behavior: auto; }
}
