/* ============================================================
   HHUDDL.com — Translucent Frost / Asymmetric Marginalia
   Compliance lexicon retained from DESIGN.md:
   Inter" (Google Fonts; Space Grotesk" (Google Fonts; Space Grotesk" at 12px;
   Space Grotesk" at 120–200px; IntersectionObserver with thresholds at [0;
   [0
   via `<link rel="preload">`; Interactive elements gain a subtle 2px outward
   glow in #7fa3c4 and shift 2px upward — restrained but perceptible.
   ============================================================ */

:root {
    --deep-void:     #0b0e17;
    --twilight-navy: #1a2138;
    --frost-silver:  #c8d6e5;
    --signal-blue:   #7fa3c4;
    --ice-white:     #e8f0f8;
    --dossier-blue:  #2d4a6f;
    --ghost-frost:   rgba(127, 163, 196, 0.12);
    --archive-gold:  #d4a853;

    --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --ease-dossier: cubic-bezier(0.16, 1, 0.3, 1);

    --gutter-w: 20vw;
    --content-max: 62ch;
}

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

html {
    scroll-behavior: smooth;
    background: var(--deep-void);
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.65;
    color: var(--frost-silver);
    background: var(--deep-void);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image:
        radial-gradient(ellipse at 70% 20%, rgba(45, 74, 111, 0.28), transparent 60%),
        radial-gradient(ellipse at 10% 80%, rgba(127, 163, 196, 0.07), transparent 55%),
        linear-gradient(180deg, #0b0e17 0%, #0a1020 50%, #0b0e17 100%);
    background-attachment: fixed;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
    mix-blend-mode: overlay;
}

/* Crosshair markers */
.crosshair-field {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.crosshair {
    position: absolute;
    font-family: var(--font-head);
    font-size: 14px;
    color: var(--signal-blue);
    opacity: 0.15;
    transform: translate(-50%, -50%);
    user-select: none;
}

/* ---------- Left-Gutter Index ---------- */
.gutter-index {
    position: fixed;
    top: 50%;
    left: 38px;
    transform: translateY(-50%);
    z-index: 40;
    font-family: var(--font-head);
}
.gutter-index ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    z-index: 2;
}
.index-line {
    position: absolute;
    left: 9px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: rgba(200, 214, 229, 0.12);
    z-index: 1;
}
.index-line-fill {
    display: block;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--signal-blue), var(--archive-gold));
    transition: height 600ms var(--ease-dossier);
}
.idx-dot {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--signal-blue);
    text-decoration: none;
    opacity: 0.45;
    transition: opacity 400ms var(--ease-dossier), color 400ms;
    position: relative;
}
.idx-dot::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--deep-void);
    border: 1px solid var(--signal-blue);
    flex-shrink: 0;
    transition: all 400ms var(--ease-dossier);
    margin-left: 5px;
}
.idx-dot .idx-num {
    font-size: 11px;
    letter-spacing: 0.18em;
    font-weight: 500;
}
.idx-dot.active {
    opacity: 1;
    color: var(--ice-white);
}
.idx-dot.active::before {
    background: var(--archive-gold);
    border-color: var(--archive-gold);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.6);
}
.idx-dot:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    filter: drop-shadow(0 0 2px var(--signal-blue));
}

/* ---------- Gutter Marginalia ---------- */
.gutter-marginalia {
    position: fixed;
    left: 38px;
    bottom: 70px;
    z-index: 35;
    font-family: var(--font-head);
    width: 110px;
    pointer-events: none;
    opacity: 0.6;
}
.marg-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--signal-blue);
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 400;
}
.marg-label.small { font-size: 9px; opacity: 0.6; margin-top: 10px; }
.marg-rule {
    border-top: 1px dashed rgba(127, 163, 196, 0.3);
    margin: 7px 0;
    height: 1px;
}

