/* 5ThingsToday — Milestone 2 design system.
   Mobile-first, colourful, playful but polished. */

:root {
    --paper: #fdf8f2;
    --paper-deep: #f5ecdf;
    --card: #ffffff;
    --ink: #26223a;
    --muted: #746f87;
    --line: #ece4d8;

    --warm: #ff5d5d;
    --cool: #2f7cf6;
    --sun: #ff9f1c;
    --mint: #2ec4b6;
    --grape: #7c5cff;

    --brand-grad: linear-gradient(135deg, var(--warm) 0%, var(--sun) 55%, var(--mint) 100%);
    --wow-grad: linear-gradient(135deg, #ff5d5d, #ff9f1c);
    --cool-grad: linear-gradient(135deg, #2f7cf6, #2ec4b6);

    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-sm: 0 2px 10px rgba(38, 34, 58, 0.06);
    --shadow-md: 0 10px 30px rgba(38, 34, 58, 0.10);
    --shadow-btn: 0 6px 0 rgba(38, 34, 58, 0.08);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(255, 159, 28, 0.12), transparent 60%),
        radial-gradient(900px 460px at -10% 20%, rgba(124, 92, 255, 0.10), transparent 55%),
        var(--paper);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
}

/* ---------- Header & footer ---------- */

.site-header {
    position: relative;
    padding: 18px 20px 0;
    display: flex;
    justify-content: center;
}

.site-nav {
    position: absolute;
    right: 16px;
    top: 18px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: var(--shadow-sm);
    transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}

.nav-link:hover {
    color: var(--ink);
    transform: translateY(-1px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--ink);
}

.brand-five {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-grad);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
}

.site-footer {
    margin-top: auto;
    padding: 28px 20px 32px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer p {
    margin: 0;
}

.footer-meta {
    margin-top: 6px;
    font-size: 0.75rem;
    opacity: 0.7;
}

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

.btn {
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    padding: 16px 28px;
    color: #fff;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--brand-grad);
    box-shadow: var(--shadow-btn);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 2px var(--line);
}

.btn-ghost:hover {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warm) 55%, var(--line));
}

.btn-lg {
    font-size: 1.15rem;
    padding: 20px 40px;
}

.btn-block {
    width: 100%;
}

/* Answer buttons */

.answer-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.btn-answer {
    width: 100%;
    font-size: 1.02rem;
    padding: 18px 20px;
    box-shadow: var(--shadow-btn);
}

.btn-wow {
    background: var(--wow-grad);
}

.btn-cool {
    background: var(--cool-grad);
}

@media (min-width: 560px) {
    .answer-form {
        grid-template-columns: 1fr 1fr;
    }
}

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

.page-hero .site-header {
    justify-content: center;
}

.hero {
    position: relative;
    text-align: center;
    padding: 64px 20px 40px;
    max-width: 720px;
    margin: 0 auto;
}

.hero-kicker {
    display: inline-block;
    margin: 0 0 18px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-sm);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    animation: fade-up 0.6s var(--ease) both;
}

.hero-title {
    margin: 0;
    font-size: clamp(3rem, 13vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 1.02;
    animation: fade-up 0.6s var(--ease) 0.08s both;
}

.hero-five {
    width: 0.78em;
    height: 0.78em;
    border-radius: 0.22em;
    font-size: 1em;
    margin-right: 0.06em;
    vertical-align: baseline;
    display: inline-grid;
    place-items: center;
}

.hero-today {
    color: var(--warm);
}

.hero-tagline {
    margin: 20px auto 0;
    font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    font-weight: 600;
    max-width: 34ch;
    animation: fade-up 0.6s var(--ease) 0.16s both;
}

.hero-form {
    margin-top: 34px;
    animation: fade-up 0.6s var(--ease) 0.24s both;
}

.hero-note {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.9rem;
    animation: fade-up 0.6s var(--ease) 0.32s both;
}

/* Floating decorative emoji */

.hero-floaters {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.floater {
    position: absolute;
    font-size: 2rem;
    opacity: 0.55;
    animation: bob 7s ease-in-out infinite;
}

.floater-1 { top: 6%;  left: 6%;  animation-delay: 0s; }
.floater-2 { top: 12%; right: 8%; animation-delay: 1.2s; font-size: 2.6rem; }
.floater-3 { top: 42%; left: 3%;  animation-delay: 2.4s; }
.floater-4 { top: 48%; right: 4%; animation-delay: 0.6s; font-size: 2.4rem; }
.floater-5 { top: 72%; left: 10%; animation-delay: 1.8s; font-size: 1.7rem; }

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-16px) rotate(5deg); }
}

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

/* ---------- Fact flow ---------- */

.flow {
    max-width: 640px;
    margin: 0 auto;
    padding: 26px 20px 40px;
    animation: fade-up 0.5s var(--ease) both;
}

.flow-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}

.flow-count {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--muted);
}

.flow-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--line);
    transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.dot.done {
    background: var(--brand-grad);
    transform: scale(1.1);
}

/* Fact card */

.fact-card {
    --cat-color: var(--warm);
    position: relative;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 26px 24px 28px;
    box-shadow: var(--shadow-md);
    border-top: 6px solid var(--cat-color);
    overflow: hidden;
}

