:root {
    --bg-0: #020403;
    --bg-1: #060c08;
    --bg-2: #0c140e;
    --panel: rgba(6, 16, 11, 0.88);
    --panel-strong: rgba(3, 11, 7, 0.95);
    --ink-strong: #fff5db;
    --ink: #e8dbb5;
    --ink-muted: #9e916d;
    --line: rgba(255, 193, 7, 0.22);
    --line-strong: rgba(255, 193, 7, 0.55);
    --gold: #ffc107;
    --gold-soft: #ffb300;
    --gold-bright: #ffd54f;
    --green: #42ffa4;
    --green-soft: #2dd387;
    --cyan: #18f4ff;
    --warning: #ffe36d;
    --danger: #ff4fd8;
    --radius: 12px;
    --space-1: 0.5rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --shell-width: min(1200px, calc(100% - 2.5rem));
    --glow-gold: 0 0 0 1px rgba(255, 193, 7, 0.25), 0 0 18px rgba(255, 193, 7, 0.22), 0 0 50px rgba(255, 193, 7, 0.08);
    --glow-green: 0 0 0 1px rgba(66, 255, 164, 0.22), 0 0 18px rgba(66, 255, 164, 0.18), 0 0 55px rgba(66, 255, 164, 0.08);
    --glow-cyan: 0 0 0 1px rgba(24, 244, 255, 0.2), 0 0 16px rgba(24, 244, 255, 0.16), 0 0 40px rgba(24, 244, 255, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--gold-soft) #03110c;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
    line-height: 1.6;
    background:
        radial-gradient(circle at 10% -15%, rgba(255, 193, 7, 0.12), transparent 40%),
        radial-gradient(circle at 95% 20%, rgba(66, 255, 164, 0.08), transparent 30%),
        linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 35%, var(--bg-0) 100%);
    min-height: 100vh;
    text-rendering: optimizeLegibility;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        repeating-linear-gradient(180deg, rgba(255, 193, 7, 0.035) 0, rgba(255, 193, 7, 0.035) 1px, transparent 1px, transparent 3px),
        linear-gradient(90deg, rgba(5, 17, 13, 0.7), rgba(5, 17, 13, 0.45) 18%, rgba(5, 17, 13, 0.7));
    mix-blend-mode: screen;
    animation: scanline-shift 8s linear infinite;
}

