/* ==========================================================================
   FlexPath — Editorial redesign
   Warm paper canvas · display serif · hairline rows · oversized numerals
   ========================================================================== */

:root {
    --paper: #F3F0E9;
    --paper-2: #ECE8DF;
    --ink: #15140F;
    --ink-soft: #45423A;
    --muted: #837E73;
    --line: rgba(21, 20, 15, 0.14);
    --line-soft: rgba(21, 20, 15, 0.08);
    --accent: #C2542E;
    --accent-deep: #A2421F;
    --max: 1240px;
    --gutter: clamp(20px, 5vw, 72px);
    --serif: 'Instrument Serif', 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Typography primitives ---------------------------------------------------- */
.display {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.015em;
}

.kicker {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
    font-weight: 500;
}

.serif-italic { font-family: var(--serif); font-style: italic; }

/* Navigation --------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(243, 240, 233, 0.72);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s ease, background 0.4s ease;
}

.navbar.scrolled { border-bottom-color: var(--line); }

.nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 18px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 26px;
    letter-spacing: -0.01em;
}

.nav-mark img { width: 26px; height: 26px; border-radius: 7px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 38px;
}

.nav-links a:not(.nav-cta) {
    font-size: 14px;
    color: var(--ink-soft);
    position: relative;
    transition: color 0.25s ease;
}

.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 1px;
    background: var(--ink);
    transition: width 0.3s ease;
}

.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }

.nav-cta {
    font-size: 14px;
    font-weight: 500;
    padding: 11px 22px;
    border: 1px solid var(--ink);
    border-radius: 100px;
    transition: all 0.3s ease;
}

.nav-cta:hover { background: var(--ink); color: var(--paper); }

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.mobile-menu-toggle span {
    width: 24px; height: 1.5px;
    background: var(--ink);
    transition: all 0.3s ease;
}

/* Buttons ------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    padding: 16px 30px;
    border-radius: 100px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }

.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.btn .arrow { transition: transform 0.3s ease; }
.btn:hover .arrow { transform: translate(3px, -3px); }

/* Hero --------------------------------------------------------------------- */
.hero {
    padding: clamp(140px, 22vh, 220px) 0 60px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 56px;
    align-items: center;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-visual img {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.35));
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
}

.hero-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.hero-title {
    font-size: clamp(3.4rem, 9.5vw, 8.2rem);
    margin-bottom: 40px;
    max-width: 14ch;
}

.hero-title em { font-style: italic; color: var(--accent); }

.hero-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: flex-start;
}

.hero-lede {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    color: var(--ink-soft);
    line-height: 1.55;
    max-width: 48ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-meta {
    margin-top: 28px;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* Strip -------------------------------------------------------------------- */
.strip {
    border-top: 1px solid var(--line);
    margin-top: 80px;
}

.strip-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    padding: 38px var(--gutter);
    max-width: var(--max);
    margin: 0 auto;
}

.strip-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 32px;
    border-left: 1px solid var(--line);
}

.strip-item:first-child { border-left: none; padding-left: 0; }

.strip-item b {
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.strip-item span {
    font-size: 13px;
    line-height: 1.4;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Editorial block ---------------------------------------------------------- */
.block {
    padding: clamp(72px, 11vh, 132px) 0;
    border-top: 1px solid var(--line);
}

.block-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
}

.block-index {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--accent);
}

.block-title {
    font-size: clamp(2rem, 4.4vw, 3.6rem);
    max-width: 18ch;
    margin-bottom: 56px;
}

.block-intro {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    color: var(--ink-soft);
    max-width: 60ch;
    margin: -32px 0 56px;
}

/* Hairline rows ------------------------------------------------------------ */
.rows { border-top: 1px solid var(--line); }

.row {
    display: grid;
    grid-template-columns: 64px 0.9fr 1.3fr;
    gap: 32px;
    align-items: start;
    padding: 36px 0;
    border-bottom: 1px solid var(--line);
    transition: padding-left 0.35s ease;
}

.row:hover { padding-left: 14px; }

