/*
 * Copyright 2026 Mehmet KURTGOZ
 * FootWordle — shared landing-site styles.
 * Design tokens mirror /DESIGN.md (Nunito, grass green #16A34A, gold #F59E0B).
 */

:root {
    --green: #16A34A;
    --green-dark: #128040;
    --gold: #F59E0B;

    /* Light theme (default) */
    --bg-0: #F8FAFC;
    --bg-1: #F1F5F9;
    --bg-2: #E2E8F0;
    --bg-disabled: #CBD5E1;
    --fg-0: #0F172A;
    --fg-1: #334155;
    --fg-2: #64748B;
    --fg-3: #94A3B8;
    --border: #E2E8F0;
    --card: #FFFFFF;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 16px;
    --maxw: 1080px;
    --font: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-0: #0F172A;
        --bg-1: #1E293B;
        --bg-2: #334155;
        --bg-disabled: #475569;
        --fg-0: #F8FAFC;
        --fg-1: #CBD5E1;
        --fg-2: #94A3B8;
        --fg-3: #64748B;
        --border: #334155;
        --card: #1E293B;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }
}

:root[data-theme="dark"] {
    --bg-0: #0F172A;
    --bg-1: #1E293B;
    --bg-2: #334155;
    --bg-disabled: #475569;
    --fg-0: #F8FAFC;
    --fg-1: #CBD5E1;
    --fg-2: #94A3B8;
    --fg-3: #64748B;
    --border: #334155;
    --card: #1E293B;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
    margin: 0;
    font-family: var(--font);
    font-weight: 400;
    color: var(--fg-1);
    background: var(--bg-0);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--fg-0); font-weight: 800; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--fg-2); }
code { background: var(--bg-1); padding: 1px 5px; border-radius: 5px; font-size: .88em; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* horizontal only — must not touch vertical padding, or it would override
   the section rhythm below (it has higher specificity than `main > section`). */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* Breathing room between the fixed header / footer and the page content,
   plus consistent space on both sides of every section divider. */
main { padding: 56px 0; }
main > section { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--border); }
main > section:first-child { border-top: 0; padding-top: 0; }
main > section:last-child { padding-bottom: 0; }
.section-lead { max-width: 640px; color: var(--fg-2); font-size: 1.05rem; }
.center { text-align: center; }
.center .section-lead { margin-inline: auto; }

/* ---------- Language visibility ----------
   Only ever *hide* the inactive language, with !important so it beats
   later, more specific component rules. The active language keeps its
   natural / component display value untouched. */
body:not(.tr) .lang-tr { display: none !important; }
body.tr .lang-en { display: none !important; }

/* ---------- Header ---------- */
header {
    position: sticky; top: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg-0) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav { position: relative; display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--fg-0); font-size: 1.1rem; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; display: block; flex: 0 0 auto; }
.nav-links { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--fg-1); font-weight: 700; font-size: .9rem; padding: 8px 10px; border-radius: 8px; }
.nav-links a:hover { color: var(--green); text-decoration: none; background: var(--bg-1); }
.nav-links a.active { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.nav-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.btn-ghost {
    border: 1px solid var(--border); background: var(--card); color: var(--fg-1);
    border-radius: 999px; padding: 6px 12px; font-family: var(--font); font-weight: 800;
    font-size: .82rem; cursor: pointer; line-height: 1;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.lang-switch b { color: var(--green); }
.nav-toggle { display: none; border: 1px solid var(--border); background: var(--card); color: var(--fg-0);
    border-radius: 10px; width: 40px; height: 36px; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; order: 3; }
    .nav-tools { order: 2; margin-left: auto; }
    .nav-links {
        display: none; flex-direction: column; gap: 2px;
        position: absolute; top: 100%; left: 0; right: 0; z-index: 70;
        background: var(--bg-0); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow); padding: 8px 16px 14px; margin: 0;
    }
    body.nav-open .nav-links { display: flex; }
    .nav-links a { padding: 13px 12px; font-size: 1rem; }
}

/* ---------- Buttons / store badges ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.center .cta-row { justify-content: center; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--green); color: #fff; font-weight: 800;
    padding: 13px 22px; border-radius: 999px; font-size: .98rem;
    border: 0; cursor: pointer; font-family: var(--font); text-align: center;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--fg-0); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--green); color: var(--green); }
.store-badge {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--fg-0); color: var(--bg-0); border-radius: 999px;
    padding: 12px 22px; font-weight: 800; font-size: .95rem; line-height: 1;
}
.store-badge svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }
.store-badge:hover { text-decoration: none; opacity: .9; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.eyebrow {
    display: inline-block; background: color-mix(in srgb, var(--green) 14%, transparent);
    color: var(--green); font-weight: 800; font-size: .76rem; letter-spacing: .04em;
    text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero-art {
    background: linear-gradient(160deg, color-mix(in srgb, var(--green) 24%, var(--bg-1)), color-mix(in srgb, var(--gold) 20%, var(--bg-1)));
    border-radius: 28px; padding: 14px; box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
}
.hero-art img { width: 100%; max-width: 460px; height: auto; border-radius: 20px; display: block; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }

/* Section illustration (branded artwork, not a screenshot). */
.illus { display: block; width: 100%; max-width: 520px; height: auto; margin: 28px auto 0;
    border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.center .illus { margin-top: 24px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 18px; margin-top: 32px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow);
}
.card .ico { font-size: 1.6rem; }
.card h3 { margin-top: 10px; }
.card p { margin-bottom: 0; color: var(--fg-2); font-size: .96rem; }
.card .shot { margin-top: 16px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: var(--bg-1); }
.card .shot img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 16px; margin-top: 28px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 20px 62px; position: relative; }
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--fg-2); font-size: .95rem; }
.step::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 18px; top: 18px; width: 32px; height: 32px;
    background: var(--green); color: #fff; border-radius: 50%; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

