/* Math with Magic — marketing & legal site.
   Visual identity mirrors the app (src/styles/global.css in the app repo). */

:root {
    --color-bg-deep: #050208;
    --color-bg-mystic: #1a0b2e;
    --color-bg-mystic-dark: #0f051a;
    --color-brand-accent: #ffa502;
    --color-text-primary: #f1f2f6;
    --color-text-secondary: #ced6e0;
    --color-text-muted: rgba(255, 255, 255, 0.55);
    --color-card-bg: rgba(255, 255, 255, 0.04);
    --color-card-border: rgba(255, 255, 255, 0.1);
    --font-display: 'Fredoka', ui-rounded, 'Cinzel', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background-color: var(--color-bg-mystic-dark);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(106, 60, 181, 0.25), transparent),
        radial-gradient(ellipse 60% 40% at 90% 30%, rgba(255, 165, 2, 0.05), transparent);
    background-repeat: no-repeat;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-brand-accent);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-brand-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Header ── */

.siteHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem clamp(1.5rem, 4vw, 4rem);
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brandMark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.siteNav {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1.75rem);
    flex-wrap: wrap;
}

.siteNav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
}

.siteNav a:hover {
    color: var(--color-brand-accent);
}

/* ── Hero ── */

.hero {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 2rem;
    align-items: center;
    padding: clamp(2rem, 6vh, 5rem) clamp(1.5rem, 4vw, 4rem) 3rem;
    max-width: 1280px;
    margin: 0 auto;
}

.heroAgeBadge {
    display: inline-block;
    align-self: flex-start;
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 1.1vw, 1.05rem);
    font-weight: 700;
    color: var(--color-brand-accent);
    background: rgba(255, 165, 2, 0.12);
    border: 1px solid rgba(255, 165, 2, 0.5);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    margin: 0 0 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.heroHeadline {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 1.02;
    margin: 0 0 1.25rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.heroTagline {
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    color: var(--color-text-secondary);
    max-width: 480px;
    margin: 0 0 1.75rem;
}

.ctaBadge {
    display: inline-block;
    background: var(--color-brand-accent);
    color: var(--color-bg-mystic);
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1.1rem 2.75rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(255, 165, 2, 0.35);
    animation: ctaPulse 3s infinite ease-in-out;
}

@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(255, 165, 2, 0.35); }
    50% { box-shadow: 0 10px 40px rgba(255, 165, 2, 0.6); }
}

.ctaFinePrint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    max-width: 460px;
    margin: 1rem 0 0;
}

/* ── Hero collage ── */

.collage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
}

.collage::before {
    content: '';
    position: absolute;
    inset: 15%;
    background: radial-gradient(ellipse, rgba(255, 165, 2, 0.14), transparent 70%);
    filter: blur(10px);
}

.collage img {
    position: relative;
    width: clamp(110px, 12vw, 165px);
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.collage img:nth-child(1) { transform: rotate(-10deg) translate(28px, 14px); }
.collage img:nth-child(2) { transform: rotate(-3deg) translateY(-16px); z-index: 2; }
.collage img:nth-child(3) { transform: rotate(5deg) translate(-22px, 8px); z-index: 3; }
.collage img:nth-child(4) { transform: rotate(12deg) translate(-48px, 28px); }

/* ── Section shells ── */

.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem clamp(1.5rem, 4vw, 4rem);
}

.sectionHeading {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    text-align: center;
    margin: 0 0 2.25rem;
}

/* ── Features ── */

.featuresGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.featureCard {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.featureIcon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
    background: rgba(255, 165, 2, 0.12);
    border: 1px solid rgba(255, 165, 2, 0.35);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.featureTitle {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.featureDesc {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ── Companions strip ── */

.companionRow {
    display: flex;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    flex-wrap: wrap;
}

.companionCard {
    text-align: center;
}

.companionCard img {
    width: clamp(120px, 18vw, 180px);
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.companionCard figcaption {
    font-family: var(--font-display);
    margin-top: 0.6rem;
    color: var(--color-text-secondary);
}

/* ── Trust band ── */

.trustBand {
    background: linear-gradient(160deg, rgba(26, 11, 46, 0.9), rgba(15, 5, 26, 0.9));
    border: 1px solid var(--color-card-border);
    border-radius: 20px;
    padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
}

.trustBand h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin: 0 0 1.25rem;
    text-align: center;
}

.trustList {
    list-style: none;
    margin: 0 auto 1.5rem;
    padding: 0;
    max-width: 560px;
    display: grid;
    gap: 0.7rem;
}

.trustList li {
    padding-left: 1.9rem;
    position: relative;
    color: var(--color-text-secondary);
}

.trustList li::before {
    content: '✦';
    position: absolute;
    left: 0.25rem;
    color: var(--color-brand-accent);
}

.trustBand p {
    text-align: center;
    margin: 0;
}

/* ── Footer ── */

.siteFooter {
    border-top: 1px solid var(--color-card-border);
    margin-top: 3rem;
    padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.92rem;
}

.footerBrandName {
    font-family: var(--font-display);
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.siteFooter p {
    margin: 0 0 0.35rem;
    color: var(--color-text-secondary);
}

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

.footerNav a {
    color: var(--color-text-secondary);
}

/* ── Legal & support documents ── */

.doc {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem clamp(1.5rem, 4vw, 2.5rem) 3rem;
}

.doc h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin: 0 0 0.5rem;
}

.doc h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 2.25rem 0 0.75rem;
}

.doc p,
.doc li {
    color: var(--color-text-secondary);
}

.doc strong,
.doc em {
    color: var(--color-text-primary);
}

.lastUpdated {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0 0 2rem;
}

.tableWrapper {
    overflow-x: auto;
    margin: 1.25rem 0;
}

.dataTable {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
    font-size: 0.92rem;
}

.dataTable th,
.dataTable td {
    border: 1px solid var(--color-card-border);
    padding: 0.7rem 0.85rem;
    text-align: left;
    vertical-align: top;
    color: var(--color-text-secondary);
}

.dataTable th {
    background: rgba(255, 165, 2, 0.08);
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-weight: 600;
}

.sectionDivider {
    border: none;
    border-top: 1px solid var(--color-card-border);
    margin: 3rem 0;
}

/* ── Responsive ── */

@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .heroAgeBadge {
        align-self: center;
    }

    .heroTagline {
        margin-inline: auto;
    }

    .collage {
        min-height: 320px;
        margin-top: 1rem;
    }
}

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

    .ctaBadge {
        animation: none;
    }
}
