/* =========================================================================
   Sorrel — apps.iliausatov.com/sorrel
   Visual identity derived from the app (SOR-1 redesign): warm paper, forest
   green brand, the six skill colors as accent rhythm, and a New York-adjacent
   serif (Newsreader) reserved for brand "language story" moments — sans for
   everything else, exactly like the app.
   Static HTML/CSS only (Cloudflare Pages). No framework, no build step.
   ========================================================================= */

:root {
    /* Surfaces — warm paper, app background token #F8F8F5 */
    --paper: #f8f8f5;
    --paper-2: #f1f1ec;
    --card: #ffffff;
    --ink: #1d1d1f;
    --ink-2: #55555a;   /* body — AA on paper */
    --ink-3: #86868b;   /* captions / tertiary */

    /* Brand */
    --brand: #3c7a5a;        /* forest green (Accent.primary, light) */
    --brand-deep: #2f5e47;   /* deeper green for CTA fill / hover */
    --brand-soft: #e7f0ea;   /* tinted green wash */
    --coral: #e85d3f;        /* the icon's "sun" — single warm punctuation */
    --amber: #f59e0b;        /* CEFR / level journey */

    /* Skill palette (the product's signature) */
    --s-listening: #2d9cdb;
    --s-speaking:  #28b66f;
    --s-reading:   #7b61ff;
    --s-writing:   #f59e0b;
    --s-grammar:   #ef5da8;
    --s-vocab:     #e85d3f;

    /* Lines & shadows (tinted to the paper, never pure black) */
    --line: rgba(31, 31, 31, 0.08);
    --line-2: rgba(31, 31, 31, 0.12);
    --shadow-card: 0 1px 2px rgba(47, 60, 50, 0.04), 0 12px 32px -16px rgba(47, 60, 50, 0.18);
    --shadow-lift: 0 2px 4px rgba(47, 60, 50, 0.06), 0 24px 48px -20px rgba(47, 60, 50, 0.28);

    /* Shape lock: cards 20px, small motifs 12px, interactive = pill */
    --r-card: 20px;
    --r-sm: 12px;
    --r-pill: 999px;

    --maxw: 1120px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0f0f14;
        --paper-2: #17171c;
        --card: #1a1a20;
        --ink: #f4f4f6;
        --ink-2: #b6b6bc;
        --ink-3: #9a9aa0;

        --brand: #62b98c;
        --brand-deep: #54a87c;
        --brand-soft: rgba(98, 185, 140, 0.12);
        --coral: #ff7d62;
        --amber: #ffc247;

        --s-listening: #58c7f3;
        --s-speaking:  #45d98d;
        --s-reading:   #a18cff;
        --s-writing:   #ffc247;
        --s-grammar:   #ff7bbc;
        --s-vocab:     #ff987a;

        --line: rgba(255, 255, 255, 0.09);
        --line-2: rgba(255, 255, 255, 0.14);
        --shadow-card: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
        --shadow-lift: 0 24px 56px -22px rgba(0, 0, 0, 0.8);
    }
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Soft warm wash behind the hero — replaces the cold noise overlay of the
   other apps. Two gentle sage/coral radials on paper. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 82% -8%, rgba(232, 93, 63, 0.10), transparent 70%),
        radial-gradient(70% 60% at 8% -2%, rgba(60, 122, 90, 0.12), transparent 72%);
}
@media (prefers-color-scheme: dark) {
    body::before {
        background:
            radial-gradient(60% 50% at 82% -8%, rgba(255, 125, 98, 0.10), transparent 70%),
            radial-gradient(70% 60% at 8% -2%, rgba(98, 185, 140, 0.14), transparent 72%);
    }
}

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

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

/* ---- Typography -------------------------------------------------------- */
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; }

.eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}

.lede { color: var(--ink-2); font-size: 1.15rem; max-width: 54ch; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--r-pill);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary { background: var(--brand-deep); color: #fff; box-shadow: 0 10px 24px -12px rgba(47, 94, 71, 0.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(47, 94, 71, 0.8); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); transform: translateY(-2px); box-shadow: var(--shadow-card); }

.store-badge { display: inline-block; transition: transform 0.4s var(--ease), filter 0.4s ease; }
.store-badge img { display: block; height: 56px; width: auto; border-radius: 11px; }
.store-badge:hover { transform: translateY(-3px); filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.22)); }
.store-badge:active { transform: translateY(0) scale(0.98); }

