/* ==========================================================================
   haru.works // Spring Telemetry Archive
   Swiss-grid mission-control reading room. Candy-bright HUD over pearl void.
   ========================================================================== */

:root {
    --pearl:        #fdfaf3;
    --carbon:       #1a1a1f;
    --sakura:       #ff4d8d;
    --mint:         #5be7c4;
    --gum:          #ffd1e0;
    --sky:          #7ec8ff;
    --lemon:        #fffac8;
    --grey:         #a8a8b0;

    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body:    "Inter", system-ui, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, monospace;
    --font-hand:    "Caveat", cursive;

    --elastic:      cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--pearl);
    color: var(--carbon);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
}

/* ==========================================================================
   FIXED HUD CHROME LAYER
   ========================================================================== */

.hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

/* inset hairline frame */
.hud-frame {
    position: absolute;
    inset: 24px;
    border: 1px solid var(--carbon);
    transition: inset 0.5s var(--elastic);
}
.hud-frame.expand {
    inset: 18px;
}

/* corner L-bracket reticles */
.reticle {
    position: absolute;
    width: 16px;
    height: 16px;
    stroke: var(--carbon);
    stroke-width: 1.2;
    fill: none;
}
.reticle--tl { top: 16px;  left: 16px; }
.reticle--tr { top: 16px;  right: 16px; }
.reticle--bl { bottom: 16px; left: 16px; }
.reticle--br { bottom: 16px; right: 16px; }

/* edge rulers — tick marks via repeating-linear-gradient */
.ruler { position: absolute; }
.ruler--top, .ruler--bottom {
    left: 24px; right: 24px; height: 6px;
    background-image: repeating-linear-gradient(
        to right,
        var(--grey) 0, var(--grey) 1px,
        transparent 1px, transparent 8px
    );
}
.ruler--top    { top: 24px; }
.ruler--bottom { bottom: 24px; transform: scaleY(-1); }
.ruler--left, .ruler--right {
    top: 24px; bottom: 24px; width: 6px;
    background-image: repeating-linear-gradient(
        to bottom,
        var(--grey) 0, var(--grey) 1px,
        transparent 1px, transparent 8px
    );
}
.ruler--left  { left: 24px; }
.ruler--right { right: 24px; transform: scaleX(-1); }

/* faint always-on scanline texture */
.scanline-static {
    position: absolute;
    inset: 24px;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(26,26,31,0.018) 0, rgba(26,26,31,0.018) 1px,
        transparent 1px, transparent 4px
    );
    opacity: 0.6;
}

/* the satellite scan sweep — magenta line that travels top→bottom on enter */
.scanline-sweep {
    position: absolute;
    left: 24px; right: 24px;
    height: 2px;
    background: var(--sakura);
    opacity: 0;
    top: 0;
}
.scanline-sweep.run {
    animation: scanSweep 1.4s linear forwards;
}
@keyframes scanSweep {
    0%   { top: -2%;   opacity: 0; }
    8%   { opacity: 0.4; }
    92%  { opacity: 0.4; }
    100% { top: 102%;  opacity: 0; }
}

/* cursor-tracking targeting reticle */
.cursor-reticle {
    position: absolute;
    width: 40px; height: 40px;
    top: 0; left: 0;
    margin: -20px 0 0 -20px;
    stroke: var(--sky);
    stroke-width: 1;
    fill: none;
    opacity: 0.85;
    transition: transform 0.3s var(--elastic);
    will-change: transform;
}
.cursor-reticle circle { fill: rgba(126,200,255,0.06); }

/* ---- HUD consoles ---- */
.hud-console {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    line-height: 1.4;
    color: var(--carbon);
}

.hud-console--tl {
    top: 40px; left: 44px;
    display: flex; align-items: center; gap: 10px;
}
.wordmark {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: -0.04em;
    text-transform: lowercase;
}
.cursor-square {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--sakura);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.status-string { color: var(--grey); text-transform: uppercase; }
#bloomInline { color: var(--mint); }

