/* Titan Memory Systems - Universal Fluid Responsive CSS System */
:root {
    --bg-main: #060911;
    --bg-card: #0e1422;
    --bg-card-hover: #151d30;
    --border-color: #1e293b;
    --border-highlight: rgba(0, 242, 254, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-cyan: #00f2fe;
    --accent-blue: #38bdf8;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    /* Fluid Typography System using clamp(min, preferred, max) */
    --fs-hero-title: clamp(2.4rem, 4.5vw + 1rem, 5.5rem);
    --fs-hero-sub: clamp(1.05rem, 1.2vw + 0.6rem, 1.45rem);
    --fs-h2: clamp(1.75rem, 2.5vw + 0.8rem, 3.2rem);
    --fs-h3: clamp(1.2rem, 1.5vw + 0.5rem, 1.8rem);
    --fs-body: clamp(0.95rem, 0.8vw + 0.5rem, 1.25rem);
    --fs-stat: clamp(1.6rem, 2.5vw + 0.5rem, 3.5rem);
    --fs-small: clamp(0.75rem, 0.6vw + 0.4rem, 0.95rem);

    /* Fluid Container & Spacing */
    --container-max: clamp(1140px, 88vw, 1800px);
    --section-padding: clamp(60px, 8vh, 140px);
    --gutter-padding: clamp(16px, 3vw, 48px);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: var(--fs-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
    color: var(--accent-cyan);
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter-padding);
}

/* Header & Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(6, 9, 17, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: clamp(64px, 5vw, 84px);
    padding: 0 var(--gutter-padding);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: clamp(1.1rem, 1.4vw, 1.6rem);
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--accent-cyan);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(20px, 2.5vw, 48px);
    font-weight: 600;
    font-size: clamp(0.85rem, 0.9vw, 1.1rem);
}

.nav-actions {
    display: flex;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1vw, 14px) clamp(16px, 1.8vw, 32px);
    border-radius: 10px;
    font-weight: 700;
    font-size: clamp(0.85rem, 0.95vw, 1.1rem);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: #030712;
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 242, 254, 0.45);
    color: #030712;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
}

.btn-lg {
    padding: clamp(12px, 1.2vw, 18px) clamp(24px, 2.2vw, 44px);
}

/* Hero Section */
.hero-section {
    padding-top: clamp(120px, 15vh, 200px);
    padding-bottom: clamp(60px, 8vh, 120px);
    text-align: center;
    background: radial-gradient(circle at 50% 15%, rgba(0, 242, 254, 0.08) 0%, transparent 65%);
}

.hero-container {
    max-width: clamp(900px, 75vw, 1400px);
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: 30px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--accent-green);
    font-size: var(--fs-small);
    font-weight: 700;
    margin-bottom: clamp(20px, 3vh, 36px);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.hero-title {
    font-size: var(--fs-hero-title);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: clamp(16px, 2.5vh, 32px);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: var(--fs-hero-sub);
    color: var(--text-secondary);
    margin-bottom: clamp(32px, 4vh, 56px);
    max-width: clamp(700px, 65vw, 1100px);
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(12px, 1.5vw, 24px);
    margin-bottom: clamp(40px, 6vh, 80px);
}

/* 3D Chip Showcase Render */
.chip-showcase-box {
    max-width: clamp(700px, 65vw, 1280px);
    margin: 0 auto clamp(40px, 6vh, 80px);
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: clamp(16px, 2vw, 28px);
    padding: clamp(12px, 1.5vw, 24px);
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.18), 0 25px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chip-showcase-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 60px rgba(0, 242, 254, 0.35), 0 30px 70px rgba(0, 0, 0, 0.7);
    border-color: var(--accent-cyan);
}

.chip-img-wrapper {
    width: 100%;
    border-radius: clamp(10px, 1.2vw, 18px);
    overflow: hidden;
    background: #000;
}

.chip-render-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.chip-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: clamp(12px, 1.2vw, 20px) 8px 4px;
    font-size: var(--fs-small);
}

.caption-tag {
    padding: 6px 14px;
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
    font-weight: 700;
    font-family: var(--font-code);
    border-radius: 6px;
}

.caption-text {
    color: var(--text-secondary);
}

/* Dynamic Stats Grid */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 18vw, 320px), 1fr));
    gap: clamp(16px, 1.8vw, 32px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(16px, 1.8vw, 24px);
    padding: clamp(20px, 2.5vw, 40px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-size: var(--fs-stat);
    font-weight: 800;
    color: var(--accent-cyan);
    font-family: var(--font-code);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Sections */
.section {
    padding: var(--section-padding) 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(40px, 5vh, 80px);
}

.section-header h2 {
    font-size: var(--fs-h2);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: var(--fs-hero-sub);
}

/* Interactive 3D Stack Architecture Diagram */
.arch-diagram-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(320px, 35vw, 650px), 1fr));
    gap: clamp(24px, 3vw, 56px);
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: clamp(16px, 2vw, 28px);
    padding: clamp(24px, 3vw, 48px);
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.12), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.svg-diagram-container {
    width: 100%;
    border-radius: 16px;
    background: #030712;
    border: 1px solid var(--border-color);
    padding: 16px;
    overflow: hidden;
}

.arch-svg-graphic {
    width: 100%;
    height: auto;
    display: block;
}

