/* Trivixo marketing site.
   Colors are the app's own palette, converted from the 0-1 SKColor floats in
   Trivixo/Trivixo/UITheme.swift so the site and the game match exactly. */

:root {
    color-scheme: dark;

    /* Dark palette (UITheme.palette(for: .dark)) */
    --bg-top: #0d0f21;
    --bg-bottom: #050814;
    --accent: #8575ff;
    --accent-muted: #6352d9;
    --text-primary: #f5f7ff;
    --text-secondary: #adb8d1;
    --gold: #ffcc40;
    --card-fill: rgba(20, 26, 46, 0.98);
    --card-stroke: #333b5c;
    --glow-purple: rgba(120, 97, 255, 0.18);
    --glow-teal: rgba(43, 158, 209, 0.12);

    /* Timer-urgency colors, shared across themes */
    --warn: #f59e1c;
    --danger: #eb4235;
    --good: #2fbf71;

    --maxw: 1080px;
    --radius: 18px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-primary);
    background:
        radial-gradient(900px 620px at 12% -8%, var(--glow-purple), transparent 70%),
        radial-gradient(760px 560px at 92% 30%, var(--glow-teal), transparent 70%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
    color: #a294ff;
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 22px;
}

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

.skip:focus {
    left: 12px;
    top: 12px;
    z-index: 50;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
}

/* ---------- Header ---------- */

header.site {
    padding: 22px 0 6px;
}

header.site .wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    font-size: 19px;
    text-decoration: none;
    color: var(--text-primary);
}

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

nav.site {
    margin-left: auto;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

nav.site a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

nav.site a:hover {
    color: var(--text-primary);
}

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

.hero {
    padding: 56px 0 26px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.3rem, 5.2vw, 3.5rem);
    line-height: 1.08;
    margin: 0 0 18px;
    letter-spacing: -0.02em;
}

.hero h1 .hl {
    color: var(--accent);
}

.lede {
    font-size: clamp(1.05rem, 2.1vw, 1.28rem);
    color: var(--text-secondary);
    margin: 0 0 26px;
    max-width: 34em;
}

.eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(255, 204, 64, 0.4);
    border-radius: 999px;
    padding: 5px 14px;
    margin-bottom: 20px;
}

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

.btn {
    display: inline-block;
    padding: 15px 26px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-muted) 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(120, 97, 255, 0.3);
}

.btn-primary:hover {
    color: #fff;
    filter: brightness(1.07);
}

.btn-ghost {
    border-color: var(--card-stroke);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

/* Availability notice: the app is submitted, not yet on the store. */
.status {
    margin-top: 18px;
    font-size: 14.5px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 40em;
}

.status .dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    margin-top: 9px;
    box-shadow: 0 0 0 4px rgba(255, 204, 64, 0.16);
}

/* ---------- Phone mock ---------- */

.phone {
    justify-self: center;
    width: 290px;
    max-width: 100%;
    border-radius: 42px;
    border: 1px solid var(--card-stroke);
    background: linear-gradient(180deg, #0d0f21 0%, #050814 100%);
    padding: 16px 14px 22px;
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.phone .notch {
    width: 92px;
    height: 5px;
    border-radius: 3px;
    background: #2b3352;
    margin: 2px auto 16px;
}

.phone .app-title {
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.2em;
    font-size: 19px;
    margin-bottom: 3px;
}

.phone .app-sub {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.phone .badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.phone .badges span {
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    border: 1px solid var(--card-stroke);
    color: var(--text-secondary);
}

.mock-btn {
    border: 1px solid var(--card-stroke);
    background: var(--card-fill);
    border-radius: 14px;
    padding: 11px 14px;
    margin-bottom: 9px;
}

.mock-btn.lead {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(133, 117, 255, 0.35);
}

.mock-btn b {
    display: block;
    font-size: 14.5px;
}

.mock-btn small {
    color: var(--text-secondary);
    font-size: 11.5px;
}

/* ---------- Sections ---------- */

section {
    padding: 62px 0;
    scroll-margin-top: 20px;
}

section > .wrap > h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}

.section-lede {
    color: var(--text-secondary);
    max-width: 44em;
    margin: 0 0 34px;
}

.divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin: 0;
}

/* ---------- Stat strip ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 12px 0 6px;
}

.stat {
    border: 1px solid var(--card-stroke);
    background: var(--card-fill);
    border-radius: var(--radius);
    padding: 20px 18px;
    text-align: center;
}

.stat b {
    display: block;
    font-size: clamp(1.55rem, 3.4vw, 2.1rem);
    color: var(--gold);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.stat span {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---------- Cards ---------- */

.grid {
    display: grid;
    gap: 18px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    border: 1px solid var(--card-stroke);
    background: var(--card-fill);
    border-radius: var(--radius);
    padding: 24px 22px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 1.12rem;
}

.card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15.5px;
}

