:root {
    --bg: #0b0a09;
    --bg2: #121110;
    --bg3: #17140f;
    --bg4: #1c1916;
    --paper: #efe8d9;
    --paper-dim: #c9c0ac;
    --ink: #8c8478;
    --ink-dim: #5c564c;
    --red: #d81f2f;
    --red-bright: #ff3346;
    --red-deep: #6e0f17;
    --red-glow: rgba(216, 31, 47, 0.30);
    --red-glow-strong: rgba(255, 51, 70, 0.55);
    --line: #2a2521;
    --line-bright: #3c352d;
    --mono: 'IBM Plex Mono', monospace;
    --serif: 'Source Serif 4', Georgia, serif;
    --display: 'Bebas Neue', 'IBM Plex Mono', sans-serif;
    --nav-h: 4.5rem;
    --nav-h-m: 3.75rem;
    --transition: 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
    --transition-slow: 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body {
    background: var(--bg);
    color: var(--paper-dim);
    font-family: var(--serif);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.overlay-open { overflow: hidden; }
:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; border-radius: 1px; }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* ===== background layers ===== */
#three-canvas {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: 0.6; transition: opacity 0.8s ease;
}
@media (prefers-reduced-motion: reduce) { #three-canvas { display: none !important; } }
@media (max-width: 860px) { #three-canvas { opacity: 0.35; } }

.vignette {
    position: fixed; inset: 0; pointer-events: none; z-index: 1;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
    animation: vignetteBreathe 8s ease-in-out infinite;
}
@keyframes vignetteBreathe { 0%,100%{opacity:.78;} 50%{opacity:.92;} }
@media (prefers-reduced-motion: reduce) { .vignette { animation: none; opacity: .8; } }

#scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; background: var(--red-bright);
    z-index: 10000; width: 0%; transition: width .06s linear;
    box-shadow: 0 0 18px var(--red-glow-strong); pointer-events: none;
}

#cursor-glow {
    position: fixed; pointer-events: none; z-index: 9997;
    width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(216,31,47,.22) 0%, rgba(216,31,47,.06) 50%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width .35s ease, height .35s ease, opacity .35s ease;
    mix-blend-mode: screen; will-change: transform;
}
#cursor-glow.hover {
    width: 150px; height: 150px; opacity: 1;
    background: radial-gradient(circle, rgba(255,51,70,.32) 0%, rgba(216,31,47,.1) 50%, transparent 70%);
}
@media (max-width: 860px) { #cursor-glow { display: none; } }
@media (prefers-reduced-motion: reduce) { #cursor-glow { display: none !important; } }

.ripple-container { position: fixed; inset: 0; pointer-events: none; z-index: 9996; overflow: hidden; }
.ripple {
    position: absolute; border-radius: 50%; border: 1px solid rgba(216,31,47,.35);
    animation: rippleAnim .9s ease-out forwards; pointer-events: none;
}
@keyframes rippleAnim { 0%{transform:scale(0);opacity:.7;} 100%{transform:scale(4.5);opacity:0;} }
@media (prefers-reduced-motion: reduce) { .ripple { display: none !important; } }

/* ===== nav ===== */
.nav-bar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 5000;
    background: rgba(11,10,9,0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.nav-bar.scrolled {
    background: rgba(11,10,9,0.97); border-bottom-color: var(--line-bright);
    box-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.nav-inner {
    max-width: 1400px; height: 100%; margin: 0 auto; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.nav-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.nav-logo-mark {
    width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center;
    background: var(--red); color: var(--bg); font-family: var(--display); font-size: 1.1rem;
    border-radius: 2px; box-shadow: 0 0 16px var(--red-glow-strong);
    transition: transform .3s;
}
.nav-logo:hover .nav-logo-mark { transform: rotate(-8deg) scale(1.08); }
.nav-logo-text {
    font-family: var(--display); font-size: 1.15rem; letter-spacing: .1em; color: var(--paper);
    text-transform: uppercase;
}
.nav-logo-text em { color: var(--red-bright); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a {
    font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--ink); text-decoration: none; position: relative; padding: .3rem 0;
    transition: color .25s;
}
.nav-links a::before {
    content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
    background: var(--red-bright); transition: width .25s;
}
.nav-links a:hover { color: var(--paper); }
.nav-links a:hover::before { width: 100%; }
.nav-status {
    display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .6rem;
    color: var(--ink); letter-spacing: .1em;
}
.status-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--red-bright);
    box-shadow: 0 0 10px var(--red-glow-strong); animation: pulseDot 2.2s ease-in-out infinite; display: block;
}
@keyframes pulseDot { 0%,100%{opacity:1;box-shadow:0 0 10px var(--red-glow-strong);} 50%{opacity:.3;box-shadow:0 0 3px var(--red-glow);} }
.mobile-nav-toggle {
    display: none; background: none; border: 1px solid var(--line-bright); color: var(--paper);
    font-size: 1rem; cursor: pointer; padding: .4rem .6rem; border-radius: 2px; transition: border-color .2s, color .2s;
}
.mobile-nav-toggle:hover { border-color: var(--red-bright); color: var(--red-bright); }

@media (max-width: 860px) {
    .nav-inner { padding: 0 1.2rem; }
    .nav-links { display: none; }
    .nav-status { display: none; }
    .mobile-nav-toggle { display: block; }
    .nav-bar { height: var(--nav-h-m); }
}

.mobile-menu {
    position: fixed; inset: 0; z-index: 4900; background: rgba(11,10,9,0.98);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8rem;
    opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu a {
    font-family: var(--display); font-size: 2.1rem; color: var(--paper); text-decoration: none;
    letter-spacing: .08em; text-transform: uppercase; transition: color .3s;
}
.mobile-menu a span { color: var(--red-bright); font-family: var(--mono); font-size: 1rem; margin-right: .6rem; }
.mobile-menu a:hover { color: var(--red-bright); }
.mobile-menu-close {
    position: absolute; top: 1.4rem; right: 1.4rem; background: none; border: 1px solid var(--line-bright);
    color: var(--paper); font-size: 1.2rem; cursor: pointer; padding: .5rem .7rem; border-radius: 2px;
}

main { position: relative; z-index: 2; padding-top: var(--nav-h); }
@media (max-width: 860px) { main { padding-top: var(--nav-h-m); } }

/* ===== shared section furniture ===== */
.section { padding: 6rem 2rem; max-width: 1400px; margin: 0 auto; position: relative; }
@media (max-width: 860px) { .section { padding: 3.5rem 1.2rem; } }

.eyebrow { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.6rem; position: relative; }
.eyebrow-num {
    font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; color: var(--bg);
    background: var(--red); padding: .25rem .5rem; border-radius: 2px;
}
.eyebrow-text {
    font-family: var(--mono); font-size: .62rem; letter-spacing: .3em; text-transform: uppercase;
    color: var(--paper);
}
.eyebrow-line { flex: 1; height: 1px; background: var(--line-bright); }
.section-note {
    font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink);
    margin: -1.6rem 0 2.6rem; max-width: 48ch;
}

/* ===== hero ===== */
.hero {
    min-height: calc(100vh - var(--nav-h)); display: flex; flex-direction: column;
    align-items: center; justify-content: center; position: relative; padding: 4rem 2rem; text-align: center;
}
.hero-tag {
    position: absolute; top: 2.2rem; font-family: var(--mono); font-size: .58rem;
    letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
    border-bottom: 1px solid var(--line-bright); padding-bottom: .5rem;
}
.hero-tag-left { left: 2rem; }
.hero-tag-right { right: 2rem; color: var(--red-bright); }
.hero-kicker {
    font-family: var(--mono); font-size: .62rem; letter-spacing: .3em; text-transform: uppercase;
    color: var(--red-bright); margin-bottom: 1.6rem; animation: fadeUp 1s ease both;
}
.hero-title {
    position: relative; font-family: var(--display); font-weight: 400; text-transform: uppercase;
    font-size: clamp(4.5rem, 17vw, 13rem); letter-spacing: .01em; line-height: .84;
    color: var(--paper); animation: fadeUp 1s .12s ease both;
}
.hero-title::after {
    content: attr(data-text); position: absolute; left: 6px; top: 5px; z-index: -1;
    color: var(--red-bright); opacity: .65;
}
.hero-rule {
    width: 220px; height: 1px; margin: 2rem auto 1.6rem;
    background-image: repeating-linear-gradient(90deg, var(--line-bright) 0 6px, transparent 6px 12px);
    animation: fadeUp 1s .24s ease both;
}
.hero-subtitle {
    font-family: var(--mono); font-size: .68rem; color: var(--ink); letter-spacing: .1em;
    animation: fadeUp 1s .3s ease both; max-width: 480px; line-height: 2; min-height: 3em;
}
.hero-subtitle .cursor-blink {
    display: inline-block; width: 1px; height: .9em; background: var(--red-bright); margin-left: 2px;
    vertical-align: text-bottom; animation: blink .8s step-end infinite; box-shadow: 0 0 10px var(--red-glow-strong);
}
.hero-subtitle .cursor-blink.hidden { display: none; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }
.hero-scroll-hint {
    position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
    background: none; border: none; cursor: pointer; display: flex; flex-direction: column;
    align-items: center; gap: .5rem; font-family: var(--mono); font-size: .52rem; letter-spacing: .3em;
    text-transform: uppercase; color: var(--ink);
    animation: fadeUp 1s .5s ease both, floatHint 3s ease-in-out 1.6s infinite;
}
.hero-scroll-hint:hover { color: var(--red-bright); }
@keyframes floatHint { 0%,100%{transform:translateX(-50%) translateY(0);opacity:.6;} 50%{transform:translateX(-50%) translateY(9px);opacity:1;} }
@media (max-width: 860px) {
    .hero-tag { font-size: .5rem; top: 1.2rem; }
    .hero-tag-left { left: 1.2rem; } .hero-tag-right { right: 1.2rem; }
}

/* ===== dossier / about ===== */
#dossier {
    display: grid; grid-template-columns: 1.05fr .95fr; gap: 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    position: relative;
}
.meo-mark {
    position: absolute; left: 128px; top: 50%; transform: translateY(-50%);
    width: 100px; z-index: 50; pointer-events: none;
}
.meo-mark img { width: 100%; filter: drop-shadow(0 6px 12px rgba(0,0,0,.55)); }
@media (max-width: 860px) {
    .meo-mark { width: 90px; left: 100px; }
}
.dossier-text { padding: 5rem 3rem; display: flex; flex-direction: column; justify-content: center; gap: 1.8rem; border-right: 1px solid var(--line); }
.dossier-quote {
    font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2.1vw, 1.55rem);
    line-height: 1.6; color: var(--paper); border-left: 3px solid var(--red);
    padding-left: 1.5rem;
}
.dossier-body { font-family: var(--mono); font-size: .62rem; color: var(--ink); line-height: 2; letter-spacing: .03em; max-width: 46ch; }
.dossier-visual { padding: 4rem 3rem; display: flex; align-items: center; justify-content: center; }
.polaroid {
    background: var(--paper); padding: .9rem .9rem 3.2rem; max-width: 380px; width: 100%;
    transform: rotate(-2.2deg); position: relative; box-shadow: 0 25px 60px rgba(0,0,0,.6);
    transition: transform .5s var(--transition), box-shadow .5s;
    cursor: zoom-in;
}
.polaroid:hover { transform: rotate(0deg) scale(1.02); box-shadow: 0 30px 70px rgba(0,0,0,.7); }
.polaroid-frame { overflow: hidden; background: var(--bg2); }
.polaroid-frame img {
    width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5;
    filter: grayscale(85%) brightness(.5); transition: filter .5s ease, transform .6s ease;
}
.polaroid:hover .polaroid-frame img { filter: grayscale(25%) brightness(.85); transform: scale(1.04); }
.polaroid-caption {
    position: absolute; left: .9rem; right: .9rem; bottom: 1.1rem; font-family: var(--mono);
    font-size: .55rem; letter-spacing: .06em; color: var(--bg2); text-align: center;
}
.tape { position: absolute; width: 64px; height: 22px; background: rgba(216,31,47,.72); opacity: .85; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.tape-l { top: -10px; left: -14px; transform: rotate(-38deg); }
.tape-r { top: -10px; right: -14px; transform: rotate(38deg); }
.hint-tag {
    position: absolute; top: 1rem; right: 1rem; font-family: var(--mono); font-size: .5rem;
    letter-spacing: .12em; color: var(--paper); background: rgba(0,0,0,.75); padding: .3rem .6rem;
    border: 1px solid var(--line-bright); opacity: 0; transition: opacity .3s; text-transform: uppercase;
}
.polaroid:hover .hint-tag { opacity: 1; }
@media (max-width: 860px) {
    #dossier { grid-template-columns: 1fr; }
    .dossier-text { border-right: none; border-bottom: 1px solid var(--line); padding: 2.6rem 1.4rem; }
    .dossier-visual { padding: 2.6rem 1.4rem; }
}

/* ===== log ===== */
.log-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line);
    border: 1px solid var(--line);
}
.log-card {
    background: var(--bg2); padding: 1.9rem 1.6rem 1.7rem; text-align: left; font-family: inherit;
    color: inherit; border: none; cursor: pointer; position: relative; display: flex; flex-direction: column;
    gap: .6rem; transition: background .35s ease, transform .3s ease; text-decoration: none;
}
.log-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--red);
    transform: scaleX(0); transform-origin: left; transition: transform .35s var(--transition);
}
.log-card:hover { background: var(--bg3); transform: translateY(-4px); z-index: 1; }
.log-card:hover::before { transform: scaleX(1); }
.log-card.featured { grid-column: span 2; }
.log-time {
    font-family: var(--mono); font-size: .58rem; color: var(--red-bright); letter-spacing: .18em;
}
.log-name { font-family: var(--display); font-size: 1.55rem; letter-spacing: .02em; color: var(--paper); text-transform: uppercase; }
.log-desc { font-family: var(--mono); font-size: .58rem; color: var(--ink); letter-spacing: .04em; line-height: 1.7; }
.log-icon {
    position: absolute; top: 1.1rem; right: 1.2rem; font-size: .75rem; color: var(--line-bright);
    opacity: 0; transition: opacity .3s, color .3s;
}
.log-card:hover .log-icon { opacity: 1; color: var(--red-bright); }
.log-card.log-card-placeholder { background: var(--bg2); }
.log-card.log-card-placeholder .log-time { color: var(--ink-dim); }
.log-card.log-card-placeholder .log-icon { color: var(--ink-dim); opacity: .55; }
@media (max-width: 860px) {
    .log-grid { grid-template-columns: 1fr 1fr; }
    .log-card.featured { grid-column: span 2; }
}
@media (max-width: 560px) {
    .log-grid { grid-template-columns: 1fr; }
    .log-card.featured { grid-column: span 1; }
}

