/* ══════════════════════════════════════════════
   FRIENDSHIP DAY — Poli Theme
   Palette: Emerald Violet, Lavender Glass, Mint
══════════════════════════════════════════════ */
:root {
    --accent-soft:    #e8f5e9;
    --accent-mid:     #66bb6a;
    --accent-deep:    #388e3c;
    --accent-dark:    #1b5e20;
    --violet-mid:     #ab47bc;
    --violet-light:   #e1bee7;
    --bg:             linear-gradient(145deg, #0b1510 0%, #150f21 50%, #0c1813 100%);
    --glass-bg:       rgba(255, 255, 255, 0.08);
    --glass-border:   rgba(255, 255, 255, 0.15);
    --glass-shadow:   0 12px 40px rgba(102, 187, 106, 0.2);
    --text-light:     rgba(255, 255, 255, 0.9);
    --text-sub:       rgba(255, 255, 255, 0.65);
}

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

html, body {
    height: 100%;
    overflow-x: clip;
    font-family: 'Quicksand', sans-serif;
    background: var(--bg);
    color: var(--text-light);
    -webkit-tap-highlight-color: transparent;
}

.cursive { font-family: 'Caveat', cursive; }

/* ══════ AMBIENT ══════ */
#particles-canvas {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
}
#floating-hearts {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}
.float-heart {
    position: absolute; bottom: -20px;
    font-size: 1rem; opacity: 0;
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.2; }
    100% { opacity: 0; transform: translateY(-100vh) rotate(360deg); }
}

/* ══════ SECTIONS ══════ */
.sec {
    position: fixed; inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 2rem 1rem;
    -webkit-overflow-scrolling: touch;
}
.sec.hidden { display: none; }
.sec.active { display: flex; animation: fadeIn 0.7s ease forwards; }

#sec-0 { background: var(--bg); }
#sec-1 { background: linear-gradient(145deg, #07100b 0%, #100a18 50%, #06110c 100%); }
#sec-2 { background: var(--bg); }
#sec-3 { background: var(--bg); }
#sec-4 { background: linear-gradient(145deg, #09130d 0%, #120b1b 50%, #08140e 100%); }
#sec-5 { background: var(--bg); }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}

.sec-inner {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    align-items: center; text-align: center;
    gap: 1.5rem;
    padding: clamp(2rem, 5vh, 4rem) 1.5rem;
    margin: auto 0;
    max-width: 560px; width: 100%;
}

/* ══════ SHARED UI ══════ */
.pill-badge {
    display: inline-block;
    background: rgba(102, 187, 106, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.4rem 1.2rem;
    border-radius: 60px;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent-mid);
    border: 1px solid rgba(102, 187, 106, 0.35);
}
.memory-pill {
    font-size: 0.68rem; letter-spacing: 2.5px;
    text-transform: uppercase; font-weight: 700;
    color: var(--violet-light);
    background: rgba(225, 190, 231, 0.12);
    border: 1px solid rgba(225, 190, 231, 0.3);
    padding: 0.4rem 1.2rem; border-radius: 50px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

.section-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.8rem, 6vw, 2.6rem);
    font-weight: 400; line-height: 1.2;
    color: white;
}
.section-sub {
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    color: var(--accent-mid);
}

.next-btn {
    display: inline-flex; align-items: center; gap: 0.6rem;
    background: linear-gradient(135deg, var(--accent-mid), var(--accent-deep));
    color: white; border: none; border-radius: 50px;
    padding: 0.9rem 2rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer; letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(102,187,106,0.35);
    margin-top: 0.5rem;
}
.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102,187,106,0.55);
}
.next-dark {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: none;
    color: rgba(255,255,255,0.9);
}
.next-dark:hover {
    background: rgba(102,187,106,0.2);
    box-shadow: 0 6px 20px rgba(102,187,106,0.2);
}
.btn-arrow {
    display: inline-block; transition: transform 0.2s;
}
.next-btn:hover .btn-arrow { transform: translateX(4px); }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.2rem, 7vw, 3.6rem);
    font-weight: 400; line-height: 1.1;
    background: linear-gradient(135deg, var(--accent-mid), var(--violet-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    color: var(--text-sub);
}

.scarf-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: scarfPulse 2.5s ease-in-out infinite;
}
@keyframes scarfPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(6deg); }
}

