/* SpamGate public website - light + dark theme via prefers-color-scheme */

:root {
    --bg:          #fafafa;
    --bg-alt:      #ffffff;
    --bg-hero:    #f1f5fb;
    --text:        #1c1f24;
    --text-muted:  #5a6068;
    --accent:      #2d6cdf;
    --accent-strong:#1e4ea1;
    --border:      #e3e6ea;
    --code-bg:     #eef1f5;
    --card-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.03);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:          #0f1216;
        --bg-alt:      #161a20;
        --bg-hero:     #131822;
        --text:        #e6e8ec;
        --text-muted:  #9ba2ad;
        --accent:      #6c9bf0;
        --accent-strong:#9bbbf6;
        --border:      #262b34;
        --code-bg:     #1c2029;
        --card-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 6px rgba(0,0,0,0.25);
    }
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container.narrow { max-width: 760px; }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(6px);
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.2px;
}

.site-header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.site-header nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.site-header nav a:hover,
.site-header nav a:focus {
    color: var(--accent);
}

/* ---------- Headings + text ---------- */

h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 0.6rem 0;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -0.5px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 0; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem 0; }

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

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    background: var(--code-bg);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

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

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

.section {
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--border);
}

.section-alt { background: var(--bg-alt); }

.section:last-of-type { border-bottom: none; }

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

.hero {
    background: var(--bg-hero);
    padding: 4.5rem 0 4rem;
    border-bottom: 1px solid var(--border);
}

.tagline {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-muted);
    margin-top: -0.25rem;
    margin-bottom: 1.25rem;
}

.lead {
    max-width: 70ch;
    font-size: 1.05rem;
}

.hero-facts {
    list-style: none;
    margin: 1.5rem 0 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1.25rem;
}

.hero-facts li {
    padding: 0.85rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}

/* ---------- Flow diagram ---------- */

.flow {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 1.5rem 0;
}

.thresholds {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
}

.thresholds li { margin-bottom: 0.25rem; }

.note {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0.85rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    border-radius: 0 6px 6px 0;
    margin-top: 1.5rem;
}

/* ---------- Feature grid ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.1rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.15rem 1.25rem 1rem;
    box-shadow: var(--card-shadow);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-strong);
    font-size: 1.05rem;
}

.card p { margin-bottom: 0.5rem; }

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

ul.compact {
    margin: 0.25rem 0 0.75rem 0;
    padding-left: 1.1rem;
    font-size: 0.93rem;
}

ul.compact li { margin-bottom: 0.15rem; }

/* ---------- Screenshots gallery ---------- */

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.screenshot {
    margin: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.screenshot a {
    display: block;
    line-height: 0;
    background: var(--code-bg);
    transition: opacity 0.15s ease;
}

.screenshot a:hover,
.screenshot a:focus {
    opacity: 0.92;
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--border);
}

.screenshot figcaption {
    padding: 0.7rem 0.9rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ---------- Architecture grid ---------- */

.arch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.arch-block {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.arch-block h3 { margin-top: 0; color: var(--accent-strong); }

.sub-h { margin-top: 2rem; }

/* ---------- Requirements ---------- */

.req-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.req-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.req-table th, .req-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.req-table thead th {
    background: var(--bg-alt);
    font-weight: 600;
}

.req-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
    .req-grid { grid-template-columns: 1fr; }
}

/* ---------- Stack list ---------- */

.stack-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.6rem 1.25rem;
}

.stack-list li {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

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

.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer p { margin: 0; max-width: 70ch; }

/* ---------- Small-screen adjustments ---------- */

@media (max-width: 600px) {
    .section { padding: 2.5rem 0; }
    .hero { padding: 3rem 0 2.75rem; }
    .feature-grid { gap: 0.85rem; }
    .card { padding: 1rem 1.1rem 0.9rem; }
    .site-header nav ul { gap: 0.4rem 1rem; }
    .site-header nav a { font-size: 0.9rem; }
    .flow { font-size: 0.78rem; padding: 0.85rem 1rem; }
}

@media (max-width: 420px) {
    .nav-row { gap: 0.6rem; }
    .brand { width: 100%; }
}
