@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700&family=Unbounded:wght@700;800;900&display=swap');

:root {
    --bg: #0e1210;
    --accent: #4d8a68;
    --accent-bright: #6aad86;
    --secondary: #d4754f;
    --warm: #c9923e;
    --text: #ede8e0;
    --text-secondary: rgba(237, 232, 224, 0.64);
    --text-muted: rgba(237, 232, 224, 0.38);
    --border: rgba(255, 255, 255, 0.08);
    --font-display: 'Unbounded', system-ui, sans-serif;
    --font: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100dvh;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(77, 138, 104, 0.09), transparent 60%),
        radial-gradient(ellipse 40% 35% at 85% 70%, rgba(212, 117, 79, 0.06), transparent 55%);
}

.noise,
.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.noise {
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
    background: radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, 0.5) 100%);
}

.hud {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.hud__corner {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.55;
    letter-spacing: 0.12em;
    color: rgba(106, 173, 134, 0.45);
    text-transform: uppercase;
}

.hud__corner strong {
    color: rgba(106, 173, 134, 0.85);
    font-weight: 600;
}

.hud__corner--tl { top: max(16px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); }
.hud__corner--tr { top: max(16px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); text-align: right; }
.hud__corner--bl { bottom: max(16px, env(safe-area-inset-bottom)); left: max(18px, env(safe-area-inset-left)); }
.hud__corner--br { bottom: max(16px, env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); text-align: right; }

/* Full viewport shell – content stays compact and centered */
.shell {
    position: relative;
    z-index: 2;
    height: 100dvh;
    width: 100%;
    display: grid;
    place-items: center;
    padding:
        max(48px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(48px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
}

.shell__grid {
    position: absolute;
    inset: 12% 8%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 65% 60% at 50% 50%, black, transparent 75%);
    opacity: 0.7;
    pointer-events: none;
}

.shell__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    pointer-events: none;
}

.shell__glow--a {
    width: min(360px, 50vw);
    height: min(360px, 50vw);
    top: 18%;
    right: 12%;
    background: rgba(77, 138, 104, 0.14);
}

.shell__glow--b {
    width: min(280px, 42vw);
    height: min(280px, 42vw);
    bottom: 16%;
    left: 10%;
    background: rgba(212, 117, 79, 0.09);
}

.card {
    position: relative;
    width: min(460px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    opacity: 0;
    animation: rise 0.7s var(--ease) 0.05s forwards;
}

.card__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.brand__mark {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    color: #f5f0e8;
    background: linear-gradient(135deg, #5da87a 0%, #2d5240 55%, #1f3a2c 100%);
    box-shadow: 0 4px 20px rgba(77, 138, 104, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.brand__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.12em;
    line-height: 1.1;
}

.brand__sub {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(77, 138, 104, 0.26);
    background: rgba(77, 138, 104, 0.09);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--accent-bright);
    white-space: nowrap;
}

.eyebrow__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--secondary);
    box-shadow: 0 0 10px rgba(212, 117, 79, 0.65);
    animation: pulse 1.8s ease-in-out infinite;
}

.title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(36px, 7.5vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.title__accent {
    background: linear-gradient(125deg, #4d8a68 0%, #d4754f 48%, #c9923e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    max-width: 34ch;
    margin: 0 auto 28px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
}

.lede time {
    color: var(--text);
    font-weight: 600;
}

.timer {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.timer__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    aspect-ratio: 1 / 1.05;
    max-height: 96px;
    padding: 12px 6px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(20, 26, 23, 0.75);
    backdrop-filter: blur(10px);
}

.timer__value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: clamp(26px, 5.5vw, 34px);
    letter-spacing: 0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer__label {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

.status {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.status.is-live {
    color: var(--accent-bright);
}

/* Language switcher – corner control, away from the centered stage */
.lang {
    position: fixed;
    z-index: 20;
    top: max(56px, calc(env(safe-area-inset-top) + 44px));
    right: max(18px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
    width: 168px;
}

.lang__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(14, 18, 16, 0.88);
    backdrop-filter: blur(14px);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
}

.lang__toggle:hover,
.lang.is-open .lang__toggle {
    border-color: rgba(77, 138, 104, 0.45);
    background: rgba(20, 26, 23, 0.95);
}

.lang__chevron {
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.25s var(--ease);
}

.lang.is-open .lang__chevron {
    transform: rotate(180deg);
}

.lang__menu {
    display: none;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 24, 21, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.lang.is-open .lang__menu {
    display: block;
    animation: drop 0.22s var(--ease);
}

.lang__list {
    display: flex;
    flex-direction: column;
    max-height: min(280px, 42dvh);
    overflow-y: auto;
}

.lang__option {
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.lang__option:last-child {
    border-bottom: 0;
}

.lang__option:hover {
    background: rgba(77, 138, 104, 0.12);
    color: var(--text);
}

.lang__option.is-active {
    background: linear-gradient(135deg, #5da87a 0%, #2d5240 100%);
    color: #f5f0e8;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drop {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 768px) {
    .hud__corner { display: none; }
    .eyebrow {
        white-space: normal;
        text-align: center;
        max-width: 100%;
        line-height: 1.4;
    }
    .card { width: min(360px, 100%); }
    .timer { gap: 6px; }
    .timer__cell {
        border-radius: 14px;
        max-height: 84px;
        gap: 6px;
        padding: 10px 4px;
    }
    .lede { font-size: 14px; margin-bottom: 24px; }
    .card__head { margin-bottom: 22px; gap: 14px; }

    .lang {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        left: auto;
        bottom: auto;
        transform: none;
        width: 148px;
        flex-direction: column-reverse;
    }
}

@media (max-height: 640px) {
    .shell { padding-block: 28px; }
    .card__head { margin-bottom: 18px; gap: 12px; }
    .title { font-size: clamp(30px, 6vw, 40px); margin-bottom: 10px; }
    .lede { margin-bottom: 18px; font-size: 14px; }
    .timer__cell { max-height: 72px; aspect-ratio: auto; min-height: 68px; }
    .brand__mark { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
    .lang__list { max-height: min(220px, 36dvh); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .card { opacity: 1; transform: none; }
}
