/* daitoua.quest — holographic field journal / chrome-clad debrief */

:root {
    --gunmetal: #1a1d22;
    --slate: #4d525c;
    --chrome-mid: #6e7682;
    --nickel: #c9ced6;
    --frost: #ededf2;
    --mirror: #f7f8fa;

    --holo-ice: #a8d8ff;
    --holo-magenta: #ffb6e6;
    --holo-mint: #c8ffd0;
    --holo-gold: #ffe9a0;

    --graphite: #1c1f24;
    --expedition-red: #a02732;
    --paper-tape: #d8c089;

    --seam: 2px;
}

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

html, body {
    background: var(--gunmetal);
    color: var(--graphite);
    font-family: 'Newsreader', Georgia, serif;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #1a1d22 0%, #20242a 60%, #1a1d22 100%);
    position: relative;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============================================================
   SEAM-LIGHT — fixed-position chrome-seam light bar that sweeps
   across the page every 14s, shared between all bento cases.
   ============================================================ */
.seam-light {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background:
        linear-gradient(115deg,
            transparent 0%,
            transparent 38%,
            rgba(168, 216, 255, 0.05) 44%,
            rgba(255, 182, 230, 0.07) 48%,
            rgba(247, 248, 250, 0.14) 50%,
            rgba(200, 255, 208, 0.07) 52%,
            rgba(255, 233, 160, 0.05) 56%,
            transparent 62%,
            transparent 100%);
    background-size: 260% 100%;
    background-attachment: fixed;
    background-position: 120% 0;
    mix-blend-mode: overlay;
    animation: seamSweep 14s linear infinite;
}

@keyframes seamSweep {
    from { background-position: 120% 0; }
    to   { background-position: -120% 0; }
}

/* ============================================================
   BENTO CASES — three vertical bands; cells are children.
   ============================================================ */
.bento-case {
    display: grid;
    width: 100%;
    background: var(--gunmetal);
    gap: var(--seam);
    padding: var(--seam);
    position: relative;
    z-index: 1;
}

.bento-case--upper {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 240px 240px 240px;
    min-height: 100vh;
}

.bento-case--mid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 360px 220px;
    min-height: 90vh;
}

.bento-case--lower {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 520px 110px;
    min-height: 75vh;
}

/* upper band cells */
.cell--masthead    { grid-column: 1 / span 8;  grid-row: 1 / span 2; }
.cell--kit-a       { grid-column: 9 / span 2;  grid-row: 1 / span 1; }
.cell--kit-b       { grid-column: 11 / span 2; grid-row: 1 / span 1; }
.cell--topo        { grid-column: 9 / span 2;  grid-row: 2 / span 2; }
.cell--radio       { grid-column: 11 / span 2; grid-row: 2 / span 2; }
.cell--masthead-b  { grid-column: 1 / span 8;  grid-row: 3 / span 1; }

/* fill the leftover row 3 for upper case with masthead extension via masthead bottom */
.bento-case--upper .cell--masthead { grid-row: 1 / span 3; }

/* mid band cells */
.cell--transcript    { grid-column: 1 / span 7;  grid-row: 1 / span 2; }
.cell--ridge         { grid-column: 8 / span 5;  grid-row: 1 / span 1; }
.cell--icon-rotator  { grid-column: 8 / span 3;  grid-row: 2 / span 1; }
.cell--stations      { grid-column: 11 / span 2; grid-row: 2 / span 1; }

/* lower band cells */
.cell--map      { grid-column: 1 / span 12; grid-row: 1 / span 1; }
.cell--colophon { grid-column: 1 / span 12; grid-row: 2 / span 1; }

/* ============================================================
   CELL — base styling. Each cell is a chrome panel.
   The 2px gap between cells is the bento-case background showing
   through; that black is the gunmetal undertone of the reveal.
   ============================================================ */
.cell {
    position: relative;
    background: var(--frost);
    overflow: hidden;
    isolation: isolate;
    color: var(--graphite);
    cursor: crosshair;
    transition: background 0.4s ease;
}