@keyframes scanline-shift {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

body::after {
    background-image:
        radial-gradient(circle at 22% 17%, rgba(255, 255, 255, 0.04) 0 0.5px, transparent 0.5px),
        radial-gradient(circle at 68% 77%, rgba(255, 255, 255, 0.035) 0 0.5px, transparent 0.5px);
    background-size: 6px 6px, 9px 9px;
    opacity: 0.2;
}

.skip-link {
    position: fixed;
    top: -1%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #001b10;
    background: var(--gold);
    padding: 0.75rem 1rem;
    z-index: 300;
    text-decoration: none;
    border: 1px solid var(--line-strong);
    border-radius: 0 0 999px 999px;
    box-shadow: var(--glow-gold);
    opacity: 0.88;
    pointer-events: auto;
    transform: translate(-50%, -58%);
    transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.skip-link:hover,
.skip-link:focus,
.skip-link:focus-visible {
    opacity: 1;
    transform: translate(-50%, 0);
    box-shadow: var(--glow-gold);
}

#main-content {
    scroll-margin-top: 6rem;
}

.page-shell {
    width: var(--shell-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero {
    padding: var(--space-4) 0 var(--space-6);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding: 0.95rem 1.15rem;
    background: linear-gradient(180deg, rgba(16, 22, 10, 0.9), rgba(8, 14, 8, 0.82));
    border: 1px solid var(--line);
    box-shadow: var(--glow-gold);
    position: sticky;
    top: 0.8rem;
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    z-index: 100;
}

.brand,
.topbar a,
.text-link,
.button,
.projects-grid a {
    text-decoration: none;
    color: var(--ink-strong);
}

.brand {
    font-family: "Share Tech Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.97rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-mark {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.8);
}

.brand-vault {
    color: var(--gold);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    padding: 2px 6px;
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 4px;
    background: rgba(255, 193, 7, 0.1);
}

.topbar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.topbar-links a {
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-muted);
    padding: 0.3rem 0.65rem;
    border: 1px solid transparent;
    transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
    border-radius: 4px;
}

.topbar-links a:hover,
.topbar-links a:focus-visible {
    color: var(--ink-strong);
    border-color: rgba(255, 193, 7, 0.5);
    background: rgba(255, 193, 7, 0.08);
}

.hero-copy {
    padding-top: var(--space-5);
    animation: boot-rise 900ms ease-out both;
}

@keyframes boot-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.terminal-line {
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(255, 193, 7, 0.35);
    background: rgba(10, 14, 6, 0.9);
    padding: 0.62rem 0.85rem;
    color: var(--ink-muted);
    max-width: 60rem;
    border-radius: 6px;
    font-size: 0.84rem;
}

.prompt {
    color: var(--gold);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-msg,
#status-message {
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.status-time {
    margin-left: auto;
    color: var(--warning);
    white-space: nowrap;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.eyebrow,
.card-kicker,
.roadmap span,
.card-list dt {
    color: var(--gold);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 600;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Share Tech Mono", monospace;
    line-height: 1.15;
    color: var(--ink-strong);
}

h1 {
    max-width: 28ch;
    margin-top: 0.85rem;
    font-size: clamp(2rem, 5vw, 3.8rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-shadow: 0 0 22px rgba(255, 193, 7, 0.2);
}

h1 span {
    color: var(--gold);
    text-shadow: 0 0 16px rgba(255, 193, 7, 0.6);
}

h2 {
    font-size: clamp(1.5rem, 3.8vw, 2.5rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

h3 {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

.lead {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    color: var(--ink);
    max-width: 65ch;
    margin: 1.2rem 0 1.8rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
    border: 1px solid transparent;
}

.button-primary {
    background: var(--gold);
    color: #0c1005;
    box-shadow: 0 0 16px rgba(255, 193, 7, 0.35);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: var(--gold-bright);
    box-shadow: 0 0 24px rgba(255, 193, 7, 0.6);
    transform: translateY(-2px);
}

.button-secondary {
    background: rgba(255, 193, 7, 0.08);
    color: var(--gold);
    border-color: rgba(255, 193, 7, 0.35);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: rgba(255, 193, 7, 0.16);
    border-color: var(--gold);
    box-shadow: 0 0 16px rgba(255, 193, 7, 0.2);
    transform: translateY(-2px);
}

.hero-metrics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.hero-metrics li {
    display: flex;
    flex-direction: column;
}

.hero-metrics strong {
    font-size: 1.4rem;
    color: var(--gold);
    font-family: "Share Tech Mono", monospace;
}

.hero-metrics span {
    font-size: 0.72rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section {
    padding: var(--space-5) 0;
}

.section-heading {
    margin-bottom: var(--space-4);
}

.section-heading.narrow {
    max-width: 50ch;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-4);
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--glow-gold);
}

.card.accent-amber {
    border-color: rgba(255, 193, 7, 0.35);
}

.card.accent-amber:hover {
    border-color: rgba(255, 193, 7, 0.7);
    box-shadow: var(--glow-gold);
}

.card.accent-cyan {
    border-color: rgba(24, 244, 255, 0.3);
}

.card.accent-cyan:hover {
    border-color: rgba(24, 244, 255, 0.6);
    box-shadow: var(--glow-cyan);
}

.card h3 {
    margin: 0.3rem 0 0.8rem;
    color: var(--ink-strong);
}

.card p {
    color: var(--ink-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.card-list {
    margin: 1.2rem 0;
    display: grid;
    gap: 0.6rem;
    font-size: 0.82rem;
}

.card-list dt {
    font-size: 0.68rem;
}

.card-list dd {
    margin: 0;
    color: var(--ink);
}

.text-link-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 6px;
    color: var(--gold);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.text-link-btn:hover,
.text-link-btn:focus-visible {
    background: var(--gold);
    color: #0a0e04;
    border-color: var(--gold);
    box-shadow: 0 0 16px rgba(255, 193, 7, 0.4);
}

.roadmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.roadmap article {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.roadmap h3 {
    margin: 0.4rem 0 0.5rem;
    font-size: 1rem;
}

.roadmap p {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin: 0;
}

.topics-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-4);
}

.topic-panel {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.topic-panel h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.topic-panel ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--ink-muted);
    font-size: 0.84rem;
    display: grid;
    gap: 0.45rem;
}

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

.projects-grid article {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.projects-grid h3 {
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.projects-grid p {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-bottom: 0.8rem;
}

.projects-grid ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    display: grid;
    gap: 0.4rem;
}

.projects-grid a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.projects-grid a:hover {
    color: var(--gold-bright);
}

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

.glass-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.glass-panel h2 {
    font-size: 1.2rem;
    margin: 0.4rem 0 0.8rem;
}

.glass-panel p {
    color: var(--ink-muted);
    font-size: 0.86rem;
    margin: 0;
}

details {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem 1.2rem;
    margin-bottom: 0.8rem;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-strong);
    font-size: 0.88rem;
}

details p {
    color: var(--ink-muted);
    font-size: 0.84rem;
    margin: 0.6rem 0 0;
}

.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.8rem;
}

.related-list a {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--gold);
    font-size: 0.82rem;
    transition: background-color 160ms ease, border-color 160ms ease;
    text-decoration: none;
}

.related-list a:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--gold);
}

.footer {
    padding: var(--space-5) 0 var(--space-6);
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.footer a {
    color: var(--gold);
    text-decoration: none;
}

/* PDF viewer modal */
.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modal-in 220ms ease both;
}

.pdf-modal[hidden] {
    display: none;
}

@keyframes modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 8, 5, 0.9);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.pdf-modal-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1040px, 100%);
    height: min(92vh, 920px);
    background: linear-gradient(160deg, rgba(8, 14, 6, 0.98), rgba(3, 8, 4, 0.99));
    border: 1px solid var(--line-strong);
    box-shadow: var(--glow-gold), 0 32px 80px rgba(0, 0, 0, 0.8);
    border-radius: var(--radius);
    overflow: hidden;
    animation: shell-rise 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shell-rise {
    from { transform: translateY(28px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.pdf-modal-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 12, 5, 0.95);
    flex-shrink: 0;
}

.pdf-modal-name {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.88rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-strong);
    flex: 1;
}

.pdf-modal-close {
    background: none;
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: var(--gold);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
    flex-shrink: 0;
}

.pdf-modal-close:hover,
.pdf-modal-close:focus-visible {
    background: rgba(255, 193, 7, 0.2);
    border-color: var(--gold);
    color: #fff;
    outline: none;
}

.pdf-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.pdf-frame {
    flex: 1;
    width: 100%;
    border: none;
    display: block;
    background: #030a05;
    pointer-events: auto;
}

.pdf-notice {
    flex-shrink: 0;
    margin: 0;
    padding: 0.45rem 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    background: rgba(4, 8, 3, 0.95);
    border-top: 1px solid var(--line);
    text-align: center;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .terminal-line {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "prompt time"
            "status status";
        gap: 0.35rem 0.5rem;
        padding: 0.6rem 0.75rem;
        font-size: 0.76rem;
    }

    .prompt {
        grid-area: prompt;
        font-size: 0.76rem;
    }

    .status-time {
        grid-area: time;
        font-size: 0.72rem;
        margin-left: 0;
        text-align: right;
    }

    .status-msg,
    #status-message {
        grid-area: status;
        font-size: 0.75rem;
        color: var(--ink);
        white-space: normal;
        word-break: break-word;
        overflow: visible;
        padding-top: 3px;
        border-top: 1px dashed rgba(255, 193, 7, 0.18);
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
