/* ================================================================
   haskell.day — graffiti at midnight
   Palette: #0a0a12 #0d0b1a #050508 #e0ff00 #00e5ff #ff00aa
            #c8c4d8 #6b6580
   Fonts:   Roboto Slab (display) · IBM Plex Sans (body) · JetBrains Mono (code)
   ================================================================ */

:root {
    --void-black: #0a0a12;
    --midnight-indigo: #0d0b1a;
    --abyss: #050508;
    --acid-lime: #e0ff00;
    --electric-cyan: #00e5ff;
    --hot-magenta: #ff00aa;
    --lavender-ash: #c8c4d8;
    --smoke: #6b6580;
    --bokeh-magenta: rgba(255, 0, 170, 0.12);
    --bokeh-cyan: rgba(0, 229, 255, 0.08);
    --bokeh-lime: rgba(224, 255, 0, 0.06);

    --font-display: "Roboto Slab", "IBM Plex Sans", Georgia, serif;
    --font-body: "IBM Plex Sans", "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--void-black);
    color: var(--lavender-ash);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---------------- BOKEH ATMOSPHERIC FIELD ---------------- */
.bokeh-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bokeh-field-quiet .bokeh { opacity: 0.7; }

.bokeh {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
    animation: drift 16s ease-in-out infinite;
}
.bokeh.small { width: 220px; height: 220px; filter: blur(60px); animation-duration: 22s; }
.bokeh-magenta { background: radial-gradient(circle, var(--bokeh-magenta) 0%, transparent 70%); }
.bokeh-cyan    { background: radial-gradient(circle, var(--bokeh-cyan) 0%, transparent 70%); animation-duration: 18s; animation-delay: -4s; }
.bokeh-lime    { background: radial-gradient(circle, var(--bokeh-lime) 0%, transparent 70%); animation-duration: 20s; animation-delay: -7s; }

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -20px) scale(1.05); }
    66%  { transform: translate(-15px, 25px) scale(0.98); }
    100% { transform: translate(0, 0) scale(1); }
}

/* ================================================================
   THE WALL (Hero)
   ================================================================ */
.wall {
    position: relative;
    min-height: 100vh;
    background: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem clamp(1.5rem, 5vw, 4rem);
    overflow: hidden;
}

.wall-stage {
    position: relative;
    z-index: 2;
    max-width: 960px;
    width: 100%;
    text-align: center;
}

.crown-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: -0.5rem;
}
.crown {
    width: clamp(140px, 26vw, 260px);
    height: auto;
    display: block;
}
.crown-path {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    animation: draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
    filter: drop-shadow(0 0 8px rgba(224, 255, 0, 0.35));
}
.crown-star {
    opacity: 0;
    animation: fade-in 0.6s ease-out 1.6s forwards;
    filter: drop-shadow(0 0 6px rgba(224, 255, 0, 0.6));
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 14vw, 10rem);
    line-height: 0.95;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--acid-lime);
    text-shadow:
        0 0 30px rgba(224, 255, 0, 0.35),
        0 0 60px rgba(224, 255, 0, 0.15);
    position: relative;
    margin: 1rem 0 0.5rem;
    opacity: 0;
    animation: hero-enter 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
.hero-word { display: inline-block; }
.hero-dot {
    color: var(--hot-magenta);
    text-shadow:
        0 0 20px rgba(255, 0, 170, 0.6),
        0 0 40px rgba(255, 0, 170, 0.3);
}
.hero-day {
    transform: translateY(6px) rotate(-1.5deg);
    display: inline-block;
}

@keyframes hero-enter {
    0%   { opacity: 0; transform: translateY(30px) scale(0.97); filter: blur(8px); }
    60%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.extension {
    position: absolute;
    width: clamp(80px, 10vw, 160px);
    height: clamp(80px, 10vw, 160px);
    opacity: 0;
    animation: fade-in 0.8s ease-out 1.4s forwards;
    pointer-events: none;
}
.extension-left  { top: 10%; left: -2%; transform: rotate(-6deg); }
.extension-right { top: 8%; right: -2%; transform: rotate(6deg) scaleX(-1); }
.ext-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 1.4s forwards;
    filter: drop-shadow(0 0 6px rgba(224, 255, 0, 0.35));
}

