@font-face {
    font-family: 'Bimbo Ballpoint';
    src: url('../BimboBallpoint.woff2') format('woff2'),
         url('../fonts/Bimbo-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f7f4ef;
    --ink: #2a3a6a;
    --red: #c0392b;
    --dark: #222;
    --gray: #888;
    --hand: 'Bimbo Ballpoint', cursive;
    --body: 'Cormorant Garamond', serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    min-height: 100vh;
    font-family: var(--body);
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Текстура бумаги — через background вместо fixed pseudo-element */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        url("../images/paper=text.png")
        center / cover no-repeat;
    mix-blend-mode: multiply;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
    will-change: auto;
}

.page {
    width: 100%;
    background: transparent;
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* Общая обёртка контента внутри секций */
.section-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
}

.body-text {
    font-family: var(--body);
    font-size: 18px;
    font-weight: 400;
    color: #333;
    text-align: center;
    line-height: 1.75;
    margin-bottom: 16px;
}

.body-text strong { font-weight: 600; }

.sec-title-hand {
    font-family: var(--hand);
    font-size: 34px;
    color: var(--ink);
    margin-bottom: 5px;
    position: relative;
    display: inline-block;
}

.sec-title-hand svg {
    position: absolute;
    bottom: -4px; left: -5px;
    width: calc(100% + 10px);
    height: 8px;
}

/* ========== РАЗДЕЛИТЕЛЬ ========== */
.divider {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.divider-hearts {
    width: 60px;
    height: auto;
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

/* ========== БЕСЕДА ========== */
.screen-chat {
    padding: 30px 0 60px;
    text-align: center;
}

.chat-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 24px 0 28px;
}

.chat-qr {
    width: 180px;
    height: 180px;
    padding: 12px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.chat-link {
    display: inline-block;
    font-family: var(--body);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    padding: 12px 32px;
    border: 2px solid var(--ink);
    border-radius: 30px;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.chat-link:hover {
    background: var(--ink);
    color: #fff;
}

/* ========== COUNTDOWN ========== */
.screen-countdown {
    padding: 30px 0;
    text-align: center;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 6px;
    margin-top: 20px;
}

.cd-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.cd-num {
    font-family: var(--body);
    font-size: 36px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
    letter-spacing: 2px;
}

.cd-label {
    font-family: var(--body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gray);
    margin-top: 6px;
    font-weight: 500;
}

.cd-sep {
    font-family: var(--body);
    font-size: 30px;
    font-weight: 300;
    color: var(--red);
    opacity: 0.5;
    line-height: 1;
    padding-top: 2px;
}

/* Fade-in */
.fi {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s ease, transform .7s ease;
    will-change: opacity, transform;
}
.fi.v {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* ========== ENVELOPE OVERLAY FIX ========== */
#envelopeOverlay {
    touch-action: none;
}

#envelopeOverlay.hidden ~ .page {
    touch-action: auto;
}

/* ========== MEDIA ========== */

@media (max-width: 360px) {
    .chat-qr { width: 150px; height: 150px; padding: 10px; }
    .chat-link { font-size: 15px; padding: 10px 24px; }
    .cd-cell { min-width: 50px; }
    .cd-num { font-size: 28px; }
    .cd-sep { font-size: 24px; }
    .cd-label { font-size: 9px; letter-spacing: 1px; }
}

@media (max-width: 767px) {
    .section-inner {
        max-width: 100%;
        padding: 0 20px;
    }

    /* Убираем тяжёлый blend-mode на слабых устройствах */
    body::before {
        mix-blend-mode: normal;
        opacity: 0.12;
    }
}

@media (min-width: 768px) {
    .section-inner { max-width: 600px; }
    .body-text { font-size: 20px; }
    .sec-title-hand { font-size: 40px; }
    .divider { padding: 28px 0; }
    .divider-hearts { width: 75px; }
    .screen-chat { padding: 40px 0 70px; }
    .chat-qr { width: 200px; height: 200px; padding: 14px; }
    .chat-link { font-size: 19px; padding: 14px 38px; }
    .screen-countdown { padding: 40px 0; }
    .countdown { gap: 12px; margin-top: 28px; }
    .cd-cell { min-width: 80px; }
    .cd-num { font-size: 48px; }
    .cd-sep { font-size: 40px; }
    .cd-label { font-size: 13px; margin-top: 8px; }
}

@media (min-width: 1024px) {
    .section-inner { max-width: 680px; }
    .body-text { font-size: 22px; }
    .sec-title-hand { font-size: 44px; }
    .divider { padding: 34px 0; }
    .divider-hearts { width: 85px; }
    .screen-chat { padding: 50px 0 80px; }
    .chat-qr { width: 220px; height: 220px; padding: 16px; }
    .chat-link { font-size: 20px; padding: 16px 42px; }
    .screen-countdown { padding: 50px 0; }
    .countdown { gap: 16px; }
    .cd-cell { min-width: 100px; }
    .cd-num { font-size: 58px; }
    .cd-sep { font-size: 48px; }
    .cd-label { font-size: 14px; }
}

@media (min-width: 1400px) {
    .section-inner { max-width: 750px; }
    .body-text { font-size: 24px; }
    .sec-title-hand { font-size: 48px; }
    .divider-hearts { width: 95px; }
    .chat-qr { width: 240px; height: 240px; }
    .chat-link { font-size: 22px; }
    .cd-num { font-size: 66px; }
    .cd-cell { min-width: 110px; }
}