:root {
    --bg: #0e0f12;
    --bg-gradient-start: #1b2230;
    --fg: #e8eaf0;
    --accent: #ff6b6b;
    --accent-hover: #e55a5a;
    --accent-subtle: rgba(255,107,107,.2);
    --accent-glow: rgba(255,107,107,.35);
    --accent-glow-hover: rgba(255,107,107,.6);
    --accent-glow-active: rgba(255,107,107,.8);
    --accent-shadow: rgba(255,107,107,.3);
    --accent-focus: rgba(255,107,107,.45);
    --accent-border: rgba(255,107,107,.1);
    --accent-bg: rgba(255,107,107,.1);
    --card: #1a1d24;
    --card-back: #243041;
    --surface: #12151b;
    --surface-raised: #181b22;
    --border: #2a2d35;
    --text-on-accent: white;
    --video-bg: #000;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --overlay-bg-heavy: rgba(0, 0, 0, 0.9);
    --shadow: 0 8px 26px rgba(0,0,0,.35);
    --shadow-hover: 0 12px 32px rgba(0,0,0,.4);
    --shadow-modal: 0 20px 60px rgba(0,0,0,.5);
    --shadow-video: 0 25px 80px rgba(0,0,0,.7);
    --shadow-tooltip: 0 4px 12px rgba(0,0,0,.3);
    --blur-sm: blur(4px);
    --blur-md: blur(8px);

    --radius: 14px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;

    --typing-duration: 3200ms;
    --steps: 30;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: radial-gradient(1200px 600px at 50% -20%, var(--bg-gradient-start) 0%, var(--bg) 60%), var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 960px; padding: 24px; margin: 0 auto; position: relative; }

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

.hero { text-align: center; padding: 56px 12px 24px; }
.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: .15em solid currentColor;
    letter-spacing: .02em;
    font-size: clamp(22px, 4vw, 36px);
    animation: typing var(--typing-duration) steps(var(--steps), end), blink-caret .75s step-end infinite;
}
.hero-sub { opacity: .9; margin-top: 12px; }

@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: currentColor } }

.heart {
    display: inline-block;
    margin-top: 18px;
    font-size: 40px;
    color: var(--accent);
    animation: pulse 1.1s ease-in-out infinite;
    filter: drop-shadow(0 0 12px var(--accent-glow));
    transition: all 0.3s ease;
    user-select: none;
}
.heart::before { content: "❤"; }
.heart:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 20px var(--accent-glow-hover));
    animation-play-state: paused;
}
.heart:active {
    transform: scale(1.1);
}

.heart.long-press {
    transform: scale(1.2);
    filter: drop-shadow(0 0 25px var(--accent-glow-active));
    animation-play-state: paused;
}
.heart:focus {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 50%;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: .85; }
    50% { transform: scale(1.22); opacity: 1; }
    100% { transform: scale(1); opacity: .85; }
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-top: 28px;
}
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 20px;
    text-align: center;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.card:active {
    transform: translateY(-2px);
}
.card-content h3 {
    margin: 0 0 8px 0; font-size: 16px; font-weight: 600;
    color: var(--fg);
}
.card-hint {
    margin-top: 8px; font-size: 12px; opacity: 0.7; font-style: italic;
    color: var(--accent);
}

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-bg); backdrop-filter: var(--blur-sm);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}
.modal-overlay.active {
    opacity: 1; visibility: visible;
}
.modal-content {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    max-width: 500px; width: 100%; max-height: 85vh;
    display: flex; flex-direction: column;
    overflow: hidden; transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-title {
    margin: 0; font-size: 18px; font-weight: 600; color: var(--fg);
}
.modal-close {
    background: none; border: none; color: var(--fg);
    font-size: 24px; cursor: pointer; padding: 4px;
    border-radius: 4px; transition: background 0.2s ease;
}
.modal-close:hover {
    background: var(--border);
}
.modal-body {
    padding: 24px; color: var(--fg); line-height: 1.6;
    overflow-y: auto; flex: 1 1 auto; min-height: 0;
}
.modal-image-container {
    padding: 0;
    margin-bottom: 0;
}
.modal-image-container:empty {
    display: none;
}
.modal-image-container:not(:empty) {
    margin-bottom: 16px;
}
.modal-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
}
.modal-message {
    margin: 0; font-size: 15px;
}
.modal-footer {
    padding: 20px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 12px;
    flex-shrink: 0;
}
.modal-btn {
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all 0.2s ease;
}
.modal-btn-primary {
    background: var(--accent); color: var(--text-on-accent);
}
.modal-btn-primary:hover {
    background: var(--accent-hover); transform: translateY(-1px);
}
.modal-open {
    overflow: hidden;
}