.card .kicker {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

/* ---------- Modes table ---------- */

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--card-stroke);
    border-radius: var(--radius);
    background: var(--card-fill);
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 560px;
    font-size: 15.5px;
}

caption {
    caption-side: bottom;
    text-align: left;
    padding: 12px 20px 16px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

th,
td {
    text-align: left;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

thead th {
    font-size: 12.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: 0;
}

td b {
    color: var(--text-primary);
}

td.num {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* ---------- Category bars ---------- */

.bars {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
}

/* minmax(0, ...) on every track: a grid item's automatic minimum is
   min-content, which otherwise stops these rows shrinking on narrow screens
   and pushes the page into horizontal scroll. */
.bars div {
    display: grid;
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr) minmax(0, 58px);
    gap: 14px;
    align-items: center;
}

.bars dt {
    font-size: 15px;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.bars dd {
    margin: 0;
    min-width: 0;
}

.bar {
    height: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, #3fa3d1 100%);
}

.bars .n {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- Share card sample ---------- */

.share {
    border: 1px dashed var(--card-stroke);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.28);
    padding: 20px 22px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin: 0;
}

/* ---------- Scoring formula ---------- */

.formula {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 15.5px;
    margin: 0 0 6px;
}

.formula span {
    border: 1px solid var(--card-stroke);
    background: rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    padding: 8px 14px;
    font-variant-numeric: tabular-nums;
}

.formula .op {
    border: 0;
    background: none;
    color: var(--text-secondary);
    padding: 0 2px;
}

/* ---------- Lists ---------- */

ul.ticks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 11px;
}

ul.ticks li {
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
}

ul.ticks li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 4px rgba(47, 191, 113, 0.15);
}

ul.ticks li b {
    color: var(--text-primary);
}

ul.crosses li::before {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(235, 66, 53, 0.15);
}

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

details {
    border: 1px solid var(--card-stroke);
    background: var(--card-fill);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

details[open] {
    border-color: var(--accent-muted);
}

summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 16.5px;
    list-style: none;
}

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

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

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

details p {
    color: var(--text-secondary);
    margin: 12px 0 2px;
    font-size: 15.5px;
}

/* ---------- Closing CTA ---------- */

.closer {
    text-align: center;
    border: 1px solid var(--card-stroke);
    background: var(--card-fill);
    border-radius: 24px;
    padding: 46px 26px;
}

.closer h2 {
    margin: 0 0 10px;
    font-size: clamp(1.6rem, 3.6vw, 2.2rem);
}

.closer p {
    color: var(--text-secondary);
    max-width: 34em;
    margin: 0 auto 26px;
}

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

.closer .status {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Footer ---------- */

footer.site {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 34px 0 52px;
    color: var(--text-secondary);
    font-size: 14.5px;
}

footer.site .links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

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

footer.site a:hover {
    color: var(--text-primary);
}

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

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 38px;
        gap: 34px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .bars div {
        grid-template-columns: minmax(0, 112px) minmax(0, 1fr) minmax(0, 46px);
        gap: 10px;
    }

    section {
        padding: 46px 0;
    }
}

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