/* The chrome substrate — brushed-aluminum + top inner highlight + bottom inner shadow */
.cell__chrome {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.25) 0,
            rgba(255, 255, 255, 0) 18px),
        linear-gradient(0deg,
            rgba(20, 22, 26, 0.40) 0,
            rgba(20, 22, 26, 0) 22px),
        repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.012) 0 1px,
            rgba(20, 22, 26, 0.016) 1px 2px),
        linear-gradient(180deg, var(--frost) 0%, var(--nickel) 100%);
    z-index: 0;
}

/* a subtle horizontal grain via filter (brushed) */
.cell__chrome::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--frost);
    filter: url(#brushed-aluminum);
    opacity: 0.04;
    mix-blend-mode: multiply;
}

/* inner reveal seam highlight — 0.5px inset on the cell side */
.cell__chrome::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow:
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.45),
        inset 0 0 0 1px rgba(78, 82, 92, 0.35),
        inset 0 0 30px rgba(20, 22, 26, 0.10);
    pointer-events: none;
}

/* labels */
.cell__label {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 3;
    font-family: 'Unica One', 'Inter', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--chrome-mid);
    pointer-events: none;
}

/* ============================================================
   HOLOGRAPHIC LAMINATE FILM
   Lives only on cells with data-laminated="true".
   Layered conic-gradient sheen, displaced via SVG turbulence.
   Drifts when cursor is within 240px of cell.
   ============================================================ */
.hologram-film {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    opacity: 0.08;
    background:
        conic-gradient(from 130deg at 50% 50%,
            var(--holo-ice),
            var(--holo-magenta),
            var(--holo-mint),
            var(--holo-gold),
            var(--holo-ice));
    filter: url(#hologram-displace);
    transition: opacity 0.7s ease, transform 0.9s ease;
    transform: translate3d(0, 0, 0);
}

[data-cursor-near="true"] .hologram-film {
    opacity: 0.16;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.cell--masthead {
    grid-column: 1 / span 8;
}

.masthead-ridge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.masthead__inner {
    position: relative;
    z-index: 3;
    padding: 60px 40px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 18px;
}

.masthead__title {
    font-family: 'Big Shoulders Display', 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(3.5rem, 8.5vw, 7.5rem);
    letter-spacing: -0.02em;
    line-height: 0.86;
    color: var(--nickel);
    background:
        linear-gradient(60deg,
            #c9ced6 0%,
            #f7f8fa 25%,
            #6e7682 50%,
            #ededf2 75%,
            #4d525c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7),
        0 -1px 0 rgba(20, 22, 26, 0.85);
    filter: drop-shadow(0 2px 4px rgba(20, 22, 26, 0.4));
    user-select: none;
}

.masthead__sub {
    font-family: 'Unica One', sans-serif;
    font-size: 0.86rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--slate);
    max-width: 60ch;
}

.masthead__sub .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    background: linear-gradient(180deg, var(--mirror), var(--nickel));
    padding: 2px 6px;
    color: var(--graphite);
    margin: 0 4px;
    letter-spacing: 0;
}

.masthead__hand {
    position: absolute;
    right: 36px;
    top: 38px;
    z-index: 4;
    color: var(--graphite);
    font-size: 1.05rem;
}

/* ============================================================
   KIT CELLS — isometric icon plates
   ============================================================ */
.cell--kit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 12px 20px;
}

.iso-icon {
    width: 100px;
    height: 100px;
    z-index: 2;
    position: relative;
    margin-top: 8px;
}

.kit__hand {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 4;
    color: var(--graphite);
    font-size: 0.92rem;
    text-align: left;
}

/* ============================================================
   TOPO STRIP
   ============================================================ */
