:root {
    --panel: rgba(252, 253, 250, 0.92);
    --terminal: #293545;
    --terminal-2: #354457;
    --ink: #27303b;
    --muted: #667384;
    --line: rgba(52, 66, 84, 0.11);
    --signal: #d36d48;
    --signal-soft: #f4e7dd;
    --accent: #40766f;
    --accent-deep: #405f74;
    --grid: rgba(52, 66, 84, 0.045);
    --shadow: 0 18px 42px rgba(47, 61, 78, 0.09);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        linear-gradient(90deg, rgba(52, 66, 84, 0.045) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(52, 66, 84, 0.04) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, #f7f8f5 0%, #eef4f1 52%, #f4eee6 100%);
    background-size: 28px 28px, 28px 28px, 100% 100%;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 82%);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    width: min(1440px, calc(100% - 32px));
    margin: 22px auto 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(252, 253, 250, 0.78);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 26px rgba(47, 61, 78, 0.06);
    position: sticky;
    top: 14px;
    z-index: 20;
}

.brandline {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.badge-1993 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, #587d8f, #7a9a8e);
    color: #fff7ec;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.brand-copy strong,
h1,
h2,
.window-head,
.number,
.repo-title,
.ref-title {
    font-family: Georgia, "Times New Roman", serif;
}

.brand-copy strong {
    display: block;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand-copy span {
    color: var(--muted);
    font-size: 0.9rem;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
    background: rgba(64, 118, 111, 0.08);
    color: var(--ink);
    transform: translateY(-1px);
}

.hero,
.window,
.repo-card,
.repo-preview,
.callout,
.ref-card,
.sidebar,
.note,
.metric,
.card,
.quote,
.cta-card,
.legal-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(10px);
}

.hero {
    margin-top: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(90deg, rgba(52, 66, 84, 0.045) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(52, 66, 84, 0.04) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(252, 253, 250, 0.96), rgba(240, 246, 242, 0.93));
    background-size: 34px 34px, 34px 34px, 100% 100%;
}

.hero::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -40px;
    width: 340px;
    height: 340px;
    border: 1px solid rgba(64, 95, 116, 0.1);
    border-radius: 28px;
    background: repeating-linear-gradient(135deg, rgba(64, 95, 116, 0.045) 0 2px, transparent 2px 13px);
    transform: rotate(8deg);
    opacity: 0.32;
}

.ticker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #fff6ec;
    color: var(--accent-deep);
    border: 1px solid rgba(64, 95, 116, 0.1);
    font-size: 0.84rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticker::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 6px rgba(211, 109, 72, 0.1);
    animation: pulse 1.8s infinite;
}

.hero-grid,
.grid-2,
.cards-3,
.cards-2,
.timeline-grid,
.contact-grid,
.repo-layout,
.repo-grid,
.refs-layout,
.refs-grid {
    display: grid;
    gap: 18px;
}

.hero-grid {
    margin-top: 20px;
    grid-template-columns: 1.28fr 0.92fr;
    gap: 22px;
    position: relative;
    z-index: 1;
}

.repo-layout,
.refs-layout {
    grid-template-columns: 1.08fr 0.92fr;
    margin-top: 18px;
}

.repo-grid,
.refs-grid,
.cards-2,
.timeline-grid,
.contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: 1.08fr 0.92fr;
}

.cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

h1 {
    font-size: clamp(2.5rem, 4.4vw, 4.9rem);
    line-height: 1.02;
    margin: 18px 0;
    max-width: 12ch;
}

.eyebrow,
.tag,
.quote strong,
.kicker {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--signal-soft);
    color: #8b563e;
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.eyebrow {
    margin-bottom: 12px;
}

.tag {
    margin-bottom: 16px;
}

.hero-copy p,
.section-header p,
.card p,
.quote p,
.timeline-item p,
.hero p,
.callout p,
.repo-meta,
.repo-description,
.empty-note,
.ref-copy,
.sidebar p,
.note p,
.meta {
    color: var(--muted);
    line-height: 1.68;
}

.hero-copy p {
    max-width: 62ch;
    font-size: 1.05rem;
    margin: 0 0 24px;
}

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #c76543, #dc8460);
    color: #fff9f0;
    box-shadow: 0 12px 22px rgba(211, 109, 72, 0.16);
}

.btn-secondary {
    border-color: rgba(64, 95, 116, 0.14);
    background: rgba(255, 255, 255, 0.62);
    color: var(--accent-deep);
}

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

.metric {
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
}

.number {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.window {
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(47, 61, 78, 0.08);
    background: linear-gradient(180deg, #405166, #293545);
    border-color: rgba(141, 183, 214, 0.16);
}

.window-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(90deg, #354457, #43586c);
    color: #fff8ef;
    letter-spacing: 0.03em;
    font-size: 0.8rem;
}

.window-controls {
    display: flex;
    gap: 7px;
}

.window-controls span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 248, 239, 0.75);
}

.window-body {
    padding: 12px;
}

.terminal {
    margin: 0;
    padding: 16px;
    border-radius: 12px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.02) 50%, transparent 50%),
        linear-gradient(180deg, var(--terminal-2), var(--terminal));
    background-size: 100% 4px, 100% 100%;
    color: #e1f1ec;
    font: 0.92rem/1.72 "Consolas", "Courier New", monospace;
    overflow: auto;
    white-space: pre-wrap;
    border: 1px solid rgba(141, 183, 214, 0.12);
}

