/* ============================================
   LLITTL.com — Skeuomorphic Midnight
   A precision instrument rendered in pixels.
   Interactions feel deliberate. Interactive elements use Intersection Observer API to trigger entrance animations as panels come into view.
   ============================================ */

:root {
    --deep-void: #0a0e27;
    --midnight-surface: #141b3d;
    --midnight-lift: #1a2347;
    --twilight-edge: #1e2a5a;
    --signal-blue: #3b5998;
    --reflected-sky: #7b9bd4;
    --moonlit-white: #c8d8f0;
    --amber-glow: #e8a87c;
    --deep-indigo: #2d1f5e;

    --font-head: 'Nunito', 'Inter', system-ui, sans-serif;
    --font-body: 'Varela Round', 'Inter', system-ui, sans-serif;
    --font-label: 'DM Sans', 'Inter', system-ui, sans-serif;

    --bevel-top: rgba(200, 216, 240, 0.08);
    --bevel-inner: rgba(200, 216, 240, 0.06);
    --bevel-bottom: rgba(0, 0, 0, 0.2);
    --shadow-deep: 0 22px 48px rgba(0, 0, 0, 0.45);
    --shadow-mid: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-near: 0 2px 8px rgba(0, 0, 0, 0.25);

    --ease-serene: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--moonlit-white);
    background: var(--deep-void);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(45, 31, 94, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(59, 89, 152, 0.18) 0%, transparent 60%),
        linear-gradient(170deg, #0a0e27 0%, #141b3d 50%, #0a0e27 100%);
    background-attachment: fixed;
    line-height: 1.72;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ----- Ambient overlays ----- */
.dot-grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(30, 42, 90, 0.65) 1px, transparent 1.5px);
    background-size: 32px 32px;
    opacity: 0;
    transition: opacity 1200ms var(--ease-serene) 400ms;
}

.dot-grid-overlay.active {
    opacity: 0.55;
}

.brushed-surface {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(200, 216, 240, 0.25) 0px,
        rgba(200, 216, 240, 0.25) 0.5px,
        transparent 0.5px,
        transparent 2px
    );
    mix-blend-mode: overlay;
}

/* ----- Pill navigation ----- */
.pill-nav {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    padding: 14px 10px;
    background: linear-gradient(145deg, var(--midnight-lift) 0%, var(--midnight-surface) 100%);
    border: 1px solid rgba(30, 42, 90, 0.75);
    border-radius: 48px;
    box-shadow:
        var(--shadow-mid),
        var(--shadow-near),
        inset 0 1px 0 var(--bevel-inner),
        inset 0 -1px 0 var(--bevel-bottom);
}

.pill-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-dot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 30% 30%, #2a3564 0%, #141b3d 80%);
    cursor: pointer;
    box-shadow:
        inset 0 1px 1px rgba(0, 0, 0, 0.6),
        inset 0 -1px 0 rgba(200, 216, 240, 0.05),
        0 1px 0 rgba(200, 216, 240, 0.05);
    transition: all 400ms var(--ease-serene);
    position: relative;
}

.nav-dot:hover {
    background: radial-gradient(circle at 30% 30%, #3a4580 0%, #1e2a5a 80%);
}

.nav-dot.active {
    background: radial-gradient(circle at 30% 30%, #e8a87c 0%, #b47652 80%);
    box-shadow:
        inset 0 1px 1px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(232, 168, 124, 0.55),
        0 0 18px rgba(232, 168, 124, 0.25);
    transform: translateY(0.5px) scale(0.96);
}

/* ----- Chapter sections ----- */
.chapter {
    position: relative;
    z-index: 1;
    min-height: 88vh;
    padding: 120px 40px 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chapter[data-width="narrow"] .card {
    max-width: 680px;
}

.chapter[data-width="medium"] .card {
    max-width: 860px;
}

.chapter[data-width="wide"] .card {
    max-width: 1100px;
}

.chapter.hero {
    min-height: 100vh;
    padding-top: 60px;
}

/* ----- Hero ----- */
.hero-inner {
    position: relative;
    text-align: center;
    max-width: 820px;
    z-index: 2;
}

.hero-indicator,
.inline-indicator,
.closing-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--midnight-lift), var(--midnight-surface));
    border: 1px solid rgba(30, 42, 90, 0.6);
    box-shadow:
        inset 0 1px 0 var(--bevel-inner),
        inset 0 -1px 0 var(--bevel-bottom),
        0 4px 12px rgba(0, 0, 0, 0.3);
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--reflected-sky);
    margin-bottom: 32px;
}

