:root {
    --bg-color: #080808;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --accent: #ffaa00;
    --accent-secondary: #00ff88;
    --card-bg: #111111;
    --border-color: #2a2a2a;
    --font-mono: "Fira Code", "JetBrains Mono", Consolas, monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* --- HERO CANVAS (bare-metal silicon / PCB bus traces behind header) --- */
.hero-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: clamp(380px, 46vh, 580px);
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #14110a 0%, var(--bg-color) 72%);
    pointer-events: none;
}

#siliconCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(to bottom, transparent, var(--bg-color));
}

/* --- THE CUBE --- */
.nav-cube {
    position: absolute;
    top: 30px;
    left: 40px;
    width: 30px;
    height: 30px;
    perspective: 400px;
    display: block;
    cursor: pointer;
    z-index: 100;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 12s infinite linear;
}

.face {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 1px solid var(--accent);
    background: rgba(255, 170, 0, 0.05);
    transition: all 0.3s ease;
}

.front  { transform: translateZ(15px); }
.back   { transform: rotateY(180deg) translateZ(15px); }
.left   { transform: rotateY(-90deg) translateZ(15px); }
.right  { transform: rotateY(90deg) translateZ(15px); }
.top    { transform: rotateX(90deg) translateZ(15px); }
.bottom { transform: rotateX(-90deg) translateZ(15px); }

@keyframes rotateCube {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to { transform: rotateX(360deg) rotateY(360deg); }
}

.nav-cube:hover .face {
    border-color: var(--accent-secondary);
    background: rgba(0, 255, 136, 0.1);
}

/* --- MAIN STYLES --- */
header {
    margin-top: 110px;
    margin-bottom: 50px;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 820px;
    margin: 0 auto;
}

h1 {
    font-size: 3.5rem;
    color: var(--text-main);
    letter-spacing: -2px;
    margin-bottom: 10px;
}

h1::after {
    content: '_';
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

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

.subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 26px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.terminal-bar {
    background-color: rgba(17, 17, 17, 0.92);
    border: 1px solid var(--border-color);
    padding: 15px 25px;
    display: inline-block;
    border-radius: 4px;
    color: var(--accent-secondary);
    margin-bottom: 20px;
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.6;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.github-link a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.github-link a:hover {
    color: var(--text-main);
}

main {
    max-width: 900px;
    width: 100%;
}

/* Benchmark / Spec Section */
.benchmark-section {
    margin-bottom: 60px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 6px;
}

.benchmark-section h2 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-align: center;
}

.benchmark-section p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.benchmark-table th, .benchmark-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.benchmark-table th {
    color: var(--accent-secondary);
    font-weight: normal;
}

.benchmark-table .highlight {
    color: var(--accent);
    font-weight: bold;
}

.benchmark-table .dim {
    color: var(--text-muted);
}

/* Hardware Bus Layer Diagram */
.stack-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 22px 0;
}

.stack-row {
    display: grid;
    grid-template-columns: 165px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #0b0b0b;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    font-size: 0.88rem;
}

.stack-row.hw {
    border-left-color: var(--accent-secondary);
}

.stack-layer {
    color: var(--text-main);
    font-weight: bold;
}

.stack-desc {
    color: var(--text-muted);
}

.stack-ring {
    color: var(--accent-secondary);
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 20px;
    margin-bottom: 70px;
    justify-content: center;
}

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 4px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-secondary);
}

.feature-card h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.feature-card strong {
    color: var(--text-main);
}

/* Quickstart */
.quickstart {
    margin-bottom: 70px;
}

.quickstart h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.code-window {
    background-color: #050505;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.code-header {
    background-color: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.filename {
    margin-left: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

pre {
    padding: 20px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.55;
}

code {
    font-family: var(--font-mono);
}

p code, td code, li code {
    color: var(--accent-secondary);
    background: #171717;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Syntax Highlighting */
.keyword { color: var(--accent); font-weight: bold; }
.type { color: var(--accent-secondary); }
.modifier { color: #ff3366; }
.literal { color: #e5c07b; }
.comment { color: #5c6370; font-style: italic; }

footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

footer a {
    color: var(--accent-secondary);
    text-decoration: none;
    margin: 0 8px;
}

footer a:hover {
    text-decoration: underline;
}

/* --- Homepage: hero link row, facts row, callouts --- */
.hero-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 15px;
}

.latest-pill {
    margin-top: 18px;
    font-size: 0.85rem;
}

.latest-pill a {
    color: var(--accent-secondary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 14px;
    display: inline-block;
    background: rgba(8, 8, 8, 0.75);
}

.latest-pill a:hover {
    border-color: var(--accent-secondary);
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 15px;
    margin-bottom: 60px;
}

.fact {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 18px;
    text-align: center;
}

.fact-value {
    display: block;
    color: var(--accent);
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 6px;
}

.fact-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.fact-label a,
.benchmark-section a,
.feature-card a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.fact-label a:hover,
.benchmark-section a:hover,
.feature-card a:hover {
    text-decoration: underline;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 25px;
}

.benchmark-section .sub-heading {
    color: var(--accent-secondary);
    margin: 28px 0 12px 0;
    font-size: 1.05rem;
}

.benchmark-section p.note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 14px;
    margin-bottom: 10px;
    text-align: left;
}

.release-list {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 14px 22px;
}

.release-list li {
    margin-bottom: 10px;
}

.release-list strong {
    color: var(--text-main);
}

.callout {
    border-left: 3px solid var(--accent-secondary);
    background: rgba(255,255,255,0.02);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.benchmark-section .callout p {
    font-size: 0.88rem;
    margin: 0;
    text-align: left;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Silicon Proof Photo Gallery */
.silicon-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.silicon-shot {
    margin: 0;
    background: #050505;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.silicon-shot img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--border-color);
}

.silicon-shot figcaption {
    padding: 12px 15px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.silicon-shot figcaption strong {
    color: var(--text-main);
}

/* Docs / Engineering Records Grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.doc-link {
    display: block;
    background: #0b0b0b;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px 14px;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.doc-link:hover {
    border-color: var(--accent-secondary);
    text-decoration: none;
}

.doc-link .doc-name {
    display: block;
    color: var(--accent-secondary);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.doc-link .doc-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .silicon-gallery {
        grid-template-columns: 1fr;
    }
    header {
        margin-top: 85px;
    }
    h1 {
        font-size: 2.5rem;
    }
    .subtitle {
        font-size: 0.98rem;
        padding: 0 8px;
    }
    .terminal-bar {
        font-size: 0.82rem;
        padding: 10px 15px;
        max-width: 100%;
        overflow-x: auto;
    }
    .stack-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .stack-ring {
        justify-self: start;
    }
    .feature-card {
        padding: 16px;
    }
    .benchmark-section {
        padding: 20px 15px;
    }
    .benchmark-section .benchmark-table th,
    .benchmark-section .benchmark-table td {
        padding: 8px 10px;
    }
    pre {
        font-size: 0.8rem;
        padding: 15px;
    }
    .nav-cube {
        top: 15px;
        left: 15px;
        width: 25px;
        height: 25px;
    }
    .face {
        width: 25px;
        height: 25px;
    }
    .front  { transform: translateZ(12.5px); }
    .back   { transform: rotateY(180deg) translateZ(12.5px); }
    .left   { transform: rotateY(-90deg) translateZ(12.5px); }
    .right  { transform: rotateY(90deg) translateZ(12.5px); }
    .top    { transform: rotateX(90deg) translateZ(12.5px); }
    .bottom { transform: rotateX(-90deg) translateZ(12.5px); }
}