/* ===== frames / gallery ===== */
.filmstrip-region { position: relative; }
.filmstrip-wrap {
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding-bottom: .6rem;
    -webkit-overflow-scrolling: touch;
}
.filmstrip-wrap::-webkit-scrollbar { height: 5px; }
.filmstrip-wrap::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 3px; }
.filmstrip { display: flex; gap: 1.1rem; width: max-content; padding: .3rem .2rem; }
.frame-item {
    scroll-snap-align: start; width: 260px; flex: none; cursor: zoom-in; user-select: none;
    background: var(--bg2); border: 1px solid var(--line);
}
.frame-item.wide { width: 400px; }
.frame-sprockets {
    height: 12px; background-color: var(--bg4);
    background-image: radial-gradient(circle, var(--bg) 0 3px, transparent 3.2px);
    background-size: 18px 100%; background-position: 9px center; background-repeat: repeat-x;
}
.frame-photo { position: relative; overflow: hidden; height: 300px; }
.frame-photo img {
    width: 100%; height: 100%; object-fit: cover; filter: grayscale(78%) brightness(.48);
    transition: transform .55s ease, filter .45s ease;
}
.frame-item:hover .frame-photo img { transform: scale(1.06); filter: grayscale(15%) brightness(.9); }
.frame-item:hover .frame-photo::after { opacity: 1; }
.frame-photo::after {
    content: '↗ view'; position: absolute; bottom: .6rem; right: .6rem; z-index: 2; font-family: var(--mono);
    font-size: .48rem; letter-spacing: .12em; color: var(--paper); text-transform: uppercase;
    background: rgba(0,0,0,.7); padding: .25rem .55rem; border: 1px solid var(--line-bright);
    opacity: 0; transition: opacity .3s;
}
.frame-num {
    position: absolute; top: .6rem; left: .6rem; z-index: 2; font-family: var(--mono); font-size: .5rem;
    color: var(--red-bright); letter-spacing: .1em; text-shadow: 0 1px 6px rgba(0,0,0,.95);
}
.frame-caption {
    padding: .7rem .9rem .8rem; font-family: var(--mono); font-size: .53rem; letter-spacing: .04em;
    color: var(--ink); line-height: 1.5;
}
.filmstrip-nav {
    position: absolute; top: 45%; transform: translateY(-50%); background: rgba(11,10,9,.8);
    border: 1px solid var(--line-bright); color: var(--paper); width: 2.6rem; height: 2.6rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3;
    transition: all .2s; font-size: .85rem;
}
.filmstrip-nav:hover { border-color: var(--red-bright); color: var(--red-bright); }
.filmstrip-prev { left: -1.1rem; }
.filmstrip-next { right: -1.1rem; }
@media (max-width: 860px) {
    .filmstrip-nav { display: none; }
    .frame-item { width: 210px; }
    .frame-item.wide { width: 300px; }
    .frame-photo { height: 240px; }
}