.led {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f5d4b4 0%, #e8a87c 45%, #a96d43 100%);
    box-shadow:
        0 0 6px rgba(232, 168, 124, 0.8),
        0 0 14px rgba(232, 168, 124, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: ledPulse 4s ease-in-out infinite;
}

.led.led-amber {
    animation-duration: 5s;
}

@keyframes ledPulse {
    0%, 100% {
        box-shadow:
            0 0 6px rgba(232, 168, 124, 0.7),
            0 0 14px rgba(232, 168, 124, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow:
            0 0 10px rgba(232, 168, 124, 0.9),
            0 0 22px rgba(232, 168, 124, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

.embossed-logotype {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: clamp(4rem, 14vw, 11rem);
    letter-spacing: 0.08em;
    color: var(--midnight-surface);
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.6),
        0 0 1px rgba(0, 0, 0, 0.8),
        0 1px 0 rgba(200, 216, 240, 0.1),
        0 2px 2px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1400ms var(--ease-serene), transform 1400ms var(--ease-serene);
    line-height: 1;
    margin-bottom: 28px;
    user-select: none;
}

.embossed-logotype.active {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    color: var(--reflected-sky);
    max-width: 560px;
    margin: 0 auto 40px;
    opacity: 0;
    animation: fadeUp 1200ms var(--ease-serene) 600ms forwards;
}

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

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 14px 26px;
    background: linear-gradient(145deg, var(--midnight-lift), var(--midnight-surface));
    border-radius: 36px;
    border: 1px solid rgba(30, 42, 90, 0.6);
    box-shadow:
        var(--shadow-mid),
        inset 0 1px 0 var(--bevel-inner),
        inset 0 -1px 0 var(--bevel-bottom);
    opacity: 0;
    animation: fadeUp 1200ms var(--ease-serene) 900ms forwards;
}

.meta-chip {
    font-family: var(--font-label);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--reflected-sky);
}

.meta-divider {
    width: 1px;
    height: 12px;
    background: var(--twilight-edge);
    display: inline-block;
}

.scroll-hint {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: fadeUp 1200ms var(--ease-serene) 1400ms forwards;
}

.hint-label {
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--reflected-sky);
}

.hint-arrow {
    width: 1px;
    height: 36px;
    background: linear-gradient(180deg, transparent 0%, var(--amber-glow) 100%);
    position: relative;
    animation: arrowDrift 3.2s ease-in-out infinite;
}

.hint-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 6px;
    height: 6px;
    border-right: 1px solid var(--amber-glow);
    border-bottom: 1px solid var(--amber-glow);
}

@keyframes arrowDrift {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(6px); opacity: 1; }
}

.circuit-garnish {
    position: absolute;
    width: 220px;
    height: 220px;
    opacity: 0.7;
    pointer-events: none;
}

.circuit-garnish.garnish-tl {
    top: 80px;
    left: 40px;
}

.circuit-garnish.garnish-br {
    bottom: 80px;
    right: 40px;
}

.circuit-garnish svg {
    width: 100%;
    height: 100%;
}

.trace {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: traceDraw 3s var(--ease-serene) 800ms forwards, tracePulse 6s ease-in-out 3.8s infinite;
}

@keyframes traceDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes tracePulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.55; }
}

/* ----- Section markers ----- */
.section-marker {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms var(--ease-serene), transform 800ms var(--ease-serene);
}