.video-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-bg-heavy); backdrop-filter: var(--blur-md);
    display: flex; align-items: center; justify-content: center;
    z-index: 1001; opacity: 0; visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
}
.video-modal-overlay.active {
    opacity: 1; visibility: visible;
}
.video-modal-content {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-video);
    max-width: 800px; width: 100%; max-height: 90vh;
    overflow: hidden; transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.video-modal-overlay.active .video-modal-content {
    transform: scale(1) translateY(0);
}
.video-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--surface) 0%, var(--card) 100%);
}
.video-modal-title {
    margin: 0; font-size: 20px; font-weight: 600;
    color: var(--fg); display: flex; align-items: center; gap: 8px;
}
.video-modal-close {
    background: none; border: none; color: var(--fg);
    font-size: 28px; cursor: pointer; padding: 6px;
    border-radius: 6px; transition: all 0.2s ease;
}
.video-modal-close:hover {
    background: var(--border); transform: scale(1.1);
}
.video-modal-body {
    padding: 0; position: relative;
}
.video-player {
    width: 100%; height: auto; max-height: 70vh;
    display: block; background: var(--video-bg);
}
.video-modal-footer {
    display: none;
}
.video-modal-open {
    overflow: hidden;
}

.tooltip {
    position: fixed; z-index: 1002;
    background: var(--card); color: var(--fg);
    padding: 8px 12px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-tooltip);
    opacity: 0; transform: translateY(5px) scale(0.95);
    transition: all 0.2s ease; pointer-events: none;
    white-space: nowrap; max-width: 200px;
    border: 1px solid var(--accent-subtle);
    backdrop-filter: var(--blur-sm);
}
.tooltip.active {
    opacity: 1; transform: translateY(0) scale(1);
}
.tooltip::before {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 5px solid transparent;
    border-top-color: var(--card);
}

.tooltip.tooltip-below::before {
    top: -10px; border-top-color: transparent;
    border-bottom-color: var(--card);
}

@media (max-width: 768px) {
    .tooltip {
        font-size: 14px; padding: 10px 14px;
        max-width: 250px; white-space: normal;
        text-align: center; line-height: 1.4;
    }
    .tooltip::before {
        border-width: 6px;
    }
}

@media (max-width: 480px) {
    .tooltip {
        max-width: 90vw; font-size: 15px;
        padding: 12px 16px; border-radius: var(--radius-sm);
    }
}

.commitments { margin-top: 34px; background: var(--surface); padding: 18px; border-radius: var(--radius-lg); }
.commitments h2 { margin: 0 0 10px 0; font-size: 18px; opacity: .95; }
.ck-list { display: grid; gap: 10px; margin: 12px 0; }
.ck-item {
    display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
    padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-raised);
}
.ck-item input { transform: translateY(2px); }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; opacity: .9; }
progress { width: 160px; height: 10px; }
.cta {
    margin-top: 14px; display: inline-block; text-decoration: none;
    background: var(--accent); color: var(--text-on-accent); padding: 10px 14px; border-radius: var(--radius-md);
    box-shadow: 0 6px 20px var(--accent-shadow); border: none; cursor: pointer;
}

.flip-card-inner, .cta, .ck-item { outline: none; }
.flip-card-inner:focus-visible, .cta:focus-visible, .ck-item:focus-within {
    box-shadow: 0 0 0 3px var(--accent-focus);
}

.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.language-btn {
    background: var(--card);
    border: 1px solid var(--accent-subtle);
    border-radius: var(--radius-sm);
    color: var(--fg);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 150px;
    justify-content: space-between;
}

.language-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
}

.language-btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.language-btn .language-flag {
    font-size: 16px;
    flex-shrink: 0;
}

.language-btn .language-name {
    flex: 1;
    text-align: left;
}

.language-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.language-switcher.open .language-arrow {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--accent-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.language-switcher.open .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--accent-border);
    width: 100%;
}

.language-item:last-child {
    border-bottom: none;
}

.language-item:hover {
    background: var(--card);
}

.language-item.selected {
    background: var(--accent-bg);
    color: var(--accent);
}

.language-item .language-flag {
    flex-shrink: 0;
}

.language-item .language-name {
    flex: 1;
}

@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }

    .language-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 140px;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 90vh;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 16px 20px;
    }

    .modal-image {
        max-height: 180px;
    }
}

.reduced-motion * {
    animation: none !important;
    transition: none !important;
}
