:root {
    /* Design vocabulary: reads "est. prototype" "// imperfection" texture from returns (Google Interactions (3% IntersectionObserver threshold. rootMargin IntersectionObserver-triggered fade animations — elements slide from unpredictable directions (not uniformly from (#0B1026 | | Primary — darkness | — geometric whose mathematical precision creates productive tension hand-drawn circles letters 'o' 'p' ("imperfection intention" */
    --deep-space: #0B1026;
    --midnight-canvas: #111B33;
    --indigo-shadow: #1A2744;
    --silver-graphite: #C8D0E0;
    --lavender-mist: #8B95AD;
    --deep-slate: #505A72;
    --amber-spark: #D4944C;
    --ember-glow: #B87333;
    --kintsugi-gold: #C9A84C;
    --display: "Space Grotesk", system-ui, sans-serif;
    --body: "DM Sans", system-ui, sans-serif;
    --mono: "IBM Plex Mono", monospace;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--deep-space);
    color: var(--lavender-mist);
    font-family: var(--body);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

.narrative { width: 100%; }
.panel {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.panel-workshop, .panel-artifacts, .panel-signature { background: var(--deep-space); }
.panel-philosophy, .panel-blueprint { background: var(--midnight-canvas); }

.grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 360 360' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' seed='18'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    z-index: 1;
}
.grain.stronger { opacity: 0.56; }

h1, h2, h3 {
    margin: 0;
    font-family: var(--display);
    color: var(--silver-graphite);
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.15;
}