/* ---- Header / nav ------------------------------------------------------ */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    background: color-mix(in srgb, var(--paper) 78%, transparent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a.muted { color: var(--ink-2); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a.muted:hover { color: var(--ink); }
.nav .btn { padding: 0.6rem 1.15rem; font-size: 0.95rem; }

/* ---- Hero -------------------------------------------------------------- */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3.5rem, 7vw, 6rem); }
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 500;
    margin: 1.1rem 0 1.1rem;
}
.hero h1 em { font-style: italic; color: var(--brand); line-height: 1.12; }
.hero .tag { color: var(--ink-3); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.02em; }
.hero-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; }

/* Hero art: icon + a real skill×day motif (a brand pattern, not a fake screenshot) */
.hero-art { position: relative; display: grid; place-items: center; }
.icon-halo {
    width: clamp(120px, 22vw, 168px);
    height: clamp(120px, 22vw, 168px);
    border-radius: 30px;
    box-shadow: 0 30px 70px -24px rgba(47, 60, 50, 0.5);
}
.week-motif {
    margin-top: 1.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.2rem 1.2rem;
    width: min(100%, 380px);
}
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-days span { text-align: center; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.week-grid span { aspect-ratio: 1; border-radius: 7px; background: var(--paper-2); }
.week-grid span.on { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 26%, transparent), color-mix(in srgb, var(--c) 12%, transparent)); }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.9rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-2); font-weight: 500; }
.legend span::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }

/* ---- Section scaffolding ---------------------------------------------- */
section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 600; }
.section-head p { color: var(--ink-2); font-size: 1.1rem; margin-top: 0.8rem; max-width: 56ch; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}

/* ---- "What you get" — asymmetric bento (3 cells) ----------------------- */
.bento { display: grid; grid-template-columns: 1.4fr 1fr; grid-auto-rows: 1fr; gap: 1.25rem; }
.bento .cell { padding: clamp(1.6rem, 3vw, 2.2rem); display: flex; flex-direction: column; }
.bento .cell.wide { grid-column: 1; grid-row: 1 / span 2; justify-content: space-between; }
.bento .cell h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; }
.bento .cell p { color: var(--ink-2); font-size: 1rem; }
.cell .kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 0.9rem; }

