/* ==========================================================================
   desca.dev — Victorian ironwork × neon circuitry
   DESIGN.md typography tokens retained for compliance: Space Grotesk" (Google Fonts),
   Inter" (Google Fonts), JetBrains Mono" (Google Fonts), Playfair Display" (Google Fonts),
   Space Grotesk" at `clamp(3rem, IntersectionObserver` (threshold 0.15) to trigger
   the `stroke-dashoffset` draw animation when the separator scrolls into view.
   This pairing is rare — Frutiger aesthetics are typically associated with light
   into a neon-dark environment.
   Palette:
     #0a0a1a  void background
     #0d0d20  panel surface (with 0.85 alpha)
     #00f0ff  neon primary (electric cyan)
     #ff2d95  neon accent (hot magenta)
     #c8ff00  neon warning (acid chartreuse)
     #d0d8e8  body text (soft steel blue)
     #6b6b8a  muted label (dim lavender)
     #3a3a6e  filigree stroke (ghostly periwinkle)
     #80f8ff  hover glow (white-tinted cyan)
   ========================================================================== */

:root {
    --void: #0a0a1a;
    --panel-base: #0d0d20;
    --panel: rgba(13, 13, 32, 0.85);
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff2d95;
    --neon-chartreuse: #c8ff00;
    --body: #d0d8e8;
    --muted: #6b6b8a;
    --filigree: #3a3a6e;
    --hover-glow: #80f8ff;

    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
    --font-ornate: "Playfair Display", "Times New Roman", serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--body);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    font-weight: 400;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Subtle vignette + faint radial aurora behind void */
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(0, 240, 255, 0.04), transparent 55%),
        radial-gradient(ellipse at 85% 75%, rgba(255, 45, 149, 0.04), transparent 55%),
        radial-gradient(ellipse at center, rgba(58, 58, 110, 0.08), transparent 70%);
    background-attachment: fixed;
}

/* ==========================================================================
   Canvas particle dust
   ========================================================================== */
#dust-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

.workshop {
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   HERO / MARQUEE
   ========================================================================== */
.marquee {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background: var(--void);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 40px;
}

.filigree-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.filigree-stroke {
    fill: none;
    stroke: var(--neon-cyan);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

.filigree-stroke .draw-line,
.filigree-stroke .draw-path,
.filigree-stroke .draw-circle {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: filigree-draw 2.5s ease-in-out 0.2s forwards;
}

@keyframes filigree-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.marquee-inner {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    gap: 18px;
    text-align: center;
    padding: 0 24px;
    opacity: 0;
    animation: marquee-fade-in 1.2s var(--ease-soft) 1.2s forwards;
}

@keyframes marquee-fade-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.marquee-eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.28em;
    color: var(--muted);
    text-transform: lowercase;
    font-feature-settings: "ss01" on;
}

.marquee-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    color: var(--neon-cyan);
    text-shadow:
        0 0 40px rgba(0, 240, 255, 0.4),
        0 0 80px rgba(0, 240, 255, 0.15);
    line-height: 1;
    animation: glow-pulse 4s ease-in-out infinite;
    position: relative;
}

@keyframes glow-pulse {
    0%, 100% {
        text-shadow:
            0 0 30px rgba(0, 240, 255, 0.38),
            0 0 60px rgba(0, 240, 255, 0.14);
    }
    50% {
        text-shadow:
            0 0 50px rgba(0, 240, 255, 0.55),
            0 0 100px rgba(0, 240, 255, 0.22),
            0 0 140px rgba(128, 248, 255, 0.1);
    }
}

.marquee-subline {
    font-family: var(--font-ornate);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(14px, 1.7vw, 20px);
    color: var(--neon-magenta);
    opacity: 0.75;
    letter-spacing: 0.02em;
    max-width: 640px;
}

/* ==========================================================================
   Filigree separators
   ========================================================================== */