.chapter.in-view .section-marker {
    opacity: 1;
    transform: translateY(0);
}

.marker-label {
    font-family: var(--font-label);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--reflected-sky);
}

/* ----- Isometric hexagon marker ----- */
.iso-hex {
    position: relative;
    width: 28px;
    height: 32px;
    transform-style: preserve-3d;
    animation: isoRotate 8s linear infinite;
}

@keyframes isoRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hex-face {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-top {
    background: linear-gradient(135deg, #3b5998 0%, #7b9bd4 100%);
    clip-path: polygon(50% 0%, 100% 25%, 50% 50%, 0% 25%);
}

.hex-left {
    background: linear-gradient(135deg, #1e2a5a 0%, #141b3d 100%);
    clip-path: polygon(0% 25%, 50% 50%, 50% 100%, 0% 75%);
}

.hex-right {
    background: linear-gradient(135deg, #2d1f5e 0%, #1a2347 100%);
    clip-path: polygon(100% 25%, 100% 75%, 50% 100%, 50% 50%);
}

/* ----- Isometric cube ----- */
.iso-cube {
    position: relative;
    width: 44px;
    height: 48px;
    margin-bottom: 22px;
    transform: rotate(0deg);
    animation: isoDrift 10s ease-in-out infinite;
}

@keyframes isoDrift {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(8deg); }
}

.cube-face {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(200, 216, 240, 0.12);
}

.cube-top {
    background: linear-gradient(135deg, #5a79b8 0%, #3b5998 100%);
    clip-path: polygon(50% 0%, 100% 25%, 50% 50%, 0% 25%);
    box-shadow: inset 0 1px 0 rgba(200, 216, 240, 0.25);
}

.cube-left {
    background: linear-gradient(155deg, #1e2a5a 0%, #141b3d 100%);
    clip-path: polygon(0% 25%, 50% 50%, 50% 100%, 0% 75%);
}

.cube-right {
    background: linear-gradient(200deg, #2a3975 0%, #1a2347 100%);
    clip-path: polygon(100% 25%, 100% 75%, 50% 100%, 50% 50%);
}

/* ----- Card (skeuomorphic material) ----- */
.card {
    position: relative;
    width: 100%;
    padding: 56px 56px 64px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--midnight-lift) 0%, var(--midnight-surface) 100%);
    border: 1px solid rgba(30, 42, 90, 0.6);
    box-shadow:
        var(--shadow-deep),
        var(--shadow-mid),
        var(--shadow-near),
        inset 0 1px 0 var(--bevel-top),
        inset 0 -1px 0 var(--bevel-bottom);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(200, 216, 240, 0.04) 0px,
        rgba(200, 216, 240, 0.04) 0.5px,
        transparent 0.5px,
        transparent 2px
    );
    mix-blend-mode: overlay;
    opacity: 0.6;
    border-radius: inherit;
}

.card.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms var(--ease-serene), transform 900ms var(--ease-serene);
}

.card.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.card[data-offset="left"] {
    align-self: flex-start;
    margin-left: 0;
}

.card[data-offset="right"] {
    align-self: flex-end;
    margin-right: 0;
}

/* ----- Headings with underline-draw ----- */
.chapter-heading {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.12;
    color: var(--moonlit-white);
    margin-bottom: 28px;
    display: inline-block;
    position: relative;
}

.chapter-heading span {
    display: inline-block;
    padding-bottom: 12px;
    position: relative;
}

.chapter-heading span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(232, 168, 124, 0.7);
    box-shadow: 0 0 8px rgba(232, 168, 124, 0.3);
    transition: width 800ms var(--ease-serene) 400ms;
}

.card.in-view .chapter-heading span::after,
.reveal.in-view .chapter-heading span::after {
    width: 100%;
}

.lead {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.35vw, 1.2rem);
    color: var(--moonlit-white);
    max-width: 62ch;
    margin-bottom: 22px;
}

