:root {
    --bg: #050505;
    --surface: #0A0A0B;
    --panel: #111113;
    --border: #1F1F22;
    --border-strong: #2A2A2E;
    --text-pri: #FFFFFF;
    --text-sec: #A1A1AA;
    --accent: #CCFF00;
    --accent-dim: rgba(204, 255, 0, 0.08);
    --accent-glow: rgba(204, 255, 0, 0.2);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 6px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg);
    color: var(--text-pri);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.2;
    mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* ============ MAIN VIEW ============ */
.view-main {
    position: relative;
    z-index: 1;
    transition: all 0.6s var(--ease);
}
.view-main.dimmed {
    transform: scale(0.98);
    filter: blur(10px) grayscale(0.5);
    opacity: 0.4;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.status-badge {
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.05em;
}
.status-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--accent); }

.flow-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

.flow-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
}
.flow-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.7; }
.flow-hint { font-family: var(--font-mono); font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.15em; display: inline-flex; align-items: center; gap: 6px; }
.flow-hint::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1.4s infinite; }

.flow-canvas {
    width: 100%;
    height: 400px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

/* React Flow dark-theme overrides */
.flow-canvas .react-flow__attribution { background: transparent; }
.flow-canvas .react-flow__attribution a { color: var(--text-sec); opacity: 0.5; }
.flow-canvas .react-flow__handle.rf-handle {
    width: 8px; height: 8px;
    background: var(--accent);
    border: 2px solid var(--bg);
    opacity: 0.3;
    transition: opacity 0.3s var(--ease);
}
.flow-canvas .react-flow__node:hover .react-flow__handle.rf-handle,
.flow-canvas .plugin-node.active .react-flow__handle.rf-handle { opacity: 1; }
.flow-canvas .react-flow__edge-path { transition: stroke 0.5s var(--ease); }
.flow-canvas .react-flow__controls { box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.flow-canvas .react-flow__controls button {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    color: var(--text-sec);
}
.flow-canvas .react-flow__controls button svg { fill: currentColor; }
.flow-canvas .react-flow__controls button:hover { background: #151518; color: var(--accent); }

.plugin-node {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    width: 220px;
    position: relative;
    z-index: 2;
    transition: all 0.4s var(--ease);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.plugin-node:hover { border-color: var(--accent); transform: translateY(-6px); background: #121214; box-shadow: 0 16px 30px rgba(0,0,0,0.4); }
.plugin-node.active { border-color: var(--accent); box-shadow: 0 0 30px var(--accent-dim); background: #151518; }
.plugin-icon { width: 48px; height: 48px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; transition: all 0.4s var(--ease); }
.plugin-node:hover .plugin-icon { border-color: var(--accent); background: var(--bg); transform: scale(1.1); }
.plugin-title { font-size: 15px; font-weight: 600; color: var(--text-pri); margin-bottom: 6px; }
.plugin-desc { font-size: 13px; color: var(--text-sec); line-height: 1.4; }

.bottom-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; }
.metrics-group { display: flex; flex-direction: column; gap: 24px; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; transition: all 0.3s; }
.kpi-card:hover { border-color: var(--border-strong); background: #151518; }
.kpi-value { font-size: 42px; font-weight: 800; color: var(--accent); line-height: 1; display: block; margin-bottom: 8px; }
.kpi-label { font-size: 13px; color: var(--text-sec); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

.trade-offs-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }
.trade-offs-card h4 { font-size: 12px; text-transform: uppercase; color: var(--text-sec); margin-bottom: 16px; letter-spacing: 0.1em; }
.trade-off-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.trade-off-item { font-size: 13px; color: var(--text-pri); display: flex; align-items: center; gap: 10px; }
.trade-off-item::before { content: "•"; color: var(--accent); font-size: 18px; }

.terminal-card { background: #000; border: 1px solid var(--border); border-radius: var(--radius-lg); font-family: var(--font-mono); display: flex; flex-direction: column; overflow: hidden; height: 100%; box-shadow: 0 30px 60px rgba(0,0,0,0.6); }
.terminal-header { background: #0A0A0B; padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; color: #666; font-size: 11px; }
.terminal-body { padding: 20px; font-size: 12px; color: #D1D1D1; overflow-y: auto; flex-grow: 1; }
.terminal-footer { padding: 0 20px 20px; font-family: var(--font-mono); font-size: 12px; color: #666; }
.log-line { margin-bottom: 8px; display: flex; gap: 12px; opacity: 0; transform: translateX(-10px); animation: slideIn 0.3s forwards; }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
.log-time { color: #444; min-width: 65px; }
.log-level-info { color: #4A9EFF; font-weight: 600; }
.log-level-success { color: var(--accent); font-weight: bold; }
.log-msg { color: #B0B0B0; }
.cursor { display: inline-block; width: 6px; height: 14px; background: var(--accent); animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ THE DETAIL WORKSPACE ============ */
.workspace {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 85%;
    background: var(--bg);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.6s var(--ease);
    border-left: 1px solid var(--border);
    box-shadow: -40px 0 100px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.workspace.open { transform: translateX(0); }

.workspace-header {
    padding: 32px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, var(--surface), transparent);
    border-bottom: 1px solid var(--border);
}
.close-workspace {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text-pri);
    font-size: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.close-workspace:hover { border-color: var(--accent); color: var(--accent); }
.breadcrumb { font-family: var(--font-mono); font-size: 12px; color: var(--text-sec); }
.breadcrumb .crumb-accent { color: var(--accent); }

.workspace-content {
    flex: 1;
    overflow-y: auto;
    padding: 48px;
    scroll-behavior: smooth;
}

.hero-section {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 60px;
    animation: fadeInDown 0.6s var(--ease);
}
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.hero-ico-lg {
    width: 96px; height: 96px;
    background: var(--panel);
    border: 2px solid var(--accent);
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
    box-shadow: 0 0 40px var(--accent-dim);
}
.hero-title h2 { font-size: 42px; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 8px; }
.hero-title .role { color: var(--accent); font-family: var(--font-mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; }

.grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.blueprint-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.blueprint-card:hover { border-color: var(--border-strong); background: #151518; }
.blueprint-card h3 { font-size: 14px; text-transform: uppercase; color: var(--text-sec); letter-spacing: 0.1em; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.blueprint-card h3::before { content: ""; width: 12px; height: 2px; background: var(--accent); }

/* VISUAL LOGIC MAP */
.logic-map {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}
.map-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-sec);
    text-align: center;
}
.map-node {
    width: 32px; height: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-pri);
    transition: all 0.3s;
}
.map-node.active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px var(--accent-dim); }
.map-arrow { color: var(--border); font-size: 14px; }

/* Content Lists */
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.detail-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}
.detail-item:hover { border-color: var(--border-strong); transform: translateX(4px); }
.detail-item .num { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }
.detail-item .text h5 { font-size: 15px; margin-bottom: 4px; }
.detail-item .text p { font-size: 13px; color: var(--text-sec); line-height: 1.5; }

/* Code block */
.code-block {
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow: hidden;
}
.code-bar { background: #0A0A0B; padding: 10px 16px; border-bottom: 1px solid var(--border); color: #666; font-size: 11px; display: flex; justify-content: space-between; }
.code-content { padding: 20px; color: #C9C9C9; overflow-x: auto; white-space: pre; }
.c-str { color: var(--accent); }
.c-key { color: #4A9EFF; }
.c-com { color: #555; font-style: italic; }

/* I/O block */
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.io-zone { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.io-zone span { font-family: var(--font-mono); font-size: 10px; color: var(--text-sec); text-transform: uppercase; display: block; margin-bottom: 10px; }
.io-pill {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 6px;
    display: block;
}
.io-pill.out { border-left: 2px solid var(--accent); }

/* IMPACT SECTION */
.impact-card {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--panel), #16161a);
    border: 1px solid var(--accent);
    padding: 32px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 20px;
}
.impact-icon { font-size: 40px; }
.impact-text h4 { font-size: 18px; margin-bottom: 8px; color: var(--accent); }
.impact-text p { color: var(--text-sec); font-size: 15px; line-height: 1.6; }

.sim-btn {
    background: var(--accent);
    color: #000;
    border: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 13px;
    padding: 12px 24px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.sim-btn:hover { transform: scale(1.05); box-shadow: 0 0 20px var(--accent-glow); }

/* ============ HERO ============ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 13px;
    background: var(--accent-dim);
    box-shadow: 0 0 18px var(--accent-dim);
}
.brand-name { font-weight: 700; letter-spacing: -0.02em; font-size: 15px; }

.hero {
    position: relative;
    text-align: center;
    padding: 64px 12px 8px;
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    top: -46%;
    left: 50%;
    width: 920px;
    height: 620px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, var(--accent-glow), transparent 62%);
    filter: blur(30px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
    animation: heroPulse 7s var(--ease) infinite;
}
@keyframes heroPulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.08); }
}
.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    animation: fadeInDown 0.8s var(--ease);
}
.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-sec);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.02);
}
.hero-eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}
.hero h1 {
    font-size: clamp(40px, 7vw, 84px);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.045em;
    max-width: 15ch;
}
.hero h1 .grad {
    background: linear-gradient(120deg, var(--accent) 0%, #EEFF9E 45%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    font-size: clamp(15px, 1.8vw, 19px);
    color: var(--text-sec);
    line-height: 1.65;
    max-width: 64ch;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.btn-primary, .btn-ghost {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    padding: 13px 26px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary { background: var(--accent); color: #000; border: 1px solid var(--accent); font-weight: 700; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--text-pri); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-stats {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 760px;
}
.hero-stat { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hero-stat .n { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.hero-stat .l { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-sec); }

/* ============ ABOUT ============ */
.about-section {
    background: linear-gradient(180deg, var(--panel), rgba(17, 17, 19, 0.35));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    position: relative;
    overflow: hidden;
}
.about-head {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 44px;
}
.about-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.about-kicker::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.about-head h2 { font-size: clamp(26px, 3.6vw, 42px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.06; }
.about-lead { color: var(--text-sec); font-size: 16px; line-height: 1.75; }
.about-lead strong { color: var(--text-pri); font-weight: 600; }

.about-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.about-step {
    background: var(--surface);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: background 0.4s var(--ease);
}
.about-step:hover { background: #151518; }
.about-step::after {
    content: "";
    position: absolute;
    left: 0; top: 0;
    height: 2px; width: 0;
    background: var(--accent);
    transition: width 0.45s var(--ease);
}
.about-step:hover::after { width: 100%; }
.about-step .idx { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent); }
.about-step .ico { font-size: 22px; }
.about-step h4 { font-size: 15px; font-weight: 600; }
.about-step p { font-size: 13px; color: var(--text-sec); line-height: 1.55; }

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 960px) {
    .bottom-grid { grid-template-columns: 1fr; }
    .flow-canvas { height: 320px; }
    .grid-layout { grid-template-columns: 1fr; }
    .workspace { width: 100%; }
    .about-head { grid-template-columns: 1fr; gap: 24px; }
    .about-steps { grid-template-columns: repeat(2, 1fr); }
    .about-section { padding: 40px 24px; }
}

@media (max-width: 560px) {
    .about-steps { grid-template-columns: 1fr; }
    .hero-stats { gap: 28px; }
    .hero { padding-top: 40px; }
}