/* ===== signal / whispers ===== */
#signal { text-align: center; padding: 6rem 2rem; }
.signal-eq { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 26px; margin: 0 auto 2.4rem; }
.signal-eq span {
    width: 4px; height: 100%; background: var(--red); border-radius: 1px; transform-origin: bottom;
    animation: eqBounce 1.1s ease-in-out infinite;
}
.signal-eq span:nth-child(1) { animation-duration: 1.3s; animation-delay: 0s; }
.signal-eq span:nth-child(2) { animation-duration: .9s; animation-delay: .1s; }
.signal-eq span:nth-child(3) { animation-duration: 1.5s; animation-delay: .2s; }
.signal-eq span:nth-child(4) { animation-duration: 1s; animation-delay: .05s; }
.signal-eq span:nth-child(5) { animation-duration: 1.2s; animation-delay: .15s; }
@keyframes eqBounce { 0%,100%{transform:scaleY(.25);} 50%{transform:scaleY(1);} }
@media (prefers-reduced-motion: reduce) { .signal-eq span { animation: none; transform: scaleY(.6); } }
.whisper-container { max-width: 680px; margin: 0 auto; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.whisper-text {
    font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 2rem); font-style: italic; line-height: 1.7;
    color: var(--paper); transition: opacity .5s ease, transform .5s ease; opacity: 1; transform: translateY(0);
}
.whisper-text.fading { opacity: 0; transform: translateY(12px); }
.whisper-leds { display: flex; gap: .55rem; justify-content: center; margin-top: 2.2rem; }
.whisper-dot {
    width: 16px; height: 5px; background: var(--line-bright); cursor: pointer; transition: all .3s; border-radius: 1px;
}
.whisper-dot.active { background: var(--red-bright); box-shadow: 0 0 12px var(--red-glow-strong); width: 30px; }
.whisper-dot:hover { background: var(--red); }