p {
    color: var(--moonlit-white);
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    margin-bottom: 18px;
    max-width: 66ch;
}

p:last-child {
    margin-bottom: 0;
}

/* ----- Craft grid ----- */
.craft-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 44px;
}

.craft-pillar {
    padding: 28px 24px 30px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(26, 35, 71, 0.8) 0%, rgba(20, 27, 61, 0.8) 100%);
    border: 1px solid rgba(30, 42, 90, 0.5);
    box-shadow:
        inset 0 1px 0 var(--bevel-inner),
        inset 0 -1px 0 var(--bevel-bottom),
        0 6px 18px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms var(--ease-serene), transform 700ms var(--ease-serene);
}

.pillar-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--moonlit-white);
    margin-bottom: 10px;
}

.craft-pillar p {
    font-size: 0.98rem;
    color: var(--reflected-sky);
    line-height: 1.68;
    margin-bottom: 0;
}

/* staggered reveal helper */
.reveal-child.in-view { opacity: 1; transform: translateY(0); }
.reveal-child[data-step="1"] { transition-delay: 100ms; }
.reveal-child[data-step="2"] { transition-delay: 200ms; }
.reveal-child[data-step="3"] { transition-delay: 300ms; }
.reveal-child[data-step="4"] { transition-delay: 400ms; }
.reveal-child[data-step="5"] { transition-delay: 500ms; }
.reveal-child[data-step="6"] { transition-delay: 600ms; }
.reveal-child[data-step="7"] { transition-delay: 700ms; }
.reveal-child[data-step="8"] { transition-delay: 800ms; }

/* ----- Instrument stack ----- */
.instrument-stack {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 44px;
    margin-top: 48px;
}

.instrument-card {
    padding: 44px 48px;
    max-width: 640px;
    width: 92%;
}

.instrument-card[data-offset="right"] {
    align-self: flex-end;
}

.instrument-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(30, 42, 90, 0.55);
}

.instrument-id {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--reflected-sky);
}

.serial {
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--signal-blue);
}

.instrument-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    color: var(--moonlit-white);
    margin-bottom: 12px;
}

.instrument-card p {
    color: var(--reflected-sky);
    margin-bottom: 22px;
}

/* ----- Dials ----- */
.dial-row {
    display: flex;
    gap: 32px;
    justify-content: flex-start;
    margin-top: 20px;
    flex-wrap: wrap;
}

.dial {
    position: relative;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, rgba(200, 216, 240, 0.08) 0%, transparent 50%),
        linear-gradient(145deg, var(--midnight-surface) 0%, var(--deep-void) 100%);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.55),
        inset 0 -1px 0 rgba(200, 216, 240, 0.05),
        0 2px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.dial::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 225deg,
        rgba(30, 42, 90, 0.7) 0deg,
        rgba(30, 42, 90, 0.7) 2deg,
        transparent 2deg,
        transparent 18deg
    );
    mask: radial-gradient(circle, transparent 52%, #000 53%);
    -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%);
}

.dial-needle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: linear-gradient(to top, #e8a87c 0%, #f5d4b4 100%);
    box-shadow: 0 0 6px rgba(232, 168, 124, 0.6);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-120deg);
    transition: transform 1400ms var(--ease-serene);
    border-radius: 2px;
}

.dial.active .dial-needle {
    transform: translateX(-50%) rotate(calc(-120deg + (var(--value, 50) * 2.4deg)));
}

.dial-cap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #7b9bd4 0%, #1e2a5a 100%);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 3;
}

.dial-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-label);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--reflected-sky);
}

.dial-row {
    margin-bottom: 28px;
}

/* ----- Pill toggle ----- */
.toggle-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 10px;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--deep-void), var(--midnight-surface));
    border: 1px solid rgba(30, 42, 90, 0.65);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 -1px 0 rgba(200, 216, 240, 0.04);
    cursor: pointer;
    transition: all 400ms var(--ease-serene);
    user-select: none;
}

