/* ==========================================================================
   ThinkMachine Design System — Version 7.0 Light (Dual Spectrum)
   Physical AI: Heat (Amber) × Signal (Cyan)
   Light-mode variant — all class names identical to v6 for theme toggling
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Design Tokens ── */
:root {
    --bg-primary:     #FAFBFC;
    --bg-secondary:   #F1F3F5;
    --bg-card:        rgba(255, 255, 255, 0.8);
    --bg-card-hover:  rgba(255, 255, 255, 0.95);

    --heat-300:       #F59E0B;
    --heat-400:       #E09000;
    --heat-500:       #D97706;
    --heat-600:       #B45309;
    --heat-glow:      rgba(217, 119, 6, 0.08);

    --signal-300:     #22D3EE;
    --signal-400:     #0CB8D0;
    --signal-500:     #0891B2;
    --signal-600:     #0E7490;
    --signal-glow:    rgba(8, 145, 178, 0.08);

    --text-primary:   #1E293B;
    --text-secondary: #334155;
    --text-muted:     #64748B;
    --border-subtle:  rgba(15, 23, 42, 0.08);

    --font-display:   'Space Grotesk', sans-serif;
    --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:      'JetBrains Mono', 'Courier New', monospace;

    --radius-sm:      8px;
    --radius-md:      16px;
    --radius-lg:      24px;
    --transition-default: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset & Base ── */
body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Subtle noise texture overlay on body — nearly invisible on light bg */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ── Typography ── */
.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.gradient-heat {
    background: linear-gradient(135deg, var(--heat-400) 0%, var(--heat-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-signal {
    background: linear-gradient(135deg, var(--signal-400) 0%, var(--signal-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-dual {
    background: linear-gradient(135deg, var(--heat-500) 0%, var(--signal-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Card System ── */
.card-base {
    position: relative;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: var(--transition-default);
}

.card-base:hover {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Heat Card — amber left border */
.card-heat {
    border-left: 2px solid transparent;
    border-image: linear-gradient(to bottom, var(--heat-400), var(--heat-600)) 1;
    border-image-slice: 1;
}
.card-heat:hover {
    box-shadow: -4px 0 24px var(--heat-glow), 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Signal Card — cyan left border */
.card-signal {
    border-left: 2px solid transparent;
    border-image: linear-gradient(to bottom, var(--signal-400), var(--signal-600)) 1;
    border-image-slice: 1;
}
.card-signal:hover {
    box-shadow: -4px 0 24px var(--signal-glow), 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Glassmorphism stat card — light variant */
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ── Pillar Panels (S3: Two-Pillar Layout) ── */
.pillar-panel {
    position: relative;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: var(--transition-default);
    overflow: hidden;
}

.pillar-heat {
    border: 1px solid rgba(217, 119, 6, 0.12);
}
.pillar-heat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--heat-400), var(--heat-600));
}
.pillar-heat:hover {
    border-color: rgba(217, 119, 6, 0.3);
    box-shadow: 0 8px 30px var(--heat-glow), 0 4px 15px rgba(0, 0, 0, 0.06);
}

.pillar-signal {
    border: 1px solid rgba(8, 145, 178, 0.12);
}
.pillar-signal::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--signal-400), var(--signal-600));
    left: auto;
}
.pillar-signal:hover {
    border-color: rgba(8, 145, 178, 0.3);
    box-shadow: 0 8px 30px var(--signal-glow), 0 4px 15px rgba(0, 0, 0, 0.06);
}

/* ── Divider Line (Dual Spectrum) ── */
.spectrum-divider {
    width: 1px;
    background: linear-gradient(to bottom, var(--heat-500), transparent 40%, transparent 60%, var(--signal-500));
    opacity: 0.3;
}

/* ── Buttons ── */
.btn-heat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--heat-500) 0%, var(--heat-600) 100%);
    color: #000;
    font-family: var(--font-display);
    font-weight: 600;
    border: none;
    border-radius: 9999px;
    transition: var(--transition-default);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.25);
}
.btn-heat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.35);
    filter: brightness(1.1);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-weight: 500;
    background: transparent;
    border-radius: 9999px;
    transition: var(--transition-default);
}
.btn-ghost:hover {
    border-color: var(--signal-500);
    color: var(--signal-600);
    background: rgba(8, 145, 178, 0.06);
    transform: translateY(-2px);
}

/* ── Navigation ── */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ── Mobile Menu ── */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open {
    transform: translateX(0);
}

/* ── Scroll Reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.25, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.25, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms; }

/* ── Section Label ── */
.section-label {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── SVG Icon Container ── */
.tm-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-default);
}
.tm-icon svg {
    width: 22px;
    height: 22px;
}
.tm-icon-heat {
    background: var(--heat-glow);
    border: 1px solid rgba(217, 119, 6, 0.2);
}
.tm-icon-signal {
    background: var(--signal-glow);
    border: 1px solid rgba(8, 145, 178, 0.2);
}
.tm-icon-neutral {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

/* ── Industry Horizontal Scroll ── */
.industry-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
}
.industry-scroll::-webkit-scrollbar { display: none; }
.industry-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ── Hero Tag Strip ── */
.tag-strip {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}
.tag-strip span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* ── Cognitive Engine (from v5, re-themed for light) ── */
.cognitive-engine-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1;
    margin: 0 auto;
}
.engine-orbit {
    position: absolute;
    inset: 15%;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    animation: spin-cw 30s linear infinite;
}
.engine-orbit-inner {
    position: absolute;
    inset: 30%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    animation: spin-ccw 20s linear infinite;
}
@keyframes spin-cw  { to { transform: rotate(360deg); } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }

.engine-node {
    position: absolute;
    width: 56px;
    height: 56px;
    margin-left: -28px;
    margin-top: -28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-default);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}
.engine-node-0 { top: 12%; left: 50%; }
.engine-node-1 { top: 50%; left: 88%; }
.engine-node-2 { top: 88%; left: 50%; }
.engine-node-3 { top: 50%; left: 12%; }

.engine-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90px; height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.08) 0%, transparent 70%);
    border: 1px solid rgba(8, 145, 178, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(8, 145, 178, 0.06);
}

/* ── Status Indicators ── */
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot-heat   { background: var(--heat-500);   box-shadow: 0 0 8px var(--heat-500); }
.status-dot-signal { background: var(--signal-500); box-shadow: 0 0 8px var(--signal-500); }
.status-dot-ok     { background: #22C55E; box-shadow: 0 0 8px #22C55E; }

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.blink { animation: blink 2s infinite ease-in-out; }

/* ── TM Slider ── */
.tm-tab .tm-progress { transform: scaleX(0); }
.tm-tab.active .tm-progress {
    transform: scaleX(1);
    transition: transform var(--duration, 5s) linear;
}
.tm-slide > div:first-child { will-change: transform; }

/* ── Machine Mode Terminal (kept dark — it's a terminal) ── */
#machine-mode-panel {
    display: none;
    position: fixed;
    inset: 0;
    background-color: #020308;
    z-index: 9999;
    font-family: var(--font-mono);
    color: #22C55E;
    overflow-y: auto;
}
#machine-mode-panel::before {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%),
                linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    z-index: 2;
}
.terminal-header {
    background-color: #090e1a;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    position: sticky;
    top: 0; z-index: 10;
}
.terminal-cursor {
    display: inline-block;
    width: 8px; height: 15px;
    background: #22C55E;
    animation: t-blink 1s infinite steps(2, start);
}
@keyframes t-blink { to { visibility: hidden; } }
.terminal-window {
    background: rgba(3, 6, 15, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.15);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.05);
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .engine-orbit, .engine-orbit-inner { animation: none; }
    .blink { animation: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
