:root {
    --bg-obsidian: #0b0d10;
    --bg-deep: #080b12;
    --bg-right: #0d121c;
    --bg-surface: rgba(15, 23, 42, 0.72);
    --bg-surface-solid: #111827;
    --bg-card-left: #13171d;
    --bg-card-right: rgba(6, 182, 212, 0.04);
    --text-primary: #f8fafc;
    --text-secondary: #9ba3b0;
    --text-muted: #64748b;
    --gold: #c5a365;
    --gold-dim: #8c7143;
    --cyan: #06b6d4;
    --cyan-bright: #22d3ee;
    --cyan-soft: #67e8f9;
    --cyan-glow: rgba(6, 182, 212, 0.25);
    --emerald: #10b981;
    --emerald-soft: #6ee7b7;
    --emerald-glow: rgba(16, 185, 129, 0.22);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-cyan: rgba(6, 182, 212, 0.24);
    --border-emerald: rgba(16, 185, 129, 0.26);
    --border-gold: rgba(197, 163, 101, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: clip;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--cyan-soft);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.18;
}

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.12rem 0.4rem;
    border-radius: 5px;
    color: #e2e8f0;
    overflow-wrap: anywhere;
}

/* =========================================================
   Buttons & Pills
   ========================================================= */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.45rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.94rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    font-family: var(--font-sans);
}

.btn-sm {
    padding: 0.6rem 1.05rem;
    font-size: 0.86rem;
}

.btn-gold {
    background: #1c222b;
    color: var(--gold);
    border-color: var(--gold-dim);
}

.btn-gold:hover {
    background: #252d3a;
    border-color: var(--gold);
    transform: translateY(-1px);
}

.btn-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px var(--cyan-glow);
}

.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(6, 182, 212, 0.42);
}

.btn-cyan-outline {
    background: rgba(6, 182, 212, 0.08);
    color: var(--cyan-soft);
    border-color: rgba(6, 182, 212, 0.35);
}

.btn-cyan-outline:hover {
    background: rgba(6, 182, 212, 0.16);
    border-color: var(--cyan-bright);
    transform: translateY(-2px);
}

.btn-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px var(--emerald-glow);
}

.btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(16, 185, 129, 0.38);
}

.btn-emerald-outline {
    background: rgba(16, 185, 129, 0.08);
    color: var(--emerald-soft);
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-emerald-outline:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: var(--emerald);
    transform: translateY(-2px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pill-cyan {
    background: rgba(6, 182, 212, 0.14);
    color: var(--cyan-bright);
    border: 1px solid rgba(6, 182, 212, 0.32);
}

.pill-emerald {
    background: rgba(16, 185, 129, 0.14);
    color: var(--emerald-soft);
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.pill-gold {
    background: rgba(197, 163, 101, 0.15);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
}

/* =========================================================
   Inner-Page Shell: Sticky Top Navigation
   ========================================================= */
.page-shell {
    background:
        radial-gradient(ellipse 80% 45% at 50% -10%, rgba(6, 182, 212, 0.12), transparent 65%),
        radial-gradient(ellipse 50% 40% at 95% 20%, rgba(16, 185, 129, 0.07), transparent 60%),
        var(--bg-deep);
    position: relative;
}

.page-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.page-shell.theme-sentinel {
    background:
        radial-gradient(ellipse 80% 45% at 50% -10%, rgba(16, 185, 129, 0.13), transparent 65%),
        radial-gradient(ellipse 50% 40% at 10% 30%, rgba(6, 182, 212, 0.07), transparent 60%),
        var(--bg-deep);
}

.page-shell.theme-license {
    background:
        radial-gradient(ellipse 80% 45% at 50% -10%, rgba(197, 163, 101, 0.11), transparent 65%),
        radial-gradient(ellipse 50% 40% at 85% 25%, rgba(6, 182, 212, 0.08), transparent 60%),
        var(--bg-deep);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 11, 18, 0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.9rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.nav-emblem {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--gold-dim);
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.nav-brand-title {
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.nav-brand-sub {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cyan-soft);
}

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

.nav-links a {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 7px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.18s ease, background 0.18s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--cyan-bright);
    background: rgba(6, 182, 212, 0.12);
}

.nav-links a.active-emerald {
    color: var(--emerald-soft);
    background: rgba(16, 185, 129, 0.12);
}

.nav-links a.active-gold {
    color: var(--gold);
    background: rgba(197, 163, 101, 0.12);
}

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

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

/* =========================================================
   Main Content Container & Sections
   ========================================================= */
.container {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.75rem;
}

.hero {
    padding: 4.5rem 0 3.25rem;
}

.hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2.15rem, 4.2vw, 3.45rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.15rem;
    max-width: 900px;
}

.gradient-cyan {
    background: linear-gradient(135deg, #ffffff 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-emerald {
    background: linear-gradient(135deg, #ffffff 0%, #6ee7b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-gold {
    background: linear-gradient(135deg, #ffffff 0%, #e6cb91 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 760px;
    margin-bottom: 2rem;
}

.section {
    padding: 3rem 0;
    border-top: 1px solid var(--border-subtle);
}

.section-header {
    margin-bottom: 2rem;
}

.section-kicker {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan-soft);
    margin-bottom: 0.5rem;
}

.section-kicker.emerald {
    color: var(--emerald-soft);
}

.section-kicker.gold {
    color: var(--gold);
}

.section-header h2 {
    font-size: clamp(1.55rem, 2.5vw, 2.15rem);
    margin-bottom: 0.55rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 740px;
    font-size: 0.98rem;
}

/* =========================================================
   Cards & Grids
   ========================================================= */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card > * {
    min-width: 0;
}

.card-cyan {
    border-color: var(--border-cyan);
    background: linear-gradient(160deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 23, 42, 0.76) 55%);
}

.card-cyan:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.card-emerald {
    border-color: var(--border-emerald);
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.76) 55%);
}

.card-emerald:hover {
    border-color: rgba(52, 211, 153, 0.5);
}

.card-gold {
    border-color: var(--border-gold);
    background: linear-gradient(160deg, rgba(197, 163, 101, 0.08) 0%, rgba(17, 24, 39, 0.8) 55%);
}

.card h3 {
    font-size: 1.22rem;
    margin-bottom: 0.65rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    font-size: 0.94rem;
    margin-bottom: 1rem;
}

.card p:last-child {
    margin-bottom: 0;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1rem 0 1.25rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
}

.check-list {
    list-style: none;
    margin: 0.75rem 0 1.25rem;
}

.check-list li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.55rem;
    color: #cbd5e1;
    font-size: 0.92rem;
}

