/* ═══════════════════════════════════════════════════════════
   QUALIUM AI — NVIDIA-STYLE DESIGN SYSTEM v2.0
   Full Interactive Edition
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & TOKENS ──────────────────────────────────────── */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0d0d0d;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --bg-elevated: #1a1a1a;
    --accent: #76b900;
    --accent-dim: #5a8f00;
    --accent-glow: rgba(118, 185, 0, 0.15);
    --accent-glow-strong: rgba(118, 185, 0, 0.3);
    --accent-glow-intense: rgba(118, 185, 0, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #606060;
    --border: #1e1e1e;
    --border-hover: #2a2a2a;
    --border-accent: rgba(118, 185, 0, 0.3);
    --red: #ff4444;
    --yellow: #ffaa00;
    --green: #76b900;
    --blue: #4a90d9;
    --purple: #c792ea;
    --cyan: #89ddff;
    --orange: #f78c6c;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 8px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
    --max-width: 1280px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

input,
select {
    font-family: inherit;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.accent {
    color: var(--accent);
}

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 24px;
    height: 72px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    background: rgba(10, 10, 10, 0.95);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
    padding: 4px 0;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all var(--transition);
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
}

.nav-btn--ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
}

.nav-btn--ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.nav-btn--primary {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}

.nav-btn--primary:hover {
    background: #8ad200;
    box-shadow: 0 0 20px var(--accent-glow);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 1px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── HERO ────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 200px 24px 40px;
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 75%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.8s 0.2s forwards;
}

.hero-title {
    font-size: clamp(36px, 8vw, 130px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -3px;
    margin-bottom: 24px;
}

.hero-line {
    display: block;
    opacity: 0;
    animation: fadeUp 0.8s forwards;
}

.hero-line:nth-child(1) {
    animation-delay: 0.4s;
}

.hero-line:nth-child(2) {
    animation-delay: 0.6s;
}

.hero-line:nth-child(3) {
    animation-delay: 0.8s;
}

.hero-line--accent {
    color: var(--accent);
    text-shadow: 0 0 60px var(--accent-glow-strong);
}

.hero-line--outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--text-primary);
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--accent);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-sub {
    font-size: clamp(16px, 2vw, 22px);
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.7;
    opacity: 0;
    animation: fadeUp 0.8s 1s forwards;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.8s 1.2s forwards;
}

.hero-stats {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 64px;
    justify-content: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    opacity: 0;
    animation: fadeUp 0.8s 1.4s forwards;
}

.hero-stat {
    text-align: center;
}

.hero-stat__value {
    display: block;
    font-size: 48px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent);
    line-height: 1;
}

.hero-stat__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 8px;
}

/* ── HERO TELEMETRY RIBBON ───────────────────────────────── */
.hero-telemetry {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: 48px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    opacity: 0;
    animation: fadeUp 0.8s 1.6s forwards;
}

.telemetry-track {
    display: flex;
    width: max-content;
    white-space: nowrap;
    animation: scrollTelemetry 20s linear infinite;
}

.tele-group {
    display: flex;
    gap: 48px;
    padding-right: 48px;
    /* Maintain gap between groups */
    flex-shrink: 0;
}

.tele-item {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tele-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.tele-dot--green {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow-strong);
    animation: pulse-dot 2s infinite;
}

@keyframes scrollTelemetry {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-25%);
        /* Since there are 4 identical groups, scroll by exactly 1 group to perfectly loop */
    }
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius);
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn--primary {
    background: var(--accent);
    color: #000;
}

.btn--primary:hover {
    background: #8ad200;
    box-shadow: 0 0 30px var(--accent-glow-strong);
    transform: translateY(-2px);
}

