/* HHASSL.com — Design System */
/* Palette from DESIGN.md */
:root {
    --deep-soil: #2c1e12;
    --deep-soil-dark: #1a120a;
    --worn-clay: #a0522d;
    --oxidized-copper: #b87333;
    --bone-white: #f2ece4;
    --cool-slate: #4a6670;
    --glitch-teal: #2dd4a8;
    --void-black: #0d0b09;
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--bone-white);
    background: var(--void-black);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== Scroll Progress Indicator ==================== */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 24px;
    width: 2px;
    height: 100vh;
    background: rgba(184, 115, 51, 0.12);
    z-index: 1000;
    pointer-events: none;
}

.scroll-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--oxidized-copper);
    transform-origin: top;
    box-shadow: 0 0 8px rgba(184, 115, 51, 0.4);
}

/* ==================== Chapter Label ==================== */
.chapter-label {
    position: fixed;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    opacity: 0;
    transition: opacity 800ms ease-out;
    pointer-events: none;
}

.chapter-label.visible {
    opacity: 1;
}

.chapter-label-text {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cool-slate);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0.7;
}

/* ==================== Floating Annotations ==================== */
.annotation {
    position: fixed;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 1000ms ease-out;
    animation: drift 12s ease-in-out infinite;
    pointer-events: none;
}

.annotation.visible {
    opacity: 0.6;
}

.annotation-left {
    left: 28px;
    top: 40%;
    animation-delay: 0s;
}

.annotation-right {
    right: 72px;
    top: 35%;
    animation-delay: 6s;
    text-align: right;
}

.annotation-coord,
.annotation-time,
.annotation-serial {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cool-slate);
    line-height: 1.4;
}

.annotation-coord {
    color: var(--oxidized-copper);
    opacity: 0.75;
}

@keyframes drift {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

/* ==================== Chapter Base ==================== */
.chapter {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* ==================== Opening Void ==================== */
.chapter-void {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--void-black);
    min-height: 100vh;
    padding: 40px 24px;
}

.void-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 0%, rgba(13, 11, 9, 0.3) 60%, var(--void-black) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 1200ms ease-out;
}

.photo-frame-hero {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.photo-hero {
    background:
        radial-gradient(circle at 50% 50%, rgba(160, 82, 45, 0.12) 0%, transparent 55%),
        linear-gradient(135deg, var(--void-black) 0%, var(--deep-soil) 50%, var(--void-black) 100%);
    filter: saturate(0.7) contrast(1.1);
}

.topo-pattern {
    width: 80%;
    height: 80%;
    opacity: 0.85;
}

.void-text {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1400ms ease-out, transform 1400ms ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.void-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.void-meta {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--oxidized-copper);
    opacity: 0.55;
}

.site-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    color: var(--bone-white);
    line-height: 1;
}

.site-subtitle {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cool-slate);
}

.scroll-hint {
    margin-top: 40px;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--oxidized-copper);
    opacity: 0.5;
    animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.35; transform: translateY(0); }
    50%      { opacity: 0.7;  transform: translateY(4px); }
}

/* ==================== Flicker Animation ==================== */
.flicker {
    animation: flicker 5s steps(1) infinite;
}

@keyframes flicker {
    0%, 4%, 8%, 12%, 16%, 90%, 100% { opacity: 1; }
    2%  { opacity: 0.88; }
    6%  { opacity: 0.92; }
    10% { opacity: 0.85; }
    14% { opacity: 0.94; }
    92% { opacity: 0.9;  }
}

/* ==================== Interference Zones ==================== */
.interference-zone {
    position: relative;
    height: 60px;
    overflow: hidden;
    background: var(--void-black);
    border-top: 1px solid rgba(74, 102, 112, 0.05);
    border-bottom: 1px solid rgba(74, 102, 112, 0.05);
}

.interference-wide {
    height: 80px;
}

.interference-strip {
    position: absolute;
    left: -5%;
    width: 110%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(45, 212, 168, 0.08) 30%, rgba(184, 115, 51, 0.12) 60%, transparent 100%);
    clip-path: polygon(0% 0%, 98% 2%, 100% 100%, 2% 98%);
    will-change: transform, opacity;
}

.interference-strip:nth-child(1) { top: 20%; }
.interference-strip:nth-child(2) { top: 45%; }
.interference-strip:nth-child(3) { top: 70%; }
.interference-strip:nth-child(4) { top: 85%; }
.interference-strip:nth-child(5) { top: 10%; }

.interference-zone.glitching .interference-strip {
    animation: interferenceFlash 260ms steps(3) forwards;
}

.interference-zone.glitching .interference-strip:nth-child(2) { animation-delay: 40ms; }
.interference-zone.glitching .interference-strip:nth-child(3) { animation-delay: 80ms; }
.interference-zone.glitching .interference-strip:nth-child(4) { animation-delay: 120ms; }

@keyframes interferenceFlash {
    0%   { opacity: 1;   transform: translateX(0); }
    33%  { opacity: 0.4; transform: translateX(-3px); }
    66%  { opacity: 0.8; transform: translateX(2px); }
    100% { opacity: 1;   transform: translateX(0); }
}

.interference-zone.active .interference-strip {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(45, 212, 168, 0.08) 20%,
        rgba(184, 115, 51, 0.14) 50%,
        rgba(45, 212, 168, 0.06) 80%,
        transparent 100%
    );
    height: 4px;
}