.svg-layer-group {
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.svg-layer-group:hover .layer-shape, .svg-layer-group.active-target .layer-shape {
    stroke: var(--accent-cyan) !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.6));
}

.animated-tsv {
    animation: dashPulse 2s infinite linear;
}

@keyframes dashPulse {
    from { stroke-dashoffset: 20; }
    to { stroke-dashoffset: 0; }
}

.arch-info-panel {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: clamp(20px, 2.5vw, 36px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-family: var(--font-code);
    font-weight: 700;
    border-radius: 4px;
    align-self: flex-start;
}

.info-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 12px;
    border-top: 1px dashed var(--border-color);
    padding-top: 16px;
}

.spec-mini {
    display: flex;
    flex-direction: column;
}

.s-key {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.s-val {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-code);
    margin-top: 2px;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 26vw, 480px), 1fr));
    gap: clamp(20px, 2vw, 36px);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(16px, 1.8vw, 24px);
    padding: clamp(24px, 2.5vw, 44px);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
    transform: translateY(-6px);
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
}

.card-icon {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: var(--fs-h3);
    font-weight: 700;
    margin-bottom: 14px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: var(--fs-body);
    margin-bottom: 28px;
    flex-grow: 1;
}

.card-tag {
    align-self: flex-start;
    padding: 6px 14px;
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    font-size: var(--fs-small);
    font-family: var(--font-code);
    font-weight: 600;
    border-radius: 6px;
}

/* Interactive Simulator Section */
.simulator-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(16px, 2vw, 28px);
    padding: clamp(24px, 3vw, 48px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(320px, 38vw, 680px), 1fr));
    gap: clamp(24px, 3vw, 56px);
}

.sim-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-group label {
    display: block;
    font-size: var(--fs-body);
    font-weight: 600;
    margin-bottom: 10px;
}

.control-group span {
    color: var(--accent-cyan);
    font-family: var(--font-code);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-cyan);
    height: 8px;
    cursor: pointer;
}

select {
    width: 100%;
    padding: clamp(10px, 1vw, 14px);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: var(--fs-body);
}

/* Simulation Results & Waveforms */
.sim-results {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sim-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 12vw, 220px), 1fr));
    gap: 16px;
}

.metric-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: clamp(14px, 1.2vw, 20px);
    display: flex;
    flex-direction: column;
}

.m-label {
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

.m-val {
    font-size: clamp(1.05rem, 1.4vw, 1.5rem);
    font-weight: 700;
    margin-top: 6px;
    font-family: var(--font-code);
}

.highlight-green { color: var(--accent-green); }
.highlight-cyan { color: var(--accent-cyan); }

.waveform-box {
    background: #04060b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: clamp(16px, 1.8vw, 28px);
    font-family: var(--font-code);
}

.wf-header {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
}

.wf-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.sig-name {
    width: clamp(100px, 12vw, 160px);
    font-size: var(--fs-small);
    color: var(--text-secondary);
    word-break: break-all;
}

.sig-wave {
    flex: 1;
    height: 18px;
    background: #0f1626;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.sig-wave.active::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 30%;
    background: var(--accent-cyan);
    animation: wavePulse 1.5s infinite linear;
}

.preempt-wave.active::after { background: var(--accent-green); }
.resp-wave.active::after { background: var(--accent-blue); }

@keyframes wavePulse {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Benchmarks Grid */
.benchmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(320px, 32vw, 600px), 1fr));
    gap: clamp(24px, 2.5vw, 40px);
}

.bench-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(16px, 1.8vw, 24px);
    padding: clamp(24px, 2.5vw, 44px);
}

.bench-card h4 {
    margin-bottom: 20px;
    font-size: var(--fs-h3);
}

.bar-group {
    margin-bottom: 20px;
}

.bar-label {
    font-size: var(--fs-body);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.bar {
    height: clamp(12px, 1vw, 18px);
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-jedec { background: #3b82f6; }
.bar-custom { background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); }

/* Datasheet Box */
.datasheet-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(16px, 2vw, 28px);
    padding: clamp(32px, 4vw, 64px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 34vw, 650px), 1fr));
    gap: clamp(32px, 4vw, 64px);
    align-items: center;
}

.ds-list {
    list-style: none;
    margin-top: 20px;
}

.ds-list li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: var(--fs-body);
}

.ds-actions {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Contact Form */
.contact-box {
    max-width: clamp(650px, 50vw, 950px);
    margin: 0 auto;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 20vw, 400px), 1fr));
    gap: 20px;
}

input, textarea {
    width: 100%;
    padding: clamp(12px, 1.2vw, 18px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: var(--fs-body);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

footer {
    padding: clamp(30px, 4vh, 60px) 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--fs-small);
    border-top: 1px solid var(--border-color);
}

/* Media Queries for Ultrawide & Mobile Specific Tweaks */

/* 34" Ultrawide Monitors & 4K Displays (>= 2560px) */
@media (min-width: 2560px) {
    :root {
        --container-max: 2200px;
    }
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-bar {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablets & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .nav-links {
        display: none; /* Mobile menu mode */
    }
}

/* Mobile Screens (<= 640px) */
@media (max-width: 640px) {
    .hero-cta-group {
        flex-direction: column;
        width: 100%;
    }
    .btn {
        width: 100%;
    }
    .chip-caption {
        flex-direction: column;
        align-items: flex-start;
    }
}
