/* ===================================
   historical.day - Styles
   A contemplative daily history companion
   Seapunk-inspired depth metaphor
   =================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Surface palette (deep-burgundy descent) */
    --surface-1: #3A1020;
    --surface-2: #4A2030;
    --surface-3-start: #3A2030;
    --surface-3-end: #2A2040;
    --surface-4: #1A1030;
    --abyss: #0A0A20;

    /* Text colors */
    --text-cream: #F0E4D8;
    --text-muted: #B0A090;

    /* Accent colors */
    --ripple-burgundy: #6A3040;
    --vintage-gold: #C4A060;

    /* Typography */
    --font-primary: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    color: var(--text-cream);
    line-height: 1.95;
    font-size: clamp(16px, 1.15vw, 18px);
    background-color: var(--abyss);
    /* Full-page depth gradient */
    background-image: linear-gradient(
        to bottom,
        var(--surface-1) 0%,
        var(--surface-1) 12%,
        var(--surface-2) 25%,
        var(--surface-3-start) 40%,
        var(--surface-3-end) 55%,
        var(--surface-4) 70%,
        var(--abyss) 90%
    );
    background-attachment: fixed;
    background-size: 100% 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Sections --- */
.section {
    position: relative;
    width: 100%;
}

/* --- Opening Viewport --- */
.section-opening {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Ripple effect container */
.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
    z-index: 0;
}

.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    box-shadow: 0 0 0 0 rgba(106, 48, 64, 0.3);
    animation: ripple-expand 2s ease-out infinite;
    animation-delay: 1s;
}

.ripple-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(106, 48, 64, 0.2);
    animation: ripple-expand 2s ease-out infinite;
    animation-delay: 2.5s;
}

.ripple-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(106, 48, 64, 0.15);
    animation: ripple-expand 2s ease-out infinite;
    animation-delay: 4s;
}

@keyframes ripple-expand {
    0% {
        box-shadow: 0 0 0 0 rgba(106, 48, 64, 0.3);
    }
    100% {
        box-shadow: 0 0 0 150px rgba(106, 48, 64, 0);
    }
}

/* Date display */
.date-display {
    position: relative;
    z-index: 1;
    text-align: center;
    opacity: 0;
    animation: date-fade-in 1500ms ease-in forwards;
    cursor: default;
}

@keyframes date-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.date-month {
    display: block;
    font-weight: 400;
    font-variant: small-caps;
    letter-spacing: 0.2em;
    font-size: clamp(18px, 2.5vw, 28px);
    color: var(--text-muted);
    margin-bottom: 0.25em;
}

.date-day-number {
    display: block;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    line-height: 1;
    color: var(--text-cream);
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-variant: small-caps;
    letter-spacing: 0.12em;
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0;
    animation: hint-fade-in 1000ms ease-in 2500ms forwards;
}

@keyframes hint-fade-in {
    0% { opacity: 0; }
    100% { opacity: 0.5; }
}

/* --- Narrative Column --- */
.narrative-column {
    max-width: 55ch;
    margin: 0 auto;
    padding: 6rem 1.5rem;
}

/* --- Primary Event Section --- */
.section-primary {
    min-height: 100vh;
}

.event-year {
    display: block;
    font-variant: small-caps;
    letter-spacing: 0.12em;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.event-title {
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 36px);
    line-height: 1.3;
    color: var(--text-cream);
    margin-bottom: 1.5rem;
}

.event-body {
    margin-bottom: 1.5rem;
    color: var(--text-cream);
}

/* --- Thin Rule Divider --- */
.thin-rule {
    width: 40%;
    height: 1px;
    background-color: rgba(176, 160, 144, 0.3);
    margin: 1.5rem auto 2rem auto;
}

/* --- Asterism Section Divider --- */
.asterism {
    text-align: center;
    font-size: 18px;
    color: var(--vintage-gold);
    letter-spacing: 1em;
    padding: 2rem 0;
    user-select: none;
}

/* --- Deeper Dive Section --- */
.section-deeper {
    min-height: 100vh;
}

.section-label {
    font-variant: small-caps;
    font-weight: 400;
    letter-spacing: 0.12em;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.secondary-event {
    margin-bottom: 1rem;
}

.secondary-title {
    font-weight: 500;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.4;
    color: var(--text-cream);
    margin-bottom: 0.75rem;
}

.secondary-body {
    font-size: clamp(15px, 1.05vw, 17px);
    color: rgba(240, 228, 216, 0.85);
    margin-bottom: 1rem;
}

/* --- Archives Section --- */
.section-archives {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.archival-quote {
    margin: 2rem 0;
    padding-left: 2rem;
    border-left: 2px solid rgba(196, 160, 96, 0.3);
}

.archival-quote p {
    font-style: italic;
    font-weight: 500;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.8;
    color: var(--text-cream);
    margin-bottom: 1.5rem;
}

.quote-attribution {
    display: block;
    font-style: normal;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.quote-date {
    color: var(--vintage-gold);
}

.ornamental-flourish {
    text-align: center;
    margin-top: 3rem;
    opacity: 0.6;
}

/* --- Footer --- */
.section-footer {
    padding: 4rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    font-variant: small-caps;
    font-weight: 400;
    letter-spacing: 0.12em;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 300ms ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--text-cream);
}

.nav-arrow {
    font-size: 18px;
    vertical-align: -1px;
}

.nav-separator {
    color: rgba(176, 160, 144, 0.3);
    font-size: 14px;
    user-select: none;
}

/* Ripple effect on nav hover */
.nav-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(106, 48, 64, 0.15);
    transform: translate(-50%, -50%);
    transition: width 600ms ease-out, height 600ms ease-out, opacity 600ms ease-out;
    opacity: 0;
    z-index: -1;
}

.nav-link:hover::after {
    width: 120px;
    height: 120px;
    opacity: 1;
}

/* --- Fade-in for scroll-revealed elements --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Date hover ripple --- */
.date-display.ripple-active .ripple-trigger {
    animation: ripple-expand 1.5s ease-out;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .narrative-column {
        max-width: 100%;
        padding: 4rem 1.25rem;
    }

    .archival-quote {
        padding-left: 1.25rem;
    }

    .section-opening {
        height: 100svh;
    }
}

@media (max-width: 480px) {
    .narrative-column {
        padding: 3rem 1rem;
    }

    .thin-rule {
        width: 60%;
    }
}