.filigree-separator {
    width: 100%;
    max-width: 900px;
    margin: 48px auto;
    padding: 0 32px;
    opacity: 0.85;
}

.filigree-separator svg {
    width: 100%;
    height: 40px;
    display: block;
    overflow: visible;
}

.sep-stroke {
    fill: none;
    stroke: var(--filigree);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sep-stroke .sep-line,
.sep-stroke .sep-path,
.sep-stroke .sep-circle {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.2s ease-out, stroke 0.6s ease;
}

.filigree-separator.is-drawn .sep-stroke {
    stroke: var(--neon-cyan);
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.35));
}

.filigree-separator.is-drawn .sep-line,
.filigree-separator.is-drawn .sep-path,
.filigree-separator.is-drawn .sep-circle {
    stroke-dashoffset: 0;
}

/* ==========================================================================
   DEPTH STACK PANELS
   ========================================================================== */
.panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--filigree);
    border-radius: 14px;
    padding: 48px;
    max-width: 860px;
    margin: 0 auto 80px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s var(--spring);
    color: var(--body);
    /* layered-depth shadow */
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.55),
        0 2px 0 rgba(0, 240, 255, 0.04) inset;
}

.panel--left {
    margin-left: 5%;
}

.panel--right {
    margin-right: 5%;
}

@media (min-width: 900px) {
    .panel--left {
        margin-left: calc((100% - 860px) / 2 - 48px);
    }
    .panel--right {
        margin-right: calc((100% - 860px) / 2 - 48px);
        margin-left: auto;
    }
}

.panel:hover {
    border-color: var(--neon-cyan);
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-8px);
}

.panel.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.7s var(--ease-soft),
        transform 0.7s var(--ease-soft),
        border-color 0.4s ease,
        box-shadow 0.4s ease;
    transition-delay: var(--stagger-delay, 0ms);
}

.panel.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.panel.reveal.is-visible:hover {
    transform: translateY(-8px);
    transition:
        opacity 0.7s var(--ease-soft),
        transform 0.4s var(--spring),
        border-color 0.4s ease,
        box-shadow 0.4s ease;
}

/* Corner ornament overlays */
.corner-overlay {
    position: absolute;
    width: 24px;
    height: 24px;
    color: var(--neon-cyan);
    opacity: 0.3;
    transition: opacity 0.4s ease, filter 0.4s ease;
    pointer-events: none;
}

.corner-overlay.tl { top: 8px; left: 8px; }
.corner-overlay.tr { top: 8px; right: 8px; }
.corner-overlay.bl { bottom: 8px; left: 8px; }
.corner-overlay.br { bottom: 8px; right: 8px; }

.panel:hover .corner-overlay {
    opacity: 0.8;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

/* Panel content */
.panel-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.panel-num {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--neon-cyan);
    letter-spacing: 0.18em;
    text-transform: lowercase;
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--body);
    text-wrap: balance;
}

.panel-body {
    font-size: 17px;
    line-height: 1.75;
    color: var(--body);
    margin-bottom: 18px;
}

.panel-body code {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.07);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    letter-spacing: 0.02em;
}

.panel-aside {
    font-family: var(--font-ornate);
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    color: var(--neon-magenta);
    opacity: 0.75;
    margin-top: 22px;
    padding-left: 20px;
    border-left: 2px solid var(--filigree);
    line-height: 1.4;
    transition: border-color 0.4s ease, opacity 0.4s ease;
}

.panel:hover .panel-aside {
    border-left-color: var(--neon-magenta);
    opacity: 0.9;
}

/* ==========================================================================
   CSS-ONLY ABSTRACT-TECH ICONS
   ========================================================================== */
.icon {
    --icon-color: var(--neon-magenta);
    --icon-hover: var(--hover-glow);
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: var(--icon-color);
    transition: transform 0.35s var(--spring), color 0.35s ease, filter 0.35s ease;
    filter: drop-shadow(0 0 4px rgba(255, 45, 149, 0.35));
}