.drips {
    position: absolute;
    left: 50%;
    top: 62%;
    transform: translateX(-50%);
    width: clamp(320px, 85%, 900px);
    height: 200px;
    pointer-events: none;
    opacity: 0;
    animation: fade-in 0.8s ease-out 1.8s forwards;
}
.drip {
    transform-origin: top;
    transform: scaleY(0);
    animation: drip-fall 2s cubic-bezier(0.33, 0, 0.2, 1) 1.9s forwards;
}
.drip.d2 { animation-delay: 2.1s; animation-duration: 2.4s; }
.drip.d3 { animation-delay: 2.0s; animation-duration: 2.2s; }
.drip.d4 { animation-delay: 2.3s; animation-duration: 2.6s; }
.drip.d5 { animation-delay: 1.95s; animation-duration: 2.1s; }

@keyframes drip-fall {
    0%   { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

.hero-sub {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    color: var(--lavender-ash);
    letter-spacing: 0.02em;
    max-width: 540px;
    margin: 2.5rem auto 0;
    opacity: 0;
    animation: fade-in 1s ease-out 1.5s forwards;
}

.tag-annotations {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.tag {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--electric-cyan);
    opacity: 0;
    animation: fade-in 1s ease-out 2.2s forwards;
}
.tag-tl { top: 6%; left: 4%; transform: rotate(-4deg); opacity: 0; animation-delay: 2.2s; }
.tag-tr { top: 10%; right: 4%; transform: rotate(3deg); opacity: 0; animation-delay: 2.4s; }
.tag-bl { bottom: 18%; left: 6%; transform: rotate(-2deg); opacity: 0; animation-delay: 2.6s; }
.tag-br { bottom: 12%; right: 8%; transform: rotate(4deg); font-size: 1.3rem; opacity: 0; animation-delay: 2.8s; }

.tag-tl, .tag-tr, .tag-bl, .tag-br {
    --final-opacity: 0.4;
    animation-name: tag-in;
}
@keyframes tag-in {
    0% { opacity: 0; }
    100% { opacity: 0.4; }
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    animation: fade-in 1s ease-out 3s forwards;
}
.hint-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--smoke);
    animation: pulse-soft 2.8s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ================================================================
   THE BLACKBOOK
   ================================================================ */
.blackbook {
    position: relative;
    background: var(--midnight-indigo);
    padding: 10rem clamp(1.5rem, 5vw, 4rem);
    overflow: hidden;
}

.blackbook::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8rem;
    background: linear-gradient(to bottom, var(--void-black), transparent);
    pointer-events: none;
    z-index: 1;
}

.page {
    position: relative;
    max-width: 640px;
    margin: 0 auto 8rem;
    padding: 3rem clamp(1.25rem, 4vw, 2.5rem) 3.5rem;
    z-index: 2;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.page:last-child { margin-bottom: 0; }

.page.is-visible { opacity: 1; transform: translateY(0); }

.page::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--electric-cyan);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}
.page.is-visible::after {
    animation: ripple-reveal 0.9s ease-out forwards;
}
@keyframes ripple-reveal {
    0%   { opacity: 0.4; transform: translate(-50%, -50%) scale(0); }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(18); }
}

.sketch-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}
.page.is-visible .sketch-border { opacity: 1; }

.sketch-path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    opacity: 0.3;
}
.page.is-visible .sketch-path {
    animation: draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
.sketch-corner {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
}
.page.is-visible .sketch-corner {
    animation: draw 0.6s ease-out 0.9s forwards;
}

.page-number {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--smoke);
    margin-bottom: 1.25rem;
}

.page-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--acid-lime);
    text-shadow:
        0 0 20px rgba(224, 255, 0, 0.25),
        0 0 45px rgba(224, 255, 0, 0.1);
    margin-bottom: 1.5rem;
}

.page-body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--lavender-ash);
    margin-bottom: 1.75rem;
}

.code-block {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    color: var(--electric-cyan);
    background: rgba(0, 229, 255, 0.035);
    border-left: 2px solid var(--electric-cyan);
    padding: 1rem 1.25rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}
.code-block code { color: inherit; }

/* ================================================================
   THE CONSTELLATION
   ================================================================ */
.constellation {
    position: relative;
    background: var(--void-black);
    padding: 8rem clamp(1.5rem, 5vw, 4rem);
    overflow: hidden;
    min-height: 100vh;
}

.constellation::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8rem;
    background: linear-gradient(to bottom, var(--midnight-indigo), transparent);
    pointer-events: none;
    z-index: 1;
}

.constellation-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 4rem;
    position: relative;
    z-index: 2;
}
.constellation-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--acid-lime);
    text-shadow: 0 0 25px rgba(224, 255, 0, 0.3);
}
.constellation-sub {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--lavender-ash);
    margin-top: 1rem;
    letter-spacing: 0.02em;
}

.starfield {
    position: relative;
    max-width: 1000px;
    height: min(900px, 85vh);
    margin: 0 auto;
    z-index: 2;
}