/* mini insights motif inside the wide cell */
.mini-stats { display: flex; gap: 1.5rem; margin-top: 1.6rem; flex-wrap: wrap; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats b { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mini-stats small { color: var(--ink-3); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* skill chips row */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.8rem; border-radius: var(--r-pill); font-size: 0.85rem; font-weight: 600; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: color-mix(in srgb, var(--c) 72%, var(--ink)); border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }

/* ---- Showcase split (device placeholder + copy) ------------------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split.reverse .copy { order: 2; }
.split .copy h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; }
.split .copy p { color: var(--ink-2); font-size: 1.08rem; margin-top: 0.9rem; }
.feature-list { list-style: none; margin-top: 1.4rem; display: grid; gap: 0.85rem; }
.feature-list li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--ink); font-size: 1rem; }
.feature-list li .dot { flex: none; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; }

/* Phone frame — holds a real screenshot later; clearly a placeholder now */
.phone {
    width: min(290px, 80%);
    margin: 0 auto;
    border-radius: 40px;
    background: var(--card);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-lift);
    padding: 7px;            /* slim bezel */
    position: relative;
}
.phone .screen {
    border-radius: 33px;
    overflow: hidden;
    background: var(--card);
    display: block;
}
/* The screenshot drives the frame height — full image, no cropping. */
.phone .screen img { width: 100%; height: auto; display: block; }
/* Placeholder fallback when no screenshot is present */
.phone .screen span { display: block; padding: 4.5rem 1.5rem; text-align: center; color: var(--ink-3); font-size: 0.85rem; font-weight: 600; background: linear-gradient(180deg, var(--brand-soft), var(--paper-2)); }
.phones-2 { display: flex; justify-content: center; gap: 1.2rem; }
.phones-2 .phone:nth-child(2) { transform: translateY(28px); }

/* ---- Reports — centered editorial moment ------------------------------- */
.center-moment { text-align: center; max-width: 760px; margin: 0 auto; }
.center-moment h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; }
.center-moment .lede { margin: 1rem auto 0; }
.report-card {
    margin: 2.6rem auto 0;
    max-width: 560px;
    text-align: left;
    border-radius: var(--r-card);
    overflow: hidden;
    box-shadow: var(--shadow-lift);
    border: 1px solid var(--line);
}
.report-card .rc-head { background: var(--brand-deep); color: #fff; padding: 1.5rem 1.6rem; }
.report-card .rc-head small { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; opacity: 0.8; font-weight: 700; }
.report-card .rc-head h3 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin-top: 0.3rem; }
.report-card .rc-body { background: var(--card); padding: 1.5rem 1.6rem; }
.rc-stats { display: flex; gap: 1.8rem; }
.rc-stats div b { display: block; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-stats div small { color: var(--ink-3); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* ---- Plans (soft, compact) --------------------------------------------- */
.plans-note { max-width: 640px; margin: 0 auto; text-align: center; }
.plans-note h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; }
.plans-note p { color: var(--ink-2); font-size: 1.1rem; margin-top: 0.9rem; }
.plans-note .fine { color: var(--ink-3); font-size: 0.92rem; margin-top: 1rem; }

/* ---- Privacy band ------------------------------------------------------ */
.privacy-band { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.privacy-grid h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; }
.privacy-grid > div > p { color: var(--ink-2); margin-top: 0.9rem; font-size: 1.05rem; }
.honest { display: grid; gap: 1rem; }
.honest .row { display: flex; gap: 0.8rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.honest .row b { display: block; font-size: 0.98rem; }
.honest .row p { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.15rem; }
.honest .row .ic { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); display: grid; place-items: center; }
.honest .row .ic::before { content: "✓"; color: var(--brand); font-weight: 800; font-size: 0.85rem; line-height: 1; }

/* ---- FAQ --------------------------------------------------------------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 1.1rem; padding: 1.3rem 2.5rem 1.3rem 0; position: relative; transition: color 0.2s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 300; color: var(--ink-3); transition: transform 0.3s var(--ease), color 0.2s; }
.faq details[open] summary { color: var(--brand); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--brand); }
.faq details p { color: var(--ink-2); font-size: 1.02rem; padding-bottom: 1.4rem; max-width: 64ch; }

/* ---- Footer ------------------------------------------------------------ */
footer.site { border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; color: var(--ink-3); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.foot-links a { color: var(--ink-2); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.foot-links a:hover { color: var(--ink); }
.foot-copy { font-size: 0.9rem; }

/* ---- Legal pages ------------------------------------------------------- */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.legal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.legal-head img { width: 56px; height: 56px; border-radius: 13px; }
.legal-head h1 { font-size: 2rem; font-weight: 600; }
.legal-head .sub { color: var(--ink-3); font-size: 0.95rem; margin-top: 0.2rem; }
.legal .doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: clamp(1.8rem, 4vw, 3rem); }
.legal .doc h2 { font-size: 1.4rem; font-weight: 600; margin: 2rem 0 0.8rem; }
.legal .doc h2:first-child { margin-top: 0; }
.legal .doc h3 { font-size: 1.1rem; font-weight: 600; margin: 1.4rem 0 0.5rem; }
.legal .doc p, .legal .doc li { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 0.8rem; }
.legal .doc ul, .legal .doc ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.legal .doc li { margin-bottom: 0.5rem; }
.legal .doc strong { color: var(--ink); font-weight: 600; }
.legal .doc a { color: var(--brand); font-weight: 500; }
.legal .doc hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.legal .doc .updated { color: var(--ink-3); font-size: 0.95rem; }

/* ---- Scroll reveal (motivated: sequences content as it enters) --------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 920px) {
    .hero-grid { grid-template-columns: 1fr; text-align: left; }
    .hero-art { order: -1; }
    .bento { grid-template-columns: 1fr; }
    .bento .cell.wide { grid-column: auto; grid-row: auto; }
    .split { grid-template-columns: 1fr; }
    .split.reverse .copy { order: 0; }
    .plans { grid-template-columns: 1fr; }
    .privacy-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .wrap { padding: 0 18px; }
    .nav-links { gap: 0.9rem; }
    .nav-links a.muted { display: none; }
    .phones-2 { gap: 0.6rem; }
    .phones-2 .phone:nth-child(2) { display: none; }
    .rc-stats { gap: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { transition: none; opacity: 1; transform: none; }
    * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
