:root {
    --ink: #eaf3ff;
    --muted: #9db0c7;
    --surface: #101b2a;
    --surface-2: #152438;
    --surface-3: #1c3049;
    --line: rgba(166, 198, 232, .16);
    --navy: #08121f;
    --sky: #59c5ff;
    --sky-2: #a7e3ff;
    --amber: #ffbf69;
    --green: #6ed6a8;
    --danger: #ff8e8e;
    --shadow: 0 22px 60px rgba(0, 0, 0, .28);
    --radius: 18px;
    --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 14% 0%, rgba(38, 111, 165, .22), transparent 34rem),
        linear-gradient(180deg, #07111e 0%, #0a1422 48%, #08111d 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--sky-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.container { width: min(calc(100% - 36px), var(--max)); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; }
.skip-link:focus { left: 8px; background: #fff; color: #000; padding: 8px 14px; border-radius: 8px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 30, .88);
    backdrop-filter: blur(16px);
}
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: .02em; }
.brand img { width: 52px; height: 52px; object-fit: cover; border-radius: 11px; box-shadow: 0 7px 18px rgba(0,0,0,.24); }
.brand small { display: block; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2; }
.nav-toggle { display: none; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.main-nav { display: flex; align-items: center; gap: 19px; }
.main-nav a { color: #d8e8f8; text-decoration: none; font-size: .91rem; font-weight: 650; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--sky); }
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; }
.lang-switch a { padding: 4px 9px; border-radius: 999px; font-size: .76rem; }
.lang-switch a.active { background: var(--surface-3); color: #fff; }

.hero { position: relative; overflow: hidden; padding: 92px 0 72px; }
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.kicker { color: var(--sky); font-size: .78rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; margin: 0 0 12px; }
h1, h2, h3 { line-height: 1.14; letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(3rem, 8vw, 6.4rem); max-width: 10ch; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); margin: 0 0 18px; }
h3 { font-size: 1.28rem; margin: 0 0 10px; }
.hero-lead { color: #bfd0e3; font-size: clamp(1.08rem, 2vw, 1.3rem); max-width: 58ch; margin: 24px 0 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(89,197,255,.35);
    background: linear-gradient(135deg, #2e91c8, #1d6c9b);
    color: white;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(27, 115, 166, .22);
}
.button:hover { filter: brightness(1.1); color: #fff; }
.button.secondary { background: rgba(255,255,255,.04); box-shadow: none; border-color: var(--line); }
.button.danger { background: rgba(160, 49, 49, .8); border-color: rgba(255,142,142,.4); }
.button.small { min-height: 36px; padding: 6px 12px; font-size: .84rem; }

.hero-panel {
    position: relative;
    min-height: 430px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(24, 48, 74, .94), rgba(8, 20, 34, .98));
    box-shadow: var(--shadow);
    overflow: hidden;
}
.hero-panel::before { content:""; position:absolute; width:260px; height:260px; border-radius:50%; background:rgba(89,197,255,.12); filter:blur(10px); top:-90px; right:-50px; }
.radar { position: absolute; width: 330px; height: 330px; border: 1px solid rgba(89,197,255,.25); border-radius: 50%; right: -42px; bottom: -72px; }
.radar::before, .radar::after { content:""; position:absolute; inset:16.6%; border:1px solid rgba(89,197,255,.18); border-radius:50%; }
.radar::after { inset:33.2%; }
.radar-line { position:absolute; left:50%; top:0; bottom:0; border-left:1px solid rgba(89,197,255,.18); }
.radar-line.horizontal { transform:rotate(90deg); }
.flight-card { position:absolute; left:30px; right:30px; top:32px; border:1px solid var(--line); border-radius:18px; padding:24px; background:rgba(8,18,31,.75); }
.flight-card .year { color:var(--amber); font-size:3.6rem; line-height:1; font-weight:850; }
.flight-card p { margin:12px 0 0; color:var(--muted); }
.flight-path { position:absolute; inset:190px 30px 32px; }
.flight-path svg { width:100%; height:100%; }

.section { padding: 76px 0; }
.section.compact { padding: 44px 0; }
.section-head { display:flex; justify-content:space-between; align-items:end; gap:30px; margin-bottom:30px; }
.section-head p { max-width: 58ch; color:var(--muted); margin:0; }
.eyebrow { display:block; color:var(--amber); text-transform:uppercase; letter-spacing:.14em; font-size:.72rem; font-weight:800; margin-bottom:10px; }
.surface { background: rgba(15, 29, 46, .72); border-block: 1px solid var(--line); }
.cards { display:grid; grid-template-columns: repeat(3, 1fr); gap:18px; }
.card { border:1px solid var(--line); border-radius:var(--radius); background:linear-gradient(160deg, rgba(25,44,67,.84), rgba(12,24,39,.9)); padding:24px; box-shadow:0 12px 32px rgba(0,0,0,.12); }
.card p { color:var(--muted); }
.card .meta { color:var(--sky); font-size:.78rem; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.card-link { color:var(--ink); text-decoration:none; }
.card-link:hover h3 { color:var(--sky); }

.timeline { position:relative; display:grid; grid-template-columns: repeat(4, 1fr); gap:18px; }
.timeline::before { content:""; position:absolute; left:5%; right:5%; top:28px; border-top:1px dashed rgba(89,197,255,.38); }
.timeline-item { position:relative; padding-top:58px; }
.timeline-item::before { content:""; position:absolute; top:21px; left:16px; width:14px; height:14px; border-radius:50%; background:var(--sky); box-shadow:0 0 0 8px rgba(89,197,255,.11); }
.timeline-item strong { color:var(--amber); font-size:1.3rem; }
.timeline-item p { color:var(--muted); margin:.4rem 0 0; }

.stats { display:grid; grid-template-columns: repeat(3, 1fr); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.stat { background:var(--surface); padding:28px; }
.stat strong { display:block; color:var(--sky); font-size:2rem; }
.stat span { color:var(--muted); font-size:.9rem; }

.page-hero { padding:74px 0 42px; border-bottom:1px solid var(--line); }
.page-hero h1 { font-size:clamp(2.6rem, 6vw, 5rem); max-width:15ch; }
.page-hero p { max-width:64ch; color:var(--muted); font-size:1.15rem; }
.prose { width:min(100%, 820px); }
.prose h2 { margin-top:2.3em; font-size:2rem; }
.prose h3 { margin-top:2em; }
.prose p, .prose li { color:#c2d1e1; }
.prose a { word-break:break-word; }
.prose blockquote { margin:2rem 0; border-left:3px solid var(--sky); padding:10px 22px; background:rgba(89,197,255,.06); }
.prose .button { color:#fff; }

.article-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:20px; }
.article-card { display:flex; flex-direction:column; min-height:300px; }
.article-card .article-footer { margin-top:auto; }
.article-date { color:var(--muted); font-size:.84rem; }
.article-layout { display:grid; grid-template-columns:minmax(0, 820px) 260px; gap:52px; align-items:start; }
.aside { position:sticky; top:100px; }
.aside .card { padding:18px; }

.legacy-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:24px; }
.legacy-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.status-badge { display:inline-flex; border-radius:999px; padding:3px 9px; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; background:rgba(110,214,168,.12); color:var(--green); border:1px solid rgba(110,214,168,.25); }
.status-badge.partial { color:var(--amber); background:rgba(255,191,105,.1); border-color:rgba(255,191,105,.24); }
.status-badge.unknown { color:var(--muted); }
.legacy-path { display:block; font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:.78rem; color:var(--sky-2); background:rgba(0,0,0,.18); border-radius:8px; padding:7px 9px; overflow-wrap:anywhere; }
.notice { border:1px solid rgba(255,191,105,.28); background:rgba(255,191,105,.07); border-radius:14px; padding:16px 18px; color:#efd7b4; }
.notice.info { border-color:rgba(89,197,255,.28); background:rgba(89,197,255,.07); color:#c9eafe; }

.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:18px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field.full { grid-column:1 / -1; }
label { font-weight:700; color:#dfeafa; }
input, textarea, select {
    width:100%;
    border:1px solid rgba(166,198,232,.22);
    background:#0a1726;
    color:var(--ink);
    border-radius:10px;
    padding:11px 12px;
    outline:none;
}
input:focus, textarea:focus, select:focus { border-color:var(--sky); box-shadow:0 0 0 3px rgba(89,197,255,.1); }
textarea { min-height:150px; resize:vertical; }
.error { color:var(--danger); font-size:.84rem; }
.alert { border-radius:12px; padding:13px 16px; margin:18px 0; border:1px solid var(--line); background:var(--surface-2); }
.alert.success { border-color:rgba(110,214,168,.28); color:#b9f2d8; }
.alert.warning { border-color:rgba(255,191,105,.28); color:#ffe0b6; }
.alert.danger { border-color:rgba(255,142,142,.28); color:#ffc4c4; }
.honeypot { position:absolute !important; left:-10000px !important; width:1px !important; height:1px !important; overflow:hidden !important; }

.pagination { display:flex; flex-wrap:wrap; gap:7px; margin-top:30px; }
.pagination a, .pagination span { border:1px solid var(--line); border-radius:8px; padding:6px 11px; text-decoration:none; }
.pagination .active { background:var(--surface-3); color:#fff; }

.cta { position:relative; overflow:hidden; border:1px solid rgba(89,197,255,.25); border-radius:24px; padding:42px; background:linear-gradient(135deg, #173858, #102438); }
.cta::after { content:"SC"; position:absolute; right:20px; bottom:-55px; font-size:11rem; font-weight:900; color:rgba(255,255,255,.035); line-height:1; }
.cta p { max-width:60ch; color:#c4d8e9; }

.site-footer { border-top:1px solid var(--line); padding:42px 0 26px; color:var(--muted); }
.footer-grid { display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:30px; }
.footer-grid h3 { color:var(--ink); font-size:1rem; }
.footer-grid ul { list-style:none; margin:0; padding:0; }
.footer-grid li { margin:5px 0; }
.footer-grid a { color:var(--muted); }
.footer-bottom { display:flex; justify-content:space-between; gap:20px; border-top:1px solid var(--line); margin-top:28px; padding-top:20px; font-size:.82rem; }

/* Administration */
.admin-body { background:#07101b; }
.admin-shell { display:grid; grid-template-columns:250px 1fr; min-height:100vh; }
.admin-sidebar { background:#0b1725; border-right:1px solid var(--line); padding:22px 16px; position:sticky; top:0; height:100vh; }
.admin-sidebar nav { display:grid; gap:6px; margin-top:26px; }
.admin-sidebar nav a { color:var(--muted); text-decoration:none; padding:9px 11px; border-radius:8px; }
.admin-sidebar nav a:hover { background:var(--surface-2); color:#fff; }
.admin-main { padding:34px; min-width:0; }
.admin-top { display:flex; justify-content:space-between; gap:20px; align-items:center; margin-bottom:28px; }
.admin-top h1 { font-size:2.3rem; max-width:none; }
.metric-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
.metric { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px; }
.metric strong { display:block; color:var(--sky); font-size:2rem; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; }
table { width:100%; border-collapse:collapse; min-width:780px; background:var(--surface); }
th, td { padding:11px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th { color:var(--sky-2); font-size:.76rem; letter-spacing:.08em; text-transform:uppercase; background:#0c1a2a; }
td { color:#c5d4e3; }
.table-actions { display:flex; gap:6px; }
.checkbox-row { display:flex; align-items:center; gap:9px; }
.checkbox-row input { width:auto; }
.admin-login { width:min(calc(100% - 36px), 460px); margin:10vh auto; }

@media (max-width: 1000px) {
    .hero-grid, .article-layout { grid-template-columns:1fr; }
    .hero-panel { min-height:350px; }
    .cards, .article-grid, .legacy-grid { grid-template-columns:repeat(2,1fr); }
    .timeline { grid-template-columns:repeat(2,1fr); }
    .timeline::before { display:none; }
    .aside { position:static; }
    .metric-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 780px) {
    .nav-toggle { display:block; }
    .main-nav { display:none; position:absolute; top:82px; left:0; right:0; flex-direction:column; align-items:stretch; gap:0; background:#081523; border-bottom:1px solid var(--line); padding:14px 18px 20px; }
    .main-nav.open { display:flex; }
    .main-nav > a { padding:10px 6px; }
    .lang-switch { margin-top:10px; align-self:flex-start; }
    .hero { padding-top:60px; }
    .cards, .article-grid, .legacy-grid, .stats, .footer-grid { grid-template-columns:1fr; }
    .section-head, .footer-bottom, .legacy-toolbar { align-items:flex-start; flex-direction:column; }
    .form-grid { grid-template-columns:1fr; }
    .field.full { grid-column:auto; }
    .admin-shell { display:block; }
    .admin-sidebar { position:static; height:auto; border-right:0; border-bottom:1px solid var(--line); }
    .admin-sidebar nav { grid-template-columns:repeat(2,1fr); }
    .admin-main { padding:24px 16px; }
}

@media (max-width: 520px) {
    .container { width:min(calc(100% - 24px), var(--max)); }
    h1 { font-size:2.7rem; }
    .hero-panel { min-height:320px; }
    .flight-card { left:18px; right:18px; }
    .flight-card .year { font-size:2.8rem; }
    .cta { padding:28px 22px; }
    .timeline { grid-template-columns:1fr; }
}

/* Legacy library, article archive, and screenshot gallery */
.archive-search { margin: 0 0 2rem; padding: 1rem; border: 1px solid var(--border, #27384d); border-radius: 14px; background: rgba(255,255,255,.03); }
.archive-search label { display: block; margin-bottom: .6rem; font-weight: 700; }
.archive-search > div { display: flex; gap: .7rem; }
.archive-search input { flex: 1; min-width: 0; padding: .85rem 1rem; border-radius: 10px; border: 1px solid #52677e; background: #fff; color: #102033; }
.archive-list, .download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.archive-card h2, .download-card h2 { margin: .55rem 0; font-size: 1.25rem; }
.archive-meta { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; font-size: .83rem; opacity: .78; }
.detail-list { display: grid; grid-template-columns: minmax(125px, 190px) 1fr; gap: .7rem 1rem; }
.detail-list dt { font-weight: 700; }
.detail-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.legacy-content img { max-width: 100%; height: auto; }
.legacy-preview { margin: 1rem 0 1.5rem; }
.legacy-preview img { max-width: min(100%, 760px); height: auto; border-radius: 12px; }
.gallery-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.gallery-category { display: block; text-decoration: none; }
.gallery-category h2 { margin-top: 0; }
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.screenshot-card { overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.04); }
.screenshot-card > a { color: inherit; text-decoration: none; }
.screenshot-card img, .image-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #0d2139; }
.screenshot-card h3, .screenshot-card p { margin: .75rem 1rem; }
.image-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; color: #b8c8d9; }
.image-placeholder small { font-size: .72rem; }
.screenshot-detail { max-width: 1040px; margin: 0 auto; }
.screenshot-detail > img { display: block; max-width: 100%; height: auto; margin: 0 auto 1.5rem; border-radius: 14px; box-shadow: 0 16px 45px rgba(0,0,0,.25); }
.notice.warning { border-color: #c99029; background: rgba(201,144,41,.12); }
button[disabled] { opacity: .55; cursor: not-allowed; }

@media (max-width: 680px) {
    .archive-search > div { flex-direction: column; }
    .detail-list { grid-template-columns: 1fr; gap: .2rem; }
    .detail-list dd { margin-bottom: .8rem; }
}
.legacy-article-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.legacy-article-media img { width: 100%; height: auto; max-height: 520px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.04); }

.legacy-metrics { grid-template-columns: repeat(4, 1fr); margin-bottom: 54px; }
.legacy-metrics .metric { display:block; }
@media (max-width: 1000px) { .legacy-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .legacy-metrics { grid-template-columns: 1fr; } }

/* Legacy download taxonomy and community history */
.download-category-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(270px,1fr)); gap:1rem; margin:1rem 0 2.5rem; }
.download-category-card { display:grid; grid-template-columns:92px 1fr; gap:1rem; align-items:start; text-decoration:none; }
.download-category-card img, .category-thumbnail-placeholder { width:92px; aspect-ratio:1; object-fit:cover; border-radius:12px; background:#0d2139; }
.category-thumbnail-placeholder { display:flex; align-items:center; justify-content:center; font-weight:900; font-size:1.6rem; color:var(--sky); border:1px solid var(--line); }
.download-category-card h3 { margin:.1rem 0 .45rem; }
.download-category-card p { margin:.2rem 0 .65rem; color:var(--muted); }
.subcategory-links { display:flex; flex-wrap:wrap; gap:.65rem; margin:1rem 0 2rem; }
.subcategory-links a { display:inline-flex; align-items:center; gap:.45rem; padding:.55rem .8rem; border:1px solid var(--line); border-radius:999px; text-decoration:none; }
.subcategory-links a.active { border-color:var(--sky); background:rgba(89,197,255,.1); }
.subcategory-links span { color:var(--muted); font-size:.8rem; }
.archive-breadcrumbs { display:flex; align-items:center; flex-wrap:wrap; gap:.55rem; margin:0 0 1.5rem; color:var(--muted); }
.category-label { color:var(--sky-2); font-weight:700; font-size:.85rem; }
.rating-summary { color:#f6cf7b; font-weight:700; }
.community-history { margin-top:2.2rem; }
.rating-breakdown { display:grid; gap:.45rem; max-width:680px; }
.rating-row { display:grid; grid-template-columns:52px minmax(120px,1fr) 55px; gap:.7rem; align-items:center; }
.rating-track { height:10px; overflow:hidden; border-radius:999px; background:rgba(255,255,255,.09); }
.rating-track i { display:block; height:100%; background:linear-gradient(90deg,var(--sky),#75d9b1); border-radius:inherit; }
.historical-comment footer { color:var(--muted); font-size:.86rem; }
.legacy-admin-metrics { grid-template-columns:repeat(4,1fr); margin-bottom:20px; }
.legacy-admin-tabs { margin-bottom:18px; flex-wrap:wrap; }
.inline-edit-form { display:flex; gap:6px; margin-top:6px; min-width:390px; }
.category-admin-editor { margin-top:.6rem; }
.category-admin-editor summary { cursor:pointer; color:var(--sky-2); }
.category-edit-form { display:grid; gap:.65rem; min-width:430px; margin-top:.8rem; }
.category-edit-form textarea { min-height:80px; }
.admin-thumbnail { width:86px; height:64px; object-fit:cover; border-radius:8px; }

@media (max-width:1000px) {
    .legacy-admin-metrics { grid-template-columns:repeat(2,1fr); }
}

@media (max-width:680px) {
    .download-category-card { grid-template-columns:70px 1fr; }
    .download-category-card img, .category-thumbnail-placeholder { width:70px; }
    .rating-row { grid-template-columns:46px minmax(80px,1fr) 45px; }
    .legacy-admin-metrics { grid-template-columns:1fr; }
}
