/* Tasks & Treasures — landing page
   Visual identity drawn from the raccoon logo: cream + navy, amber pouch
   as the primary accent, gem purple as the secondary, check green for
   success. Light is the default; dark follows the system preference or
   the manual toggle (html[data-theme]). */

:root {
    --bg-primary: #faf4e6;
    --bg-secondary: #f1e7d0;
    --bg-card: #fffdf6;
    --bg-card-soft: #f6eedb;
    --text-primary: #142238;
    --text-secondary: #5b6577;
    --text-soft: #3e4a63;
    --accent-primary: #b97e06;
    --accent-secondary: #574cca;
    --accent-rgb: 247, 173, 23;
    --accent2-rgb: 87, 76, 202;
    --on-accent: #1b2338;
    --success: #57a32f;
    --warning: #f7ad17;
    --danger: #d64545;
    --border-subtle: rgba(20, 34, 56, 0.12);
    --border-strong: rgba(20, 34, 56, 0.18);
    --radius: 16px;
    --gradient: linear-gradient(135deg, #f7ad17, #ee8d12);
    --gradient-text: linear-gradient(135deg, #c47408, #574cca);
}

[data-theme="dark"] {
    --bg-primary: #101c31;
    --bg-secondary: #0b1526;
    --bg-card: #1a2740;
    --bg-card-soft: #223050;
    --text-primary: #f7f1e1;
    --text-secondary: #a4aec2;
    --text-soft: #d8d3c4;
    --accent-primary: #f7ad17;
    --accent-secondary: #8d7ff0;
    --on-accent: #1b2338;
    --success: #6dbf45;
    --warning: #f7ad17;
    --danger: #ef5f5f;
    --border-subtle: rgba(247, 241, 225, 0.12);
    --border-strong: rgba(247, 241, 225, 0.18);
    --gradient-text: linear-gradient(135deg, #f7ad17, #a99bff);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #101c31;
        --bg-secondary: #0b1526;
        --bg-card: #1a2740;
        --bg-card-soft: #223050;
        --text-primary: #f7f1e1;
        --text-secondary: #a4aec2;
        --text-soft: #d8d3c4;
        --accent-primary: #f7ad17;
        --accent-secondary: #8d7ff0;
        --on-accent: #1b2338;
        --success: #6dbf45;
        --warning: #f7ad17;
        --danger: #ef5f5f;
        --border-subtle: rgba(247, 241, 225, 0.12);
        --border-strong: rgba(247, 241, 225, 0.18);
        --gradient-text: linear-gradient(135deg, #f7ad17, #a99bff);
    }
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

section { padding: 72px 0; }

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

h2 {
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    margin-bottom: 12px;
    text-align: center;
}

.section-sub {
    color: var(--text-secondary);
    text-align: center;
    max-width: 620px;
    margin: 0 auto 44px;
    font-size: 1.05rem;
}

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

.hero {
    background:
        radial-gradient(1000px 500px at 70% -10%, rgba(var(--accent-rgb), 0.20), transparent 65%),
        radial-gradient(800px 400px at 10% 10%, rgba(var(--accent2-rgb), 0.14), transparent 60%),
        var(--bg-primary);
    padding: 56px 0 80px;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 56px;
}

.hero-brand img { width: 44px; height: 44px; border-radius: 10px; }

.hero-brand span { font-weight: 700; font-size: 1.15rem; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 18px;
}

.hero h1 .grad {
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 30px;
    max-width: 480px;
}

/* ---------- Calls to action ---------- */

.cta-row {
    display: flex;
    align-items: center;
    gap: 22px;
}

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

/* Light/dark switch: sliding knob over sun and moon */
.theme-switch {
    margin-left: auto;
    position: relative;
    width: 64px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    font-size: 13px;
    line-height: 1;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg-card-soft);
    cursor: pointer;
}

.theme-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.theme-switch[aria-checked="true"] .theme-switch-knob {
    transform: translateX(32px);
}

.hero-login {
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
}

.hero-login:hover { color: var(--text-primary); }

/* Smaller button variant for the top bar */
.btn-primary.btn-compact {
    padding: 9px 18px;
    font-size: 0.9rem;
    border-radius: 12px;
}

.btn-primary {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius);
    color: var(--on-accent);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 26px;
    white-space: nowrap;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.35);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(var(--accent-rgb), 0.45); }

.form-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* ---------- Tablet frame ---------- */

.tablet {
    background: #0b0f1e;
    border: 2px solid #2c3654;
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    padding: 14px;
    position: relative;
}

.tablet::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3a4569;
}

