/* ============================================
   layer2.report -- Watercolor Data Journal
   ============================================ */

/* --- CSS Variables / Palette --- */
:root {
    --cream-ground: #f5ede0;
    --coastal-teal: #4a9c9c;
    --sandy-warm: #d4b896;
    --coral-accent: #c4786a;
    --deep-tide: #2a5a5a;
    --foam-white: #faf8f2;
    --chart-stroke: rgba(42, 90, 90, 0.7);
    --watercolor-bleed: 0.2;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.7;
    color: var(--deep-tide);
    background-color: var(--cream-ground);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chart-annotation,
.chart-axis-label {
    font-family: 'Kalam', cursive;
    font-weight: 400;
    font-size: 12px;
    fill: var(--deep-tide);
}

.chart-annotation {
    font-size: 13px;
    fill-opacity: 0.85;
}

/* ============================================
   HERO SECTION
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 8vw;
    overflow: hidden;
    background-color: var(--cream-ground);
}

/* Watercolor splashes */
.splash {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
    pointer-events: none;
}

.splash.visible {
    opacity: 1;
    transform: scale(1.0);
}

.splash-teal {
    width: 45vw;
    height: 45vw;
    max-width: 550px;
    max-height: 550px;
    top: -10%;
    right: -8%;
    background: radial-gradient(ellipse at 40% 40%, rgba(74, 156, 156, 0.2) 0%, rgba(74, 156, 156, 0.08) 50%, transparent 70%);
}

.splash-sand {
    width: 35vw;
    height: 35vw;
    max-width: 400px;
    max-height: 400px;
    bottom: 5%;
    left: -5%;
    background: radial-gradient(ellipse at 60% 50%, rgba(212, 184, 150, 0.25) 0%, rgba(212, 184, 150, 0.08) 55%, transparent 75%);
}

.splash-coral {
    width: 25vw;
    height: 25vw;
    max-width: 300px;
    max-height: 300px;
    top: 55%;
    right: 15%;
    background: radial-gradient(ellipse at 45% 55%, rgba(196, 120, 106, 0.2) 0%, rgba(196, 120, 106, 0.06) 50%, transparent 70%);
}

.splash-teal-sm {
    width: 18vw;
    height: 18vw;
    max-width: 220px;
    max-height: 220px;
    top: 20%;
    left: 30%;
    background: radial-gradient(ellipse at 50% 50%, rgba(74, 156, 156, 0.12) 0%, rgba(74, 156, 156, 0.03) 60%, transparent 75%);
}

.hero-title {
    font-size: clamp(48px, 10vw, 120px);
    line-height: 0.95;
    letter-spacing: 0.08em;
    color: var(--deep-tide);
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.hero-chart {
    position: relative;
    z-index: 2;
    max-width: 550px;
    width: 60%;
    align-self: flex-end;
    margin-top: -80px;
    margin-right: 5vw;
}

.watercolor-chart-hero {
    width: 100%;
    height: auto;
}

.hero-chart-caption {
    font-family: 'Kalam', cursive;
    font-size: 14px;
    color: var(--deep-tide);
    opacity: 0.7;
    text-align: center;
    margin-top: 8px;
}

.hero-subtitle {
    font-family: 'Kalam', cursive;
    font-size: clamp(16px, 2vw, 22px);
    color: var(--deep-tide);
    opacity: 0.75;
    position: relative;
    z-index: 2;
    margin-top: 30px;
    max-width: 500px;
}

/* Hero chart animations */
.chart-line-hero {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.chart-line-hero.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s ease-out;
}

.chart-area-hero.shown {
    opacity: 0.3;
    transition: opacity 800ms ease-out 1s;
}

/* ============================================
   FIELD NOTES SECTION
   ============================================ */
#field-notes {
    position: relative;
    padding: 80px 6vw 100px;
    background-color: var(--cream-ground);
}

.section-title {
    font-size: clamp(36px, 7vw, 96px);
    color: var(--deep-tide);
    margin-bottom: 50px;
    letter-spacing: 0.08em;
}

.notes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: flex-start;
}

/* Note base */
.note {
    background-color: var(--foam-white);
    border: 1px solid rgba(42, 90, 90, 0.1);
    padding: 30px 28px;
    transform: rotate(var(--note-angle, 0deg));
    opacity: 0;
    translate: 0 20px;
    transition: opacity 400ms ease-out, translate 400ms ease-out;
    position: relative;
}

.note.visible {
    opacity: 1;
    translate: 0 0;
}

