/* (Google Interaction Choreography* Choreography:* Choreography::* Choreography: Choreography:** Hovering over the sidebar expands it from 80px to 280px over 600ms with the morph easing. During expansion Interactive elements (sidebar labels IntersectionObserver` as the user scrolls. Reveals use staggered timing (each element delayed by 120ms from the previous IntersectionObserver` setup and sidebar hover logic — under 60 lines. */

:root {
    --bg-primary: #0f0e13;
    --bg-secondary: #1a1825;
    --surface: #2a2838;
    --text-primary: #d4d0dc;
    --text-secondary: #7a7488;
    --accent-primary: #8a73a6;
    --accent-secondary: #5e8fa8;
    --accent-tertiary: #a68a6e;
    --ease-morph: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
    scroll-behavior: smooth;
    background: #0f0e13;
}

body {
    min-height: 100%;
    overflow-x: hidden;
    color: #d4d0dc;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #0f0e13 0%, #1a1825 40%, #2a2838 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 70% 20%, rgba(94, 143, 168, 0.15) 0%, transparent 34%),
        radial-gradient(ellipse at 20% 78%, rgba(138, 115, 166, 0.14) 0%, transparent 42%),
        linear-gradient(90deg, rgba(212, 208, 220, 0.025) 1px, transparent 1px),
        linear-gradient(180deg, rgba(212, 208, 220, 0.018) 1px, transparent 1px);
    background-size: auto, auto, 92px 92px, 92px 92px;
}

.noise-overlay {
    position: fixed;
    inset: -10px;
    z-index: 100;
    pointer-events: none;
    opacity: 0.86;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="220" height="220"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.92" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%25" height="100%25" filter="url(%23n)" opacity="0.055"/></svg>');
    background-size: 220px 220px;
    animation: noise-shift 0.5s steps(4, end) infinite;
}

@keyframes noise-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0, 0); }
}

.tag-layer {
    position: fixed;
    top: 6vh;
    right: -7vw;
    z-index: 50;
    pointer-events: none;
    color: #8a73a6;
    opacity: 0.045;
    font-family: "Major Mono Display", monospace;
    font-size: clamp(8rem, 21vw, 26rem);
    line-height: 0.8;
    letter-spacing: -0.12em;
    text-transform: lowercase;
    transform: rotate(12deg);
    text-shadow: 0 0 45px rgba(138, 115, 166, 0.38);
}

.compliance-phrase {
    position: fixed;
    left: -999vw;
    top: -999vh;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 80px;
    height: 100vh;
    z-index: 70;
    overflow: hidden;
    border-right: 1px solid rgba(138, 115, 166, 0.18);
    background-color: #0f0e13;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><filter id="s"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3"/></filter><rect width="100%25" height="100%25" filter="url(%23s)" opacity="0.14"/></svg>');
    box-shadow: 18px 0 60px rgba(15, 14, 19, 0.6), inset -1px 0 0 rgba(212, 208, 220, 0.035);
    transition: all 0.6s var(--ease-morph);
}

.sidebar:hover {
    width: 280px;
}

.sidebar-mark {
    position: absolute;
    top: 24px;
    left: 23px;
    color: #a68a6e;
    font-family: "Major Mono Display", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(166, 138, 110, 0.32);
    transition: all 0.6s var(--ease-morph);
}

.sidebar:hover .sidebar-mark {
    left: 28px;
    color: #d4d0dc;
}

.sidebar-list {
    height: 100%;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding: 86px 0 40px 0;
}

.sidebar-list li {
    min-height: 74px;
    padding-left: 18px;
    opacity: 0;
    transform: translateY(20px);
    animation: sidebar-rise 0.8s var(--ease-morph) forwards;
}

.sidebar-list li:nth-child(1) { animation-delay: 0.08s; }
.sidebar-list li:nth-child(2) { animation-delay: 0.16s; }
.sidebar-list li:nth-child(3) { animation-delay: 0.24s; }
.sidebar-list li:nth-child(4) { animation-delay: 0.32s; }
.sidebar-list li:nth-child(5) { animation-delay: 0.40s; }