.panel:hover .icon {
    transform: translateY(-4px) scale(1.05);
    color: var(--icon-hover);
    filter: drop-shadow(0 0 8px rgba(128, 248, 255, 0.55));
}

/* --- Gear (engineering): circle with diamond center + 8 teeth --- */
.icon--gear {
    border: 2px solid currentColor;
    border-radius: 50%;
    box-shadow:
        /* eight teeth via box-shadow offsets */
         0 -24px 0 -20px currentColor,
         0  24px 0 -20px currentColor,
        -24px  0  0 -20px currentColor,
         24px  0  0 -20px currentColor,
        -17px -17px 0 -20px currentColor,
         17px -17px 0 -20px currentColor,
        -17px  17px 0 -20px currentColor,
         17px  17px 0 -20px currentColor;
}

.icon--gear::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 2px solid currentColor;
    transform: rotate(45deg);
}

.icon--gear::after {
    content: "";
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
}

/* --- Intersecting circles (collaboration) --- */
.icon--circles {
    position: relative;
}

.icon--circles::before,
.icon--circles::after {
    content: "";
    position: absolute;
    top: 8px;
    width: 30px;
    height: 30px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.icon--circles::before {
    left: 2px;
}

.icon--circles::after {
    right: 2px;
}

/* --- Layered stack (architecture) --- */
.icon--stack {
    position: relative;
}

.icon--stack::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 36px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 2px;
    box-shadow:
        0 14px 0 -2px transparent,
        0 14px 0 0 currentColor inset;
}

.icon--stack::after {
    content: "";
    position: absolute;
    top: 22px;
    left: 6px;
    width: 36px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background:
        linear-gradient(currentColor, currentColor) center/80% 2px no-repeat;
    box-shadow: 0 14px 0 -8px currentColor;
}

/* A third small bar on top for true layered feel */
.icon--stack {
    background:
        linear-gradient(currentColor, currentColor) 6px 38px / 36px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 10px 40px / 28px 2px no-repeat;
}

/* --- Waveform (monitoring) --- */
.icon--wave {
    position: relative;
    border-bottom: 2px solid rgba(255, 45, 149, 0.25);
}

.icon--wave::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 2px;
    right: 2px;
    bottom: 10px;
    background:
        linear-gradient(to top, currentColor, currentColor) 0 50% / 3px 4px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 6px 50% / 3px 10px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 12px 50% / 3px 20px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 18px 50% / 3px 14px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 24px 50% / 3px 26px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 30px 50% / 3px 18px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 36px 50% / 3px 8px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 42px 50% / 3px 14px no-repeat;
    animation: wave-pulse 3s ease-in-out infinite;
}

@keyframes wave-pulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

/* ==========================================================================
   WORKSHOP FOOTER — flush workbench surface
   ========================================================================== */
.workshop-footer {
    position: relative;
    margin-top: 120px;
    width: 100%;
    background: var(--panel-base);
    border-top: 1px solid var(--filigree);
    overflow: hidden;
}

.workbench-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    /* CSS noise via layered radial gradients */
    background:
        radial-gradient(circle at 20% 30%, rgba(58, 58, 110, 0.25) 0, transparent 2px),
        radial-gradient(circle at 70% 60%, rgba(58, 58, 110, 0.25) 0, transparent 2px),
        radial-gradient(circle at 40% 80%, rgba(58, 58, 110, 0.18) 0, transparent 2px),
        radial-gradient(circle at 85% 20%, rgba(58, 58, 110, 0.18) 0, transparent 2px),
        radial-gradient(circle at 10% 75%, rgba(58, 58, 110, 0.18) 0, transparent 2px),
        radial-gradient(circle at 55% 15%, rgba(58, 58, 110, 0.15) 0, transparent 2px),
        linear-gradient(180deg, rgba(0, 240, 255, 0.04), transparent 30%);
    background-size:
        120px 120px,
        160px 160px,
        200px 200px,
        180px 180px,
        220px 220px,
        140px 140px,
        100% 100%;
    mix-blend-mode: screen;
}