/* ===== notes / thoughts ===== */
#notes { padding: 6rem 2rem 6rem; border-bottom: 1px solid var(--line); }
.notes-tabs {
    display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: 2.4rem;
}
.notes-tab {
    font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink); background: var(--bg2); border: 1px solid var(--line); padding: .65rem 1.1rem;
    cursor: pointer; white-space: nowrap; transition: all .25s; flex: none;
}
.notes-tab:hover { color: var(--paper); border-color: var(--line-bright); }
.notes-tab.active { color: var(--bg); background: var(--red-bright); border-color: var(--red-bright); }
.notes-panel {
    border-left: 2px solid var(--red); padding: .3rem 0 .3rem 2rem; display: flex; flex-direction: column;
    gap: 1.2rem; transition: opacity .3s ease; max-width: 720px;
}
.notes-panel.swapping { opacity: .1; }
.notes-tag { font-family: var(--mono); font-size: .55rem; color: var(--red-bright); letter-spacing: .22em; text-transform: uppercase; }
.notes-title { font-family: var(--display); font-size: clamp(1.7rem, 3.4vw, 2.7rem); letter-spacing: .01em; text-transform: uppercase; color: var(--paper); line-height: 1.05; }
.notes-body {
    font-size: .96rem; line-height: 1.9; color: var(--ink); max-height: 5.8em; overflow: hidden;
    position: relative; transition: max-height .55s cubic-bezier(.16,1,.3,1); white-space: pre-line;
}
.notes-body.expanded { max-height: 50em; }
.notes-body::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5em;
    background: linear-gradient(to bottom, transparent, var(--bg)); transition: opacity .35s;
}
.notes-body.expanded::after { opacity: 0; }
.read-more-btn {
    font-family: var(--mono); font-size: .55rem; color: var(--red-bright); letter-spacing: .18em;
    text-transform: uppercase; background: none; border: none; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; gap: .5rem; transition: gap .25s, color .25s; width: fit-content;
}
.read-more-btn:hover { gap: .9rem; color: var(--paper); }