h1, .signature-mark h2 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 300; }
h2 { font-size: clamp(2rem, 4.2vw, 3.9rem); }
h3 { font-size: clamp(1.2rem, 2.1vw, 1.65rem); }
p { margin: 0; }
p + p { margin-top: 1.2rem; }
.annotation {
    font-family: var(--mono);
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: var(--deep-slate);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-mark {
    position: absolute;
    left: 38%;
    top: 45%;
    transform: translate(-50%, -50%) rotate(-0.6deg);
    z-index: 3;
}
.hero-mark .annotation { margin: 0 0 0.8rem -1.6rem; }
.hero-trace {
    position: absolute;
    inset: auto -1vw 0 -1vw;
    width: 102vw;
    height: 72vh;
    z-index: 2;
}
.draw-line, .node-path {
    fill: none;
    stroke: var(--indigo-shadow);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.node-path { opacity: 0.45; stroke-width: 1.3; }
.gold-on-view { transition: stroke 1.4s ease; }
.in-view .gold-on-view { stroke: var(--kintsugi-gold); }
.solder-dots path, .component-doodles path, .pin-dots { fill: var(--kintsugi-gold); opacity: 0.78; }
.hero-trace .draw-line { stroke-dasharray: 1680; stroke-dashoffset: 1680; animation: lineBirth 3s ease-out 0.2s forwards; }
@keyframes lineBirth { to { stroke-dashoffset: 0; } }

.panel-philosophy { display: flex; align-items: center; justify-content: flex-end; }
.blueprint-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    z-index: 0;
}
.blueprint-grid path { stroke: var(--indigo-shadow); stroke-width: 1; fill: none; }
.schematic-drift {
    position: absolute;
    left: -6vw;
    top: 50%;
    width: 54vw;
    height: 65vh;
    transform: translateY(-50%);
    opacity: 0.12;
    animation: schematicBreath 8s ease-in-out infinite;
}
@keyframes schematicBreath {
    0%, 100% { transform: translateY(-50%) rotate(-0.5deg); }
    50% { transform: translateY(-50%) rotate(0.5deg); }
}
.sketch-lines path, .wire-lines path {
    fill: none;
    stroke: var(--silver-graphite);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.philosophy-copy {
    width: 42vw;
    max-width: 680px;
    margin-right: 48px;
    padding: 1.4rem 0 1.4rem 3rem;
    position: relative;
    z-index: 2;
}
.philosophy-copy h2, .blueprint-copy h2 { margin: 0.7rem 0 1.5rem; text-transform: lowercase; }

.panel-artifacts { display: flex; align-items: center; }
.cards-wrap {
    width: min(1180px, 92vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5vw;
    perspective: 800px;
}
.artifact-card {
    min-height: 430px;
    padding: clamp(1.4rem, 3vw, 2.6rem);
    background: var(--midnight-canvas);
    border: 1px solid var(--indigo-shadow);
    color: var(--lavender-mist);
    transform-style: preserve-3d;
    transition: transform 0.6s var(--spring), box-shadow 0.4s ease, border-color 0.4s ease;
    will-change: transform;
}
.artifact-card svg { width: 100%; height: 134px; margin-bottom: 2rem; overflow: visible; }
.artifact-card h3 { margin: 0.55rem 0 0.9rem; text-transform: lowercase; }
.artifact-card:hover { border-color: rgba(212, 148, 76, 0.55); box-shadow: 0 24px 80px rgba(11, 16, 38, 0.38), 0 0 34px rgba(212, 148, 76, 0.12); }
.card-one { width: 28%; transform: translateY(0) rotate(-1.5deg); clip-path: polygon(1.8% 0, 98.4% 1.1%, 99% 96.5%, 3.4% 99%, 0 5%); }
.card-two { width: 34%; transform: translateY(-24px) rotate(0.5deg); clip-path: polygon(0 2.3%, 99.3% 0, 97.8% 98%, 2.4% 100%); }
.card-three { width: 26%; transform: translateY(16px) rotate(-0.8deg); clip-path: polygon(1.2% 0, 99% 2.8%, 100% 95.8%, 0 100%, 2% 4%); }
.icon-line { fill: none; stroke: var(--deep-slate); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.35s ease; }
.icon-gold { fill: none; stroke: var(--kintsugi-gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.artifact-card:hover .icon-line { stroke: var(--amber-spark); }
.oscilloscope { animation: waveform 4.8s ease-in-out infinite; }
@keyframes waveform { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.panel-blueprint { min-height: 110vh; }
.wireframe {
    position: absolute;
    left: 8vw;
    top: 50%;
    width: 50vw;
    max-width: 820px;
    transform: translateY(-50%) rotate(-0.7deg);
    z-index: 1;
}
.wire-lines path { stroke: var(--lavender-mist); opacity: 0.72; stroke-width: 1.6; }
.wire-lines .gold-repair { stroke: var(--kintsugi-gold); opacity: 0.95; stroke-width: 2; }
.shape-float {
    float: left;
    width: 55vw;
    height: 82vh;
    shape-outside: polygon(0 10%, 72% 6%, 94% 30%, 89% 72%, 62% 91%, 0 100%);
}
.blueprint-copy {
    position: relative;
    z-index: 3;
    width: min(46vw, 650px);
    padding-top: 28vh;
    margin-left: auto;
    margin-right: 7vw;
}
.fracture {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 4;
    pointer-events: none;
}
.fracture-top { top: 0; }
.fracture-bottom { bottom: 0; }
.fracture-line { stroke: var(--kintsugi-gold); stroke-width: 1.5; opacity: 0.9; }

.panel-signature { display: flex; align-items: center; justify-content: center; }
.signature-mark {
    position: absolute;
    left: 62%;
    top: 55%;
    transform: translate(-50%, -50%) rotate(0.4deg);
    text-align: center;
    z-index: 2;
}
.signature-mark .annotation { margin-top: 1.1rem; }
.imperfect-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(38vw, 430px);
    transform: translate(-50%, -50%);
    overflow: visible;
    animation: circlePulse 6s ease-in-out infinite;
    z-index: -1;
}
.imperfect-circle path { fill: none; stroke: var(--silver-graphite); stroke-width: 1.4; opacity: 0.58; }
.imperfect-circle .circle-repair { stroke: var(--kintsugi-gold); opacity: 0.86; stroke-width: 1.7; }
@keyframes circlePulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.04); } }

.drift-object {
    opacity: 0;
    transition: opacity 0.9s ease, transform 1.05s var(--spring);
}
.drift-object[data-drift="left"] { transform: translate(-24px, 18px) rotate(-1.6deg); }
.drift-object[data-drift="right"] { transform: translate(36px, -12px) rotate(1.2deg); }
.drift-object[data-drift="up"] { transform: translateY(34px) rotate(-1deg); }
.drift-object[data-drift="down"] { transform: translateY(-30px) rotate(1deg); }
.in-view .drift-object, .drift-object.in-view { opacity: 1; }
.panel-workshop.in-view .hero-mark { transform: translate(-50%, -50%) rotate(-0.6deg); }
.panel-philosophy.in-view .philosophy-copy, .panel-blueprint.in-view .blueprint-copy { transform: translate(0, 0) rotate(0); }
.panel-artifacts.in-view .card-one { transform: translateY(0) rotate(-1.5deg); }
.panel-artifacts.in-view .card-two { transform: translateY(-24px) rotate(0.5deg); }
.panel-artifacts.in-view .card-three { transform: translateY(16px) rotate(-0.8deg); }
.panel-signature.in-view .signature-mark { transform: translate(-50%, -50%) rotate(0.4deg); }

.draw-prep { stroke-dasharray: var(--dash); stroke-dashoffset: var(--dash); }
.draw-active { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s ease-out; }
.wire-lines .draw-prep { transition: none; }

@media (max-width: 900px) {
    .hero-mark, .signature-mark { left: 50%; }
    .philosophy-copy, .blueprint-copy { width: 84vw; margin: 0 auto; padding: 0; }
    .schematic-drift { width: 100vw; left: -20vw; opacity: 0.06; }
    .cards-wrap { flex-direction: column; padding: 7rem 0; }
    .artifact-card, .card-one, .card-two, .card-three { width: min(520px, 88vw); min-height: auto; }
    .wireframe { position: relative; left: 5vw; top: auto; width: 88vw; transform: none; margin-top: 7rem; }
    .shape-float { display: none; }
    .panel-blueprint { min-height: auto; padding-bottom: 7rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .drift-object { opacity: 1; transform: none !important; }
}