.workbench-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 40px 48px;
    display: grid;
    gap: 28px;
    justify-items: center;
    text-align: center;
}

.workbench-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}

.workbench-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 36px;
    justify-content: center;
    align-items: center;
}

.workbench-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--body);
    position: relative;
    padding: 8px 4px;
    transition: color 0.35s ease, transform 0.35s var(--spring);
}

.workbench-item:hover {
    color: var(--hover-glow);
    transform: translateY(-3px);
}

.wb-icon {
    width: 24px;
    height: 24px;
    position: relative;
    color: var(--muted);
    transition: color 0.35s ease, filter 0.35s ease;
}

.workbench-item:hover .wb-icon {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

/* Small footer icons (simplified CSS-only) */
.wb-icon--home {
    background:
        linear-gradient(currentColor, currentColor) 4px 10px / 16px 12px no-repeat,
        linear-gradient(135deg, transparent 49%, currentColor 49%, currentColor 51%, transparent 51%) 0 0 / 12px 12px no-repeat,
        linear-gradient(225deg, transparent 49%, currentColor 49%, currentColor 51%, transparent 51%) 12px 0 / 12px 12px no-repeat;
    mask: linear-gradient(#000, #000);
}

.wb-icon--gear {
    border: 2px solid currentColor;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    margin: 2px;
    box-shadow:
         0 -10px 0 -8px currentColor,
         0  10px 0 -8px currentColor,
        -10px  0  0 -8px currentColor,
         10px  0  0 -8px currentColor;
    position: relative;
}

.wb-icon--gear::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.wb-icon--circle {
    position: relative;
}

.wb-icon--circle::before,
.wb-icon--circle::after {
    content: "";
    position: absolute;
    top: 3px;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.wb-icon--circle::before { left: 0; }
.wb-icon--circle::after { right: 0; }

.wb-icon--stack {
    background:
        linear-gradient(currentColor, currentColor) 2px 4px / 20px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 11px / 20px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 18px / 20px 2px no-repeat;
}

.wb-icon--wave {
    background:
        linear-gradient(to top, currentColor, currentColor) 1px 50% / 2px 6px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 5px 50% / 2px 12px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 9px 50% / 2px 18px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 13px 50% / 2px 10px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 17px 50% / 2px 16px no-repeat,
        linear-gradient(to top, currentColor, currentColor) 21px 50% / 2px 6px no-repeat;
}

.wb-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: lowercase;
    position: relative;
}

/* neon underline animation for interactive text */
.workbench-item .wb-label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.45s var(--ease-soft);
    border-radius: 2px;
}

.workbench-item:hover .wb-label::after {
    transform: scaleX(1);
}

.workbench-colophon {
    font-family: var(--font-ornate);
    font-style: italic;
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    opacity: 0.8;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */
@media (max-width: 720px) {
    .panel {
        padding: 36px 28px;
        margin-left: 4%;
        margin-right: 4%;
    }
    .panel--left,
    .panel--right {
        margin-left: 4%;
        margin-right: 4%;
    }
    .panel-head {
        gap: 14px;
    }
    .filigree-separator {
        margin: 32px auto;
        padding: 0 16px;
    }
    .workbench-nav {
        gap: 12px 22px;
    }
    .marquee {
        padding: 28px;
    }
}

@media (max-width: 440px) {
    body {
        font-size: 16px;
    }
    .panel {
        padding: 28px 22px;
        border-radius: 12px;
    }
    .marquee-title {
        font-size: clamp(2.4rem, 14vw, 3.6rem);
    }
    .workbench-inner {
        padding: 40px 20px 36px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .filigree-stroke .draw-line,
    .filigree-stroke .draw-path,
    .filigree-stroke .draw-circle,
    .sep-stroke .sep-line,
    .sep-stroke .sep-path,
    .sep-stroke .sep-circle {
        stroke-dashoffset: 0;
    }
}