.cell--topo {
    padding: 28px 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topo__paper {
    position: relative;
    background: var(--paper-tape);
    box-shadow:
        inset 0 0 30px rgba(28, 31, 36, 0.18),
        0 2px 6px rgba(20, 22, 26, 0.25);
    width: 86%;
    height: 88%;
    clip-path: url(#tear-edge-1);
    z-index: 2;
}

.topo__svg {
    width: 100%;
    height: 100%;
    display: block;
}

.topo__hand {
    position: absolute;
    z-index: 5;
    color: var(--expedition-red);
    font-size: 1rem;
    top: 28%;
    left: 8%;
    width: 80%;
}

.topo__hand--low {
    top: 70%;
    color: var(--graphite);
    left: 12%;
}

/* ============================================================
   RADIO
   ============================================================ */
.cell--radio {
    padding: 38px 16px 18px;
    overflow: hidden;
}

.radio__list {
    list-style: none;
    z-index: 2;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--graphite);
}

.radio__list li {
    display: grid;
    grid-template-columns: 50px 1fr 60px;
    gap: 6px;
    align-items: center;
    padding: 3px 6px;
    background: linear-gradient(180deg, rgba(247, 248, 250, 0.6), rgba(201, 206, 214, 0.6));
    border: 0.5px solid rgba(78, 82, 92, 0.25);
}

.radio__t { color: var(--chrome-mid); }
.radio__f { color: var(--graphite); }
.radio__s {
    color: var(--expedition-red);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-align: right;
}

.radio__pulse {
    position: absolute;
    bottom: 12px;
    right: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--expedition-red);
    box-shadow: 0 0 0 0 rgba(160, 39, 50, 0.6);
    animation: radioPulse 2.4s ease-out infinite;
    z-index: 3;
}

@keyframes radioPulse {
    0%   { box-shadow: 0 0 0 0 rgba(160, 39, 50, 0.6); }
    70%  { box-shadow: 0 0 0 14px rgba(160, 39, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(160, 39, 50, 0); }
}

/* ============================================================
   TRANSCRIPT — middle band, the page's only long prose
   ============================================================ */
.cell--transcript {
    padding: 50px 56px 36px;
    display: flex;
    align-items: center;
}

.transcript {
    position: relative;
    z-index: 3;
    max-width: 58ch;
    margin: 0 auto;
}

.transcript p {
    font-family: 'Newsreader', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.05rem, 1.4vw, 1.22rem);
    line-height: 1.55;
    color: var(--graphite);
}

.transcript .ts {
    font-style: normal;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--chrome-mid);
    background: linear-gradient(180deg, var(--mirror), var(--nickel));
    padding: 1px 4px;
}

.transcript .redact {
    display: inline-block;
    background: var(--graphite);
    color: var(--graphite);
    padding: 0 8px;
    transform: rotate(-1deg);
    font-style: normal;
    user-select: none;
}

.transcript__hand {
    position: absolute;
    bottom: 18px;
    right: 36px;
    z-index: 4;
    color: var(--expedition-red);
    font-size: 1.1rem;
}

.transcript__arrow {
    position: absolute;
    bottom: 30px;
    left: 16px;
    width: 180px;
    height: 60px;
    z-index: 4;
    pointer-events: none;
    opacity: 0.7;
}

/* ============================================================
   RIDGE — elevation profile
   ============================================================ */
.cell--ridge {
    padding: 38px 22px 18px;
    overflow: hidden;
}

.ridge-svg {
    width: 100%;
    height: calc(100% - 40px);
    z-index: 2;
    position: relative;
    margin-top: 18px;
}

.ridge__hand {
    position: absolute;
    z-index: 4;
    color: var(--graphite);
    font-size: 0.9rem;
    pointer-events: none;
}

/* ============================================================
   ICON-ROTATOR
   ============================================================ */
