/* MindFence landing page. Warm paper with the ember accent: the app's dark
 * screenshots sit framed on a light ground, the way Apple shows a phone.
 * Dark-committed until 2026-08-26; the founder retired it because ember on
 * near-black reads as another site entirely.
 * Same posture as style.css: no fonts, no scripts, no third parties. */

:root {
    color-scheme: light;
    --ground: #FBF9F6;
    --panel: #FFFFFF;
    --line: #E4DED4;
    --text: #16130F;
    --muted: #5C554C;
    --ember: #A85F1E;
    --ember-deep: #D8873F;
    --on-ember: #FFFFFF;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: var(--ember); }

:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
    border-radius: 4px;
}

.wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---- Sticky nav ---- */

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--ground) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 650;
    letter-spacing: -0.01em;
}

.mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex: none;
    background: conic-gradient(from 232deg, var(--ember) 0deg 305deg, transparent 305deg 360deg);
    -webkit-mask: radial-gradient(closest-side, transparent 54%, #000 56%, #000 92%, transparent 94%);
    mask: radial-gradient(closest-side, transparent 54%, #000 56%, #000 92%, transparent 94%);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    font-size: .95rem;
}

.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.nav-links a.button { color: var(--on-ember); }

@media (max-width: 480px) {
    .nav-links a:not(.button) { display: none; }
}

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

.button {
    display: inline-block;
    background: var(--ember);
    color: var(--on-ember);
    text-decoration: none;
    font-weight: 650;
    padding: .8rem 1.35rem;
    border-radius: 12px;
    transition: transform .15s ease, filter .15s ease;
}

.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button.small { padding: .45rem .9rem; border-radius: 10px; font-size: .92rem; }

.button.quiet {
    background: transparent;
    color: var(--ember);
    border: 1px solid var(--line);
}

.cta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem 1rem;
}

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

.hero {
    position: relative;
    padding: 4.5rem 0 0;
    text-align: center;
}

/* The ember glow the phone sits in. Pure decoration, cheap to paint. */
.hero::before {
    content: "";
    position: absolute;
    inset: auto 0 -20rem 0;
    height: 60rem;
    background:
        radial-gradient(42rem 42rem at 50% 78%,
            color-mix(in srgb, var(--ember-deep) 26%, transparent), transparent 68%);
    pointer-events: none;
}

.hero .wrap { position: relative; }

h1 {
    font-size: clamp(2.4rem, 6.5vw, 4rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
    margin: 0 auto .9rem;
    max-width: 24ch;
    font-weight: 700;
}

.hero .lede {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.55;
    color: var(--muted);
    max-width: 44ch;
    margin: 0 auto 1.75rem;
}

.hero .cta { justify-content: center; }

.hero .fine {
    margin: .9rem 0 0;
    font-size: .88rem;
    color: var(--muted);
}

/* ---- Phone frames ---- */

.phone {
    margin: 3rem auto 0;
    width: min(340px, 82vw);
    border: 8px solid #26201A;
    border-radius: 52px;
    background: #000;
    box-shadow:
        0 40px 90px -30px rgba(22, 19, 15, .35),
        0 0 0 1px rgba(22, 19, 15, .05);
    overflow: hidden;
    position: relative;
}

.phone img { display: block; width: 100%; height: auto; }

/* Hero phone: tall screenshot clipped at the fold */
.hero .phone {
    border-bottom: 0;
    border-radius: 52px 52px 0 0;
    max-height: min(560px, 64vh);
}

/* Feature phones: same clip, so a tall screenshot's empty tail never shows */
.feature .phone {
    border-bottom: 0;
    border-radius: 52px 52px 0 0;
    max-height: 520px;
}

/* ---- Fact ribbon ---- */

.facts {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 60%, transparent);
}

.facts .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem 2.2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: .92rem;
    color: var(--muted);
}

.facts span { white-space: nowrap; }

/* ---- Feature sections ---- */

.feature { padding: 5rem 0 2rem; }

.feature .wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 760px) {
    .feature { padding: 7rem 0 2rem; }
    .feature .wrap { grid-template-columns: 1fr 1fr; gap: 4rem; }
    .feature.flip .copy { order: 2; }
    .feature.flip .phone { order: 1; }
    .feature .phone { margin: 0 auto; }
}

.after-tiers { margin-top: 2rem; }

.feature h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 0 .8rem;
}

.feature p { color: var(--muted); font-size: 1.05rem; margin: 0 0 1rem; }
.feature p strong { color: var(--text); font-weight: 600; }

.kicker {
    display: block;
    font-size: .85rem;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: .7rem;
}

/* ---- Tier cards ---- */

.tiers {
    display: grid;
    gap: .8rem;
    grid-template-columns: 1fr;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 700px) { .tiers { grid-template-columns: repeat(3, 1fr); } }

.tiers li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
}

.tiers h3 { margin: 0 0 .3rem; font-size: 1.02rem; }
.tiers p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---- Plain sections ---- */