/* ===== index / interests ===== */
#index { padding: 6rem 2rem 6rem; }
.index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.index-cell {
    background: var(--bg); padding: 2.4rem 1.7rem; display: flex; flex-direction: column; gap: .7rem;
    cursor: pointer; transition: background .35s, transform .3s ease; position: relative; min-height: 190px;
    width: 100%; text-align: left; font-family: inherit; color: inherit; border: none;
}
.index-cell:hover { background: var(--bg2); transform: translateY(-4px); z-index: 1; }
.index-cell.featured { border-top: 2px solid var(--red); }
.index-num { font-family: var(--mono); font-size: .5rem; color: var(--ink); letter-spacing: .2em; transition: all .3s; }
.index-cell:hover .index-num { color: var(--red-bright); transform: translateX(5px); }
.index-name { font-family: var(--display); font-size: 1.5rem; letter-spacing: .02em; color: var(--paper); text-transform: uppercase; }
.index-desc { font-family: var(--mono); font-size: .55rem; color: var(--ink); letter-spacing: .04em; line-height: 1.7; }
.index-arrow { position: absolute; bottom: 1.2rem; right: 1.3rem; font-size: .65rem; color: var(--line-bright); opacity: 0; transition: all .3s; }
.index-cell:hover .index-arrow { opacity: 1; color: var(--red-bright); transform: translateX(3px); }
@media (max-width: 860px) { .index-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .index-grid { grid-template-columns: 1fr; } }

/* ===== footer ===== */
footer { border-top: 1px solid var(--line); }
.footer-inner {
    max-width: 1400px; margin: 0 auto; padding: 1.8rem 2rem; display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 1.6rem;
}
.footer-left { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.footer-brand {
    font-family: var(--display); font-size: 1.15rem; letter-spacing: .18em; color: var(--paper);
    text-decoration: none; cursor: pointer; transition: color .2s; text-transform: uppercase;
}
.footer-brand em { color: var(--red-bright); font-style: normal; }
.footer-brand:hover { color: var(--red-bright); }
.footer-links { display: flex; gap: 1.4rem; list-style: none; flex-wrap: wrap; }
.footer-links a {
    font-family: var(--mono); font-size: .55rem; color: var(--ink); text-decoration: none; letter-spacing: .06em;
    transition: color .2s;
}
.footer-links a::before { content: '['; color: var(--line-bright); margin-right: .15rem; }
.footer-links a::after { content: ']'; color: var(--line-bright); margin-left: .15rem; }
.footer-links a:hover { color: var(--red-bright); }
.footer-right { font-family: var(--mono); font-size: .52rem; color: var(--ink); letter-spacing: .08em; white-space: nowrap; }
@media (max-width: 860px) {
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-left { flex-direction: column; align-items: flex-start; gap: .8rem; }
}

/* ===== reveal / misc utility ===== */
.reveal { opacity: 0; transform: translateY(35px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } }

#back-to-top {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 5000; width: 42px; height: 42px;
    border: 1px solid var(--line-bright); background: rgba(11,10,9,.88); backdrop-filter: blur(10px);
    color: var(--paper); font-size: 1rem; cursor: pointer; transition: all .3s ease; opacity: 0;
    transform: translateY(20px); pointer-events: none; display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
#back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
#back-to-top:hover { border-color: var(--red-bright); color: var(--red-bright); box-shadow: 0 0 30px var(--red-glow); }

/* ===== lightbox ===== */
.lightbox {
    position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(6,5,5,.97); backdrop-filter: blur(16px); cursor: zoom-out; }
.lightbox-frame {
    position: relative; z-index: 1; max-width: 90vw; max-height: 88vh; display: flex; flex-direction: column;
    align-items: center; gap: 1rem; transform: scale(.92); transition: transform .35s ease; padding: 1.4rem;
}
.lightbox.active .lightbox-frame { transform: scale(1); }
.lightbox-frame::before, .lightbox-frame::after,
.lightbox-corner-a, .lightbox-corner-b {
    content: ''; position: absolute; width: 22px; height: 22px; border: 2px solid var(--red-bright); opacity: .8;
}
.lightbox-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.lightbox-frame::after { top: 0; right: 0; border-left: none; border-bottom: none; }
.lightbox-corner-a { bottom: 0; left: 0; border-right: none; border-top: none; }
.lightbox-corner-b { bottom: 0; right: 0; border-left: none; border-top: none; }
.lightbox-img { max-width: 88vw; max-height: 78vh; object-fit: contain; background: var(--bg); min-height: 100px; min-width: 100px; }
.lightbox-caption { font-family: var(--mono); font-size: .55rem; color: var(--ink); letter-spacing: .16em; text-transform: uppercase; text-align: center; }
.lightbox-close {
    position: absolute; top: -2.6rem; right: 0; background: none; border: none; color: var(--paper);
    font-family: var(--mono); font-size: .55rem; letter-spacing: .2em; cursor: pointer; text-transform: uppercase;
    transition: color .2s; display: flex; align-items: center; gap: .5rem; opacity: .6;
}
.lightbox-close:hover { color: var(--red-bright); opacity: 1; }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(11,10,9,.7);
    border: 1px solid var(--line-bright); color: var(--paper); font-family: var(--mono); font-size: .85rem;
    width: 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all .2s; z-index: 2; opacity: .5;
}
.lightbox-nav:hover { border-color: var(--red-bright); color: var(--red-bright); opacity: 1; }
.lightbox-prev { left: -3rem; } .lightbox-next { right: -3rem; }
@media (max-width: 860px) {
    .lightbox-prev { left: .1rem; } .lightbox-next { right: .1rem; }
    .lightbox-nav { width: 2.2rem; height: 2.2rem; font-size: .7rem; }
}