.fact-card::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cat-color) 12%, transparent);
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: color-mix(in srgb, var(--cat-color) 14%, var(--card));
    color: color-mix(in srgb, var(--cat-color) 65%, var(--ink));
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    position: relative;
    z-index: 1;
}

.cat-chip.small {
    font-size: 0.68rem;
    padding: 4px 9px;
}

.fact-title {
    margin: 18px 0 12px;
    font-size: clamp(1.5rem, 5.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.18;
}

.fact-text {
    margin: 0;
    font-size: clamp(1.1rem, 3.8vw, 1.3rem);
    line-height: 1.6;
}

.fact-explanation {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.fact-source {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.answered-note {
    text-align: center;
    color: var(--muted);
    margin: 4px 0 0;
    font-weight: 600;
}

/* ---------- Quiz ---------- */

.choice-form {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.choice-btn {
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    background: var(--card);
    color: var(--ink);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    transition: transform 0.16s var(--ease), border-color 0.16s var(--ease),
        box-shadow 0.16s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.choice-btn:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--cat-color, var(--warm)) 60%, var(--line));
    box-shadow: var(--shadow-sm);
}

.choice-btn:active {
    transform: translateY(0);
}

.quiz-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 20px 0 0;
}

.score-message {
    font-size: 1.15rem;
    color: var(--ink);
    margin: 0 0 28px;
}

/* ---------- Done ---------- */

.done {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px 48px;
    text-align: center;
    animation: fade-up 0.5s var(--ease) both;
}

.done-emoji {
    font-size: 4rem;
    animation: pop 0.5s var(--ease) both;
}

@keyframes pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.done-title {
    margin: 14px 0 6px;
    font-size: clamp(1.9rem, 7vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.done-stat {
    margin: 0 0 26px;
    font-size: 1.15rem;
    color: var(--muted);
}

.done-stat strong {
    color: var(--ink);
    font-size: 1.4em;
}

.done-quiz {
    margin: -12px 0 26px;
    color: var(--muted);
}

.done-quiz strong {
    color: var(--cool);
}

.done-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    display: grid;
    gap: 12px;
    text-align: left;
}

.done-item {
    --cat-color: var(--warm);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--cat-color);
}

.done-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.done-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.done-fact-title {
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.35;
}

.done-message {
    color: var(--muted);
    margin: 0 0 26px;
    font-size: 1.05rem;
}

/* ---------- Done page: streak chip ---------- */

.done-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.streak-chip {
    display: inline-block;
    margin: 0 auto 16px;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff3d6, #ffe1b3);
    color: #9a5b00;
    font-weight: 800;
    font-size: 1.02rem;
    box-shadow: var(--shadow-sm);
    animation: pop 0.5s var(--ease) both;
}

/* ---------- Stats page ---------- */

.stats {
    max-width: 720px;
    margin: 0 auto;
    padding: 36px 20px 48px;
    text-align: center;
    animation: fade-up 0.5s var(--ease) both;
}

.stats-title {
    margin: 0 0 6px;
    font-size: clamp(1.9rem, 7vw, 2.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.stats-sub {
    margin: 0 auto 30px;
    max-width: 44ch;
    color: var(--muted);
}

.stats-empty {
    color: var(--muted);
    font-size: 1.05rem;
    padding: 40px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 20px 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.stat-card.stat-flame {
    background: linear-gradient(160deg, #fff6e5, #ffe9c7);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- Facts / SEO pages ---------- */

.facts-index {
    max-width: 640px;
    margin: 0 auto;
    padding: 36px 20px 48px;
    animation: fade-up 0.5s var(--ease) both;
}

.facts-title {
    margin: 0 0 6px;
    font-size: clamp(1.9rem, 7vw, 2.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.facts-sub {
    margin: 0 0 28px;
    color: var(--muted);
    max-width: 46ch;
}

.facts-category {
    margin-bottom: 26px;
}

.facts-category-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 800;
}

.facts-category-title a {
    text-decoration: none;
}

.facts-category-title a:hover {
    text-decoration: underline;
}

.facts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.facts-item {
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.facts-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fact-link {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
    font-weight: 700;
}

.fact-link:hover {
    color: var(--warm);
}

.fact-detail .fact-title {
    font-size: clamp(1.7rem, 6vw, 2.3rem);
}

.facts-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.cat-link {
    text-decoration: none;
    color: inherit;
}

.cat-link:hover {
    text-decoration: underline;
}

/* ---------- Share row (fact pages) ---------- */

.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--line);
}

.share-label {
    width: 100%;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (min-width: 480px) {
    .share-label {
        width: auto;
        margin-right: 4px;
    }
}

.share-btn {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 10px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.16s var(--ease), filter 0.16s var(--ease),
        box-shadow 0.16s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: var(--shadow-md);
}

.share-btn:active {
    transform: translateY(0);
}

.share-wa {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.share-fb {
    background: linear-gradient(135deg, #4a8bfc, #1877f2);
}

.share-copy {
    background: linear-gradient(135deg, var(--mint), var(--cool));
}

.share-btn.copied {
    filter: brightness(1.1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 40%, transparent);
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