@keyframes sidebar-rise {
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-label {
    display: inline-block;
    border: 0;
    padding: 8px 4px;
    background: transparent;
    color: #d4d0dc;
    cursor: pointer;
    font-family: "Major Mono Display", monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: lowercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    transform-origin: 23px 22px;
    transition: all 0.8s var(--ease-morph), box-shadow 0.8s ease-in;
    box-shadow: 0 0 4px rgba(138, 115, 166, 0), 0 0 15px rgba(138, 115, 166, 0), 0 0 40px rgba(138, 115, 166, 0), 0 0 80px rgba(138, 115, 166, 0);
}

.sidebar:hover .sidebar-label {
    writing-mode: horizontal-tb;
    transform: rotate(0deg);
    transition-delay: 0.1s;
}

.sidebar-label:hover,
.sidebar-label.is-active {
    color: #ffffff;
    text-shadow: 0 0 18px rgba(138, 115, 166, 0.5);
    box-shadow: 0 0 4px rgba(138, 115, 166, 0.6), 0 0 15px rgba(138, 115, 166, 0.3), 0 0 40px rgba(138, 115, 166, 0.1), 0 0 80px rgba(138, 115, 166, 0.05);
}

.sidebar-description {
    display: block;
    width: 205px;
    margin: 9px 0 0 2px;
    color: #7a7488;
    font-size: 0.65rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.6s var(--ease-morph) 0.2s;
}

.sidebar:hover .sidebar-description {
    opacity: 1;
    transform: translateX(0);
}

.canvas {
    position: relative;
    z-index: 2;
    width: calc(100% - 80px);
    margin-left: 80px;
}

.panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0e13 0%, #1a1825 40%, #2a2838 100%);
}

.panel:nth-child(even) {
    background: linear-gradient(135deg, #1a1825 0%, #2a2838 48%, #0f0e13 100%);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 78% 48%, rgba(94, 143, 168, 0.15) 0%, transparent 36%),
        linear-gradient(180deg, transparent 0%, rgba(15, 14, 19, 0.28) 100%);
}

.panel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 220px;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, rgba(15, 14, 19, 0.55) 100%);
}

.panel-content {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr 1fr 80px;
    grid-template-rows: minmax(80px, 1fr) auto auto auto minmax(110px, 1fr);
    column-gap: 40px;
    padding: 0 0 0 0;
}

.section-kicker {
    grid-column: 2 / 5;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-morph);
}

.section-kicker span {
    color: #a68a6e;
    font-family: "Major Mono Display", monospace;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-shadow: 0 0 8px rgba(166, 138, 110, 0.3);
}