.cell--icon-rotator {
    padding: 38px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.icon-rotator {
    position: relative;
    width: 110px;
    height: 110px;
    margin-top: 12px;
    z-index: 2;
}

.iso-icon--rot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.iso-icon--rot.is-active {
    opacity: 1;
}

.icon-rotator__hand {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    z-index: 4;
    color: var(--graphite);
    text-align: center;
    font-size: 1.05rem;
}

/* ============================================================
   STATIONS
   ============================================================ */
.cell--stations {
    padding: 38px 18px 22px;
    overflow: hidden;
}

.stations {
    list-style: none;
    z-index: 2;
    position: relative;
    margin-top: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--graphite);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stations li {
    padding: 2px 4px;
    background: linear-gradient(180deg, rgba(247, 248, 250, 0.6), rgba(201, 206, 214, 0.6));
}

.stations .strike {
    text-decoration: line-through;
    text-decoration-color: var(--expedition-red);
    text-decoration-thickness: 1.4px;
    color: var(--chrome-mid);
}

.stations__hand {
    position: absolute;
    bottom: 10px;
    left: 16px;
    right: 10px;
    z-index: 4;
    color: var(--expedition-red);
    font-size: 0.95rem;
}

/* ============================================================
   MAP — colossal closing cell
   ============================================================ */
.cell--map {
    padding: 0;
}

.map__paper {
    position: relative;
    width: 96%;
    height: 88%;
    margin: 6% 2%;
    background: var(--paper-tape);
    z-index: 2;
    clip-path: url(#tear-edge-2);
    box-shadow:
        inset 0 0 60px rgba(28, 31, 36, 0.16),
        0 4px 12px rgba(20, 22, 26, 0.30);
}

.map__svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: contrast(0.95) brightness(0.98);
}

.map__hand {
    position: absolute;
    z-index: 5;
    color: var(--graphite);
    font-size: 1.1rem;
    pointer-events: none;
}

.map__hand--a {
    top: 12%;
    left: 6%;
    color: var(--expedition-red);
    font-size: 1.4rem;
}

.map__hand--b {
    top: 18%;
    right: 8%;
    font-size: 1rem;
}

.map__hand--c {
    bottom: 12%;
    left: 22%;
    color: var(--expedition-red);
}

.map__torn-arrow {
    position: absolute;
    width: 200px;
    height: 60px;
    bottom: 22%;
    left: 38%;
    z-index: 4;
    opacity: 0.8;
}

.redacted-block {
    position: absolute;
    top: 38%;
    left: 56%;
    width: 110px;
    height: 18px;
    background: var(--graphite);
    transform: rotate(-1.4deg);
    z-index: 5;
}

/* ============================================================
   COLOPHON
   ============================================================ */
.cell--colophon {
    padding: 22px 28px;
}

.colophon {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr 220px;
    gap: 28px;
    align-items: center;
    height: 100%;
}

.colophon__col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.colophon__line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--chrome-mid);
    letter-spacing: 0.04em;
}

.colophon__col--switch {
    align-items: flex-end;
    flex-direction: row;
    justify-content: flex-end;
    gap: 14px;
}

.colophon__line--switchlabel {
    color: var(--graphite);
}

.colophon__hand {
    position: absolute;
    top: 10px;
    right: 28px;
    z-index: 5;
    color: var(--expedition-red);
    font-size: 1rem;
}

/* rocker switch */
.rocker {
    position: relative;
    width: 50px;
    height: 22px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    z-index: 4;
}

.rocker__track {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, var(--slate), var(--nickel) 50%, var(--slate));
    border-radius: 11px;
    box-shadow:
        inset 0 1px 2px rgba(20, 22, 26, 0.6),
        inset 0 -1px 1px rgba(255, 255, 255, 0.3);
}

.rocker__knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background:
        radial-gradient(circle at 30% 30%, var(--mirror), var(--nickel) 60%, var(--slate));
    border-radius: 50%;
    box-shadow:
        0 1px 2px rgba(20, 22, 26, 0.6),
        inset 0 0 0 0.5px rgba(78, 82, 92, 0.4);
    transition: left 0.3s cubic-bezier(0.5, 0, 0.4, 1);
}

.rocker__indicator {
    position: absolute;
    top: -6px;
    left: 22px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chrome-mid);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.rocker[aria-pressed="true"] .rocker__knob {
    left: 30px;
}