.btn--outline {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: transparent;
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn--large {
    padding: 18px 40px;
    font-size: 15px;
}

.btn--full {
    width: 100%;
}

/* ── SECTION COMMON ──────────────────────────────────────── */
.section {
    padding: 120px 0;
}

.section--dark {
    background: var(--bg-primary);
}

.section--darker {
    background: var(--bg-secondary);
}

.section-header {
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -1px;
}

.section-sub {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 560px;
    margin-top: 20px;
    line-height: 1.7;
}

/* ── HARDWARE GRID ───────────────────────────────────────── */
.hw-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.hw-card {
    position: relative;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    cursor: default;
}

.hw-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.hw-card__glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.hw-card:hover .hw-card__glow {
    opacity: 1;
}

.hw-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hw-card__id {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    padding: 4px 10px;
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
}

.hw-card__status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px var(--accent);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 12px var(--accent-glow-strong);
    }
}

.hw-card__status-text {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1.5px;
}

.hw-card__visual {
    height: 80px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.hw-card__canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hw-card__stat {
    margin-bottom: 12px;
}

.hw-card__stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.hw-card__stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.hw-card__title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.hw-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Hardware Metrics Bars */
.hw-card__metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric__label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    width: 70px;
    text-transform: uppercase;
}

.metric__bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.metric__fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric__val {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    width: 40px;
    text-align: right;
}

/* ── SOFTWARE LAYOUT ─────────────────────────────────────── */
.sw-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
}

.sw-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sw-info__title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.sw-info__desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.sw-btn {
    align-self: flex-start;
}

/* ── INTERACTIVE TERMINAL ────────────────────────────────── */
.sw-terminal {
    width: 100%;
}

.terminal {
    background: #0c0c0c;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition);
}

.terminal:focus-within {
    border-color: var(--border-accent);
}

.terminal__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #141414;
    border-bottom: 1px solid var(--border);
}

.terminal__dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.dot:hover {
    opacity: 0.7;
}

.dot--red {
    background: var(--red);
}

.dot--yellow {
    background: var(--yellow);
}

.dot--green {
    background: var(--green);
}

.terminal__title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    flex: 1;
}

.terminal__status {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.terminal__body {
    padding: 16px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.terminal__output {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    padding-bottom: 12px;
}

.terminal__output .cmd-line {
    color: var(--accent);
}

.terminal__output .cmd-response {
    color: var(--text-secondary);
}

.terminal__output .cmd-error {
    color: var(--red);
}

.terminal__output .cmd-success {
    color: var(--accent);
}

.terminal__output .cmd-info {
    color: var(--cyan);
}

.terminal__output .cmd-warn {
    color: var(--yellow);
}

.terminal__input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.terminal__prompt {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    white-space: nowrap;
}

.terminal__input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    caret-color: var(--accent);
}

.terminal__input::placeholder {
    color: var(--text-tertiary);
}

/* ── CIRCUIT DESIGNER ────────────────────────────────────── */
.sw-circuit {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: stretch;
}

.circuit-code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.circuit-code__header {
    padding: 18px 20px;
    background: #141414;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.circuit-code__body {
    padding: 24px;
    flex: 1;
    background: #0a0a0a;
    overflow-y: auto;
}

.circuit-code__body pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.code-keyword {
    color: var(--accent);
}

.code-function {
    color: #569cd6;
}

/* Example syntax highlight */
.code-string {
    color: #ce9178;
}

.code-comment {
    color: var(--text-tertiary);
    font-style: italic;
}

.circuit-designer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.circuit-designer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #141414;
    border-bottom: 1px solid var(--border);
}

.circuit-designer__title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.circuit-designer__controls {
    display: flex;
    gap: 8px;
}

.circuit-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    letter-spacing: 1px;
    transition: all var(--transition);
}

.circuit-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* Gate Library */
.gate-library {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.gate-library__label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    white-space: nowrap;
}

.gate-library__gates {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gate-lib-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(118, 185, 0, 0.06);
    color: var(--text-primary);
    cursor: grab;
    transition: all var(--transition);
    user-select: none;
}

.gate-lib-item:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

.gate-lib-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.gate-lib-item--measure {
    border-color: var(--yellow);
    color: var(--yellow);
    background: rgba(255, 170, 0, 0.06);
}

.gate-lib-item--measure:hover {
    border-color: var(--yellow);
    background: rgba(255, 170, 0, 0.15);
}