.pill-knob {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a3564 0%, #141b3d 90%);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(200, 216, 240, 0.05);
    transition: all 400ms var(--ease-serene);
}

.pill-toggle[data-state="on"] .pill-knob {
    background: radial-gradient(circle at 30% 30%, #f5d4b4 0%, #e8a87c 45%, #a96d43 100%);
    box-shadow:
        0 0 10px rgba(232, 168, 124, 0.55),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.pill-text {
    font-family: var(--font-label);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--reflected-sky);
}

.pill-toggle[data-state="on"] .pill-text {
    color: var(--moonlit-white);
}

/* ----- Signal strip ----- */
.signal-strip {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 28px;
    margin-top: 16px;
}

.pulse-core {
    position: absolute;
    left: 28px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f5d4b4 0%, #e8a87c 50%, #a96d43 100%);
    box-shadow: 0 0 12px rgba(232, 168, 124, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    left: 28px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(232, 168, 124, 0.6);
    animation: ripple 4.5s ease-out infinite;
    opacity: 0;
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(5); opacity: 0; }
}

/* ----- Swatch rail ----- */
.swatch-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 44px;
}

.swatch {
    padding: 18px 20px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(26, 35, 71, 0.7) 0%, rgba(20, 27, 61, 0.7) 100%);
    border: 1px solid rgba(30, 42, 90, 0.55);
    box-shadow:
        inset 0 1px 0 var(--bevel-inner),
        inset 0 -1px 0 var(--bevel-bottom),
        0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms var(--ease-serene), transform 700ms var(--ease-serene);
}

.swatch-chip {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    background: var(--swatch);
    box-shadow:
        inset 0 1px 0 rgba(200, 216, 240, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.swatch-chip::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 0px,
        rgba(255, 255, 255, 0.04) 0.5px,
        transparent 0.5px,
        transparent 2px
    );
    mix-blend-mode: overlay;
}

.swatch-name {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--moonlit-white);
}

.swatch-code {
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--signal-blue);
}

/* ----- Breath meter ----- */
.breath-meter {
    display: flex;
    align-items: end;
    gap: 8px;
    margin: 36px 0 28px;
    height: 72px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--deep-void), var(--midnight-surface));
    border: 1px solid rgba(30, 42, 90, 0.6);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.55),
        inset 0 -1px 0 rgba(200, 216, 240, 0.05);
}

.breath-bar {
    flex: 1;
    background: linear-gradient(to top, var(--signal-blue) 0%, var(--reflected-sky) 100%);
    border-radius: 2px;
    height: 20%;
    box-shadow: 0 0 6px rgba(123, 155, 212, 0.35);
    animation: breathe 5s ease-in-out infinite;
}

.breath-bar:nth-child(1) { animation-delay: 0s; }
.breath-bar:nth-child(2) { animation-delay: 0.2s; }
.breath-bar:nth-child(3) { animation-delay: 0.4s; }
.breath-bar:nth-child(4) { animation-delay: 0.6s; }
.breath-bar:nth-child(5) { animation-delay: 0.8s; }
.breath-bar:nth-child(6) { animation-delay: 1s; }
.breath-bar:nth-child(7) { animation-delay: 1.2s; }
.breath-bar:nth-child(8) { animation-delay: 1.4s; }

@keyframes breathe {
    0%, 100% { height: 20%; }
    50% { height: 85%; background: linear-gradient(to top, var(--signal-blue) 0%, var(--amber-glow) 100%); }
}

/* ----- Pull quote ----- */
.pull-quote {
    position: relative;
    margin-top: 36px;
    padding: 28px 32px 28px 52px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(45, 31, 94, 0.35) 0%, rgba(20, 27, 61, 0.6) 100%);
    border-left: 2px solid var(--amber-glow);
    box-shadow: inset 0 1px 0 var(--bevel-inner);
}

.pull-quote p {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    color: var(--moonlit-white);
    font-style: italic;
    margin-bottom: 0;
    max-width: none;
}

