/* Frontpage. Mobile first; on wider screens it stays a centred column. */
:root {
    --cream: #FFF9EE;
    --ink: #1E1B3A;
    --muted: #3B3858;
    --red: #E2412F;
    --red-shadow: #9E2418;
    --blue: #2563EB;
    --yellow: #FFC93C;
    --purple: #5B21B6;
    --font-body: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: Fredoka, "Nunito", system-ui, sans-serif;
}

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

.home-body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-text-size-adjust: 100%;
}

.home {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 8px;
    overflow: hidden;
}

/* two soft background circles, like the design */
.home::before, .home::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}
.home::before { top: 26px; right: -38px; width: 140px; height: 140px; background: var(--yellow); opacity: .55; }
.home::after  { top: 448px; left: -52px; width: 88px; height: 88px; background: #3BA6F5; opacity: .25; }
.home > * { position: relative; z-index: 1; }

a { color: var(--ink); }
a:hover { color: var(--purple); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* header: language + login */
.home-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0; }
.lang { display: flex; gap: 2px; padding: 3px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; }
.lang a, .lang button, .lang .is-active {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 38px; border-radius: 999px;
    font-weight: 800; font-size: 14px; text-decoration: none; color: var(--ink);
}
.lang .is-active { background: var(--ink); color: #fff; }
.lang button { border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.lang button:hover { background: var(--yellow); }

.pill {
    display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px;
    border: 0; border-radius: 999px; font: inherit; font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
}
.pill-dark { background: var(--ink); color: #fff; }
.pill-dark:hover { color: #fff; background: #2d2958; }

/* hero */
.hero { padding: 58px 20px 8px; display: flex; flex-direction: column; gap: 16px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.b-red { color: var(--red); }
.b-blue { color: var(--blue); }
.hero h1 {
    margin: 0; font-family: var(--font-display); font-weight: 700;
    font-size: clamp(40px, 11vw, 56px); line-height: 1; letter-spacing: -1.2px;
}
.hero h1 span { display: block; }
.lead { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); }

/* tilted badges, top right under the header */
.badges {
    position: absolute; top: 72px; right: 14px; z-index: 2;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
    pointer-events: none;
}
.badge {
    display: inline-block; padding: 5px 12px; border-radius: 12px;
    font-family: var(--font-display); font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap;
    border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.badge-yellow { background: var(--yellow); color: var(--ink); transform: rotate(-4deg); }
.badge-dark { background: var(--ink); color: #fff; transform: rotate(3deg); margin-right: 6px; }

/* photo <-> coloring page slider */
.compare-section { padding: 16px 20px 0; }
.compare-section figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.compare {
    --pos: 50; --line: 22; --detail: 0;
    position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
    border-radius: 24px; background: #fff;
    box-shadow: 0 14px 34px rgba(30, 27, 58, .18), 0 0 0 1px rgba(30, 27, 58, .08);
}
.compare:has(.compare-range:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.compare-before { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare-after { position: absolute; inset: 0; background: #fff; clip-path: inset(0 0 0 calc(var(--pos) * 1%)); }
.art { display: block; width: 100%; height: 100%; }
.art-lines { fill: none; stroke: #111; stroke-width: var(--line); stroke-linecap: round; stroke-linejoin: round; }
.art-detail { opacity: var(--detail); transition: opacity .2s; }
.art-fill { fill: #111; }
.compare-line { position: absolute; top: 0; bottom: 0; left: calc(var(--pos) * 1%); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(30, 27, 58, .2); }
.compare-knob {
    position: absolute; top: 50%; left: calc(var(--pos) * 1%); width: 44px; height: 44px; margin: -22px 0 0 -22px;
    border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 27, 58, .25);
}
.tag { position: absolute; top: 12px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.tag-before { left: 12px; background: rgba(255, 255, 255, .94); color: var(--ink); }
.tag-after { right: 12px; background: var(--ink); color: #fff; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare-section figcaption { font-size: 14px; color: var(--muted); text-align: center; }

/* big buttons */
.actions { padding: 28px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; padding: 0 20px;
    border: 2px solid transparent; border-radius: 18px; font: inherit; font-size: 19px; font-weight: 800;
    text-decoration: none; cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.btn-red { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-shadow); }
.btn-red:hover { color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.btn-yellow { background: var(--yellow); color: var(--ink); min-height: 54px; font-size: 17px; border-radius: 16px; }
.btn-yellow:hover { color: var(--ink); filter: brightness(.96); }
.btn-red:active, .btn-light:active { transform: translateY(3px); box-shadow: 0 2px 0 currentColor; }
.btn-small { min-height: 44px; font-size: 16px; padding: 0 16px; border-radius: 14px; box-shadow: 0 3px 0 var(--red-shadow); }

.picked {
    display: flex; gap: 14px; align-items: center; margin-top: 8px; padding: 12px;
    background: #fff; border: 2px solid var(--ink); border-radius: 20px;
}
.picked[hidden] { display: none; }
.picked img { flex: 0 0 auto; width: 96px; height: 96px; object-fit: cover; border-radius: 14px; background: #eee; }
.picked-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.picked-name { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.link-button { background: none; border: 0; padding: 8px 4px; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; cursor: pointer; min-height: 44px; }
.picked-note { margin: 0; min-height: 0; font-size: 15px; font-weight: 700; color: var(--muted); }
.picked-note:empty { display: none; }

/* age picker */
.ages {
    margin: 32px 16px 0; padding: 22px 18px; background: var(--yellow);
    border: 2px solid var(--ink); border-radius: 26px; display: flex; flex-direction: column; gap: 14px;
}
.ages h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.age-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.age {
    height: 56px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink);
    font-family: var(--font-display); font-weight: 600; font-size: 18px; cursor: pointer;
}
.age[aria-pressed="true"] { background: var(--ink); color: #fff; }
.age-now { margin: 0; font-size: 15px; font-weight: 700; }

/* how it works */
.how { padding: 36px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.how h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.step { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 16px; }
.step-n {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 20px;
}
.step-n-1 { background: #FFC93C; } .step-n-2 { background: #7CC8FF; } .step-n-3 { background: #6EE0A8; }
.step h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.step p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }

/* call to action */
.cta { margin: 36px 16px 0; padding: 26px 22px; background: var(--purple); color: #fff; border-radius: 26px; display: flex; flex-direction: column; gap: 12px; }
.cta h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.cta p { margin: 0; font-size: 16px; line-height: 1.5; }

.home-footer { padding: 28px 20px 32px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }

@media (min-width: 700px) {
    .home { padding-bottom: 24px; }
    .actions { flex-direction: row; flex-wrap: wrap; }
    .actions .btn { flex: 1 1 0; }
    .actions .picked, .actions .picked-note { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .art-detail { transition: none; }
}

/* login overlay (log in / forgot password) */
body.auth-open { overflow: hidden; }
.auth-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: var(--font-body); color: var(--ink); }
.auth-modal[hidden] { display: none; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(30, 27, 58, .6); }
.auth-card {
    position: relative; width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow: auto;
    padding: 28px 22px 22px; background: #fff; border: 2px solid var(--ink); border-radius: 26px;
    box-shadow: 0 8px 0 var(--ink), 0 24px 48px rgba(30, 27, 58, .35);
}
.auth-card:focus { outline: none; }
.auth-card h2 { margin: 0 40px 14px 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.auth-card p { margin: 0 0 14px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.auth-close {
    position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%;
    background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.auth-close:hover { background: var(--yellow); }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 800; }
.field input {
    min-height: 52px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 14px;
    font: inherit; font-size: 17px; font-weight: 500; color: var(--ink); background: #fff;
}
.field input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--red); background: #FFF5F3; }
.field-error { font-size: 14px; font-weight: 700; color: #B42318; }
.field-error[hidden] { display: none; }
.auth-card .btn { min-height: 56px; }
.auth-card .btn:disabled { opacity: .6; cursor: progress; }
.auth-card .link-button { align-self: flex-start; }
.auth-error { margin: 0; padding: 10px 14px; border-radius: 14px; background: #FDE8E5; border: 2px solid var(--red); color: #7A1409; font-weight: 700; }
.auth-error[hidden], .auth-notice[hidden], .auth-success[hidden], .auth-card [hidden] { display: none; }
.auth-notice, .auth-success { padding: 10px 14px; border-radius: 14px; background: #E3F8EC; border: 2px solid #1F9D63; color: #0F4D30 !important; font-weight: 700; }

/* remember me + bot check in the login overlay */
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 700; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: 0 0 auto; }
.bot-check { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bot-check [data-auth-turnstile]:empty { display: none; }
.bot-check .field-error[hidden] { display: none; }

@media (max-width: 420px) {
    .auth-card { padding: 26px 16px 20px; }
}
