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

:root {
    --bg: #07131a;
    --bg-soft: #0f1f29;
    --panel: rgba(15, 31, 41, 0.78);
    --panel-border: rgba(126, 168, 187, 0.24);
    --text: #ecf6f4;
    --muted: #9bb8bd;
    --primary: #31b89f;
    --primary-soft: rgba(49, 184, 159, 0.18);
    --accent: #ff9f5a;
    --accent-soft: rgba(255, 159, 90, 0.16);
    --inf-color: #53b7de;
    --inf-soft: rgba(83, 183, 222, 0.15);
    --dsc-color: #44c4a6;
    --dsc-soft: rgba(68, 196, 166, 0.15);
    --fdf-color: #ff9f5a;
    --fdf-soft: rgba(255, 159, 90, 0.15);
    --mono: 'JetBrains Mono', 'Consolas', monospace;
    --head: 'Space Grotesk', 'Segoe UI', sans-serif;
    --body: 'Manrope', 'Segoe UI', sans-serif;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at 12% 10%, #123041 0%, transparent 35%),
        radial-gradient(circle at 90% 15%, #3f2536 0%, transparent 34%),
        linear-gradient(165deg, #060f15 0%, #08151d 45%, #07131a 100%);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.6;
}

.bg-orb {
    position: fixed;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}

.orb-a {
    top: -48px;
    left: -70px;
    background: #38c4a2;
}

.orb-b {
    right: -70px;
    bottom: -96px;
    background: #ff9054;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(7, 18, 25, 0.78);
    border-bottom: 1px solid rgba(126, 168, 187, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.45rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
    font-family: var(--head);
    min-width: 0;
}

.brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.87rem;
    white-space: nowrap;
}

.back-link:hover {
    color: var(--text);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    border-color: rgba(49, 184, 159, 0.45);
    background: rgba(49, 184, 159, 0.18);
}

.lang-switcher {
    display: flex;
    gap: 0.45rem;
}

.lang-btn {
    border: 1px solid rgba(126, 168, 187, 0.34);
    color: var(--muted);
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.34rem 0.64rem;
    cursor: pointer;
    font-weight: 600;
}

.lang-btn.active,
.lang-btn:hover {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(49, 184, 159, 0.18);
}

.page {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.4rem;
}

.section {
    margin-bottom: 1.35rem;
    scroll-margin-top: 86px;
}

.hero {
    padding: 1.4rem 1.3rem 1.1rem;
}

.eyebrow {
    display: inline-block;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.77rem;
    font-weight: 700;
    margin-bottom: 0.72rem;
}

h1,
.section h2,
.section h3 {
    font-family: var(--head);
    line-height: 1.25;
}

.hero h1 {
    font-size: clamp(1.6rem, 2.3vw, 2.5rem);
    max-width: 24ch;
}

.hero-desc {
    margin-top: 0.95rem;
    color: var(--muted);
    max-width: 72ch;
}

/* ── File Cards (Hero) ── */
.file-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.file-card {
    background: linear-gradient(155deg, rgba(17, 36, 46, 0.9), rgba(10, 23, 31, 0.92));
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.52rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.file-card.inf { border-color: rgba(83, 183, 222, 0.38); box-shadow: inset 0 0 0 1px rgba(83, 183, 222, 0.12); }
.file-card.dsc { border-color: rgba(68, 196, 166, 0.38); box-shadow: inset 0 0 0 1px rgba(68, 196, 166, 0.12); }
.file-card.fdf { border-color: rgba(255, 159, 90, 0.38);  box-shadow: inset 0 0 0 1px rgba(255, 159, 90, 0.12); }

.file-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.file-ext {
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(126, 168, 187, 0.4);
    color: #c8e0e5;
}

.file-card.inf .file-ext { color: var(--inf-color); border-color: rgba(83, 183, 222, 0.5); }
.file-card.dsc .file-ext { color: var(--dsc-color); border-color: rgba(68, 196, 166, 0.5); }
.file-card.fdf .file-ext { color: var(--fdf-color); border-color: rgba(255, 159, 90, 0.5); }

.file-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(126, 168, 187, 0.12);
    color: var(--muted);
}

.inf-badge { background: var(--inf-soft); color: var(--inf-color); }
.dsc-badge { background: var(--dsc-soft); color: var(--dsc-color); }
.fdf-badge { background: var(--fdf-soft); color: var(--fdf-color); }

.file-card h2 {
    font-size: 1rem;
    color: var(--text);
    margin-top: 0.1rem;
}

.file-card p {
    color: var(--muted);
    font-size: 0.88rem;
    flex: 1;
}

.track-btn {
    margin-top: 0.3rem;
    background: transparent;
    border: 1px solid rgba(126, 168, 187, 0.35);
    border-radius: 8px;
    color: var(--muted);
    padding: 0.44rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: 0.2s ease;
    font-family: var(--body);
}

.file-card.inf .track-btn:hover { color: var(--inf-color); border-color: var(--inf-color); background: var(--inf-soft); }
.file-card.dsc .track-btn:hover { color: var(--dsc-color); border-color: var(--dsc-color); background: var(--dsc-soft); }
.file-card.fdf .track-btn:hover { color: var(--fdf-color); border-color: var(--fdf-color); background: var(--fdf-soft); }

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 1rem;
}

.section-head h2 {
    font-size: clamp(1.24rem, 1.8vw, 1.75rem);
}

.section-head p {
    margin-top: 0.38rem;
    color: var(--muted);
}

/* ── Pipeline Section ── */
.pipeline-layout {
    margin-top: 0.9rem;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
    align-items: start;
}

.pipeline-diagram-wrap {
    border: 1px solid rgba(126, 168, 187, 0.36);
    background: rgba(6, 14, 20, 0.72);
    border-radius: 14px;
    padding: 0.5rem 0.5rem 0.2rem;
    overflow-x: auto;
}

.pipeline-hint {
    color: var(--muted);
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem 0.4rem;
    opacity: 0.7;
}

#pipeline-svg {
    min-width: 900px;
    width: 100%;
    display: block;
}

