:root {
    --bg: #f5f7fb;
    --card: rgba(255, 255, 255, 0.82);
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(17, 24, 39, 0.08);
    --shadow: 0 24px 70px rgba(17, 24, 39, 0.10);
    --button: #111827;
    --button-text: #ffffff;
}

html[data-theme="dark"] {
    --bg: #0b0d12;
    --card: rgba(22, 25, 33, 0.90);
    --text: #f3f4f6;
    --muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --button: #f3f4f6;
    --button-text: #111827;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background 180ms ease, color 180ms ease;
}

.clock-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 48px);
}

.clock-card {
    width: min(1100px, 100%);
    padding: clamp(24px, 5vw, 54px);
    border: 1px solid var(--border);
    border-radius: clamp(20px, 3vw, 34px);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    text-align: center;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(28px, 6vw, 60px);
}

.brand {
    color: var(--muted);
    font-size: clamp(10px, 1.2vw, 13px);
    font-weight: 800;
    letter-spacing: 0.18em;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--button);
    color: var(--button-text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, opacity 120ms ease;
}

.theme-toggle:hover {
    opacity: 0.88;
}

.theme-toggle:active {
    transform: scale(0.97);
}

.theme-icon {
    font-size: 15px;
    line-height: 1;
}

.clock {
    display: flex;
    align-items: baseline;
    justify-content: center;
    white-space: nowrap;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: clamp(48px, 10.8vw, 148px);
    font-weight: 700;
    letter-spacing: 0.015em;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
}

.separator {
    margin: 0 0.035em;
    opacity: 0.72;
}

.milliseconds {
    margin-left: 0.08em;
    color: var(--muted);
    font-size: 0.42em;
    letter-spacing: 0.015em;
}

.date {
    margin-top: clamp(28px, 5vw, 44px);
    color: var(--text);
    font-size: clamp(15px, 2vw, 22px);
    font-weight: 600;
}

.timezone {
    margin-top: 8px;
    color: var(--muted);
    font-size: clamp(11px, 1.5vw, 14px);
}

@media (max-width: 520px) {
    .clock-page {
        padding: 14px;
    }

    .clock-card {
        padding: 22px 16px 28px;
        border-radius: 22px;
    }

    .topbar {
        margin-bottom: 34px;
    }

    .brand {
        font-size: 9px;
    }

    .theme-toggle {
        padding: 8px 11px;
    }

    .theme-text {
        display: none;
    }

    .clock {
        font-size: clamp(38px, 12.8vw, 70px);
    }

    .date {
        font-size: 14px;
    }
}