.note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(212, 184, 150, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.note-large {
    width: 60%;
    min-width: 300px;
    flex-shrink: 0;
}

.note-medium {
    width: 45%;
    min-width: 280px;
    flex-shrink: 0;
}

.note-small {
    width: 30%;
    min-width: 220px;
    flex-shrink: 0;
    padding: 22px 20px;
}

.note-heading {
    font-size: clamp(20px, 3vw, 32px);
    color: var(--deep-tide);
    margin-bottom: 15px;
    letter-spacing: 0.06em;
}

.note-body {
    color: var(--deep-tide);
    margin-bottom: 15px;
}

.note-annotation {
    font-family: 'Kalam', cursive;
    font-size: 14px;
    color: var(--deep-tide);
    opacity: 0.8;
    margin-top: 10px;
}

.note-margin-text {
    font-family: 'Kalam', cursive;
    font-size: 15px;
    color: var(--deep-tide);
    opacity: 0.85;
    line-height: 1.6;
}

/* Inline charts in notes */
.note-chart-inline {
    margin: 20px 0 10px;
    max-width: 100%;
}

.watercolor-chart-inline {
    width: 100%;
    height: auto;
}

.chart-line-inline {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.chart-line-inline.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.2s ease-out;
}

.chart-area-inline.shown {
    opacity: 1;
    transition: opacity 600ms ease-out 0.8s;
}

/* ============================================
   TIDE CHARTS SECTION
   ============================================ */
#tide-charts {
    position: relative;
    padding: 80px 6vw 100px;
    background-color: var(--cream-ground);
}

.tide-intro {
    font-family: 'Kalam', cursive;
    font-size: clamp(16px, 2vw, 20px);
    color: var(--deep-tide);
    opacity: 0.7;
    margin-top: -35px;
    margin-bottom: 50px;
}

.tide-chart-block {
    position: relative;
    margin-bottom: 80px;
}

.tide-chart-title {
    font-size: clamp(22px, 3.5vw, 42px);
    color: var(--deep-tide);
    margin-bottom: 20px;
    letter-spacing: 0.06em;
}

.tide-chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: var(--foam-white);
    border: 1px solid rgba(42, 90, 90, 0.08);
    padding: 20px;
    transform: rotate(-0.3deg);
}

.watercolor-chart-tide {
    width: 100%;
    height: auto;
}

.chart-line-tide {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.chart-line-tide.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.8s ease-out;
}

.chart-area-tide.shown {
    opacity: 1;
    transition: opacity 800ms ease-out 1.2s;
}

/* Chart tooltip */
.chart-tooltip {
    position: absolute;
    background-color: var(--foam-white);
    border: 1px solid rgba(42, 90, 90, 0.15);
    padding: 10px 14px;
    font-family: 'Kalam', cursive;
    font-size: 14px;
    color: var(--deep-tide);
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-out;
    white-space: pre-line;
    z-index: 10;
    box-shadow: 2px 3px 10px rgba(42, 90, 90, 0.08);
    max-width: 220px;
}

.chart-tooltip.show {
    opacity: 1;
}

/* ============================================
   DATA POINT PULSE ANIMATION
   ============================================ */
@keyframes pulse-attention {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

.pulse-point {
    animation: pulse-attention 2s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

/* ============================================
   JOURNAL END / CLOSING SECTION
   ============================================ */
#journal-end {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--cream-ground);
}

.closing-wash {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 30%, rgba(74, 156, 156, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 60%, rgba(212, 184, 150, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(196, 120, 106, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(74, 156, 156, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 15% 70%, rgba(196, 120, 106, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.closing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    padding: 40px;
}

.closing-title {
    font-size: clamp(36px, 7vw, 80px);
    color: var(--deep-tide);
    margin-bottom: 25px;
    letter-spacing: 0.06em;
    line-height: 1.1;
}

.closing-observation {
    font-size: clamp(16px, 1.8vw, 20px);
    color: var(--deep-tide);
    line-height: 1.8;
    margin-bottom: 30px;
}

.closing-sign-off {
    font-family: 'Kalam', cursive;
    font-size: 16px;
    color: var(--deep-tide);
    opacity: 0.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .hero-chart {
        width: 80%;
        max-width: 400px;
        margin-top: 20px;
        margin-right: 0;
        align-self: center;
    }

    .note-large,
    .note-medium,
    .note-small {
        width: 100%;
        min-width: 0;
    }

    .notes-container {
        flex-direction: column;
        gap: 20px;
    }

    .tide-chart-wrapper {
        transform: rotate(0deg);
    }
}

@media (max-width: 600px) {
    #hero {
        padding: 40px 5vw;
    }

    #field-notes,
    #tide-charts {
        padding: 50px 5vw 60px;
    }

    .section-title {
        margin-bottom: 30px;
    }

    .note {
        padding: 20px 18px;
    }
}
