/* SagaJoe public site. Mobile-first; breakpoints 640 / 960 / 1200. Colors only from the tokens.
   The brand tokens (colors, fonts, focus ring) are defined once in App.razor and shared with app.css. */

:root {
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15, 39, 71, .06), 0 8px 24px rgba(15, 39, 71, .08);
    --max: 1120px;
    --gutter: 20px;
    --section-y: 64px;
    --header-h: 64px;
}

@media (min-width: 640px) {
    :root { --gutter: 24px; }
}

@media (min-width: 960px) {
    :root { --section-y: 96px; --header-h: 68px; }
}

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body.public {
    margin: 0;
    background: var(--offwhite);
    color: var(--navy);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

@media (min-width: 960px) {
    body.public { font-size: 18px; }
}

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

h1, h2, h3 { margin: 0; font-family: var(--font-display); color: inherit; }

h1 {
    font-weight: 700;
    font-size: 38px;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

h2 { font-weight: 600; font-size: 30px; line-height: 1.15; }
h3 { font-weight: 600; font-size: 20px; line-height: 1.3; }

@media (min-width: 960px) {
    h1 { font-size: 56px; }
    h2 { font-size: 38px; }
    h3 { font-size: 22px; }
}

p { margin: 0; }

a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.chips, .pills, .checks, .faq { margin: 0; padding: 0; list-style: none; }

.sr-only {
    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: 16px; top: -48px; z-index: 100;
    padding: 8px 16px; border-radius: 999px;
    background: var(--navy); color: var(--white); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
    width: 100%;
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.center { text-align: center; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 28px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--teal-deep); color: var(--white); }
.btn-primary:hover { background: var(--teal-deep-hover); color: var(--white); }

.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { color: var(--navy); border-color: var(--slate); }

.btn-on-dark { background: var(--white); color: var(--navy); }
.btn-on-dark:hover { background: var(--offwhite); color: var(--navy); }

a.btn:hover { transform: translateY(-1px); }

.btn-sm { height: 44px; padding: 0 20px; }
.btn-xs { height: 36px; padding: 0 16px; font-size: 14px; cursor: default; }
.btn-square { border-radius: 10px; }
.btn-block { display: flex; width: 100%; }

.btn-text { font-size: 14px; font-weight: 600; color: var(--navy); padding: 0 6px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--header-h);
}

.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand .logo { height: 36px; width: auto; }

.header-nav { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.header-signin { display: none; font-size: 16px; font-weight: 600; color: var(--navy); }
.header-signin:hover { color: var(--navy); }

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--navy);
    cursor: pointer;
}
.menu-toggle .menu-icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon-close { display: inline; }

.mobile-menu { border-top: 1px solid var(--line); background: var(--white); }
.mobile-menu .container { display: flex; flex-direction: column; padding-block: 8px 16px; }
.mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    color: var(--navy);
}
.mobile-menu a:last-child { border-bottom: 0; }

@media (min-width: 960px) {
    .header-nav {
        display: flex;
        gap: 28px;
        margin-inline: auto;
        font-size: 16px;
        font-weight: 500;
    }
    .header-nav a { color: var(--navy); }
    .header-actions { margin-left: 0; gap: 20px; }
    .header-signin { display: inline; }
    .menu-toggle, .mobile-menu { display: none; }
}

/* ---------- Sections ---------- */

.band { padding-block: var(--section-y); }
.band-white { background: var(--white); }
.band-mint { background: var(--mint); }
.band-navy { background: var(--navy); color: var(--offwhite); }
.band-tight { padding-block: 64px; }

@media (min-width: 960px) {
    .band-tight { padding-block: 80px; }
}

.eyebrow {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--teal-deep);
}

.section-title { margin-bottom: 40px; max-width: 720px; }
.section-title.wide { max-width: 780px; }
.section-title.flush { margin-bottom: 16px; }
.center .section-title { margin-inline: auto; }

@media (min-width: 960px) {
    .section-title { margin-bottom: 48px; }
}

.muted { color: var(--slate); }

.card { background: var(--white); border-radius: var(--radius); }
.card.mock { box-shadow: var(--shadow); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }

.chip {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--mint);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.chip-white { background: var(--white); padding: 2px 10px; font-size: 13px; font-weight: 600; }
.chip-peach { background: var(--peach); color: var(--navy); padding: 2px 10px; font-size: 12px; font-weight: 600; }

/* ---------- Hero ---------- */

.hero { padding-block: 56px 72px; }

.hero-grid { display: grid; gap: 48px; align-items: center; }

.hero h1 { margin-bottom: 20px; }
.hero .eyebrow { margin-bottom: 16px; }
.lead { margin-bottom: 32px; font-size: 18px; color: var(--slate); max-width: 520px; }
.hero .btn-row { margin-bottom: 20px; }
.reassure { font-size: 14px; color: var(--slate); }

