/*
 * Layout adapted from HelloESP, Copyright (c) 2022-2026 Kristian Kramer (Tech1k).
 * MIT license: helloesp-license.txt
 * Source: https://github.com/Tech1k/helloesp/blob/a07b7fcb8b950425c94f258ebf6a908e64968e52/data/index.html
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    color-scheme: light dark;
    --bg: #f8f7f4;
    --ink: #1a1a1a;
    --mid: #686865;
    --faint: #ccc;
    --stat-bg: var(--bg);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    min-height: 100vh;
}

main {
    max-width: 688px;
    margin: 0 auto;
    padding: 80px 24px 64px;
    width: 100%;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.site-name {
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mid);
    text-decoration: none;
    transition: color 0.15s;
}

.site-icon { color: var(--ink); }

.top-links {
    display: flex;
    gap: 16px;
    list-style: none;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.top-links a {
    color: var(--mid);
    text-decoration: none;
    transition: color 0.15s;
}

.site-name:hover, .top-links a:hover, .top-links a[aria-current="page"] {
    color: var(--ink);
}

a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
}

h1 {
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.desc {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--mid);
    margin-bottom: 48px;
    max-width: 540px;
}

.desc a {
    color: var(--ink);
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.desc a:hover { color: var(--mid); }

.stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    background: var(--faint);
    border: 1px solid var(--faint);
    margin-bottom: 48px;
}

.stat {
    grid-column: span 2;
    background: var(--stat-bg);
    padding: 20px;
    min-width: 0;
}

.stat-half { grid-column: span 3; }

.stat-label {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mid);
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 1.375rem;
    color: var(--ink);
    line-height: 1.15;
    overflow-wrap: break-word;
}

.stat-sub {
    font-size: 0.8125rem;
    color: var(--mid);
    margin-top: 4px;
}

.stat-update {
    grid-column: 1 / -1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.stat-update .stat-value { font-size: 0.9375rem; }

.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mid);
    margin-left: 6px;
    vertical-align: 3px;
}

[data-state="online"] .live-dot { background: #0a8b4a; }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111110;
        --ink: #e8e6e1;
        --mid: #a09f99;
        --faint: #2a2a28;
        --stat-bg: #1a1918;
    }
    [data-state="online"] .live-dot { background: #4fc08d; }
}

@media (max-width: 670px) {
    main { padding: 60px 16px 48px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { grid-column: span 1; }
    .stat-memory, .stat-update { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
    h1 br { display: none; }
    .stat { padding: 14px; }
}