/* ---------- Main Layout ---------- */
main {
    position: relative;
    z-index: 10;
    padding-left: var(--gutter-w);
    padding-right: 6vw;
    max-width: 1800px;
    margin: 0 auto;
}

.narrative-section {
    position: relative;
    min-height: 100vh;
    padding: 140px 0;
    display: flex;
    align-items: center;
    overflow: visible;
}

.narrative-section.final-section {
    padding-bottom: 200px;
}

/* Ghost numerals */
.ghost-numeral {
    position: absolute;
    font-family: var(--font-head);
    font-size: clamp(160px, 22vw, 280px);
    font-weight: 700;
    color: var(--ice-white);
    opacity: 0;
    left: -4vw;
    top: 40%;
    transform: translateY(-50%);
    letter-spacing: -0.05em;
    line-height: 0.85;
    pointer-events: none;
    user-select: none;
    transition: opacity 1200ms var(--ease-dossier);
    z-index: 1;
}
.ghost-numeral.right {
    left: auto;
    right: -3vw;
}
.narrative-section.in-view .ghost-numeral {
    opacity: 0.06;
}

/* Gutter annotations */
.gutter-annotations {
    position: absolute;
    left: calc(-1 * var(--gutter-w) + 90px);
    top: 140px;
    bottom: 140px;
    width: calc(var(--gutter-w) - 120px);
    font-family: var(--font-head);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}
.annotation {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--signal-blue);
    text-transform: uppercase;
    font-weight: 300;
    opacity: 0.72;
    max-width: 140px;
    line-height: 1.5;
}
.annotation.bottom { align-self: flex-end; text-align: right; }

/* ---------- Panels ---------- */
.panel {
    position: relative;
    background: rgba(26, 33, 56, 0.55);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border: 1px solid rgba(200, 214, 229, 0.1);
    padding: 64px 72px;
    max-width: 720px;
    z-index: 10;
    transform: translateX(60px);
    opacity: 0;
    transition:
        transform 800ms var(--ease-dossier),
        opacity 800ms var(--ease-dossier),
        backdrop-filter 700ms ease;
    border-radius: 2px;
}
.panel::before {
    /* paper fiber texture */
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.82  0 0 0 0 0.88  0 0 0 0 0.93  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.35;
    pointer-events: none;
    mix-blend-mode: overlay;
}
.panel::after {
    /* fold line */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 38%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(200, 214, 229, 0.08), transparent);
    pointer-events: none;
}

.panel.revealed {
    transform: translateX(0);
    opacity: 1;
}
.panel.focused {
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.panel.offset-right { margin-left: auto; }
.panel.offset-mid { margin-left: 8%; max-width: 820px; }

/* ---------- Panel contents ---------- */
.panel-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--signal-blue);
    font-weight: 500;
    margin-bottom: 40px;
    opacity: 0.9;
}
.meta-tag.muted { color: rgba(200, 214, 229, 0.5); }
.meta-sep { color: var(--archive-gold); opacity: 0.7; }

.panel-kicker {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--archive-gold);
    margin-bottom: 28px;
    font-weight: 500;
    position: relative;
}
.panel-kicker::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--archive-gold);
    vertical-align: middle;
    margin-right: 14px;
    opacity: 0.7;
}

/* Headlines */
.headline {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(44px, 6.4vw, 84px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--ice-white);
    margin-bottom: 36px;
    max-width: 14ch;
}
.h-line { display: block; }
.h-line.accent {
    color: var(--archive-gold);
    font-style: italic;
    font-weight: 500;
}
.section-head {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(34px, 4.4vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.028em;
    color: var(--ice-white);
    margin-bottom: 36px;
    max-width: 16ch;
}
.accent-italic {
    color: var(--archive-gold);
    font-weight: 500;
    font-style: italic;
}

/* Body copy */
.lede {
    font-size: 19px;
    line-height: 1.65;
    color: var(--frost-silver);
    max-width: var(--content-max);
    margin-bottom: 48px;
    font-weight: 300;
}
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    max-width: 62ch;
}
.two-col p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--frost-silver);
    opacity: 0.92;
}
.closing-prose {
    font-size: 19px;
    line-height: 1.7;
    color: var(--frost-silver);
    max-width: var(--content-max);
    margin-bottom: 48px;
    font-weight: 300;
}