/* Circuit Grid */
.circuit-grid {
    padding: 24px 20px;
}

.circuit-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
    position: relative;
}

.qubit-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    width: 36px;
    flex-shrink: 0;
}

.circuit-slots {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.circuit-slot {
    width: 48px;
    height: 48px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.circuit-slot.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    border-style: solid;
}

.circuit-slot .placed-gate {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    border-radius: 5px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    animation: gatePlace 0.3s ease;
}

.circuit-slot .placed-gate.gate-H {
    background: rgba(118, 185, 0, 0.2);
    border: 1px solid var(--accent-dim);
}

.circuit-slot .placed-gate.gate-X {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: var(--red);
}

.circuit-slot .placed-gate.gate-Y {
    background: rgba(255, 170, 0, 0.15);
    border: 1px solid rgba(255, 170, 0, 0.4);
    color: var(--yellow);
}

.circuit-slot .placed-gate.gate-Z {
    background: rgba(74, 144, 217, 0.15);
    border: 1px solid rgba(74, 144, 217, 0.4);
    color: var(--blue);
}

.circuit-slot .placed-gate.gate-CX {
    background: rgba(199, 146, 234, 0.15);
    border: 1px solid rgba(199, 146, 234, 0.4);
    color: var(--purple);
}

.circuit-slot .placed-gate.gate-T {
    background: rgba(137, 221, 255, 0.15);
    border: 1px solid rgba(137, 221, 255, 0.4);
    color: var(--cyan);
}

.circuit-slot .placed-gate.gate-S {
    background: rgba(118, 185, 0, 0.1);
    border: 1px solid var(--accent-dim);
}

.circuit-slot .placed-gate.gate-M {
    background: rgba(255, 170, 0, 0.2);
    border: 1px solid rgba(255, 170, 0, 0.5);
    color: var(--yellow);
}

@keyframes gatePlace {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.qubit-wire {
    position: absolute;
    left: 36px;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
    z-index: 1;
}

/* Circuit running animation */
.circuit-slot.executing .placed-gate {
    animation: gatePulse 0.5s ease;
    box-shadow: 0 0 15px var(--accent-glow-strong);
}

@keyframes gatePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Circuit Results */
.circuit-results {
    border-top: 1px solid var(--border);
}

.circuit-results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #141414;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
}

.circuit-results__status {
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.circuit-results__status.running {
    color: var(--yellow);
    border-color: var(--yellow);
    animation: blink 0.5s infinite;
}

.circuit-results__status.complete {
    color: var(--accent);
    border-color: var(--accent-dim);
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

.circuit-results__body {
    padding: 20px;
}

.result-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.result-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-bar-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    width: 40px;
}

.result-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-bar-val {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    width: 45px;
    text-align: right;
}

.result-meta {
    display: flex;
    gap: 24px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ── BENCHMARKS ──────────────────────────────────────────── */
.bench-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.bench-toggle {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 1px;
}

.bench-toggle.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.bench-toggle:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

.bench-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.bench-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bench-table thead {
    background: var(--bg-card);
}

.bench-table th {
    padding: 20px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
}

.bench-table__nirvana {
    color: var(--accent) !important;
}

.bench-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.bench-table tbody tr:last-child td {
    border-bottom: none;
}

.bench-table tbody tr {
    transition: background var(--transition);
}

.bench-table tbody tr:hover {
    background: var(--bg-card);
}

.bench-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.nirvana-val {
    color: var(--accent) !important;
    font-weight: 600 !important;
    font-family: var(--font-mono);
}

.bench-chart-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    background: var(--bg-card);
}

#benchmarkCanvas {
    width: 100%;
    max-width: 100%;
}

/* ── CTA SECTION — NVIDIA RED BANNER ─────────────────────── */
.section--cta {
    background: #3a5c00;
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.cta-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.section--cta .container {
    position: relative;
    z-index: 2;
}

.cta-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.cta-left {
    flex: 1;
}

.cta-title {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 900;
    font-style: italic;
    line-height: 0.95;
    letter-spacing: -1px;
    color: #ffffff;
    margin-bottom: 24px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.cta-sub {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 1.5px;
    line-height: 1.8;
    text-transform: uppercase;
    max-width: 480px;
}

.cta-right {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.cta-btn {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 18px 36px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    white-space: nowrap;
}

.cta-btn--solid {
    background: #000000;
    color: #ffffff;
}

.cta-btn--solid:hover {
    background: #1a1a1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.cta-btn--outline {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.cta-btn--outline:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }

    .cta-sub {
        text-align: center;
        margin: 0 auto;
    }

    .cta-right {
        flex-direction: column;
        width: 100%;
    }

    .cta-btn {
        width: 100%;
        text-align: center;
    }

    .cta-title {
        font-size: 36px;
    }
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
    padding: 80px 0 40px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.footer-brand {
    flex: 1;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 1px;
}

.footer-links-grid {
    display: flex;
    gap: 64px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-col a {
    font-size: 13px;
    color: var(--text-tertiary);
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 1px;
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: color var(--transition);
}

.footer-legal a:hover {
    color: var(--accent);
}

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 460px;
    width: 90%;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    transition: color var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal__close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal__icon {
    margin-bottom: 20px;
}

.modal__title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal__desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal__input {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}

.modal__input:focus {
    border-color: var(--accent);
}

.modal__input::placeholder {
    color: var(--text-tertiary);
}

select.modal__input {
    appearance: none;
    cursor: pointer;
}

select.modal__input option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal__success {
    text-align: center;
    padding: 20px 0;
}

.success-check {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--accent);
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.modal__success h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent);
}

.modal__success p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── TOAST NOTIFICATIONS ─────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.toast--success {
    border-left: 3px solid var(--accent);
}

.toast.toast--info {
    border-left: 3px solid var(--blue);
}

.toast.toast--warning {
    border-left: 3px solid var(--yellow);
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ── REVEAL ANIMATIONS ───────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hw-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sw-layout {
        grid-template-columns: 1fr;
    }

    .sw-terminal {
        grid-column: auto;
    }

    .sw-circuit {
        grid-column: auto;
    }

    .footer-links-grid {
        gap: 40px;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-actions {
        display: none;
    }

    .nav-links.active,
    .nav-actions.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .nav-links.active {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 24px;
        background: rgba(10, 10, 10, 0.98);
        border-bottom: 1px solid var(--border);
        gap: 16px;
        z-index: 999;
    }

    .nav-actions.active {
        position: fixed;
        top: calc(72px + 160px);
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 0 24px 24px;
        background: rgba(10, 10, 10, 0.98);
        border-bottom: 1px solid var(--border);
        gap: 12px;
        z-index: 999;
    }

    .hero {
        padding: 120px 20px 40px;
    }

    .hero-stats {
        gap: 24px;
        flex-wrap: wrap;
    }

    .hero-stat__value {
        font-size: 36px;
    }

    .hero-telemetry {
        gap: 32px;
    }

    .section {
        padding: 80px 0;
    }

    .hw-grid {
        grid-template-columns: 1fr;
    }

    .gate-library {
        flex-wrap: wrap;
    }

    .circuit-slots {
        gap: 4px;
    }

    .circuit-slot {
        width: 40px;
        height: 40px;
    }

    .result-meta {
        flex-wrap: wrap;
        gap: 12px;
    }

    .bench-table th,
    .bench-table td {
        padding: 12px 16px;
        font-size: 12px;
    }

    .footer-top {
        flex-direction: column;
    }

    .footer-links-grid {
        flex-wrap: wrap;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .modal {
        padding: 28px;
    }
}

@media (max-width: 480px) {
    .circuit-slot {
        width: 34px;
        height: 34px;
    }

    .gate-lib-item {
        width: 34px;
        height: 34px;
        font-size: 10px;
    }

    .hero-title {
        font-size: 40px;
    }
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

::selection {
    background: var(--accent);
    color: #000;
}