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

:root {
    --c-bg: #0a0a0b;
    --c-surface: #141416;
    --c-surface2: #1c1c20;
    --c-border: #2a2a30;
    --c-border-subtle: #1e1e24;
    --c-text: #e8e6e3;
    --c-text-muted: #8a8a94;
    --c-text-dim: #5a5a64;
    --c-accent: #c8a45e;
    --c-accent-dim: rgba(200,164,94,0.12);
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-duration: 0.3s;
}

html.light {
    --c-bg: #f5f3ef;
    --c-surface: #ffffff;
    --c-surface2: #f0ede8;
    --c-border: #ddd8d0;
    --c-border-subtle: #e8e4dc;
    --c-text: #1a1a1c;
    --c-text-muted: #6e6e78;
    --c-text-dim: #a0a0a8;
    --c-accent: #a07830;
    --c-accent-dim: rgba(160,120,48,0.08);
}

html {
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-duration) ease, color var(--transition-duration) ease;
}

.controls {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    gap: 0.4rem;
    z-index: 100;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.theme-toggle:hover {
    color: var(--c-text);
    border-color: var(--c-accent);
}

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

.theme-toggle:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 44px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: none;
    border-top: 1px solid var(--c-border-subtle);
    background: transparent;
    color: var(--c-text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.lang-option:first-child {
    border-top: none;
}

#lang-wrapper {
    position: relative;
}

.lang-option.active {
    color: var(--c-accent);
    background: var(--c-accent-dim);
}

.lang-option:hover:not(.active) {
    background: var(--c-surface2);
}

.theme-icon {
    display: none;
}

.theme-icon.sun {
    display: block;
}

html.light .theme-icon.sun {
    display: none;
}

html.light .theme-icon.moon {
    display: block;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem 2rem;
    text-align: center;
}

@media (min-width: 640px) {
    main {
        padding: 2rem;
    }
}

h1 {
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--c-text);
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    transition: color var(--transition-duration) ease;
}

.subheading {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--c-text-dim);
    letter-spacing: 0.01em;
    font-family: var(--font-mono);
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
    opacity: 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--c-text-muted);
    letter-spacing: 0.04em;
    transition: color var(--transition-duration) ease;
    border-top: 1px solid var(--c-border-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.tooltip-trigger {
    position: relative;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
    color: var(--c-text-muted);
}

.tooltip-trigger:focus {
    outline: none;
}

.tooltip-trigger:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

.tooltip {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.45rem 0.7rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: 0.68rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 10;
    max-width: calc(100vw - 2rem);
}

@media (max-width: 480px) {
    .tooltip {
        bottom: 3rem;
        white-space: normal;
        text-align: center;
    }
}

.tooltip-trigger[aria-expanded="true"] .tooltip {
    opacity: 1;
    visibility: visible;
}

.uppercase {
    text-transform: uppercase;
}

.svg-sprites {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    h1, .subheading {
        opacity: 1;
    }
}
