:root {
    --bg-color: #050505;
    /* Deep Black */
    --text-color: #FFFFFF;
    --text-dim: #888888;
    --accent-color: #00FFCC;
    /* Cyan/Green from Ref */
    --grid-line: #1A1A1A;
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Inter', sans-serif;

    /* Strict Grid System */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    --space-24: 96px;
}

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

html {
    /* Scroll snap on html instead of body for better mobile support */
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    height: 100%;
    /* Ensure height is set for scroll snap */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    letter-spacing: normal;
    height: 100%;
    /* Ensure height is set for scroll snap */
    overflow-y: scroll;
    /* Enable scrolling on body */
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: -0.03em;
    text-transform: none;
    /* Reset uppercase */
}

a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

a:hover {
    color: var(--text-color);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    padding: 0 var(--space-12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 5, 0.95);
    /* Semi-transparent for contrast */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--grid-line);
    z-index: 1000;
}

/* Directed Descent Logo */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 80px;
    /* Increased from 60px */
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: var(--space-12);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-cta {
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-cta:hover {
    border-color: #fff;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Left align */
    text-align: left;
    padding: 0 15%;
    /* Indent content */
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;

    /* Scroll snap */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100vh;
    /* Force full height */
}

/* Fade out grid at edges */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-color) 80%);
    pointer-events: none;
}

.telemetry-overlay.bottom-left {
    position: absolute;
    bottom: 3rem;
    left: 3rem;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #666;
    border: none;
    padding: 0;
    z-index: 2;
}

.telemetry-row {
    display: flex;
    gap: var(--space-4);
}

.t-label {
    opacity: 0.5;
    width: 30px;
}

.t-value {
    color: #888;
}

.loading-bar {
    width: 30px;
    height: 2px;
    background: #00FFCC;
    margin-top: 0.5rem;
    box-shadow: 0 0 5px #00FFCC;
}

.hero-content {
    z-index: 1;
    max-width: 800px;
}

.system-status {
    font-family: var(--font-mono);
    color: var(--accent-color);
    /* Unified Accent */
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 0;
    /* Mechanical square */
    box-shadow: 0 0 5px var(--accent-color);
}

.hero-title {
    font-size: 6rem;
    line-height: 1;
    margin-bottom: var(--space-8);
    color: #fff;
    font-weight: 300;
    /* Light weight for refined aesthetic */
}

.dim-text {
    color: #444;
    /* Dark Grey */
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: var(--space-6);
    font-weight: 400;
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: 1.2rem;
    color: #888;
    max-width: 600px;
    margin-bottom: var(--space-16);
    font-weight: 300;
}

.hero-cta-container {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.hero-cta {
    background: #E0E0E0;
    color: #000;
    border: none;
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-mono);
    font-weight: 500;
    /* Reduced from 700 */
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-cta:hover {
    background: #fff;
    transform: translateY(-2px);
}

.scroll-indicator {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #444;
    letter-spacing: 0.1em;
}

/* Hide old elements */
.mission-control,
.protocol-display {
    display: none;
}

/* Market Scan Section */
.market-scan-section {
    padding: var(--space-24) var(--space-8);
    background: var(--bg-color);
    border-bottom: 1px solid var(--grid-line);
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;

    /* Vertical centering */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-header {
    font-family: var(--font-mono);
    color: var(--accent-color);
    margin-bottom: var(--space-12);
    opacity: 0.7;
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
}

.market-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-16);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--grid-line);
    color: var(--text-dim);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.1em;
}

.tab-btn:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.market-content {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
}

.market-content.active {
    display: block;
    animation: scanReveal 0.5s steps(10);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-16);
}

.use-case-card {
    background: var(--bg-color);
    border: 1px solid var(--grid-line);
    padding: var(--space-8);
    transition: all 0.2s ease;
    position: relative;
    /* For markers */
}

/* Blueprint Corner Markers */
.use-case-card::before,
.use-case-card::after,
.pillar-card::before,
.pillar-card::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--accent-color);
    transition: all 0.3s ease;
    opacity: 0;
}

.use-case-card::before,
.pillar-card::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.use-case-card::after,
.pillar-card::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.use-case-card:hover::before,
.use-case-card:hover::after,
.pillar-card:hover::before,
.pillar-card:hover::after {
    opacity: 1;
}

.use-case-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.1);
}

.use-case-card h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.use-case-card p {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-family: var(--font-sans);
}

.market-metrics {
    display: flex;
    justify-content: center;
    gap: var(--space-16);
    text-align: center;
    border-top: 1px solid var(--grid-line);
    padding-top: var(--space-12);
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-val {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 400;
    /* Reduced from 700 */
    color: var(--accent-color);
    letter-spacing: -0.05em;
}

.metric-lbl {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* Instrument Section */
.instrument-section {
    padding: var(--space-24) var(--space-8);
    background: #080808;
    border-bottom: 1px solid var(--grid-line);
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;

    /* Vertical centering */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.instrument-display {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--grid-line);
    padding: var(--space-12);
    background: #000;
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

/* Segment Badge */
.segment-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-color);
    letter-spacing: 0.15em;
    text-align: center;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--grid-line);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.confidence-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: var(--space-8);
}

.confidence-value {
    font-size: 4rem;
    color: var(--accent-color);
    font-weight: 400;
    /* Reduced from 700 */
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.confidence-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    font-family: var(--font-mono);
}

.confidence-context {
    text-align: right;
}

.context-label {
    font-size: 0.65rem;
    color: #666;
    letter-spacing: 0.1em;
    font-family: var(--font-mono);
    margin-bottom: var(--space-1);
}

