:root {
    color-scheme: light dark;
    --background: #fff;
    --foreground: #222;
    --secondary: #666;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #171717;
        --foreground: #f2f2f2;
        --secondary: #b0b0b0;
    }
}

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--background);
    color: var(--foreground);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

main {
    --page-padding: clamp(24px, 6vw, 64px);
    width: 100%;
    max-width: 1000px;
    min-height: 100vh;
    min-height: 100svh;
    margin-inline: auto;
    padding: var(--page-padding);
    padding-top: max(var(--page-padding), env(safe-area-inset-top));
    padding-right: max(var(--page-padding), env(safe-area-inset-right));
    padding-bottom: max(var(--page-padding), env(safe-area-inset-bottom));
    padding-left: max(var(--page-padding), env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(32px, 8vh, 96px);
}

h1 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.035em;
}

#countup {
    display: grid;
    gap: clamp(8px, 1.6vh, 18px);
}

.counter-row {
    display: grid;
    grid-template-columns: 3ch minmax(0, 1fr);
    align-items: baseline;
    column-gap: 0.35em;
    margin: 0;
    font-size: clamp(2rem, 7vw, 4.75rem);
    font-variant-numeric: tabular-nums lining-nums;
    line-height: 1.1;
}

.counter-value {
    letter-spacing: -0.045em;
    text-align: left;
}

.counter-label {
    color: var(--secondary);
    font-size: clamp(1rem, 2.8vw, 1.35rem);
    line-height: 1.4;
}

noscript p {
    margin: 0;
    color: var(--secondary);
    font-size: 0.95rem;
}

/* Keep the vertical stack on short screens; allow natural scrolling if needed. */
@media (max-height: 550px) and (orientation: landscape) {
    main {
        gap: 24px;
    }

    #countup {
        gap: 6px;
    }

    .counter-row {
        font-size: clamp(1.8rem, 6vh, 3rem);
    }
}