.quote-mark {
    font-family: var(--font-head);
    font-size: 2.6rem;
    color: rgba(232, 168, 124, 0.45);
    position: absolute;
    top: 8px;
    left: 18px;
    line-height: 1;
}

.quote-mark.close {
    position: static;
    display: inline;
    margin-left: 4px;
    font-size: 1.4rem;
    vertical-align: middle;
}

/* ----- Workshop diagram ----- */
.workshop-diagram {
    width: 100%;
    max-width: 640px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--deep-void), var(--midnight-surface));
    border: 1px solid rgba(30, 42, 90, 0.55);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.55),
        inset 0 -1px 0 rgba(200, 216, 240, 0.05);
}

.workshop-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

.animated-trace {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: workshopTrace 5s var(--ease-serene) infinite;
}

@keyframes workshopTrace {
    0% { stroke-dashoffset: 800; }
    60% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -800; }
}

.pulse-node {
    transform-origin: center;
    animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { r: 6; opacity: 1; }
    50% { r: 8; opacity: 0.7; }
}

/* ----- Workshop list ----- */
.workshop-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

.workshop-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(26, 35, 71, 0.6) 0%, rgba(20, 27, 61, 0.6) 100%);
    border: 1px solid rgba(30, 42, 90, 0.5);
    box-shadow: inset 0 1px 0 var(--bevel-inner);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 700ms var(--ease-serene), transform 700ms var(--ease-serene);
}

.list-led {
    flex-shrink: 0;
    margin-top: 8px;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f5d4b4 0%, #e8a87c 45%, #a96d43 100%);
    box-shadow: 0 0 8px rgba(232, 168, 124, 0.5);
}

.workshop-list strong {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--moonlit-white);
    display: block;
    margin-bottom: 4px;
}

.workshop-list li > div {
    flex: 1;
    color: var(--reflected-sky);
    font-size: 0.98rem;
}

/* ----- Colophon ----- */
.colophon {
    margin: 32px 0 28px;
    padding: 24px 26px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--deep-void), var(--midnight-surface));
    border: 1px solid rgba(30, 42, 90, 0.55);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 -1px 0 rgba(200, 216, 240, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.colophon-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(30, 42, 90, 0.7);
    padding-bottom: 10px;
}

.colophon-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.colophon-label {
    font-family: var(--font-label);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--signal-blue);
}

.colophon-value {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--moonlit-white);
}

/* ----- Footer ----- */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 60px 40px 80px;
    border-top: 1px solid rgba(30, 42, 90, 0.6);
    background: linear-gradient(180deg, transparent 0%, var(--deep-void) 100%);
    margin-top: 60px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.foot-mark {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: var(--midnight-surface);
    text-shadow:
        0 1px 0 rgba(200, 216, 240, 0.08),
        0 -1px 0 rgba(0, 0, 0, 0.6);
}

.foot-line {
    font-family: var(--font-label);
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    color: var(--reflected-sky);
}

.foot-led {
    display: inline-flex;
    align-items: center;
}

/* ----- Responsive ----- */
@media (max-width: 860px) {
    .chapter { padding: 80px 24px 100px; }
    .card { padding: 40px 28px 46px; }
    .craft-grid { grid-template-columns: 1fr; gap: 20px; }
    .pill-nav { right: 14px; padding: 10px 8px; }
    .nav-dot { width: 10px; height: 10px; }
    .instrument-card { width: 100%; }
    .instrument-card[data-offset="right"],
    .instrument-card[data-offset="left"] { align-self: center; }
    .circuit-garnish { display: none; }
    .hero-meta { gap: 10px; padding: 10px 16px; }
    .meta-chip { font-size: 0.62rem; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .dial-row { gap: 22px; }
}

@media (max-width: 520px) {
    .dial { width: 68px; height: 68px; }
    .dial-needle { height: 24px; }
    .swatch-rail { grid-template-columns: 1fr 1fr; }
    .hero-meta { flex-direction: column; }
    .meta-divider { width: 32px; height: 1px; }
}