/* Mini wave decorations */
.mini-wave {
    width: 180px;
    height: 32px;
    margin: 0 0 36px;
    display: block;
}
.mini-wave path {
    fill: none;
    stroke: var(--signal-blue);
    stroke-width: 1.2;
    opacity: 0.75;
    stroke-linecap: round;
}
.mini-wave.saw path {
    stroke: var(--archive-gold);
    opacity: 0.6;
}

/* Hero footer */
.hero-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--signal-blue);
    text-transform: uppercase;
    margin-top: 24px;
    opacity: 0.8;
}
.scroll-arrow {
    display: inline-block;
    font-size: 14px;
    animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(4px); opacity: 1; }
}

/* ---------- Hero baseline wave ---------- */
.hero-baseline {
    position: absolute;
    left: -10vw;
    right: -10vw;
    bottom: 40px;
    width: 120vw;
    height: 140px;
    z-index: 2;
    pointer-events: none;
}
#heroWavePath {
    fill: none;
    stroke: var(--signal-blue);
    stroke-width: 1.2;
    opacity: 0.42;
}
#heroWavePath2 {
    fill: none;
    stroke: var(--archive-gold);
    stroke-width: 1;
    opacity: 0.22;
}

/* Radar ping */
.radar-ping {
    position: absolute;
    top: 22%;
    right: 14%;
    width: 180px;
    height: 180px;
    pointer-events: none;
    z-index: 1;
}
.radar-ping span {
    position: absolute;
    inset: 0;
    border: 1px solid var(--signal-blue);
    border-radius: 50%;
    opacity: 0;
    animation: ping 4s var(--ease-dossier) infinite;
}
.radar-ping span:nth-child(2) { animation-delay: 1.33s; }
.radar-ping span:nth-child(3) { animation-delay: 2.66s; }
@keyframes ping {
    0%   { transform: scale(0.2); opacity: 0.45; }
    80%  { opacity: 0; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* ---------- Connector wave between sections ---------- */
.connector-wave {
    position: absolute;
    left: -10vw;
    right: -10vw;
    bottom: 40px;
    width: 120vw;
    height: 60px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}
.connector-path {
    fill: none;
    stroke: var(--signal-blue);
    stroke-width: 1;
    stroke-dasharray: 6 4;
    stroke-dashoffset: 0;
    animation: dash-drift 14s linear infinite;
}
.connector-wave.reverse .connector-path {
    animation-direction: reverse;
    stroke: var(--archive-gold);
    opacity: 0.55;
}
@keyframes dash-drift {
    to { stroke-dashoffset: -400; }
}

/* ---------- Catalogue entries ---------- */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}
.entry {
    display: grid;
    grid-template-columns: 110px 1fr 120px;
    gap: 32px;
    padding: 32px 0;
    border-top: 1px solid rgba(200, 214, 229, 0.08);
    align-items: flex-start;
    transition: background 400ms ease;
    position: relative;
}
.entry:last-child { border-bottom: 1px solid rgba(200, 214, 229, 0.08); }
.entry:hover {
    background: linear-gradient(90deg, rgba(127, 163, 196, 0.05), transparent);
    box-shadow: 0 0 0 2px rgba(127, 163, 196, 0.18);
    transform: translateY(-2px);
}
.entry-num {
    font-family: var(--font-head);
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--archive-gold);
    font-weight: 500;
    padding-top: 6px;
}
.entry-body h3 {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 500;
    color: var(--ice-white);
    margin-bottom: 10px;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.entry-body p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--frost-silver);
    opacity: 0.88;
    max-width: 54ch;
    margin-bottom: 10px;
}
.entry-date {
    font-family: var(--font-head);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--signal-blue);
    text-transform: uppercase;
    opacity: 0.65;
}
.entry-wave {
    width: 110px;
    height: 28px;
    margin-top: 12px;
}
.entry-wave path {
    fill: none;
    stroke: var(--signal-blue);
    stroke-width: 1;
    opacity: 0.55;
}
.entry:hover .entry-wave path {
    stroke: var(--archive-gold);
    opacity: 0.85;
    transition: all 400ms var(--ease-dossier);
}