.row-num {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--muted);
}

.row-title {
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.row-text {
    color: var(--ink-soft);
    font-size: 1rem;
    max-width: 46ch;
}

/* Economics figures -------------------------------------------------------- */
.figures {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.figure {
    padding: 40px 28px 44px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background 0.35s ease;
}

.figure:hover { background: var(--paper-2); }

.figure-num {
    font-family: var(--serif);
    font-size: clamp(2.8rem, 5vw, 4.4rem);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.figure.lead .figure-num { color: var(--accent); }

.figure-label {
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.45;
}

.figure-note {
    margin-top: 36px;
    font-size: 0.95rem;
    color: var(--muted);
    max-width: 70ch;
}

.figure-note b { color: var(--ink); font-weight: 500; }

/* Founder quote ------------------------------------------------------------ */
.quote-block {
    padding: clamp(90px, 14vh, 160px) 0;
    border-top: 1px solid var(--line);
}

.quote {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.6vw, 3.7rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    max-width: 24ch;
}

.quote em { font-style: italic; color: var(--accent); }

.quote-by {
    margin-top: 40px;
    font-size: 14px;
    color: var(--muted);
    max-width: 52ch;
    line-height: 1.6;
}

/* FAQ ---------------------------------------------------------------------- */
.faq-list { border-top: 1px solid var(--line); }

.qa {
    border-bottom: 1px solid var(--line);
}

.qa summary {
    list-style: none;
    cursor: pointer;
    padding: 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color 0.25s ease;
}

.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--accent); }

.qa .toggle {
    flex-shrink: 0;
    width: 26px; height: 26px;
    position: relative;
}

.qa .toggle::before,
.qa .toggle::after {
    content: '';
    position: absolute;
    background: var(--ink);
    transition: transform 0.3s ease;
}

.qa .toggle::before { top: 50%; left: 0; width: 100%; height: 1.5px; transform: translateY(-50%); }
.qa .toggle::after { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.qa[open] .toggle::after { transform: translateX(-50%) scaleY(0); }

.qa-answer {
    padding: 0 0 34px;
    max-width: 70ch;
    color: var(--ink-soft);
    font-size: 1.02rem;
}

/* Payers ------------------------------------------------------------------- */
.payers {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
}

.payer {
    position: relative;
    border: 1px solid var(--line);
    background: var(--paper-2);
    padding: 13px 24px 13px 36px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
}

.payer::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Patients ----------------------------------------------------------------- */
.patients {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 48px;
    align-items: center;
}

.patients h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.01em;
}

.patients p { color: var(--ink-soft); margin: 22px 0 30px; max-width: 46ch; }

.appstore img { height: 52px; width: auto; }

.patients-note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* CTA / demo --------------------------------------------------------------- */
.cta {
    padding: clamp(90px, 14vh, 170px) 0;
    border-top: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.cta ::selection { background: var(--paper); color: var(--ink); }

.cta-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: end;
}

.cta-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.015em;
}

.cta-title em { font-style: italic; color: var(--accent); }

.cta-sub { margin-top: 26px; color: rgba(243, 240, 233, 0.66); max-width: 40ch; }

.cta-form { width: 100%; }

.cta-form .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.email-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(243, 240, 233, 0.4);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 1.1rem;
    padding: 14px 2px;
    transition: border-color 0.3s ease;
}

.email-input::placeholder { color: rgba(243, 240, 233, 0.45); }
.email-input:focus { outline: none; border-bottom-color: var(--paper); }
.email-input.invalid { border-bottom-color: var(--accent); }

.validation-feedback { font-size: 13px; color: #E8946F; min-height: 16px; }

.cta-form .primary-button {
    margin-top: 8px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--paper);
    color: var(--ink);
    border: none;
    border-radius: 100px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    padding: 17px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-form .primary-button:hover { background: var(--accent); color: var(--paper); }
.cta-form .primary-button:disabled { opacity: 0.6; cursor: default; }

.cta-fineprint { margin-top: 18px; font-size: 13px; color: rgba(243, 240, 233, 0.55); }
.cta-fineprint a { color: var(--paper); border-bottom: 1px solid rgba(243,240,233,0.4); }

/* Footer ------------------------------------------------------------------- */
.foot {
    padding: 72px 0 48px;
    background: var(--ink);
    color: rgba(243, 240, 233, 0.7);
    border-top: 1px solid rgba(243, 240, 233, 0.12);
}

.foot-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 56px;
    border-bottom: 1px solid rgba(243, 240, 233, 0.12);
}

