/* A Small Light — one wisdom per day */

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #060d1b;
    color: #e8dcc8;
    font-family: Georgia, 'Times New Roman', serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

/* ─── Breathing glow ─────────────────────────── */

.glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 196, 140, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: breathe 9s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ─── Main content ───────────────────────────── */

#wisdom-container {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 36rem;
    width: 100%;
}

/* ─── Wisdom lines ───────────────────────────── */

.wisdom {
    font-size: 1.35rem;
    line-height: 1.9;
    letter-spacing: 0.01em;
}

.wisdom-line {
    display: block;
    opacity: 0;
    transform: translateY(8px);
    animation: line-appear 0.8s ease forwards;
}

/* Staggered delays for lines 1-6 (no inline styles needed — CSP safe) */
.wisdom-line:nth-child(1) { animation-delay: 0.5s; }
.wisdom-line:nth-child(2) { animation-delay: 1.3s; }
.wisdom-line:nth-child(3) { animation-delay: 2.1s; }
.wisdom-line:nth-child(4) { animation-delay: 2.9s; }
.wisdom-line:nth-child(5) { animation-delay: 3.7s; }
.wisdom-line:nth-child(6) { animation-delay: 4.5s; }

@keyframes line-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Byline ─────────────────────────────────── */

.byline {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    color: #8a7d6b;
    margin-top: 3rem;
    opacity: 0;
    animation: fade-in 2s ease forwards;
    animation-delay: 6s;
}

/* Byline delay classes — matches line count (CSP safe, no inline styles) */
.byline-rest { animation-delay: 3s; }
.byline-3 { animation-delay: 4.4s; }
.byline-4 { animation-delay: 5.2s; }
.byline-5 { animation-delay: 6s; }
.byline-6 { animation-delay: 6.8s; }

@keyframes fade-in {
    to { opacity: 1; }
}

/* ─── Fallback (no wisdom today) ─────────────── */

.wisdom-rest {
    font-style: italic;
    color: #8a7d6b;
}

/* ─── About toggle ───────────────────────────── */

.about-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2;
    background: none;
    border: none;
    color: #8a7d6b;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.about-toggle:hover,
.about-toggle:focus-visible {
    color: #e8dcc8;
    outline: 2px solid #e8dcc8;
    outline-offset: 2px;
}

/* ─── About panel ────────────────────────────── */

.about-panel {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(6, 13, 27, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fade-in 0.4s ease forwards;
}

.about-panel[hidden] {
    display: none;
}

.about-content {
    max-width: 28rem;
    padding: 2rem;
    text-align: left;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #b8ad9a;
}

.about-content p {
    margin-bottom: 1.2rem;
}

.about-content strong {
    color: #e8dcc8;
}

.about-close {
    display: block;
    margin-top: 1.5rem;
    background: none;
    border: none;
    color: #8a7d6b;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
}

.about-close:hover,
.about-close:focus-visible {
    color: #e8dcc8;
    outline: 2px solid #e8dcc8;
    outline-offset: 2px;
}

/* ─── Reduced motion ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .glow {
        animation: none;
        opacity: 0.7;
    }

    .wisdom-line {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .byline {
        opacity: 1;
        animation: none;
    }

    .about-panel {
        animation: none;
        opacity: 1;
    }
}

/* ─── Responsive ─────────────────────────────── */

@media (max-width: 480px) {
    body {
        padding: 1.5rem;
    }

    .wisdom {
        font-size: 1.15rem;
        line-height: 1.8;
    }

    .glow {
        width: 350px;
        height: 350px;
    }
}

/* ─── Print ──────────────────────────────────── */

@media print {
    body {
        background: white;
        color: black;
    }

    .glow,
    .about-toggle,
    .about-panel {
        display: none;
    }

    .wisdom-line {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .byline {
        opacity: 1;
        animation: none;
        color: #666;
    }
}