@media (min-width: 960px) {
    .hero { padding-block: 96px 104px; }
    .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 64px; }
    .hero h1 { margin-bottom: 24px; }
    .lead { font-size: 19px; margin-bottom: 36px; }
    .hero .btn-row { margin-bottom: 24px; }
}

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

/* Joe peeks over the card's top edge: his chin is hidden behind the card. */
.note-wrap { position: relative; width: 100%; max-width: 460px; margin: 0; padding-top: 84px; }
.joe-peek { position: absolute; top: 0; right: 28px; width: 104px; z-index: 0; }

.note-card { position: relative; z-index: 1; padding: 24px; }
@media (max-width: 399px) {
    .note-card { padding: 20px 16px; }
}

.note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.note-head img { width: 30px; height: 32px; }
.note-title { font-weight: 600; }
.note-date { margin-left: auto; font-size: 13px; color: var(--slate); white-space: nowrap; }
.note-line { margin-bottom: 16px; }

.proposal { padding: 16px; border-radius: 12px; background: var(--mint); }
.proposal .chip { margin-bottom: 10px; }
.proposal p { margin-bottom: 8px; }
.old-value { color: var(--slate); }
.source { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--slate); }
.alert-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--alert); flex: 0 0 auto; }
.proposal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.note-foot { margin-top: 16px; font-size: 13px; color: var(--slate); }

@media (prefers-reduced-motion: no-preference) {
    .note-wrap { animation: fade-up .4s ease-out both; }
    .proposal { animation: highlight-once 1.4s ease-in-out .6s 1 both; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes highlight-once {
    0%, 100% { box-shadow: 0 0 0 0 rgba(19, 138, 138, 0); }
    40% { box-shadow: 0 0 0 4px rgba(19, 138, 138, .35); }
}

/* ---------- Problem cards ---------- */

.grid-3 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.problem-card { padding: 28px; background: var(--offwhite); }
.problem-card svg, .principle svg { color: var(--teal-deep); }
.problem-card h3 { margin: 16px 0 8px; font-size: 20px; }
.problem-card p { font-size: 16px; color: var(--slate); }

/* ---------- How it works: steps joined by a dashed line on desktop ---------- */

.steps {
    position: relative;
    display: grid;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.step-num {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 0 0 6px var(--offwhite);
}

.step-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    border: 1px solid var(--line);
}
.step-card p { font-size: 16px; color: var(--slate); }

@media (min-width: 960px) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

    /* From the centre of the first badge (18px) to the centre of the last one. */
    .steps::before {
        content: "";
        position: absolute;
        top: 17px;
        left: 18px;
        right: calc((100% - 48px) / 3 - 18px);
        border-top: 2px dashed var(--teal);
    }
}

.snip { margin-top: auto; padding-top: 12px; font-size: 14px; }
.snip-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--slate); }
.snip-row { display: flex; gap: 8px; }
.snip-input {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--offwhite);
    font-size: 15px;
}

.snip-fact, .snip-accept { padding: 14px; border-radius: 12px; line-height: 1.5; display: flex; gap: 10px; }
.snip-fact { align-items: flex-start; background: var(--offwhite); }
.snip-fact svg { flex: 0 0 auto; margin-top: 1px; color: var(--teal-deep); }
.snip-source { display: block; font-size: 13px; color: var(--slate); }
.snip-accept { align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--mint); }

/* ---------- The brief ---------- */

.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; } }

.split-copy .section-title { margin-bottom: 20px; }
.split-copy .muted { margin-bottom: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.brief-card { margin: 0; padding: 24px; }
@media (max-width: 399px) { .brief-card { padding: 20px 16px; } }

.brief-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.brief-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.brief-sub { font-size: 13px; color: var(--slate); }

.fact-group {
    margin: 16px 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--slate);
}
.fact { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact-source { font-size: 13px; color: var(--slate); }
.fact .chip-peach { margin-top: 4px; }

/* ---------- Works with your AI ---------- */

.ai-row { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .ai-row { grid-template-columns: minmax(0, 1fr) auto; gap: 48px; } }

.ai-copy p { max-width: 560px; color: var(--navy); }
.ai-pills { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills li { padding: 10px 20px; border-radius: 999px; background: var(--white); font-weight: 600; font-size: 16px; }
.soon {
    padding: 4px 12px;
    border: 1px dashed var(--teal-deep);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Calm by design ---------- */

.principles { display: grid; gap: 32px; }
@media (min-width: 640px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; } }

.principle { display: flex; gap: 16px; }
.principle svg { flex: 0 0 auto; }
.principle h3 { margin-bottom: 4px; font-size: 20px; }
.principle p { font-size: 16px; color: var(--slate); }

/* ---------- Pricing ---------- */

.price-card {
    max-width: 520px;
    margin-inline: auto;
    padding: 28px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--offwhite);
    text-align: left;
}
@media (min-width: 640px) { .price-card { padding: 36px; } }

.price { display: flex; align-items: baseline; gap: 8px; }
.price-amount { font-family: var(--font-display); font-weight: 700; font-size: 52px; line-height: 1; }
.price-unit { color: var(--slate); }
.price-includes { margin: 8px 0 4px; font-weight: 600; }
.price-extra { margin-bottom: 24px; color: var(--slate); }

.checks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; font-size: 16px; }
.checks li {
    position: relative;
    padding-left: 30px;
}
.checks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    background: var(--teal-deep);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.calc { margin-bottom: 24px; padding: 20px; border-radius: 14px; background: var(--white); }
.calc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.calc-row label, .calc-row output { font-weight: 600; }
.calc-row:first-child { margin-bottom: 10px; }
.calc-total-row { margin-top: 12px; }
.calc-total-row span { color: var(--slate); }
.calc-total { font-family: var(--font-display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }

.calc input[type="range"] {
    width: 100%;
    height: 24px;
    margin: 0;
    accent-color: var(--teal-deep);
    cursor: pointer;
}

.price-note { margin-top: 16px; font-size: 14px; color: var(--slate); text-align: center; }

/* ---------- FAQ ---------- */

.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    position: relative;
    display: block;
    padding: 20px 36px 20px 0;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.4;
    cursor: pointer;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "";
    position: absolute;
    right: 6px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--teal-deep);
    border-bottom: 2px solid var(--teal-deep);
    transform: translateY(-70%) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding-bottom: 20px; font-size: 16px; color: var(--slate); }