.rocker[aria-pressed="true"] .rocker__indicator {
    background: var(--holo-magenta);
    box-shadow: 0 0 6px var(--holo-magenta);
}

/* ============================================================
   TAPE-END footer
   ============================================================ */
.tape-end {
    background: var(--gunmetal);
    color: var(--chrome-mid);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    border-top: 0.5px solid rgba(110, 118, 130, 0.3);
}

/* ============================================================
   HAND-WRITTEN MARGINALIA — Caveat with rotation presets
   ============================================================ */
.hand {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.02em;
    display: inline-block;
}

.hand--rot1 { transform: rotate(-2.4deg); }
.hand--rot2 { transform: rotate(1.6deg); }
.hand--rot3 { transform: rotate(-1.2deg); }
.hand--rot4 { transform: rotate(2.8deg); }

/* ============================================================
   RIPPLE — page's signature interaction.
   Created via JS, animated via CSS. Bounded by .cell overflow.
   ============================================================ */
.ripple {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(circle,
        rgba(168, 216, 255, 0.5) 0%,
        rgba(255, 182, 230, 0.45) 30%,
        rgba(200, 255, 208, 0.40) 55%,
        rgba(255, 233, 160, 0.30) 75%,
        transparent 100%);
    mix-blend-mode: overlay;
    z-index: 6;
    animation: rippleExpand 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}

@keyframes rippleExpand {
    0%   { transform: translate(-50%, -50%) scale(1);    opacity: 0.9; }
    50%  { opacity: 0.65; }
    100% { transform: translate(-50%, -50%) scale(160); opacity: 0;   }
}

/* ============================================================
   CURSOR RETICULE (custom) — appears only over chrome cells
   ============================================================ */
.cursor-reticule {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.cursor-reticule.is-active {
    opacity: 1;
}

.cursor-reticule .reticule-dot {
    opacity: 0;
    transition: opacity 0.2s ease, fill 0.2s ease;
}

.cursor-reticule.has-dot .reticule-dot {
    opacity: 1;
}

/* hide native cursor on chrome */
body.chrome-cursor {
    cursor: none;
}

/* ============================================================
   ICON-STAGGER — one-time scroll-triggered reveal of kit icons
   in middle band. Each icon does a clip-path wipe.
   ============================================================ */
.iso-icon-stagger {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.iso-icon-stagger.is-revealed {
    clip-path: inset(0 0 0 0);
}

/* ============================================================
   RESPONSIVE — single-column under 900px, faster seam-sweep
   ============================================================ */
@media (max-width: 900px) {
    .seam-light {
        animation-duration: 9s;
    }

    .bento-case--upper,
    .bento-case--mid,
    .bento-case--lower {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .cell--masthead    { grid-column: 1 / -1; grid-row: auto; min-height: 320px; }
    .cell--kit-a,
    .cell--kit-b      { grid-column: 1 / -1; grid-row: auto; min-height: 200px; }
    .cell--topo        { grid-column: 1 / -1; grid-row: auto; min-height: 360px; }
    .cell--radio       { grid-column: 1 / -1; grid-row: auto; min-height: 240px; }

    .cell--transcript    { grid-column: 1 / -1; grid-row: auto; padding: 40px 22px 28px; min-height: 460px; }
    .cell--ridge         { grid-column: 1 / -1; grid-row: auto; min-height: 280px; }
    .cell--icon-rotator  { grid-column: 1 / -1; grid-row: auto; min-height: 220px; }
    .cell--stations      { grid-column: 1 / -1; grid-row: auto; min-height: 220px; }

    .cell--map      { grid-column: 1 / -1; grid-row: auto; min-height: 360px; }
    .cell--colophon { grid-column: 1 / -1; grid-row: auto; min-height: 200px; }

    .colophon { grid-template-columns: 1fr; gap: 12px; }
    .colophon__col--switch { justify-content: flex-start; }

    .masthead__inner { padding: 30px 24px 24px; }
    .masthead__hand { right: 18px; top: 22px; font-size: 0.95rem; }
}