.tablet img { border-radius: 10px; }

.hero-caption {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 14px;
}

/* ---------- Motivation loop ---------- */

#value { background: var(--bg-secondary); }

/* ---------- How it works ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
}

.step-emoji { font-size: 2.4rem; display: block; margin-bottom: 14px; }

.step-num {
    display: inline-block;
    background: var(--gradient);
    color: var(--on-accent);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 12px;
    margin-bottom: 12px;
}

.step h3 { font-size: 1.1rem; margin-bottom: 8px; }

.step p { color: var(--text-secondary); font-size: 0.95rem; }

/* ---------- Feature tour ---------- */

.tour-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 72px;
}

.tour-row:last-child { margin-bottom: 0; }

.tour-row.flip .tour-text { order: 2; }

.tour-text h3 { font-size: 1.5rem; margin-bottom: 12px; }

.tour-text p { color: var(--text-secondary); margin-bottom: 16px; }

.tour-text ul {
    list-style: none;
    color: var(--text-secondary);
}

.tour-text li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 8px;
}

.tour-text li::before {
    content: "✦";
    position: absolute;
    left: 4px;
    color: var(--accent-secondary);
}

.tour-text li strong { color: var(--text-primary); }

/* ---------- Feature grid ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 44px;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 20px;
}

.feature .f-emoji { font-size: 1.6rem; display: block; margin-bottom: 10px; }

.feature h4 { font-size: 1rem; margin-bottom: 6px; }

.feature p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; }

/* ---------- Story ---------- */

.story { background: var(--bg-secondary); }

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    max-width: 720px;
    margin: 0 auto;
    padding: 40px;
}

.story-card p { color: var(--text-soft); margin-bottom: 16px; }

.story-card p:last-of-type { margin-bottom: 0; }

.story-sign {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.story-sign .sig-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---------- Privacy ---------- */

.privacy-band {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent2-rgb), 0.12));
    border: 1px solid rgba(var(--accent2-rgb), 0.3);
    border-radius: var(--radius);
    padding: 36px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.privacy-item .p-emoji { font-size: 1.8rem; display: block; margin-bottom: 10px; }

.privacy-item h4 { font-size: 0.98rem; margin-bottom: 4px; }

.privacy-item p { color: var(--text-secondary); font-size: 0.85rem; }

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

.faq-list { max-width: 720px; margin: 0 auto; }

details {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

summary {
    cursor: pointer;
    font-weight: 600;
    padding: 18px 22px;
    list-style: none;
    position: relative;
}

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

summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    color: var(--accent-secondary);
    font-size: 1.3rem;
    line-height: 1;
}

details[open] summary::after { content: "–"; }

details p {
    color: var(--text-secondary);
    padding: 0 22px 18px;
}

/* ---------- Final CTA + footer ---------- */

.final-cta {
    background:
        radial-gradient(700px 350px at 50% 0%, rgba(var(--accent-rgb), 0.2), transparent 65%),
        var(--bg-secondary);
    text-align: center;
}

.final-cta .form-note { text-align: center; }

footer {
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 28px 0;
    text-align: center;
}

footer a { color: var(--accent-secondary); text-decoration: none; }

footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    section { padding: 56px 0; }

    .hero { padding: 36px 0 60px; }

    .hero-brand { margin-bottom: 36px; }

    .hero-grid { grid-template-columns: 1fr; gap: 40px; }

    .steps { grid-template-columns: 1fr; }

    .tour-row { grid-template-columns: 1fr; gap: 24px; margin-bottom: 56px; }

    .tour-row.flip .tour-text { order: 0; }

    .feature-grid { grid-template-columns: 1fr 1fr; }

    .privacy-band { grid-template-columns: 1fr 1fr; padding: 28px; }

    .story-card { padding: 28px; }
}

@media (max-width: 520px) {
    .cta-row { flex-direction: column; align-items: stretch; }

    .cta-row .btn-primary { width: 100%; }

    .feature-grid { grid-template-columns: 1fr; }

    .privacy-band { grid-template-columns: 1fr; }
}