/* ===== overlays shared ===== */
.poem-overlay, .glitch-overlay, .card-overlay {
    position: fixed; inset: 0; z-index: 8200; display: flex; align-items: center; justify-content: center;
    background: rgba(6,5,5,.96); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.poem-overlay.active, .glitch-overlay.active, .card-overlay.active { opacity: 1; pointer-events: all; }
.poem-card, .glitch-card {
    background: var(--bg2); border: 1px solid var(--line); padding: 2.6rem 2.8rem; max-width: 500px; width: 90%;
    position: relative; box-shadow: 0 0 80px rgba(0,0,0,.9); transform: translateY(10px); transition: transform .35s ease;
}
.poem-overlay.active .poem-card, .glitch-overlay.active .glitch-card { transform: translateY(0); }
.overlay-close {
    position: absolute; top: .8rem; right: 1rem; background: none; border: none; color: var(--ink);
    font-size: 1rem; cursor: pointer; transition: color .2s; z-index: 5;
}
.overlay-close:hover { color: var(--red-bright); }
.poem-label {
    font-family: var(--mono); font-size: .55rem; letter-spacing: .3em; color: var(--red-bright);
    text-transform: uppercase; margin-bottom: 1.6rem; display: flex; align-items: center; gap: .8rem;
}
.poem-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.poem-title { font-family: var(--display); font-size: 1.9rem; letter-spacing: .02em; text-transform: uppercase; color: var(--paper); margin-bottom: 1.4rem; }
.poem-card { border-left: 3px solid var(--red); }
.poem-text { font-family: var(--serif); font-size: 1rem; line-height: 2; color: var(--ink); font-style: italic; white-space: pre-line; }

.glitch-card { max-width: 700px; overflow: hidden; }
.glitch-scan-lines {
    position: absolute; inset: 0; pointer-events: none; z-index: 2;
    background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(216,31,47,.012) 3px, rgba(216,31,47,.012) 6px);
    animation: scanFlicker 8s infinite linear;
}
@keyframes scanFlicker { 0%,99.5%,100%{opacity:1;} 99.6%,99.9%{opacity:.15;} }
.glitch-ritual-wrapper { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 0; }
.glitch-ritual {
    font-family: var(--display); font-size: clamp(3.5rem, 11vw, 9rem); text-transform: uppercase;
    color: var(--paper); letter-spacing: .01em; line-height: 1; position: relative; display: inline-block;
}
.glitch-red { color: var(--red-bright); position: relative; z-index: 1; }
.glitch-ritual::before, .glitch-ritual::after {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    font: inherit; letter-spacing: inherit; opacity: 0; pointer-events: none;
}
.glitch-ritual::before { color: #ff0000; clip-path: inset(12% 0 55% 0); animation: gSliceA 2.5s infinite steps(1); }
.glitch-ritual::after { color: #ffffff; clip-path: inset(52% 0 18% 0); animation: gSliceB 3.1s infinite steps(1); }
@keyframes gSliceA { 0%,92%,100%{opacity:0;transform:translate(0,0);} 93%{opacity:.5;transform:translate(-5px,1px);} 94%{opacity:.65;transform:translate(4px,-2px);} 95%{opacity:0;transform:translate(0,0);} }
@keyframes gSliceB { 0%,88%,100%{opacity:0;transform:translate(0,0);} 89%{opacity:.4;transform:translate(4px,-1px);} 90%{opacity:.6;transform:translate(-3px,2px);} 91%{opacity:0;transform:translate(0,0);} }
.glitch-ritual.intense::before { animation: gIntA .25s steps(2) !important; opacity: .75 !important; clip-path: inset(5% 0 70% 0) !important; transform: translate(-8px,3px) !important; }
.glitch-ritual.intense::after { animation: gIntB .25s steps(2) !important; opacity: .7 !important; clip-path: inset(60% 0 8% 0) !important; transform: translate(6px,-3px) !important; }
@keyframes gIntA { 0%{transform:translate(-8px,3px);clip-path:inset(5% 0 70% 0);} 50%{transform:translate(10px,-5px);clip-path:inset(30% 0 40% 0);} 100%{transform:translate(-4px,7px);clip-path:inset(55% 0 15% 0);} }
@keyframes gIntB { 0%{transform:translate(6px,-3px);clip-path:inset(60% 0 8% 0);} 50%{transform:translate(-9px,4px);clip-path:inset(15% 0 55% 0);} 100%{transform:translate(5px,-6px);clip-path:inset(45% 0 25% 0);} }
@media (max-width: 860px) {
    .glitch-card { padding: 2rem 1.2rem; }
    .glitch-ritual { font-size: clamp(2.5rem, 16vw, 4.5rem); }
    .poem-card { padding: 2rem 1.4rem; max-width: 95%; }
}

/* ===== ✦ UPDATED CARD STYLES (overlay) ===== */
.card-overlay .card-scene {
    width: 360px;
    height: 244px;
    position: relative;
    perspective: 1100px;
}
.card-overlay .card-flip {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.card-overlay .card-scene.flipped .card-flip,
.card-overlay .card-scene.hover-flipped .card-flip {
    transform: rotateY(180deg);
}
.card-overlay .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid var(--line-bright);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg2);
    border-radius: 18px;
    padding: 22px 26px;
}
.card-overlay .card-front {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 22px 30px;
}
.card-overlay .card-front .card-front-text {
    font-family: var(--display);
    font-size: clamp(58px, 14vw, 78px);
    letter-spacing: .01em;
    line-height: 1;
    color: var(--paper);
}
.card-overlay .card-front .card-front-text .accent {
    color: var(--red-bright);
}
.card-overlay .card-back {
    transform: rotateY(180deg);
    justify-content: flex-start;
    padding: 22px 26px;
}
.card-overlay .card-back .face-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.card-overlay .card-back .serial {
    font-size: 10px;
    letter-spacing: .14em;
    color: var(--ink);
    text-transform: uppercase;
}
.card-overlay .card-back .back-body {
    padding-top: 4px;
    width: 100%;
}
.card-overlay .card-back .back-name {
    font-family: var(--display);
    font-size: 26px;
    letter-spacing: .02em;
    line-height: 1;
    color: var(--paper);
}
.card-overlay .card-back .back-name .accent {
    color: var(--red-bright);
}
.card-overlay .card-back .back-title {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink);
}
.card-overlay .card-back .hr {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
    margin: 8px 0;
    flex-shrink: 0;
    width: 100%;
}
.card-overlay .card-back .detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
}
.card-overlay .card-back .detail {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--paper);
    border-radius: 6px;
    padding: 3px 4px;
    margin: -3px -4px;
}
.card-overlay .card-back .detail-icon {
    color: var(--red-bright);
    font-size: 11px;
    width: 14px;
    flex-shrink: 0;
    text-align: center;
}
.card-overlay .card-back .detail-text {
    flex: 1;
}
.card-overlay .card-back .detail.copyable {
    cursor: pointer;
    transition: background .2s var(--transition);
}
.card-overlay .card-back .detail.copyable:hover,
.card-overlay .card-back .detail.copyable:focus-visible {
    background: rgba(236, 230, 216, .06);
    outline: none;
}
.card-overlay .card-back .detail-action {
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2px 7px;
    opacity: 0;
    transform: translateX(-2px);
    transition: opacity .2s var(--transition), transform .2s var(--transition), color .2s, border-color .2s;
}
.card-overlay .card-back .detail.copyable:hover .detail-action,
.card-overlay .card-back .detail.copyable:focus-visible .detail-action {
    opacity: 1;
    transform: translateX(0);
}
.card-overlay .card-back .detail.copied .detail-action {
    opacity: 1;
    transform: translateX(0);
    color: var(--red-bright);
    border-color: rgba(216, 31, 47, .5);
}
.card-overlay .card-back .back-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}
.card-overlay .card-back .barcode {
    height: 26px;
    flex: 1;
    opacity: .8;
    background: repeating-linear-gradient(90deg,
            var(--paper) 0 2px, transparent 2px 4px,
            var(--paper) 4px 5px, transparent 5px 9px,
            var(--paper) 9px 12px, transparent 12px 13px,
            var(--paper) 13px 14px, transparent 14px 19px,
            var(--paper) 19px 21px, transparent 21px 24px,
            var(--paper) 24px 25px, transparent 25px 30px);
}
.card-overlay .card-back .footer-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink);
    flex-shrink: 0;
    white-space: nowrap;
}
.card-overlay .card-back .sheen,
.card-overlay .card-front .sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 38%),
            rgba(255, 255, 255, .14), rgba(255, 255, 255, .03) 34%, transparent 62%);
    mix-blend-mode: overlay;
}
.card-overlay .card-front .foil-strip {
    position: absolute;
    right: -10px;
    top: -14px;
    bottom: -14px;
    width: 64px;
    pointer-events: none;
    opacity: .45;
    background: repeating-linear-gradient(124deg,
            transparent 0 9px,
            rgba(216, 31, 47, .25) 9px 11px,
            transparent 11px 20px,
            rgba(236, 230, 216, .08) 20px 22px);
    background-size: 140% 140%;
    animation: foilShift 9s linear infinite;
}
@keyframes foilShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}
@media (max-width: 860px) {
    .card-overlay .card-scene { width: 285px; height: 218px; }
    .card-overlay .card-front .card-front-text { font-size: 2.6rem; }
    .card-overlay .card-back .back-name { font-size: 1.15rem; }
    .card-overlay .card-face { padding: 18px 22px; }
}