.check-list li::before {
    content: "✦";
    position: absolute;
    left: 0;
    top: 1px;
    color: var(--cyan-bright);
    font-size: 0.82rem;
}

.check-list.emerald li::before {
    color: var(--emerald-soft);
}

.check-list.gold li::before {
    content: "◆";
    color: var(--gold);
    font-size: 0.72rem;
    top: 3px;
}

/* =========================================================
   Code Blocks & Copy Buttons
   ========================================================= */
.code-block {
    background: #06090f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 100%;
    margin: 1rem 0;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.24rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
    background: rgba(6, 182, 212, 0.16);
    border-color: var(--cyan);
    color: var(--cyan-soft);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--emerald);
    color: var(--emerald-soft);
}

.code-block pre {
    padding: 1rem 1.1rem;
    overflow-x: auto;
    max-width: 100%;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.55;
    color: #e2e8f0;
}

.code-block pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    overflow-wrap: normal;
}

/* =========================================================
   Tables
   ========================================================= */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(11, 15, 25, 0.75);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 620px;
}

thead th {
    text-align: left;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.9rem 1.05rem;
    border-bottom: 1px solid var(--border-subtle);
}

tbody td {
    padding: 0.88rem 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody td strong {
    color: var(--text-primary);
}

/* =========================================================
   Architecture & License Callouts
   ========================================================= */
.arch-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.arch-node {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-md);
    padding: 1.15rem;
}

.arch-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--emerald-soft);
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}

.arch-node h4 {
    font-size: 0.96rem;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
}

.arch-node p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.license-box {
    background: #06090f;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.72;
    color: #dbe3ee;
    white-space: pre-wrap;
    overflow-x: auto;
}

.callout-banner {
    border-radius: var(--radius-lg);
    padding: 1.85rem 2rem;
    border: 1px solid var(--border-gold);
    background: linear-gradient(135deg, rgba(197, 163, 101, 0.1) 0%, rgba(6, 182, 212, 0.07) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.callout-banner h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.callout-banner p {
    color: var(--text-secondary);
    font-size: 0.94rem;
    max-width: 680px;
}

.callout-banner-legacy {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, rgba(197, 163, 101, 0.11) 0%, rgba(19, 23, 29, 0.92) 65%);
}

.closure-hero-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.closure-emblem {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid var(--gold-dim);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
    flex-shrink: 0;
}

.notice-list {
    list-style: none;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #28303d;
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    margin: 1rem 0 1.25rem;
    color: #e2e6ec;
    font-size: 0.96rem;
}

.notice-list li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.7rem;
}

.notice-list li:last-child {
    margin-bottom: 0;
}

.notice-list li::before {
    content: "◆";
    color: var(--gold);
    font-size: 0.72rem;
    position: absolute;
    left: 0;
    top: 3px;
}

.gratitude-note {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 1rem;
}

/* =========================================================
   Site Footer (Inner Pages)
   ========================================================= */
.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(6, 9, 15, 0.85);
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.5rem 1.75rem;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 0.65rem;
    max-width: 400px;
}

.footer-col h4 {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.85rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.15s ease;
}

.footer-col a:hover {
    color: var(--cyan-soft);
}

.footer-bottom {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.15rem 1.75rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================================
   Responsive Breakpoints
   ========================================================= */
@media (max-width: 1024px) {
    .arch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(8, 11, 18, 0.97);
        border-bottom: 1px solid var(--border-subtle);
        padding: 0.85rem 1.25rem 1.15rem;
        gap: 0.25rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-actions .btn-desktop-only {
        display: none;
    }

    .grid-2,
    .grid-3,
    .arch-grid,
    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        padding: 3.25rem 0 2.25rem;
    }

    .closure-hero-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
