/* Homepage theme — one design language with the game.
   The token block below is copied verbatim from play/assets/css/style.css. If that file
   changes, change these too: the homepage and play.trivia.xxx must not drift apart.
   No framework: the class names come from the markup, the values from the game. */

@font-face {
    font-family: 'Luckiest Guy';
    src: url('../fonts/luckiest-guy.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Metric-matched fallback: ascent/descent from the TTF (hhea), 97% optical size. */
@font-face {
    font-family: 'Luckiest Guy Fallback';
    src: local('Arial'), local('Helvetica');
    ascent-override: 70.31%;
    descent-override: 29.69%;
    line-gap-override: 0%;
    size-adjust: 97%;
}

:root {
    /* canvas and surfaces */
    --bg-dark: #0e1015;
    --bg-card: #171b22;
    --bg-card-hover: #1f242e;

    /* brand */
    --primary: #ff1a75;
    --primary-hover: #ff3385;
    --primary-glow: rgba(255, 26, 117, 0.4);
    --accent-gold: #ffb800;
    --accent-cyan: #00d2ff;

    /* text */
    --text-main: #ffffff;
    --text-muted: #8b949e;

    /* geometry */
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    /* type */
    --font-display: 'Luckiest Guy', 'Luckiest Guy Fallback', system-ui, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* layout, homepage only */
    --wrap: 1080px;
    --pad: 2.4rem;
    --section: 7.2rem;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1.7rem;
    line-height: 1.65;
    color: var(--text-main);
    background-color: var(--bg-dark);
    /* the same two glows the game uses behind its panels */
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 26, 117, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(0, 210, 255, 0.06) 0%, transparent 50%);
    background-repeat: no-repeat;
}

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

h1,
h2,
h3 {
    margin: 0 0 1.6rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h1 {
    font-size: clamp(3.4rem, 6vw, 5.2rem);
}

h2 {
    font-size: clamp(2.4rem, 3.4vw, 3.2rem);
}

h3 {
    font-size: 2rem;
    line-height: 1.25;
}

p {
    margin: 0 0 1.6rem;
    text-wrap: pretty;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--pad);
}

/* ---------- header ---------- */
header {
    padding: 2.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

header.container {
    margin: 2.4rem auto;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-main);
}

/* <picture> is only a source selector here; without this it becomes a layout
   box and the img's percentage widths resolve against it instead of the column,
   shrinking the mark to 85% of its own max-width. */
picture {
    display: contents;
}

/* the wordmark itself, so the name is legible at header scale.
   5.6rem = 56px at the 62.5% root; the current mark is 1.70:1, so this is
   ~95px wide. It was 4rem for the old 2.73:1 wordmark, which was wider at
   the same height — height alone is not the thing to preserve, the cap
   height of the letters is. */
.brand img {
    height: 5.6rem;
    width: auto;
}

.brand:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* ---------- buttons ---------- */
.button {
    display: inline-block;
    padding: 1.4rem 2.8rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    /* 3.71:1 — only valid as large bold text, hence 1.9rem */
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    transition: var(--transition);
}

.button:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 30px var(--primary-glow);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* the header CTA keeps the 1.9rem size, because 3.71:1 is only valid for large text */
.nav .button {
    padding: 1.2rem 2rem;
}

/* ---------- hero ---------- */
.hero {
    padding: clamp(4.8rem, 9vw, 8.8rem) 0 clamp(4rem, 7vw, 6.4rem);
}

.hero .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4.8rem;
}

.hero .col-6 {
    flex: 1 1 320px;
    min-width: 0;
}

.hero .logo {
    display: flex;
    justify-content: center;
}

/* a slow float, the same idle motion the game gives its mark */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-1.2rem);
    }
}

.hero .logo img {
    width: 100%;
    max-width: 320px;
    filter: drop-shadow(0 12px 40px var(--primary-glow));
    animation: float 3.4s ease-in-out infinite;
}

.hero .muted {
    margin-top: 1.6rem;
}

.muted {
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* ---------- tagline ---------- */
#promise {
    padding: var(--section) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255, 26, 117, 0.06), transparent 70%);
}

.tagline {
    max-width: 34ch;
    margin: 0 auto;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

h1,
h2,
.tagline {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* ---------- sections and cards ---------- */
section {
    padding: var(--section) 0;
}

section>h2 {
    margin-bottom: 3.2rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 2.4rem;
}

.card {
    flex: 1 1 260px;
    min-width: 0;
    padding: 2.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.card h3 {
    margin-bottom: 0.8rem;
}

.card p {
    color: var(--text-muted);
}

/* ---------- faq ---------- */
details {
    margin-bottom: 1rem;
    padding: 1.6rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

details:hover {
    background: var(--bg-card-hover);
}

details[open] {
    background: var(--bg-card-hover);
    border-color: rgba(255, 26, 117, 0.35);
}

summary {
    cursor: pointer;
    font-size: 1.8rem;
    font-weight: 700;
    list-style: none;
}

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

summary::after {
    content: "+";
    float: right;
    color: var(--primary);
    font-weight: 800;
}

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

details p {
    margin: 1.2rem 0 0;
    color: var(--text-muted);
}

/* ---------- final call to action ---------- */
.is-center {
    display: flex;
    justify-content: center;
    text-align: center;
}

.is-center>div {
    max-width: 52rem;
}

.is-center p {
    font-size: 1.8rem;
}

/* ---------- footer ---------- */
footer {
    padding: 4rem 0 5.6rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.4rem;
}

footer p {
    margin: 0 0 0.6rem;
}

footer p:first-child {
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 700;
}

footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.6rem;
    margin: 0 0 1.6rem;
}

footer .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

footer .footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ---------- skip link ---------- */
.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 1.6rem;
    top: 1.6rem;
    z-index: 10;
    padding: 1rem 1.6rem;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
}

@media (max-width: 480px) {

    /* logo and CTA share one 375px row: give the CTA back some air */
    .nav .button {
        padding: 1rem 1.4rem;
    }
}

@media (max-width: 720px) {
    :root {
        --section: 5.2rem;
        --pad: 2rem;
    }

    .hero .row {
        gap: 3.2rem;
    }

    .hero .logo {
        order: -1;
    }

    .row {
        gap: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero .logo img {
        animation: none;
    }
}