.context-value {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-weight: 400;
    /* Reduced from 700 */
}

.terminal-output {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--grid-line);
}

.terminal-line {
    line-height: 1.6;
}

.terminal-line.dim {
    color: #666;
}

.terminal-line.highlight {
    color: var(--accent-color);
    font-weight: 400;
    /* Reduced from 700 */
}

.readout-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
}

.readout-metric {
    text-align: center;
}

.readout-metric-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 400;
    /* Reduced from 700 */
    color: var(--text-color);
    margin-bottom: var(--space-2);
}

.readout-metric-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-mono);
}

/* Decision Metric */
.decision-metric {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--grid-line);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

/* Remove old unused styles */
.spectral-analysis {
    display: none;
}

.bar {
    display: none;
}

.resource-estimate {
    display: none;
}

.estimate-value,
.estimate-label {
    display: none;
}

/* Narrative Section */
.narrative-section {
    padding: var(--space-24) var(--space-8);
    max-width: 1100px;
    margin: 0 auto;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;

    /* Vertical centering */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.narrative-content {
    text-align: center;
    margin-bottom: var(--space-24);
}

.narrative-heading {
    font-size: 2.5rem;
    margin-bottom: var(--space-6);
    color: var(--text-color);
    font-family: var(--font-mono);
    letter-spacing: -0.05em;
}

.narrative-text {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto;
    font-family: var(--font-sans);
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.pillar-card {
    border: 1px solid var(--grid-line);
    padding: var(--space-8);
    transition: all 0.2s ease;
    background: var(--bg-color);
    position: relative;
    /* For markers */
}

.pillar-card:hover {
    border-color: var(--text-color);
}

.pillar-label {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-bottom: var(--space-6);
    letter-spacing: 0.1em;
}

.pillar-card h4 {
    margin-bottom: var(--space-4);
    font-size: 1rem;
    font-family: var(--font-mono);
    color: #fff;
}

.pillar-card p {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-family: var(--font-sans);
}

/* Footer */
.waitlist-footer {
    background: var(--bg-color);
    padding: var(--space-24) var(--space-8);
    border-top: 1px solid var(--grid-line);
    text-align: center;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;

    /* Vertical centering */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.footer-heading {
    font-size: 2rem;
    margin-bottom: var(--space-4);
    color: #fff;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

.footer-subtext {
    font-family: var(--font-mono);
    margin-bottom: var(--space-16);
    color: var(--text-dim);
    font-size: 0.8rem;
}

.waitlist-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    max-width: 600px;
    margin: 0 auto var(--space-24);
}

.waitlist-form .email-input:first-child {
    grid-column: 1 / -1;
}

.waitlist-form .email-input:nth-child(3) {
    grid-column: 1 / -1;
}

.waitlist-form .notes-field {
    grid-column: 1 / -1;
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-mono);
}

.email-input,
.role-select {
    background: #000;
    border: 1px solid var(--grid-line);
    color: #fff;
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    width: 100%;
    transition: border-color 0.2s ease;
    border-radius: 0;
    /* Strict square */
}

textarea.email-input {
    font-family: var(--font-mono);
    line-height: 1.5;
}

.email-input:focus,
.role-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.email-input::placeholder {
    color: #444;
    letter-spacing: 0.1em;
}

.footer-cta {
    grid-column: 1 / -1;
    margin-top: var(--space-4);
    background: var(--text-color);
    color: #000;
    border: none;
}

.footer-cta:hover {
    background: var(--accent-color);
}

.footer-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #444;
    border-top: 1px solid var(--grid-line);
    padding: var(--space-4) var(--space-12);
    background: var(--bg-color);
    z-index: 1000;
}

.social-links {
    display: flex;
    gap: var(--space-6);
}

/* Animations */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes scanReveal {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

/* Scroll Reveal Animation - Mechanical Ease */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    /* Snappier, more mechanical */
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}


/* Tablet & Mobile Responsiveness */
@media (max-width: 1024px) {
    .telemetry-overlay.bottom-left {
        display: none !important;
        /* Force hide to prevent overlap */
    }
}

/* Mobile Specific */
@media (max-width: 768px) {

    .navbar {
        padding: 0 1rem;
        height: 60px;
    }

    .logo-image {
        height: 64px;
        /* Increased from 48px */
    }

    .hero {
        padding: 0 1.5rem;
        /* Ensure full viewport on mobile */
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .hero-title {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 3rem;
    }

    .nav-links {
        display: none;
    }

    .nav-cta {
        padding: 0.5rem 0.8rem;
        font-size: 0.6rem;
    }

    /* Improve mobile typography */
    .hero-title {
        font-size: 2.5rem;
        /* Slightly smaller for better fit */
        word-wrap: break-word;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    /* Ensure buttons are touch-friendly */
    .hero-cta,
    .nav-cta,
    .tab-btn,
    .footer-cta {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Ensure sections snap on mobile */
    .market-scan-section,
    .instrument-section,
    .narrative-section,
    .waitlist-footer {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .waitlist-form {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: row;
        /* Keep row on mobile for status bar */
        gap: 1rem;
        padding: var(--space-4) 1rem;
        font-size: 0.6rem;
    }

    .market-metrics {
        flex-direction: column;
        gap: 2rem;
    }

    .instrument-display {
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    .confidence-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .confidence-value {
        font-size: 3rem;
    }

    .confidence-context {
        text-align: left;
    }

    .readout-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .readout-metric-value {
        font-size: 1.5rem;
    }

    .market-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}