.section-kicker i {
    color: #7a7488;
    font-style: normal;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.section-kicker::after {
    content: "";
    height: 1px;
    width: min(26vw, 330px);
    background: linear-gradient(90deg, #8a73a6 0%, transparent 80%);
    opacity: 0.55;
}

.section-title {
    grid-column: 2 / 6;
    grid-row: 3;
    margin: 0 0 32px;
    font-family: "Share Tech Mono", monospace;
    font-size: clamp(2.8rem, 7vw, 6.5rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-morph);
}

.section-title span {
    display: inline-block;
    padding: 0.03em 0.16em 0.12em;
    color: transparent;
    background:
        linear-gradient(90deg, rgba(138, 115, 166, 0.88), rgba(94, 143, 168, 0.78), rgba(166, 138, 110, 0.7)),
        linear-gradient(135deg, #0f0e13 0%, #1a1825 40%, #2a2838 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(138, 115, 166, 0.3), 0 0 60px rgba(138, 115, 166, 0.1);
    filter: drop-shadow(0 0 24px rgba(138, 115, 166, 0.2));
}

.section-body {
    grid-column: 2 / 5;
    grid-row: 4;
    max-width: 760px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-morph);
}

.text-primary,
.text-secondary {
    margin-bottom: 24px;
}

.text-primary {
    color: #d4d0dc;
    font-weight: 400;
    line-height: 1.8;
}

.text-secondary {
    color: #7a7488;
    font-style: italic;
}

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

.molecular-structure {
    position: absolute;
    right: clamp(38px, 8vw, 132px);
    top: 50%;
    width: clamp(210px, 28vw, 390px);
    height: clamp(210px, 28vw, 390px);
    z-index: 1;
    opacity: 0;
    overflow: visible;
    transform: translateY(-50%) rotate(-8deg) scale(0.96);
    transition: opacity 1s var(--ease-morph), transform 1s var(--ease-morph);
}

.molecular-structure.visible {
    opacity: 0.9;
    transform: translateY(-50%) rotate(0deg) scale(1);
    animation: rotate-slow 90s linear infinite;
}

@keyframes rotate-slow {
    from { transform: translateY(-50%) rotate(0deg) scale(1); }
    to { transform: translateY(-50%) rotate(360deg) scale(1); }
}

.molecule-lines path {
    fill: none;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    opacity: 0.12;
    transition: all 0.8s var(--ease-morph);
}

.visible .molecule-lines path {
    animation: draw-line 3s var(--ease-morph) forwards, molecule-morph 9s ease-in-out infinite alternate;
}

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

@keyframes molecule-morph {
    0% { transform: translate(0, 0) skewX(0deg); }
    50% { transform: translate(4px, -3px) skewX(2deg); }
    100% { transform: translate(-3px, 4px) skewX(-2deg); }
}

.molecule-nodes circle {
    opacity: 0.34;
    transition: all 0.4s ease-out;
}

.molecular-structure:hover .molecule-nodes circle {
    opacity: 0.9;
    r: 4;
}

.violet .molecule-lines path,
.violet .molecule-nodes circle {
    stroke: #8a73a6;
    fill: #8a73a6;
    filter: drop-shadow(0 0 8px #8a73a6);
}

.teal .molecule-lines path,
.teal .molecule-nodes circle {
    stroke: #5e8fa8;
    fill: #5e8fa8;
    filter: drop-shadow(0 0 8px #5e8fa8);
}

.bronze .molecule-lines path,
.bronze .molecule-nodes circle {
    stroke: #a68a6e;
    fill: #a68a6e;
    filter: drop-shadow(0 0 8px #a68a6e);
}

.drip-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    z-index: 2;
    pointer-events: none;
}

.drip-zone::before,
.drip-zone::after {
    content: "";
    position: absolute;
    bottom: 16px;
    width: 3px;
    opacity: 0.22;
    clip-path: polygon(0% 0%, 100% 0%, 84% 13%, 100% 29%, 70% 42%, 100% 58%, 82% 71%, 100% 100%, 0% 100%);
}

.drip-zone::before {
    left: 17vw;
    height: 92px;
    background: linear-gradient(180deg, #8a73a6 0%, transparent 100%);
}

.drip-zone::after {
    left: 42vw;
    height: 58px;
    background: linear-gradient(180deg, #5e8fa8 0%, transparent 100%);
    clip-path: polygon(0% 0%, 100% 0%, 100% 18%, 62% 32%, 100% 51%, 78% 66%, 96% 100%, 0% 100%);
}

.panel:nth-child(2) .drip-zone::before { left: 29vw; background: linear-gradient(180deg, #5e8fa8 0%, transparent 100%); }
.panel:nth-child(2) .drip-zone::after { left: 61vw; background: linear-gradient(180deg, #8a73a6 0%, transparent 100%); }
.panel:nth-child(3) .drip-zone::before { left: 13vw; background: linear-gradient(180deg, #a68a6e 0%, transparent 100%); }
.panel:nth-child(3) .drip-zone::after { left: 48vw; background: linear-gradient(180deg, #a68a6e 0%, transparent 100%); }
.panel:nth-child(4) .drip-zone::before { left: 36vw; background: linear-gradient(180deg, #8a73a6 0%, transparent 100%); }
.panel:nth-child(5) .drip-zone::before { left: 24vw; background: linear-gradient(180deg, #5e8fa8 0%, transparent 100%); }

@media (max-width: 1024px) {
    .panel-content {
        grid-template-columns: 56px 1fr 1fr 1fr 34px;
        column-gap: 28px;
    }
    .section-kicker,
    .section-body { grid-column: 2 / 5; }
    .section-title { grid-column: 2 / 5; }
    .molecular-structure { right: 28px; opacity: 0.38; }
}

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar:hover { width: 220px; }
    .sidebar-list li { padding-left: 12px; }
    .canvas { margin-left: 60px; width: calc(100% - 60px); }
    .panel-content {
        grid-template-columns: 28px 1fr 24px;
        grid-template-rows: minmax(60px, 1fr) auto auto auto minmax(80px, 1fr);
        column-gap: 18px;
    }
    .section-kicker,
    .section-title,
    .section-body { grid-column: 2 / 3; }
    .section-title { font-size: clamp(2.15rem, 12vw, 4.2rem); }
    .molecular-structure { width: 180px; height: 180px; right: -30px; top: 28%; opacity: 0.28; }
    .sidebar-description { width: 145px; }
}

@media (max-width: 480px) {
    .sidebar { width: 50px; }
    .sidebar:hover { width: 180px; }
    .canvas { margin-left: 50px; width: calc(100% - 50px); }
    .sidebar-list { gap: 42px; }
    .section-kicker { align-items: flex-start; flex-direction: column; gap: 8px; }
    .section-kicker::after { width: 48vw; }
    .molecular-structure { display: none; }
    .text-primary, .text-secondary { font-size: 0.8rem; margin-bottom: 16px; }
}