/* ==================== Text Sections ==================== */
.chapter-text {
    background: linear-gradient(180deg, var(--deep-soil) 0%, var(--deep-soil-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 24px;
    position: relative;
}

.topo-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.topo-bg-svg {
    width: 100%;
    height: 100%;
}

/* Crosshair Markers */
.crosshair {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.crosshair::before {
    content: '+';
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 18px;
    color: var(--cool-slate);
    opacity: 0.22;
}

.crosshair-tl { top: 40px; left: 40px; }
.crosshair-tr { top: 40px; right: 40px; }
.crosshair-bl { bottom: 40px; left: 40px; }
.crosshair-br { bottom: 40px; right: 40px; }
.crosshair-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Text Corridor */
.text-corridor {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    width: 100%;
}

.chapter-number {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--oxidized-copper);
    opacity: 0.7;
    display: block;
    margin-bottom: 28px;
}

.chapter-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 5rem);
    letter-spacing: -0.02em;
    color: var(--bone-white);
    margin-bottom: 44px;
    line-height: 1.1;
    transition: text-shadow 200ms ease;
}

.chapter-title.glitch-text {
    text-shadow:
        2px 0 rgba(45, 212, 168, 0.35),
        -2px 0 rgba(184, 115, 51, 0.35);
}

.body-text {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: var(--bone-white);
    margin-bottom: 26px;
    opacity: 0.92;
}

/* Field Quote */
.field-quote {
    border-left: 2px solid var(--oxidized-copper);
    padding: 22px 0 22px 32px;
    margin: 44px 0;
    position: relative;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.18rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--bone-white);
    opacity: 0.88;
}

.field-quote .quote-mark {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.6rem;
    color: var(--oxidized-copper);
    opacity: 0.6;
    line-height: 0;
    vertical-align: middle;
}

.quote-cite {
    display: block;
    margin-top: 16px;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 10px;
    font-style: normal;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cool-slate);
    opacity: 0.7;
}

/* Seal Stamps */
.seal-stamp {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--oxidized-copper);
    opacity: 0.22;
    margin-top: 48px;
    position: relative;
}

.seal-stamp::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--oxidized-copper);
    transform: translate(-50%, -50%);
    opacity: 0.55;
}

.seal-stamp-final {
    width: 64px;
    height: 64px;
    opacity: 0.4;
    margin: 48px auto 0;
}

/* ==================== Photo Sections ==================== */
.chapter-photo {
    min-height: 100vh;
    background: var(--void-black);
    display: flex;
    flex-direction: column;
    position: relative;
}

.photo-frame {
    position: relative;
    overflow: hidden;
}

.photo-frame-bleed {
    width: 100%;
    flex: 1;
    min-height: 70vh;
}

.photo-frame-bleed .photo-placeholder {
    min-height: 70vh;
}

.photo-infrastructure {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(184, 115, 51, 0.08) 0%, transparent 50%),
        linear-gradient(145deg, var(--deep-soil) 0%, var(--void-black) 40%, var(--deep-soil-dark) 70%, var(--void-black) 100%);
    filter: saturate(0.6) contrast(1.12);
}

.photo-labor {
    background:
        radial-gradient(ellipse at 60% 50%, rgba(160, 82, 45, 0.18) 0%, transparent 50%),
        linear-gradient(200deg, var(--deep-soil-dark) 0%, var(--worn-clay) 30%, var(--deep-soil) 60%, var(--void-black) 100%);
    filter: saturate(0.55) contrast(1.1);
}

.photo-reclamation {
    background:
        radial-gradient(ellipse at 50% 70%, rgba(45, 212, 168, 0.05) 0%, transparent 50%),
        linear-gradient(160deg, var(--void-black) 0%, var(--deep-soil) 30%, var(--deep-soil-dark) 70%, var(--void-black) 100%);
    filter: saturate(0.65) contrast(1.1);
}

.topo-pattern-wide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.photo-caption {
    padding: 48px 24px 72px;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.caption-meta {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--oxidized-copper);
    opacity: 0.8;
    display: block;
    margin-bottom: 18px;
}

.caption-text {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--cool-slate);
}

/* ==================== Reveal Animations ==================== */
.reveal-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== Deep Chapter ==================== */
.chapter-deep {
    background: linear-gradient(180deg, var(--deep-soil-dark) 0%, var(--void-black) 100%);
}

.closing-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 72px;
    padding-top: 64px;
    border-top: 1px solid rgba(184, 115, 51, 0.18);
}

.closing-glyph {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 36px;
    color: var(--oxidized-copper);
    opacity: 0.55;
    margin-bottom: 26px;
    line-height: 1;
}

.closing-meta {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cool-slate);
    opacity: 0.55;
    line-height: 2;
}

/* ==================== Final Void ==================== */
.chapter-final-void {
    min-height: 60vh;
    background: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.final-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.final-meta {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--oxidized-copper);
    opacity: 0.45;
}

.final-domain {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
    color: var(--bone-white);
    opacity: 0.45;
}

.final-tagline {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cool-slate);
    opacity: 0.35;
}

/* ==================== Parallax ==================== */
.parallax-photo {
    will-change: transform;
}

/* ==================== Responsive ==================== */
@media (max-width: 960px) {
    .annotation-left  { left: 18px; }
    .annotation-right { right: 52px; }
}

@media (max-width: 768px) {
    .annotation          { display: none; }
    .chapter-label       { right: 18px; }
    .scroll-progress     { right: 10px; }
    .text-corridor       { padding: 0 8px; }
    .photo-caption       { padding: 36px 20px 56px; }
    .crosshair           { display: none; }
    .chapter-text        { padding: 96px 20px; }
    .body-text           { font-size: 16px; }
    .field-quote         { padding-left: 22px; font-size: 1.06rem; }
}

@media (max-width: 480px) {
    body                 { font-size: 16px; }
    .site-title          { font-size: 3rem; }
    .chapter-title       { font-size: 2rem; margin-bottom: 32px; }
    .chapter-text        { padding: 72px 18px; }
    .closing-mark        { margin-top: 52px; padding-top: 44px; }
    .closing-glyph       { font-size: 30px; }
}