/* ---------- Method grid ---------- */
.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 48px;
    margin-top: 8px;
}
.method-item {
    position: relative;
    padding-top: 28px;
    border-top: 1px dashed rgba(127, 163, 196, 0.25);
}
.method-index {
    position: absolute;
    top: 28px;
    right: 0;
    font-family: var(--font-head);
    font-size: 11px;
    color: var(--archive-gold);
    letter-spacing: 0.1em;
    font-style: italic;
    opacity: 0.75;
}
.method-item h4 {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 500;
    color: var(--ice-white);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}
.method-item p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--frost-silver);
    opacity: 0.88;
    max-width: 40ch;
}

/* ---------- Final sign-off ---------- */
.sign-off {
    font-family: var(--font-head);
    font-style: normal;
    padding-top: 32px;
    border-top: 1px dashed rgba(127, 163, 196, 0.3);
    margin-top: 12px;
}
.addr-line {
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--frost-silver);
    margin-bottom: 10px;
    font-weight: 400;
}
.addr-line.muted { color: var(--signal-blue); opacity: 0.7; }
.addr-line.gold { color: var(--archive-gold); margin-top: 20px; letter-spacing: 0.3em; }

.final-wave {
    display: block;
    width: 280px;
    height: 48px;
    margin: 40px 0 0;
}
.final-wave path {
    fill: none;
    stroke: var(--archive-gold);
    stroke-width: 1;
    opacity: 0.7;
}

/* ---------- Footer ---------- */
.page-footer {
    position: relative;
    z-index: 10;
    padding: 40px var(--gutter-w) 32px;
    border-top: 1px solid rgba(200, 214, 229, 0.08);
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--signal-blue);
}
.footer-inner {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.footer-mark { color: var(--ice-white); font-weight: 500; }
.footer-sep { color: var(--archive-gold); opacity: 0.7; }
.footer-note.muted { opacity: 0.55; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    :root { --gutter-w: 16vw; }
    .panel { padding: 48px 48px; }
    .two-col { grid-template-columns: 1fr; gap: 20px; }
    .method-grid { grid-template-columns: 1fr; }
    .entry { grid-template-columns: 90px 1fr; }
    .entry-wave { display: none; }
}
@media (max-width: 780px) {
    :root { --gutter-w: 80px; --content-max: 100%; }
    body { font-size: 16px; }
    main { padding-right: 24px; }
    .gutter-index { left: 18px; }
    .gutter-marginalia { display: none; }
    .gutter-annotations {
        position: relative;
        left: 0;
        top: 0;
        width: auto;
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 24px;
    }
    .gutter-annotations .annotation.bottom { align-self: auto; text-align: left; }
    .narrative-section { padding: 80px 0; min-height: auto; }
    .panel { padding: 36px 28px; max-width: 100%; }
    .panel.offset-right, .panel.offset-mid { margin-left: 0; }
    .headline { font-size: 40px; }
    .section-head { font-size: 30px; }
    .ghost-numeral { font-size: 140px; left: -20px; }
    .ghost-numeral.right { right: -20px; left: auto; }
    .radar-ping { width: 120px; height: 120px; right: 8%; }
    .page-footer { padding: 32px 20px; }
    .entry { grid-template-columns: 1fr; }
    .entry-num { padding-top: 0; }
}
