/* ========================================
   haroo.day — Victorian Ornamental Almanac
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    --midnight-amethyst: #1b1035;
    --plum-velvet: #2d1b4e;
    --deep-plum: #3d1f5e;
    --oxidized-copper: #c87941;
    --aged-gold: #e8cfa0;
    --electric-teal: #40e0d0;
    --lavender-cream: #d4c8e0;
    --muted-lavender: #8a7fad;
    --rose-quartz: #c9a0b8;
    --font-headline: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Hind', 'Segoe UI', sans-serif;
    --font-numeral: 'Playfair Display', Georgia, serif;
    --font-micro: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--midnight-amethyst);
    color: var(--lavender-cream);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Hidden SVG Filters --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Copper Dust Particles --- */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

/* --- Dawn Rail (Fixed Header) --- */
#dawn-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, var(--midnight-amethyst) 0%, var(--plum-velvet) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(200, 121, 65, 0.2);
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#dawn-rail.visible {
    opacity: 1;
    transform: translateY(0);
}

#dawn-rail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--oxidized-copper), var(--aged-gold), var(--oxidized-copper), transparent);
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-50%); }
    50% { transform: translateX(0%); }
}

.rail-ornament {
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flourish-svg {
    width: 100%;
    height: 40px;
    opacity: 0.7;
}

.rail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
}

.rail-clock-icon {
    width: 20px;
    height: 20px;
}

.rail-domain {
    font-family: var(--font-headline);
    font-weight: 600;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--aged-gold);
    letter-spacing: 0.05em;
}

/* --- Scene Base --- */
.scene {
    position: relative;
    width: 100%;
}

/* --- Scene 1: Dawn --- */
#scene-dawn {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--midnight-amethyst) 0%, var(--plum-velvet) 40%, var(--deep-plum) 100%);
}

.dawn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    opacity: 0;
    animation: dawnFadeIn 2s ease-out 0.5s forwards;
}

@keyframes dawnFadeIn {
    to { opacity: 1; }
}

.clock-face {
    width: clamp(250px, 50vmin, 400px);
    height: clamp(250px, 50vmin, 400px);
}

.clock-svg {
    width: 100%;
    height: 100%;
}

.clock-numeral {
    font-family: var(--font-numeral);
    font-weight: 700;
    font-size: 16px;
    fill: var(--oxidized-copper);
    text-anchor: middle;
    font-variant-caps: small-caps;
}

.clock-ring {
    transition: stroke-dashoffset 3s ease-out;
}

.clock-ring.animate {
    stroke-dashoffset: 0;
}

.clock-hand {
    transform-origin: 200px 200px;
    transition: transform 0.5s ease;
}

.dawn-title {
    font-family: var(--font-headline);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    color: var(--aged-gold);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: titleFadeIn 1.5s ease-out 2.5s forwards;
}

@keyframes titleFadeIn {
    to { opacity: 1; }
}

.dawn-subtitle {
    font-family: var(--font-micro);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-lavender);
    opacity: 0;
    animation: titleFadeIn 1.5s ease-out 3.2s forwards;
}

/* --- Scene 2: Morning --- */
#scene-morning {
    min-height: 100vh;
    padding: clamp(40px, 6vw, 120px) clamp(20px, 4vw, 60px);
    padding-top: 120px;
}

.morning-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: clamp(30px, 4vw, 80px);
    align-items: flex-start;
}

.morning-vignette-area {
    flex: 0 0 62%;
}

.vignette-card {
    position: relative;
    background: rgba(45, 27, 78, 0.4);
    border-radius: 6px;
    overflow: visible;
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
    cursor: default;
}

.vignette-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(27, 16, 53, 0.6), 0 0 40px rgba(64, 224, 208, 0.05);
}

.ornamental-frame {
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    z-index: 2;
    pointer-events: none;
}

.frame-border {
    transition: stroke-dashoffset 800ms ease-out;
}

.vignette-card:hover .frame-border,
.moment-card:hover .frame-border {
    stroke-dashoffset: 0 !important;
}

.watercolor-morning {
    position: relative;
    width: 100%;
    aspect-ratio: 600 / 450;
    overflow: hidden;
    border-radius: 4px;
}

.watercolor-svg {
    width: 100%;
    height: 100%;
}