/* ---------- Screenshot gallery ---------- */
.shots { display: flex; gap: 18px; overflow-x: auto; padding: 24px 4px 10px; scroll-snap-type: x mandatory; }
.shots figure {
    margin: 0; flex: 0 0 auto; scroll-snap-align: center;
    width: 258px; background: var(--card); border: 1px solid var(--border);
    border-radius: 26px; padding: 10px; box-shadow: var(--shadow);
}
.shots figure img { width: 100%; height: auto; max-height: 520px; object-fit: contain; border-radius: 18px; display: block; }
.shots figure figcaption { text-align: center; font-size: .82rem; color: var(--fg-2); padding: 8px 4px 2px; }
.shots-empty { color: var(--fg-3); font-size: .92rem; padding: 16px 0; }

/* ---------- FAQ / legal ---------- */
details.qa {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 18px; margin-bottom: 10px;
}
details.qa summary { cursor: pointer; font-weight: 700; color: var(--fg-0); list-style: none; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; float: right; color: var(--green); font-weight: 900; }
details.qa[open] summary::after { content: "\2013"; }
details.qa > *:not(summary) { margin-top: 10px; }

.legal { max-width: 760px; }
.legal h3 { margin-top: 30px; }
.legal h4 { margin-top: 20px; font-size: 1rem; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal .updated { color: var(--fg-2); font-size: .9rem; margin-bottom: 24px; }
.callout {
    border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent);
    padding: 12px 16px; border-radius: 8px; font-size: .93rem;
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--fg-2); background: var(--bg-1); }
footer .cols { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
footer .brand { margin-bottom: 8px; }
footer a { color: var(--fg-1); font-weight: 600; }
footer .muted { font-size: .85rem; max-width: 320px; }
footer nav { display: grid; gap: 6px; }

/* =====================================================================
   WORDLE DEMO  (play.html)
   ===================================================================== */
.game { max-width: 480px; margin: 0 auto; text-align: center; }
.game .clues { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 4px; }
.game .clue {
    background: var(--bg-1); border: 1px solid var(--border); color: var(--fg-1);
    border-radius: 10px; padding: 6px 12px; font-size: .85rem; font-weight: 600;
}
.game .clue b { color: var(--fg-0); font-weight: 800; }
.game .clue-note { color: var(--fg-2); font-size: .85rem; margin: 10px 0 0; }
.game .meta { color: var(--fg-2); font-size: .9rem; min-height: 1.4em; margin: 8px 0 4px; }

.board { display: grid; gap: 6px; justify-content: center; margin: 16px auto; }
.board .brow { display: grid; gap: 6px; }
.tile {
    width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800; color: var(--fg-0); text-transform: uppercase;
    border: 2px solid var(--border); border-radius: 8px; background: var(--bg-0);
    transition: transform .08s ease, background .25s ease, border-color .25s ease, color .25s ease;
}
.tile.filled { border-color: var(--fg-3); transform: scale(1.04); }
.tile.correct { background: var(--green); border-color: var(--green); color: #fff; }
.tile.present { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.tile.absent { background: var(--bg-2); border-color: var(--bg-2); color: var(--fg-2); }
@media (max-width: 420px) { .tile { width: 44px; height: 44px; font-size: 1.25rem; } }
@media (max-width: 360px) { .tile { width: 38px; height: 38px; } }

.keyboard { display: grid; gap: 6px; margin: 18px auto 0; max-width: 500px; }
.keyboard .krow { display: flex; gap: 5px; justify-content: center; }
.key {
    flex: 1 1 auto; min-width: 26px; max-width: 42px; height: 50px;
    border: 0; border-radius: 7px; background: var(--bg-2); color: var(--fg-0);
    font-family: var(--font); font-weight: 800; font-size: .95rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; text-transform: uppercase;
    transition: background .2s ease, color .2s ease;
}
.key:hover { background: var(--bg-disabled); }
.key.wide { flex: 1.6 1 auto; max-width: 68px; font-size: .72rem; }
.key.correct { background: var(--green); color: #fff; }
.key.present { background: var(--gold); color: #1a1200; }
.key.absent { background: var(--bg-1); color: var(--fg-3); }

.overlay {
    position: fixed; inset: 0; z-index: 80; display: none;
    align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
    background: color-mix(in srgb, var(--fg-0) 55%, transparent); backdrop-filter: blur(3px);
}
.overlay.show { display: flex; }
.overlay .panel {
    background: var(--card); border: 1px solid var(--border); border-radius: 20px;
    box-shadow: var(--shadow); padding: 26px; max-width: 400px; width: 100%; text-align: center;
    margin: auto;
}
.overlay .panel .emoji { font-size: 2.6rem; }
.overlay .panel h3 { font-size: 1.4rem; margin: 8px 0 4px; }
.overlay .panel .cta-row { justify-content: center; margin-top: 18px; }

.game-shake { animation: shake .4s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