.hud-console--tr {
    top: 40px; right: 44px;
    text-align: right;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.coord-axis { color: var(--sky); }
.section-label {
    color: var(--sakura);
    font-weight: 500;
    text-transform: uppercase;
    transition: opacity 0.4s ease;
}
.sakura-pill {
    margin-top: 4px;
    border: 1px solid var(--mint);
    color: var(--mint);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
}

/* left-margin vertical telemetry readout */
.hud-readout {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    color: var(--grey);
    text-transform: uppercase;
}
.readout-line {
    transition: opacity 0.4s ease, color 0.4s ease;
}
.readout-line:first-child { color: var(--carbon); }

/* right-margin lat/lon coords */
.hud-coords {
    position: absolute;
    right: 44px;
    bottom: 88px;
    text-align: right;
    display: flex; flex-direction: column; gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    color: var(--grey);
}
.coord-line { text-transform: uppercase; }

/* ASCII botanical banner, bottom-left */
.ascii-banner {
    position: absolute;
    left: 44px;
    bottom: 88px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    color: var(--grey);
    white-space: nowrap;
}

/* footer console */
.hud-console--footer {
    left: 44px; right: 44px;
    bottom: 38px;
    display: flex; align-items: center; gap: 12px;
    color: var(--grey);
    text-transform: uppercase;
}
.flower-glyph { width: 14px; height: 14px; flex-shrink: 0; }
.flower-glyph .petals ellipse { fill: var(--lemon); }
.flower-glyph .flower-center  { fill: var(--sakura); }
.flower-glyph--footer { animation: flowerBlink 4s steps(1) infinite; }
@keyframes flowerBlink {
    0%, 92% { opacity: 1; }
    93%, 96% { opacity: 0.2; }
    97%, 100% { opacity: 1; }
}

/* ==========================================================================
   CONTENT WELL — snap-scroll panels
   ========================================================================== */

.content-well {
    position: relative;
    z-index: 1;
}

.panel {
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    position: relative;
    padding: 96px 0;
}

/* master 12-col 1280px grid */
.panel-grid {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
}

/* content always lives in cols 3–7 (the rest is deliberate void) */
.panel-content {
    grid-column: 3 / 8;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.panel-content--intro,
.panel-content--outro { grid-column: 3 / 9; }

/* reveal animation driven by .in-view */
.panel-content > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s var(--elastic), transform 0.6s var(--elastic);
}
.panel.in-view .panel-content > * { opacity: 1; transform: translateY(0); }
.panel.in-view .panel-content > *:nth-child(1) { transition-delay: 0.05s; }
.panel.in-view .panel-content > *:nth-child(2) { transition-delay: 0.13s; }
.panel.in-view .panel-content > *:nth-child(3) { transition-delay: 0.21s; }
.panel.in-view .panel-content > *:nth-child(4) { transition-delay: 0.29s; }
.panel.in-view .panel-content > *:nth-child(5) { transition-delay: 0.37s; }

/* ---- typography inside panels ---- */
.kicker, .scroll-cue {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey);
}
.panel-index {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--sky);
}
.panel-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(3rem, 7vw, 6.5rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}
.intro-title { font-size: clamp(2.6rem, 6.2vw, 5.6rem); }
.outro-title { color: var(--sakura); }

.tagline {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 30ch;
    color: var(--carbon);
}
.scroll-cue { margin-top: 1.5rem; }

.flower-list {
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--grey);
    display: flex; flex-direction: column; gap: 6px;
}
.flower-list li { position: relative; padding-left: 18px; }
.flower-list li::before {
    content: "✺";
    position: absolute; left: 0;
    color: var(--lemon);
}
.signoff {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--carbon);
}
.caveat-inline {
    font-family: var(--font-hand);
    font-size: 1.2rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--sakura);
}

/* ==========================================================================
   MIXED-MEDIA SPECIMEN TILE
   ========================================================================== */

.specimen-tile {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 3;
    margin-top: 0.8rem;
    filter: contrast(1.05);
}

/* layer 1 — scanned paper background */
.tile-paper {
    position: absolute;
    inset: 0;
    background: #f3eee2;
    box-shadow: inset 0 0 0 1px rgba(26,26,31,0.08);
    background-image:
        radial-gradient(circle at 12% 18%, rgba(0,0,0,0.03) 0, transparent 14%),
        radial-gradient(circle at 80% 70%, rgba(0,0,0,0.025) 0, transparent 18%),
        repeating-linear-gradient(115deg, rgba(0,0,0,0.012) 0 1px, transparent 1px 3px);
    /* faint deckle edges */
    clip-path: polygon(
        1% 0%, 99% 1%, 100% 50%, 99% 99%,
        50% 100%, 1% 99%, 0% 50%, 1% 1%
    );
}

/* layer 2 — halftone-converted photo of the work */
.tile-photo {
    position: absolute;
    left: 14%; top: 16%;
    width: 64%; height: 64%;
    filter: grayscale(1) contrast(1.4) brightness(1.1);
    background-size: cover;
    background-position: center;
    box-shadow: 0 6px 18px rgba(26,26,31,0.18);
}
/* halftone dot screen as an overlay using the photo's own pseudo */
.tile-photo::after {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(0,0,0,0.5) 0.6px, transparent 0.7px);
    background-size: 4px 4px;
    mix-blend-mode: multiply;
    opacity: 0.5;
}