@media (prefers-reduced-motion: no-preference) {
    .faq summary::after { transition: transform .2s ease; }
}

/* ---------- Final call to action ---------- */

.cta .container { display: flex; flex-direction: column; align-items: center; }
.cta-joe {
    width: 112px;
    height: 112px;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 999px;
    background: var(--offwhite);
    object-fit: contain;
}
.cta h2 { color: var(--offwhite); }
.cta p { margin-bottom: 32px; color: var(--offwhite); }

/* ---------- Footer ---------- */

.site-footer { padding-block: 48px; border-top: 1px solid var(--line); background: var(--white); }

.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 32px; }
.footer-brand { flex: 1 1 280px; }
.footer-brand .logo { height: 30px; width: auto; margin-bottom: 12px; }
.footer-brand p { max-width: 320px; font-size: 14px; color: var(--slate); }

.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 14px; font-weight: 500; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); }

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 32px;
    font-size: 13px;
    color: var(--slate);
}
.made-in { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Simple pages (privacy, terms, contact, 404) ---------- */

.prose-page { min-height: 50vh; }
.prose h1 { margin-bottom: 24px; }
.prose h2 { margin: 32px 0 8px; font-size: 22px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.contact-email { font-size: 22px; font-weight: 600; }

.draft-notice {
    margin-bottom: 32px;
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--alert);
    background: var(--peach);
    color: var(--navy);
    font-size: 15px;
}

/* ---------- Articles (comparison pages) ---------- */

.article-body { max-width: calc(760px + 2 * var(--gutter)); }
.article-head { margin-bottom: 28px; }
.article-head h1 { margin-bottom: 16px; font-size: 34px; }
.article-meta { font-size: 14px; color: var(--slate); }
.article-lead { margin-bottom: 20px; font-size: 19px; }

@media (min-width: 960px) {
    .article-head h1 { font-size: 46px; }
}

.article-body h2 { margin: 48px 0 12px; font-size: 26px; }
.article-body h3 { margin: 32px 0 8px; font-size: 20px; }
.article-body h3.faq-q { margin-top: 24px; font-size: 18px; }
.article-body p, .article-body ul { margin: 0 0 14px; }
.article-body ul { padding-left: 22px; }
.article-body li { margin-bottom: 6px; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 960px) {
    .article-body h2 { font-size: 30px; }
}

.disclosure {
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--teal-deep);
    background: var(--mint);
    font-size: 15px;
}

.sources { font-size: 15px; }

/* Tables: a grid on wide screens, one card per row below 960px (no horizontal page scroll). */
.table-wrap { margin: 24px 0 12px; }
.table-note { margin-bottom: 8px; font-size: 14px; color: var(--slate); }

.compare-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.compare-table th { font-weight: 600; text-align: left; }

@media (min-width: 960px) {
    .table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
    .compare-table th, .compare-table td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--line); }
    .compare-table thead th { background: var(--mint); font-size: 14px; }
    .compare-table tbody tr:last-child > * { border-bottom: 0; }
    .compare-table-wide tbody th { width: 14%; }
}

@media (max-width: 959px) {
    .compare-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .compare-table, .compare-table tbody, .compare-table tr, .compare-table th, .compare-table td { display: block; }
    .compare-table tr {
        margin-bottom: 12px;
        padding: 16px 18px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--white);
    }
    .compare-table tbody th { margin-bottom: 8px; font-family: var(--font-display); font-size: 17px; }
    .compare-table td { padding: 6px 0; border-top: 1px solid var(--line); }
    .compare-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--slate);
    }
}