/* Watercolor breathing animations */
.wc-breathe-1 {
    animation: wcBreathe1 15s ease-in-out infinite;
}

.wc-breathe-2 {
    animation: wcBreathe2 18s ease-in-out infinite;
}

.wc-breathe-3 {
    animation: wcBreathe3 12s ease-in-out infinite;
}

@keyframes wcBreathe1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(3px, -2px) scale(1.01); }
    66% { transform: translate(-2px, 3px) scale(0.99); }
}

@keyframes wcBreathe2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-4px, 2px) scale(1.02); }
    70% { transform: translate(2px, -3px) scale(0.98); }
}

@keyframes wcBreathe3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(2px, 4px) scale(1.015); }
}

/* Morning Almanac Column */
.morning-almanac {
    flex: 0 0 35%;
    padding-top: 40px;
}

.almanac-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.almanac-hour {
    font-family: var(--font-numeral);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 2rem);
    color: var(--oxidized-copper);
    font-variant-caps: small-caps;
    letter-spacing: 0.05em;
}

.almanac-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--oxidized-copper), var(--aged-gold), transparent);
}

.almanac-label {
    font-family: var(--font-micro);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-lavender);
}

.almanac-date {
    font-family: var(--font-headline);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--aged-gold);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.almanac-season {
    font-family: var(--font-micro);
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--rose-quartz);
    font-style: italic;
}

.almanac-weather {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 0;
    border-top: 1px solid rgba(200, 121, 65, 0.15);
    border-bottom: 1px solid rgba(200, 121, 65, 0.15);
}

.weather-label {
    font-family: var(--font-micro);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-lavender);
}

.weather-value {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--lavender-cream);
}

.almanac-observation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.almanac-observation p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: var(--lavender-cream);
}

/* --- Clock Divider --- */
.clock-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 6vw, 100px) 0;
}

.clock-divider-svg {
    width: 120px;
    height: 120px;
    opacity: 0.6;
}

.divider-numeral {
    font-family: var(--font-numeral);
    font-weight: 700;
    font-size: 10px;
    fill: var(--oxidized-copper);
    text-anchor: middle;
    font-variant-caps: small-caps;
}

.divider-hand {
    transform-origin: 100px 100px;
    animation: dividerRotate 60s linear infinite;
}

@keyframes dividerRotate {
    to { transform: rotate(360deg); }
}

/* --- Scene 3: Afternoon --- */
#scene-afternoon {
    min-height: 100vh;
    padding: clamp(40px, 6vw, 120px) clamp(20px, 4vw, 60px);
}

.afternoon-layout {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 30px;
    padding-left: 60px;
}

.moment-card {
    position: relative;
    width: clamp(180px, 20vw, 220px);
    background: rgba(45, 27, 78, 0.35);
    border-radius: 4px;
    overflow: visible;
    transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 250ms ease-out;
    cursor: default;
}

.moment-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 16px 48px rgba(27, 16, 53, 0.5);
    z-index: 10;
}

.moment-card:hover::after {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: radial-gradient(circle at 50% 50%, rgba(64, 224, 208, 0.12) 0%, transparent 70%);
    z-index: -1;
    border-radius: 8px;
    pointer-events: none;
}

.card-1 { transform: rotate(-2deg); margin-top: 0; }
.card-2 { transform: rotate(1.5deg); margin-top: 40px; }
.card-3 { transform: rotate(-1deg); margin-top: -20px; }
.card-4 { transform: rotate(2.5deg); margin-top: 60px; }
.card-5 { transform: rotate(-1.5deg); margin-top: 10px; }

.frame-small {
    position: absolute;
    top: -4px;
    left: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    z-index: 2;
    pointer-events: none;
}

.card-watercolor {
    width: 100%;
    aspect-ratio: 200 / 240;
    overflow: hidden;
    border-radius: 3px;
}

.card-watercolor svg {
    width: 100%;
    height: 100%;
}

.card-label {
    display: block;
    padding: 10px 12px;
    font-family: var(--font-micro);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-lavender);
    text-align: center;
}

/* --- Scene 4: Evening --- */
#scene-evening {
    min-height: 100vh;
    padding: clamp(40px, 6vw, 120px) 0;
}

.evening-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 80vh;
}