.constellation-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.c-line {
    stroke: var(--electric-cyan);
    stroke-width: 1;
    fill: none;
    opacity: 0.5;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 2s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.35));
}
.constellation.lines-drawn .c-line { stroke-dashoffset: 0; }

.star {
    position: absolute;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transform: translate(-50%, -50%);
    animation: pulse 3s ease-in-out infinite;
}
.star svg {
    width: 100%;
    height: 100%;
    fill: var(--hot-magenta);
    filter: drop-shadow(0 0 8px rgba(255, 0, 170, 0.7))
            drop-shadow(0 0 18px rgba(255, 0, 170, 0.3));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.4s ease-out;
}
.star:hover svg,
.star:focus-visible svg {
    transform: scale(1.3);
    fill: var(--acid-lime);
    filter: drop-shadow(0 0 12px rgba(224, 255, 0, 0.9))
            drop-shadow(0 0 28px rgba(224, 255, 0, 0.4));
}

@keyframes pulse {
    0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.15); }
}

.ripple-ring {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 2px solid var(--electric-cyan);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: ripple 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes ripple {
    0%   { width: 0; height: 0; opacity: 0.8; }
    100% { width: 240px; height: 240px; opacity: 0; }
}

.star-tooltip {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, calc(-100% - 24px));
    background: rgba(10, 10, 18, 0.92);
    border: 1px solid rgba(0, 229, 255, 0.4);
    padding: 0.6rem 0.9rem;
    font-family: var(--font-mono);
    color: var(--lavender-ash);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}
.star-tooltip.is-visible { opacity: 1; }

.tooltip-name {
    display: block;
    color: var(--acid-lime);
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.tooltip-sig {
    display: block;
    color: var(--electric-cyan);
    font-size: 0.78rem;
}

/* ================================================================
   THE FREIGHT (Closing)
   ================================================================ */
.freight {
    position: relative;
    background: var(--abyss);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem clamp(1.5rem, 5vw, 4rem);
    overflow: hidden;
    text-align: center;
}

.freight::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8rem;
    background: linear-gradient(to bottom, var(--void-black), transparent);
    pointer-events: none;
    z-index: 1;
}

.freight-orb {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.25) 0%, transparent 65%);
    filter: blur(100px);
    animation: breathe 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.6; }
    50%      { transform: translate(-50%, -50%) scale(1.08); opacity: 1;   }
}

.freight-statement {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--acid-lime);
    text-shadow:
        0 0 30px rgba(224, 255, 0, 0.4),
        0 0 60px rgba(224, 255, 0, 0.2);
    max-width: 1100px;
}

.fl, .fl-dot {
    position: relative;
    display: inline-block;
}
.fl::after, .fl-dot::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, rgba(224, 255, 0, 0.8), transparent);
    transform: translateX(-50%);
    pointer-events: none;
}
.freight.is-visible .fl::after,
.freight.is-visible .fl-dot::after {
    animation: drip-down 2.4s cubic-bezier(0.33, 0, 0.2, 1) forwards;
    animation-delay: calc(0.08s * var(--i) + 0.4s);
}
@keyframes drip-down {
    0%   { height: 0; opacity: 1; }
    100% { height: 50px; opacity: 0; }
}

.fl-dot {
    color: var(--hot-magenta);
    text-shadow:
        0 0 20px rgba(255, 0, 170, 0.6),
        0 0 40px rgba(255, 0, 170, 0.3);
}
.fl-space {
    display: inline-block;
    width: 0.4em;
}

.freight-line {
    position: relative;
    z-index: 2;
    margin-top: 2.5rem;
    max-width: 640px;
}
.fl-sub {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--lavender-ash);
    letter-spacing: 0.02em;
}

.freight-tag {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--smoke);
    opacity: 0.5;
    transform: rotate(-2deg);
    z-index: 2;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 720px) {
    .hero-title { font-size: clamp(2.5rem, 16vw, 6rem); }
    .extension { display: none; }
    .tag-annotations .tag { font-size: 0.7rem; }
    .tag-br { font-size: 1rem; }
    .starfield { height: 700px; }
    .star { width: 26px; height: 26px; }
    .star-tooltip { font-size: 0.75rem; }
    .freight-statement { font-size: clamp(2rem, 10vw, 4rem); }
    .freight-tag { position: static; display: block; margin-top: 2rem; }
    .page { margin-bottom: 5rem; }
}

@media (max-width: 480px) {
    .crown { width: 140px; }
    .drips { top: 60%; }
    .tag-tl, .tag-tr { display: none; }
    .code-block { font-size: 0.8rem; }
}