.foot-brand { max-width: 34ch; }

.foot-mark {
    font-family: var(--serif);
    font-size: 30px;
    color: var(--paper);
    margin-bottom: 14px;
}

.foot-brand p { font-size: 14px; line-height: 1.6; }

.foot-cols { display: flex; gap: 64px; flex-wrap: wrap; }

.foot-col h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(243, 240, 233, 0.5);
    margin-bottom: 16px;
    font-weight: 500;
}

.foot-col a {
    display: block;
    font-size: 14px;
    margin-bottom: 11px;
    color: rgba(243, 240, 233, 0.75);
    transition: color 0.25s ease;
}

.foot-col a:hover { color: var(--paper); }

.foot-bottom {
    padding-top: 28px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
    color: rgba(243, 240, 233, 0.5);
}

.foot-bottom a:hover { color: var(--paper); }

/* Legal pages -------------------------------------------------------------- */
.legal-page {
    padding: clamp(130px, 20vh, 200px) 0 clamp(72px, 11vh, 120px);
}

.legal-content {
    max-width: 760px;
    margin: 0 auto;
}

.legal-content > h1 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.015em;
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    margin-bottom: 14px;
}

.legal-content .last-updated {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 40px;
}

.legal-content > p {
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.legal-section {
    padding: 36px 0;
    border-top: 1px solid var(--line);
}

.legal-section h2 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.05;
    margin-bottom: 22px;
}

.legal-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 28px 0 12px;
}

.legal-section h4 {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 22px 0 10px;
}

.legal-section p {
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.legal-section ul {
    margin: 0 0 18px;
    padding-left: 22px;
}

.legal-section li {
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 10px;
}

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

.legal-content a {
    color: var(--accent);
    border-bottom: 1px solid rgba(194, 84, 46, 0.35);
    transition: border-color 0.25s ease;
}

.legal-content a:hover { border-bottom-color: var(--accent); }

/* Toast (from script.js) --------------------------------------------------- */
.form-message {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideInDown 0.3s ease;
}

.form-message.success { background: var(--ink); color: var(--paper); }
.form-message.error { background: var(--accent); color: var(--paper); }

/* Reveal ------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 900px) {
    .nav-links {
        position: fixed;
        top: 0; right: 0;
        height: 100vh;
        width: min(80vw, 320px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 28px;
        padding: 0 40px;
        background: var(--paper);
        border-left: 1px solid var(--line);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .nav-links.active { transform: translateX(0); }
    .nav-links a:not(.nav-cta) { font-size: 22px; font-family: var(--serif); }
    .mobile-menu-toggle { display: flex; z-index: 110; }
    .mobile-menu-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

    .hero-layout { grid-template-columns: 1fr; gap: 40px; }
    .hero-visual { order: -1; }
    .hero-visual img { max-width: 240px; }
    .hero-grid { grid-template-columns: 1fr; gap: 36px; align-items: start; }
    .figures { grid-template-columns: repeat(2, 1fr); }
    .cta-grid { grid-template-columns: 1fr; gap: 40px; align-items: start; }
    .patients { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 560px) {
    .row { grid-template-columns: 1fr; gap: 10px; }
    .row-num { font-size: 18px; }
    .figures { grid-template-columns: 1fr; }
    .strip-inner { grid-template-columns: 1fr 1fr; gap: 28px 0; }
    .strip-item { padding: 4px 20px; }
    .strip-item:nth-child(odd) { border-left: none; padding-left: 0; }
    .strip-item b { font-size: 28px; }
    .foot-cols { gap: 40px; }
}