.tile-photo--01 { background-color: #cfcfcf; background-image:
    linear-gradient(135deg, #e8e8e8 0%, #b6b6b6 45%, #d8d8d8 100%),
    radial-gradient(circle at 30% 30%, #fff 0, transparent 40%); }
.tile-photo--02 { background-color: #cdcdcd; background-image:
    linear-gradient(120deg, #dadada 0%, #a8a8a8 50%, #ececec 100%),
    radial-gradient(ellipse at 70% 60%, #fff 0, transparent 35%); }
.tile-photo--03 { background-color: #c8c8c8; background-image:
    linear-gradient(160deg, #ececec 0%, #b0b0b0 55%, #d4d4d4 100%),
    radial-gradient(circle at 20% 80%, #fff 0, transparent 40%); }
.tile-photo--04 { background-color: #d2d2d2; background-image:
    linear-gradient(100deg, #e4e4e4 0%, #b4b4b4 48%, #efefef 100%),
    radial-gradient(circle at 60% 25%, #fff 0, transparent 38%); }

/* layer 2b — candy-pink duotone rectangle multiplied over photo */
.tile-photo-tint {
    position: absolute;
    left: 14%; top: 16%;
    width: 64%; height: 64%;
    background: var(--sakura);
    mix-blend-mode: multiply;
    opacity: 0.55;
}
.tile-photo-tint--mint  { background: var(--mint);  opacity: 0.5; }
.tile-photo-tint--sky   { background: var(--sky);   opacity: 0.45; }
.tile-photo-tint--lemon { background: var(--sakura); opacity: 0.5; }

/* layer 3 — washi tape: rotated rect, gum-pink, jagged torn left edge */
.washi-tape {
    position: absolute;
    width: 140px; height: 34px;
    background: var(--gum);
    opacity: 0.92;
    box-shadow: 0 2px 6px rgba(26,26,31,0.16);
    clip-path: polygon(
        4% 0%, 100% 0%, 100% 100%, 4% 100%,
        0% 78%, 6% 62%, 0% 42%, 6% 22%
    );
}
.washi-tape--01 { top: 6%;  left: 6%;  transform: rotate(-7deg); }
.washi-tape--02 { top: 8%;  right: 4%; transform: rotate(6deg);  }
.washi-tape--03 { bottom: 10%; left: 8%; transform: rotate(-9deg); }
.washi-tape--04 { bottom: 6%; right: 6%; transform: rotate(5deg); }

/* layer 4 — hand-drawn arrow */
.hand-arrow {
    position: absolute;
    width: 110px; height: 74px;
    stroke: var(--carbon);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.hand-arrow--01 { right: -2%;  bottom: 2%; }
.hand-arrow--02 { left: -4%;   bottom: 4%; }
.hand-arrow--03 { right: -4%;  top: 0%;    }
.hand-arrow--04 { left: -2%;   top: 4%;    }

/* layer 5 — handwritten margin note */
.margin-note {
    position: absolute;
    font-family: var(--font-hand);
    font-size: 1.25rem;
    color: var(--carbon);
    transform: rotate(-3deg);
    white-space: nowrap;
}
.margin-note--01 { right: -8%; top: 4%;  color: var(--sakura); }
.margin-note--02 { left: -10%; top: -6%; color: var(--carbon); }
.margin-note--03 { right: -6%; bottom: -8%; transform: rotate(2deg); color: var(--sky); }
.margin-note--04 { left: -8%; bottom: -8%; color: var(--carbon); }

/* faster mint scanline on title hover, crossing just the tile */
.panel-content:has(.panel-title:hover) .specimen-tile::before,
.specimen-tile.hover-scan::before {
    content: "";
    position: absolute;
    left: 0; right: 0; height: 2px;
    background: var(--mint);
    opacity: 0.6;
    animation: tileScan 0.25s linear forwards;
}
@keyframes tileScan {
    from { top: -4px; }
    to   { top: calc(100% + 4px); }
}

.panel-title:hover { color: var(--sakura); transition: color 0.3s var(--elastic); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    .hud-readout { display: none; }
    .hud-coords { display: none; }
    .ascii-banner { display: none; }
    .panel-content,
    .panel-content--intro,
    .panel-content--outro { grid-column: 2 / 12; }
    .status-string { display: none; }
    .cursor-reticle { display: none; }
}

@media (max-width: 560px) {
    .panel-content,
    .panel-content--intro,
    .panel-content--outro { grid-column: 1 / 13; }
    .panel-grid { padding: 0 20px; }
    .hud-frame { inset: 14px; }
    .reticle--tl, .reticle--tr { top: 10px; }
    .reticle--bl, .reticle--br { bottom: 10px; }
    .reticle--tl, .reticle--bl { left: 10px; }
    .reticle--tr, .reticle--br { right: 10px; }
    .hud-console--tl { left: 22px; top: 24px; }
    .hud-console--tr { right: 22px; top: 24px; }
    .hud-console--footer { left: 22px; right: 22px; bottom: 22px; }
    .ruler { display: none; }
    .margin-note { font-size: 1rem; }
    .specimen-tile { max-width: 100%; }
}
