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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: #14110f;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: rgba(30, 26, 22, 0.85);
    backdrop-filter: blur(12px);
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    border-bottom: 1px solid #3a332c;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.nav-brand-link {
    display: inline-block;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: #e0a458;
    padding: 0.5rem 0;
    transition: transform 0.2s ease-in;
}

.nav-brand-link:visited,
.nav-brand-link:focus,
.nav-brand-link:active {
    color: #e0a458;
    text-decoration: none;
}

.nav-brand-link:hover,
.nav-brand-link:focus {
    transform: scale(1.01);
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #cbb9a5;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nav-links a:hover {
    background: rgba(224, 164, 88, 0.18);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.github-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .nav-links {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    .nav-links li {
        width: 100%;
    }
    .nav-links a {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 0.9rem;
    }
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: linear-gradient(135deg, #2a221b 0%, #14110f 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid #3a332c;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0;
    font-weight: 300;
    color: #e0a458;
    letter-spacing: 0.04em;
}

.hero p.ipa-subtitle {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: #cbb9a5;
}

.hero p.expansion {
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9c8f7e;
    margin-bottom: 1.25rem;
}

.hero p.version-mark {
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    color: #9c8f7e;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.hero p.version-mark code {
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #e0a458;
    background: rgba(224, 164, 88, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 640px;
    margin: 0 auto;
    color: #cbb9a5;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding: 4rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin-top: 2rem;
}

.content-section {
    background: #221d18;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    margin-bottom: 2rem;
    border: 1px solid #3a332c;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #e0a458;
    border-bottom: 2px solid #e0a458;
    padding-bottom: 0.5rem;
}

.content-section h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem 0;
    color: #e0a458;
    border-bottom: 2px solid #e0a458;
    padding-bottom: 0.5rem;
    display: inline-block;
    width: fit-content;
}

.content-section h4 {
    color: #e2e8f0;
    margin: 1rem 0 0.5rem 0;
}

.content-section h3.guide-link {
    color: #5eb3b3;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 4px solid #5eb3b3;
    padding-left: 10px;
    display: inline-block;
    border-bottom: none;
    padding-bottom: 0;
}

.content-section h3.guide-link a {
    color: #5eb3b3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-section h3.guide-link a:hover {
    color: #7fd4d4;
    text-decoration: underline;
}

.content-section p {
    color: #cbb9a5;
    margin-bottom: 1rem;
}

.content-section ul {
    color: #cbb9a5;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.35rem;
}

.content-section a {
    color: #e0a458;
    text-decoration: none;
    transition: color 0.3s ease;
}

.content-section a:hover {
    color: #f0c489;
    text-decoration: underline;
}

/* ==================== DISCLAIMER ==================== */
.disclaimer {
    background: #4a2f10;
    border-left: 4px solid #d69e2e;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.disclaimer h4 {
    color: #fbd38d;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer h4::before {
    content: "\26A0\FE0F";
    font-size: 1.2rem;
}

.disclaimer p {
    color: #fed7aa;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: #221d18;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    margin-bottom: 1.5rem;
    border: 1px solid #3a332c;
}

.sidebar-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #e0a458;
}

.sidebar-section p {
    color: #cbb9a5;
    font-size: 0.9rem;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    margin-bottom: 0.5rem;
}

.sidebar-list a {
    color: #d9b98c;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-list a:hover {
    color: #e0a458;
    text-decoration: underline;
}

/* ==================== TABLES ==================== */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #14110f;
    border-radius: 8px;
    overflow: hidden;
}

.spec-table th,
.spec-table td {
    border: 1px solid #3a332c;
    padding: 0.75rem;
    text-align: left;
}

.spec-table th {
    background: #3a332c;
    font-weight: 600;
    color: #e2e8f0;
}

.spec-table td {
    color: #cbb9a5;
}

.spec-table caption {
    caption-side: top;
    font-weight: 600;
    font-size: 1rem;
    color: #e2e8f0;
    text-align: left;
    margin-bottom: 0.5rem;
}

/* ==================== FIGURES ==================== */
figure {
    text-align: center;
    margin: 1rem 0;
}

figure figcaption {
    font-weight: 600;
    font-size: 1rem;
    color: #e2e8f0;
    margin-top: 0.5rem;
    text-align: center;
}

/* ==================== CODE BLOCKS ==================== */
.code-block {
    background: #14110f;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #3a332c;
}

/* ==================== STATUS BADGES ==================== */
.status-badge {
    display: inline-block;
    background: #48bb78;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.status-badge.in-progress {
    background: #ed8936;
}

.status-badge.planned {
    background: #9f7aea;
}

/* ==================== SCROLL MARGIN ==================== */
section[id],
h1[id],
h2[id],
h3[id] {
    scroll-margin-top: 80px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .sidebar {
        position: static;
    }
}


/* ==================== FABRICATION PAGE ==================== */
details.fab-spec {
    background: #14110f;
    border: 1px solid #3a332c;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

details.fab-spec > summary {
    cursor: pointer;
    padding: 0.85rem 1rem;
    color: #e0a458;
    font-weight: 600;
    background: #3a332c;
    list-style: none;
    user-select: none;
}

details.fab-spec > summary::-webkit-details-marker { display: none; }

details.fab-spec > summary::after {
    content: " — show full settings";
    color: #9c8f7e;
    font-weight: 400;
    font-size: 0.85rem;
}

details.fab-spec[open] > summary::after { content: " — hide full settings"; }

details.fab-spec .spec-table { margin: 0; border-radius: 0; }

.fab-callout {
    background: #221d18;
    border-left: 4px solid #e0a458;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.fab-callout h4 { color: #e0a458; margin-bottom: 0.5rem; }
.fab-callout p { margin-bottom: 0.5rem; }
.fab-callout p:last-child { margin-bottom: 0; }

.spec-table tr.cat-row td {
    background: #2a221b;
    color: #e0a458;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.provisional-tag {
    display: inline-block;
    background: rgba(224, 164, 88, 0.12);
    color: #e0a458;
    border: 1px solid rgba(224, 164, 88, 0.3);
    padding: 0.1rem 0.55rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
    vertical-align: middle;
}