.section { padding: 5rem 0 0; }
.section h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    letter-spacing: -0.02em;
    line-height: 1.12;
    margin: 0 0 .8rem;
    max-width: 22ch;
}
.section > .wrap > p { color: var(--muted); font-size: 1.05rem; max-width: 58ch; margin: 0 0 1rem; }
.section p strong { color: var(--text); font-weight: 600; }

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

.faq { max-width: 44rem; margin: 2rem auto 0; }

.faq details {
    border-bottom: 1px solid var(--line);
    padding: .35rem 0;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: .8rem 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    color: var(--ember);
    font-size: 1.3rem;
    font-weight: 400;
    flex: none;
    transition: transform .2s ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { color: var(--muted); margin: 0 0 1rem; }

/* ---- Closing CTA ---- */

.closer {
    margin: 6rem 0 0;
    padding: 4.5rem 0;
    text-align: center;
    background:
        radial-gradient(36rem 22rem at 50% 0%,
            color-mix(in srgb, var(--ember-deep) 20%, transparent), transparent 70%);
    border-top: 1px solid var(--line);
}

.closer h2 {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 .8rem;
}

.closer p { color: var(--muted); max-width: 46ch; margin: 0 auto 1.6rem; }
.closer .cta { justify-content: center; }
.closer .fine { margin-top: .9rem; font-size: .88rem; color: var(--muted); }

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

footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0 3rem;
    color: var(--muted);
    font-size: .88rem;
}

footer a { color: var(--muted); }

/* ---- The pact sentence card ---- */
/* The friends section shows the interface itself rather than a screenshot:
 * a rule is a sentence, so the marketing renders one. */

.sentence-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 2rem;
    margin: 3rem auto 0;
    max-width: 26rem;
    box-shadow: 0 30px 70px -30px rgba(22, 19, 15, .2);
}

@media (min-width: 760px) {
    .feature .sentence-card { margin: 0 auto; }
}

.sentence {
    font-size: clamp(1.5rem, 3.5vw, 1.9rem);
    line-height: 1.4;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 1.1rem;
}

.sentence mark {
    background: color-mix(in srgb, var(--ember) 16%, transparent);
    color: var(--ember);
    border-radius: .45em;
    padding: .04em .3em;
}

.sentence-note { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---- The everything-else grid ---- */

.grid {
    display: grid;
    gap: .8rem;
    grid-template-columns: 1fr;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.grid li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
}

.grid h3 { margin: 0 0 .3rem; font-size: 1.02rem; }
.grid p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---- Comparison table ---- */

.compare-scroll { overflow-x: auto; margin: 2.5rem 0 0; }

.compare {
    width: 100%;
    min-width: 34rem;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    font-size: .98rem;
}

.compare th, .compare td {
    padding: .85rem 1.1rem;
    text-align: left;
    border-top: 1px solid var(--line);
    vertical-align: top;
}

.compare thead th { border-top: 0; font-size: .92rem; color: var(--muted); }
.compare thead th.us { color: var(--ember); }
.compare tbody th { font-weight: 600; }
.compare td { color: var(--muted); }
.compare td.us { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--ember) 6%, transparent); }
.compare td.yes::before { content: "✓ "; color: var(--ember); }

/* ---- Rotating hero phrase ---- */
/* CSS-only, keeping the no-script posture: five phrases stacked in one grid
 * cell, each visible for a fifth of the cycle. Screen readers and
 * reduced-motion get the first phrase alone; the rest are aria-hidden. */

.rotator {
    display: inline-grid;
    justify-items: center;
    color: var(--ember);
}

.rotor {
    grid-area: 1 / 1;
    white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
    .rotor {
        opacity: 0;
        animation: rotate-word 15s infinite;
    }
    .rotor:nth-child(1) { animation-delay: 0s; }
    .rotor:nth-child(2) { animation-delay: 3s; }
    .rotor:nth-child(3) { animation-delay: 6s; }
    .rotor:nth-child(4) { animation-delay: 9s; }
    .rotor:nth-child(5) { animation-delay: 12s; }
}

@media (prefers-reduced-motion: reduce) {
    .rotor { display: none; }
    .rotor:first-child { display: inline; }
}

@keyframes rotate-word {
    0% { opacity: 0; transform: translateY(.35em); }
    3%, 17% { opacity: 1; transform: none; }
    20%, 100% { opacity: 0; transform: translateY(-.35em); }
}

/* ---- Scroll reveals ---- */
/* CSS-only, keeping the no-script posture: each block rises as it enters the
 * viewport, which staggers naturally because each has its own timeline.
 * Browsers without scroll-driven animations, and anyone preferring reduced
 * motion, get the finished layout with no animation at all. */

@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .reveal {
            animation: rise linear both;
            animation-timeline: view();
            animation-range: entry 5% entry 45%;
        }
    }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button { transition: none; }
}