.terminal .prompt { color: #f2c47e; }
.terminal .ok { color: #abdcb8; }
.terminal .note { color: #aacce7; }
.terminal .warn { color: #e7c88d; }
.terminal a {
    color: #b5d5ef;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terminal-band {
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    gap: 18px;
    align-items: stretch;
    padding: 22px;
    border: 1px solid rgba(64, 95, 116, 0.11);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(64, 95, 116, 0.045) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(64, 95, 116, 0.04) 0 1px, transparent 1px 100%),
        linear-gradient(135deg, #f6f8f4, #edf4ef);
    background-size: 30px 30px, 30px 30px, 100% 100%;
    color: var(--ink);
    box-shadow: var(--shadow);
}

.terminal-band h2 {
    color: var(--ink);
}

.terminal-band p {
    color: var(--muted);
    line-height: 1.68;
    margin: 12px 0 0;
}

.command-list {
    display: grid;
    gap: 10px;
}

.terminal.mini {
    min-height: 0;
    padding: 12px 14px;
    font-size: 0.86rem;
}

.quote,
.repo-card,
.repo-preview,
.callout,
.ref-card,
.sidebar,
.note,
.card,
.cta-card,
.legal-card {
    padding: 20px;
    box-shadow: 0 12px 28px rgba(47, 61, 78, 0.055);
}

.quote p,
.ref-copy,
.repo-description {
    margin: 0;
}

.ref-img-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
    margin-bottom: 14px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface, #f4f6f8);
}

.ref-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    cursor: zoom-in;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ref-img:hover {
    transform: scale(1.04);
    opacity: 0.9;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 14, 20, 0.88);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lb-fade-in 0.18s ease;
}

.lightbox.is-open {
    display: flex;
}

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

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    cursor: default;
    animation: lb-zoom-in 0.2s ease;
}

@keyframes lb-zoom-in {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s, background 0.15s;
}

.lightbox-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.section {
    padding-top: 18px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
}

.section-header p {
    margin: 0;
    max-width: 56ch;
}

.card h3,
.cta-card h3,
.repo-title,
.ref-title {
    margin: 10px 0 8px;
    font-size: 1.2rem;
}

.repo-title,
.ref-title {
    margin-top: 0;
}

.list,
.timeline,
.contact-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.list-item,
.contact-item,
.timeline-item,
.item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(64, 95, 116, 0.08);
}

.list-item strong,
.contact-item strong,
.timeline-item strong,
.item strong {
    display: block;
    margin-bottom: 4px;
}

.list-item span,
.contact-item span,
.item span {
    color: var(--muted);
}

.timeline-item {
    border-left: 4px solid var(--signal);
    border-radius: 0 16px 16px 0;
}

.cta-card {
    background: linear-gradient(135deg, rgba(211, 109, 72, 0.08), rgba(64, 118, 111, 0.09)), var(--panel);
}

.repo-meta,
.meta {
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.repo-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.repo-stats span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(64, 95, 116, 0.08);
    font-size: 0.85rem;
    color: var(--muted);
}

.repo-preview h2,
.sidebar h2 {
    margin: 0 0 14px;
    font-size: 2rem;
    line-height: 1;
}

.code {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    background: #303b4c;
    color: #e4ecf6;
    font: 0.9rem/1.7 "Consolas", "Courier New", monospace;
    overflow: auto;
}

.kw { color: #e49a78; }
.fn { color: #b5d5ef; }
.str { color: #b8ddb3; }
.cm { color: #9aa6b9; }

.empty-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(64, 95, 116, 0.08);
}

.footer {
    margin: 26px 0 10px;
    padding: 18px 0 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(64, 95, 116, 0.1);
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.footer a,
.footer-links a {
    color: var(--accent-deep);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-hero h1 {
    max-width: 12ch;
}

.legal-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.legal-card h2 {
    margin-bottom: 14px;
    font-size: clamp(1.8rem, 2.4vw, 2.5rem);
}

.legal-card address {
    color: var(--muted);
    font-style: normal;
    line-height: 1.7;
}

.legal-card p {
    color: var(--muted);
    line-height: 1.68;
    margin: 12px 0 0;
}

.legal-card-wide {
    grid-column: 1 / -1;
}

.section-gap {
    margin-top: 18px;
}

.cta-row-tight {
    margin-bottom: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.75; }
}

@media (max-width: 980px) {
    .hero-grid,
    .grid-2,
    .cards-3,
    .cards-2,
    .timeline-grid,
    .contact-grid,
    .repo-layout,
    .repo-grid,
    .refs-layout,
    .refs-grid,
    .terminal-band,
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        border-radius: 24px;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 18px, 1440px);
        margin-top: 10px;
    }

    .topbar {
        position: static;
        align-items: flex-start;
        padding: 16px;
        flex-direction: column;
    }

    .brandline {
        align-items: flex-start;
    }

    .nav {
        justify-content: flex-start;
    }

    .hero {
        padding: 22px 18px;
    }

    h1 {
        max-width: none;
        font-size: clamp(1.7rem, 7.5vw, 2.5rem);
    }

    .metrics {
        grid-template-columns: 1fr;
    }

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