.band-wrap { padding: 1rem 0; }
.band {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 0.8rem 0;
}
.band-beads {
    display: flex; gap: 6px;
    position: relative; z-index: 2;
}
.bead {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.bead:nth-child(odd) { animation: beadBounce 2s ease-in-out infinite; }
.bead:nth-child(even) { animation: beadBounce 2s ease-in-out 0.3s infinite; }
@keyframes beadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.bead-letter {
    background: linear-gradient(135deg, #102613, #1e4523);
    color: var(--accent-mid);
    border: 2px solid var(--accent-mid);
    font-family: 'Fraunces', serif;
}
.bead-scarf {
    background: linear-gradient(135deg, var(--violet-mid), #7b1fa2);
    color: white; font-size: 1rem;
    border: 2px solid var(--violet-light);
}
.band-thread {
    position: absolute; top: 50%; left: -10px; right: -10px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-mid), var(--violet-light), var(--accent-mid), transparent);
    border-radius: 3px;
    z-index: 1;
}

/* FLASHBACK */
.flashback-date {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.fb-day {
    font-family: 'Fraunces', serif;
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 300; color: white; line-height: 1;
}
.fb-year {
    font-size: 0.9rem; color: rgba(255,255,255,0.5);
    letter-spacing: 4px; font-weight: 600;
}
.flashback-text { display: flex; flex-direction: column; gap: 0.5rem; }
.fb-line {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: rgba(255,255,255,0.7); line-height: 1.3;
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fb-line.visible { opacity: 1; transform: translateY(0); }
.fb-highlight { color: var(--accent-mid); font-weight: 600; }

.flashback-counter {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem; margin-top: 1rem;
}
.fc-number {
    font-family: 'Fraunces', serif;
    font-size: clamp(3rem, 10vw, 4.5rem);
    color: white; font-weight: 300;
}
.fc-label {
    font-size: 0.85rem; color: var(--accent-mid); font-weight: 600;
}

/* STATS */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; width: 100%;
}
.stat-card {
    padding: 1.2rem 0.8rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stat-card.revealed { opacity: 1; transform: translateY(0); }
.stat-icon { font-size: 1.4rem; }
.stat-val {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    color: white; font-weight: 400;
}
.stat-lbl {
    font-size: 0.72rem; color: var(--text-sub);
    text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; line-height: 1.4;
}
.stat-note {
    font-style: italic; font-size: 0.62rem; color: var(--accent-mid); text-transform: none;
}

/* REASONS */
.reasons-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; width: 100%;
}
.reason-card {
    perspective: 600px; height: 140px; cursor: pointer; border: none; background: none; position: relative;
}
.reason-front, .reason-back {
    position: absolute; inset: 0; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    backface-visibility: hidden; transition: transform 0.6s ease; padding: 1rem;
}
.reason-front {
    background: var(--glass-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); font-size: 2rem;
}
.reason-back {
    background: linear-gradient(135deg, var(--accent-mid), var(--accent-dark));
    color: white; font-family: 'Caveat', cursive;
    font-size: clamp(0.95rem, 3vw, 1.15rem); line-height: 1.3;
    transform: rotateY(180deg); border: 1px solid rgba(255,255,255,0.2);
}
.reason-card.flipped .reason-front { transform: rotateY(180deg); }
.reason-card.flipped .reason-back { transform: rotateY(0deg); }

/* AWARDS */
.boost-list {
    display: flex; flex-direction: column; gap: 1rem; width: 100%; text-align: left;
}
.boost-item {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1rem 1.2rem; border-radius: 16px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    opacity: 0; transform: translateX(-15px); transition: opacity 0.6s ease, transform 0.6s ease;
}
.boost-item.visible { opacity: 1; transform: translateX(0); }
.boost-num { font-size: 1.6rem; flex-shrink: 0; line-height: 1.3; }
.boost-item p { font-size: 0.9rem; color: rgba(255,255,255,0.85); line-height: 1.6; }
.boost-item strong { color: var(--accent-mid); font-weight: 700; }

/* CLOSING */
.closing-band-wrap { padding: 1rem 0; }
.closing-band { font-size: 3.5rem; animation: bandPulse 2.5s ease-in-out infinite; }
@keyframes bandPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(5deg); }
}
.closing-title {
    font-family: 'Fraunces', serif; font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 400; line-height: 1.2;
}
.closing-name {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    background: linear-gradient(135deg, var(--accent-mid), var(--violet-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.closing-body { font-size: 0.95rem; color: var(--text-sub); line-height: 1.6; max-width: 380px; }
.closing-timer { display: flex; gap: 0.6rem; }
.timer-chip {
    background: var(--glass-bg); backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border); border-radius: 14px;
    padding: 0.8rem 0.6rem; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 55px;
}
.tv { font-family: 'Fraunces', serif; font-size: clamp(1.3rem, 4vw, 1.8rem); color: white; font-weight: 400; }
.tl { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-mid); font-weight: 700; }
.timer-label { font-size: 1rem; color: var(--text-sub); }
.closing-final { font-size: clamp(1.3rem, 4vw, 1.8rem); color: var(--accent-mid); margin-top: 0.5rem; }

/* CONFETTI & SPARKLE */
#confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti-piece { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: confettiFall linear forwards; }
@keyframes confettiFall { 0% { opacity: 1; transform: translateY(0) rotate(0deg); } 100% { opacity: 0; transform: translateY(100vh) rotate(720deg); } }
.sparkle { position: fixed; pointer-events: none; font-size: 13px; z-index: 9999; animation: sparkleFade 0.8s ease-out forwards; }
@keyframes sparkleFade { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-22px) scale(0); } }

@media (max-width: 480px) {
    .bead { width: 34px; height: 34px; font-size: 0.8rem; }
    .stats-grid { gap: 0.6rem; }
    .stat-card { padding: 1rem 0.6rem; }
    .reason-card { height: 120px; }
    .reason-back { font-size: 0.88rem; padding: 0.7rem; }
    .timer-chip { min-width: 48px; padding: 0.6rem 0.4rem; }
    .boost-item { padding: 0.8rem 1rem; }
}