/* SVG pipeline node styles */
.pnode-rect {
    fill: rgba(22, 44, 58, 0.88);
    stroke: rgba(126, 168, 187, 0.5);
    stroke-width: 1.5;
    cursor: pointer;
    transition: stroke 0.15s, fill 0.15s;
}

.pnode-rect:hover,
.pnode-rect.active {
    fill: rgba(30, 60, 78, 0.95);
    stroke: var(--primary);
    stroke-width: 2;
}

.pnode-text {
    text-anchor: middle;
    fill: #d8ecef;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.pnode-sub {
    text-anchor: middle;
    fill: #7ab4bc;
    font-size: 9px;
    pointer-events: none;
}

.p-arrow {
    stroke: rgba(126, 168, 187, 0.42);
    stroke-width: 1.6;
    fill: none;
}

.p-stage-bg {
    fill: rgba(10, 25, 35, 0.55);
    stroke: rgba(126, 168, 187, 0.18);
    stroke-width: 1;
    rx: 10;
}

.p-stage-label {
    fill: #6abcb8;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-anchor: middle;
}

.p-endpoint-rect {
    fill: rgba(10, 25, 35, 0.7);
    stroke: rgba(126, 168, 187, 0.4);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.p-endpoint-text {
    text-anchor: middle;
    fill: #9bb8bd;
    font-size: 11px;
    font-weight: 600;
}

/* pipeline node color variants */
.pnode-autogen .pnode-rect { stroke: rgba(75, 202, 198, 0.55); }
.pnode-autogen .pnode-rect:hover,
.pnode-autogen .pnode-rect.active { stroke: #4bcac6; fill: rgba(65, 180, 178, 0.2); }

.pnode-make .pnode-rect { stroke: rgba(126, 160, 234, 0.55); }
.pnode-make .pnode-rect:hover,
.pnode-make .pnode-rect.active { stroke: #7ea0ea; fill: rgba(88, 122, 204, 0.2); }

.pnode-imagegen .pnode-rect { stroke: rgba(255, 159, 90, 0.55); }
.pnode-imagegen .pnode-rect:hover,
.pnode-imagegen .pnode-rect.active { stroke: var(--fdf-color); fill: rgba(255, 159, 90, 0.18); }

/* Pipeline Detail Panel */
.pipeline-detail {
    border: 1px solid rgba(126, 168, 187, 0.32);
    background: rgba(6, 14, 20, 0.72);
    border-radius: 14px;
    padding: 0.9rem;
    position: sticky;
    top: 80px;
}

.detail-title {
    font-size: 0.9rem;
    color: #8ddbc8;
    margin-bottom: 0.6rem;
    font-family: var(--head);
}

.detail-placeholder {
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1rem 0;
    opacity: 0.7;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.detail-name {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.3rem 0.5rem;
    background: rgba(49, 184, 159, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(49, 184, 159, 0.3);
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.detail-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.detail-text {
    font-size: 0.83rem;
    color: var(--muted);
    line-height: 1.5;
}

.detail-mono {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: #b4d8d8;
}

/* ── Journey Tabs ── */
.journey-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.journey-tab {
    background: transparent;
    border: 1px solid rgba(126, 168, 187, 0.34);
    color: var(--muted);
    border-radius: 8px;
    padding: 0.46rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--mono);
    font-size: 0.88rem;
    transition: 0.18s ease;
}

.journey-tab:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.journey-tab.active[data-tab="inf"] {
    color: var(--inf-color);
    border-color: var(--inf-color);
    background: var(--inf-soft);
}

.journey-tab.active[data-tab="dsc"] {
    color: var(--dsc-color);
    border-color: var(--dsc-color);
    background: var(--dsc-soft);
}

.journey-tab.active[data-tab="fdf"] {
    color: var(--fdf-color);
    border-color: var(--fdf-color);
    background: var(--fdf-soft);
}

/* ── Journey Timeline ── */
.journey-content {
    margin-top: 0.9rem;
}

.journey-timeline-title {
    font-size: 0.95rem;
    color: #aef0dc;
    margin-bottom: 1rem;
    font-family: var(--head);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.timeline-step {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 0 0.8rem;
    position: relative;
}

.timeline-step:not(:last-child) .step-line {
    display: block;
}

.step-number-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: var(--mono);
    flex-shrink: 0;
    border: 2px solid rgba(126, 168, 187, 0.4);
    background: rgba(10, 24, 33, 0.9);
    color: var(--muted);
    z-index: 1;
}

.timeline-step[data-file="inf"] .step-number { border-color: var(--inf-color); color: var(--inf-color); background: var(--inf-soft); }
.timeline-step[data-file="dsc"] .step-number { border-color: var(--dsc-color); color: var(--dsc-color); background: var(--dsc-soft); }
.timeline-step[data-file="fdf"] .step-number { border-color: var(--fdf-color); color: var(--fdf-color); background: var(--fdf-soft); }

.step-line {
    flex: 1;
    width: 2px;
    background: rgba(126, 168, 187, 0.22);
    margin: 2px 0;
    min-height: 20px;
}

.step-body {
    padding-bottom: 1.1rem;
    padding-top: 0.3rem;
}

.step-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.step-title {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--head);
}

.step-program {
    font-family: var(--mono);
    font-size: 0.74rem;
    padding: 0.14rem 0.44rem;
    border-radius: 5px;
    font-weight: 600;
    white-space: nowrap;
}

.timeline-step[data-file="inf"] .step-program { background: var(--inf-soft); color: var(--inf-color); border: 1px solid rgba(83, 183, 222, 0.3); }
.timeline-step[data-file="dsc"] .step-program { background: var(--dsc-soft); color: var(--dsc-color); border: 1px solid rgba(68, 196, 166, 0.3); }
.timeline-step[data-file="fdf"] .step-program { background: var(--fdf-soft); color: var(--fdf-color); border: 1px solid rgba(255, 159, 90, 0.3); }

.step-desc {
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 0.36rem;
}

.step-artifact {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--mono);
    font-size: 0.76rem;
    padding: 0.16rem 0.5rem;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(126, 168, 187, 0.28);
    color: #b4d8d8;
}

.step-artifact::before {
    content: '→';
    opacity: 0.6;
}

.cmd-grid {
    margin-top: 0.86rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.64rem;
}

.cmd-grid label {
    display: grid;
    gap: 0.3rem;
}

.cmd-grid span {
    color: #b4d5d6;
    font-size: 0.86rem;
    font-weight: 600;
}

.cmd-grid input,
.cmd-grid select {
    width: 100%;
    background: rgba(6, 14, 20, 0.76);
    border: 1px solid rgba(126, 168, 187, 0.36);
    border-radius: 8px;
    color: var(--text);
    padding: 0.52rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.86rem;
}

.checkline {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.46rem;
}

.checkline input {
    width: auto;
}

.hidden {
    display: none !important;
}

.command-output {
    margin-top: 0.85rem;
    background: rgba(5, 11, 16, 0.88);
    border: 1px solid rgba(126, 168, 187, 0.36);
    border-radius: 12px;
    padding: 0.72rem;
    font-family: var(--mono);
    color: #d8f4ea;
    white-space: pre-wrap;
    word-break: break-word;
}

.command-notes {
    margin-top: 0.78rem;
    color: var(--muted);
}

.command-notes h3 {
    font-size: 0.95rem;
    color: #9ce5d0;
    margin-bottom: 0.35rem;
}

.command-notes ul {
    padding-left: 1.1rem;
}

.command-notes li {
    margin: 0.22rem 0;
}

.refs-list {
    margin-top: 0.86rem;
    list-style: none;
    display: grid;
    gap: 0.62rem;
}

.refs-list li {
    border: 1px solid rgba(126, 168, 187, 0.28);
    border-radius: 10px;
    padding: 0.62rem 0.74rem;
    background: rgba(6, 14, 20, 0.62);
}

.refs-list a {
    color: #8ce2cb;
    font-weight: 700;
    text-decoration: none;
}

.refs-list a:hover {
    text-decoration: underline;
}

.refs-list p {
    color: var(--muted);
    margin-top: 0.28rem;
    font-size: 0.9rem;
}

.footer {
    text-align: center;
    color: var(--muted);
    border-top: 1px solid rgba(126, 168, 187, 0.24);
    padding: 1rem;
    margin-top: 1.2rem;
}

@media (max-width: 1080px) {
    .pipeline-layout {
        grid-template-columns: 1fr;
    }

    .pipeline-detail {
        position: static;
    }
}

@media (max-width: 980px) {
    .top-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding-inline: 0.2rem;
    }
}

@media (max-width: 720px) {
    .page {
        padding: 0.7rem;
    }

    .panel {
        padding: 0.8rem;
    }

    .hero h1 {
        max-width: none;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }

    .cmd-grid {
        grid-template-columns: 1fr;
    }

    .timeline-step {
        grid-template-columns: 38px 1fr;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