.timeline-stem {
    position: relative;
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(200, 121, 65, 0.15);
    transform: translateX(-50%);
}

.timeline-progress {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, var(--oxidized-copper), var(--aged-gold));
    transform: translateX(-50%);
    transition: height 0.3s ease;
}

.timeline-numeral {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-numeral);
    font-weight: 700;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--oxidized-copper);
    font-variant-caps: small-caps;
    z-index: 2;
    background: var(--midnight-amethyst);
    padding: 4px 0;
}

.numeral-vi { top: 0; }
.numeral-xii { top: 33%; }
.numeral-xviii { top: 66%; }
.numeral-xxiv { bottom: 0; }

.evening-panorama {
    flex: 1;
    position: relative;
    min-height: 500px;
    overflow: hidden;
    border-radius: 4px;
    margin-right: clamp(20px, 4vw, 60px);
}

.panorama-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.panorama-svg {
    width: 100%;
    height: 100%;
}

.panorama-layer-1 { z-index: 1; }
.panorama-layer-2 { z-index: 2; }
.panorama-layer-3 { z-index: 3; }

.evening-annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: clamp(30px, 5vw, 80px);
}

.annotation {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.7;
    color: var(--lavender-cream);
    max-width: 420px;
    opacity: 0.85;
}

.annotation-1 { align-self: flex-start; }
.annotation-2 { align-self: flex-end; }
.annotation-3 { align-self: flex-start; margin-left: 10%; }

/* --- Scene 5: Midnight --- */
#scene-midnight {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--midnight-amethyst);
    position: relative;
    overflow: hidden;
}

.midnight-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 2;
}

.clock-midnight {
    width: clamp(300px, 70vmin, 600px);
    height: clamp(300px, 70vmin, 600px);
}

.clock-svg-large {
    width: 100%;
    height: 100%;
}

.midnight-numeral {
    font-size: 20px;
    fill: var(--oxidized-copper);
}

.midnight-hand {
    transform-origin: 250px 250px;
}

.midnight-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.midnight-text.visible {
    opacity: 1;
}

.midnight-hangul {
    font-family: var(--font-headline);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--aged-gold);
    letter-spacing: -0.02em;
    line-height: 1;
}

.midnight-english {
    font-family: var(--font-micro);
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-lavender);
}

/* --- Particle Animation Keyframes --- */
@keyframes particleDrift1 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: var(--p-opacity, 0.3); }
    90% { opacity: var(--p-opacity, 0.3); }
    100% { transform: translate(var(--p-dx, 30px), var(--p-dy, -100vh)) rotate(180deg); opacity: 0; }
}

@keyframes particleDrift2 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    15% { opacity: var(--p-opacity, 0.25); }
    85% { opacity: var(--p-opacity, 0.25); }
    100% { transform: translate(var(--p-dx, -20px), var(--p-dy, -100vh)) rotate(-120deg); opacity: 0; }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .morning-layout {
        flex-direction: column;
    }

    .morning-vignette-area {
        flex: none;
        width: 100%;
    }

    .morning-almanac {
        flex: none;
        width: 100%;
        padding-top: 20px;
    }

    .afternoon-layout {
        justify-content: center;
        padding-left: 0;
    }

    .moment-card {
        width: clamp(150px, 40vw, 200px);
    }

    .evening-layout {
        flex-direction: column;
    }

    .timeline-stem {
        width: 100%;
        height: 60px;
        flex-direction: row;
    }

    .timeline-line {
        top: 50%;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        height: 1px;
        transform: translateY(-50%);
    }

    .timeline-progress {
        top: 50%;
        left: 0;
        width: 0;
        height: 2px;
        transform: translateY(-50%);
    }

    .timeline-numeral {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
    }

    .numeral-vi, .numeral-xii, .numeral-xviii, .numeral-xxiv {
        top: auto;
        bottom: auto;
    }

    .evening-panorama {
        margin-right: 0;
        min-height: 400px;
    }

    .rail-ornament {
        display: none;
    }
}

@media (max-width: 600px) {
    .afternoon-layout {
        gap: 20px;
    }

    .moment-card {
        width: clamp(140px, 42vw, 180px);
    }

    .card-1, .card-2, .card-3, .card-4, .card-5 {
        margin-top: 0;
        transform: rotate(0deg);
    }
}