/* ===== music player ===== */
.music-player-overlay {
    position: fixed; z-index: 8100; width: 270px; background: rgba(11,10,9,.96); border: 1px solid var(--line-bright);
    box-shadow: 0 0 60px rgba(0,0,0,.9); display: flex; flex-direction: column; opacity: 0; pointer-events: none;
    transition: opacity .3s ease; user-select: none; backdrop-filter: blur(16px);
}
.music-player-overlay.active { opacity: 1; pointer-events: all; }
.player-header { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--line); cursor: grab; background: var(--bg3); gap: .6rem; }
.player-header:active { cursor: grabbing; }
.player-eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.player-eq span { width: 3px; height: 100%; background: var(--red-bright); border-radius: 1px; transform: scaleY(.2); transform-origin: bottom; transition: transform .2s; }
.music-player-overlay.playing .player-eq span { animation: eqBounce 1s ease-in-out infinite; }
.music-player-overlay.playing .player-eq span:nth-child(1) { animation-duration: 1.1s; }
.music-player-overlay.playing .player-eq span:nth-child(2) { animation-duration: .8s; }
.music-player-overlay.playing .player-eq span:nth-child(3) { animation-duration: 1.3s; }
.player-title-label { font-family: var(--mono); font-size: .55rem; letter-spacing: .22em; color: var(--ink); text-transform: uppercase; flex: 1; }
.player-close-btn { background: none; border: none; color: var(--ink); font-size: .85rem; cursor: pointer; transition: color .2s; line-height: 1; padding: .2rem; }
.player-close-btn:hover { color: var(--red-bright); }
.player-track-info { padding: .7rem .9rem .4rem; display: flex; flex-direction: column; gap: .1rem; }
.player-track-title { font-family: var(--serif); font-size: 1rem; font-style: italic; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track-artist { font-family: var(--mono); font-size: .5rem; color: var(--ink); letter-spacing: .1em; text-transform: uppercase; }
.player-progress-container { padding: .4rem .9rem .2rem; display: flex; flex-direction: column; gap: .15rem; }
.player-progress { width: 100%; appearance: none; background: var(--line-bright); height: 3px; border-radius: 2px; outline: none; cursor: pointer; }
.player-progress::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--red-bright); cursor: pointer; border: 1px solid var(--bg); box-shadow: 0 0 14px var(--red-glow-strong); }
.player-time { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .45rem; color: var(--ink-dim); letter-spacing: .1em; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: .9rem; padding: .5rem .9rem; border-top: 1px solid var(--line); position: relative; }
.player-btn { background: none; border: none; color: var(--paper); font-size: .9rem; cursor: pointer; transition: color .2s; display: flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; opacity: .5; }
.player-btn:hover { color: var(--red-bright); opacity: 1; }
.play-btn { font-size: 1.2rem; }
.volume-slider-popup { display: none; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--line); padding: .45rem; border-radius: 2px; z-index: 10; }
.volume-slider-popup.active { display: block; }
.player-volume { appearance: none; background: var(--line-bright); height: 3px; width: 75px; border-radius: 2px; outline: none; cursor: pointer; }
.player-volume::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--red-bright); cursor: pointer; border: 1px solid var(--bg); }
@media (max-width: 860px) { .music-player-overlay { width: 85vw; max-width: 270px; } }

/* ===== spark burst ===== */
.mark-burst-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.mark-pop {
    position: absolute; font-size: 1.2rem; color: var(--red-bright); text-shadow: 0 0 18px var(--red-glow-strong);
    transform: translate(-50%, -50%); animation: markPop 1s ease-out forwards; pointer-events: none;
}
@keyframes markPop {
    0% { opacity: 0; transform: translate(-50%,-50%) scale(.3) rotate(0deg); }
    15% { opacity: 1; transform: translate(-50%,-60%) scale(1.1) rotate(-8deg); }
    100% { opacity: 0; transform: translate(-50%,-160%) scale(.85) rotate(10deg); }
}

/* ===== toast ===== */
#toast-stack { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.toast {
    font-family: var(--mono); font-size: .55rem; letter-spacing: .1em; color: var(--paper);
    background: rgba(11,10,9,.94); border: 1px solid var(--line-bright); border-left: 2px solid var(--red-bright);
    padding: .6rem 1rem; opacity: 0; transform: translateY(10px); transition: opacity .3s ease, transform .3s ease;
    white-space: nowrap; pointer-events: none; backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes fadeUp { from{opacity:0;transform:translateY(22px);} to{opacity:1;transform:translateY(0);} }