:root {
  color-scheme: light;
  --bg: #fbfcfd;
  --fg: #18212f;
  --muted: #667085;
  --line: #d9e1e7;
  --panel: #ffffff;
  --panel-2: #f4f7f9;
  --ink-soft: #263445;
  --primary: #0f9f93;
  --primary-strong: #0b766f;
  --primary-soft: #e5faf7;
  --danger: #c24135;
  --ok: #0b7f56;
  --warn: #a96707;
  --shadow: 0 22px 56px -42px rgb(22 34 51 / .55);
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f141b;
    --fg: #edf2f7;
    --muted: #9aa7b7;
    --line: #263241;
    --panel: #151c25;
    --panel-2: #111821;
    --ink-soft: #cad5e2;
    --primary: #31cbbb;
    --primary-strong: #6be1d6;
    --primary-soft: #0d302e;
    --shadow: 0 22px 60px -46px rgb(0 0 0 / .85);
  }
}

/* Reset and base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-color: var(--primary); }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0 0 14px; letter-spacing: -0.015em; color: var(--fg); }
h1 { max-width: 920px; font-size: clamp(38px, 6vw, 68px); line-height: .98; }
h2 { font-size: clamp(26px, 3.5vw, 40px); line-height: 1.08; }
h3 { font-size: 18px; line-height: 1.25; }
code { font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: .92em; }

/* Layout utilities */
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--bg); font-weight: 800; transition: top .14s ease; }
.skip-link:focus { top: 14px; }
.section { padding: 68px 0; }
.section.compact { padding: 42px 0; }
.surface { background: var(--panel-2); border-block: 1px solid var(--line); }
.muted { color: var(--muted); }
.micro-copy { color: var(--muted); font-size: 13px; line-height: 1.6; }
.lead { max-width: 720px; color: var(--muted); font-size: 18px; line-height: 1.72; }
.eyebrow { margin-bottom: 12px; color: var(--primary-strong); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.preline { white-space: pre-line; line-height: 1.72; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.content-rail { display: grid; grid-template-columns: minmax(0, .74fr) minmax(300px, .26fr); gap: 28px; align-items: start; }
.guide-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(340px, 1.08fr); gap: 24px; align-items: start; }

/* Header and navigation */
.header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: #042f2e; font-weight: 900; letter-spacing: -.04em; }
.brand small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 650; }
.nav a { padding: 9px 11px; border-radius: 8px; }
.nav a:hover { color: var(--fg); background: var(--panel-2); }
.actions { display: flex; align-items: center; gap: 10px; }

/* Public hero and cards */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 72%, var(--bg)), var(--bg) 58%); }
.hero::after { content: ""; position: absolute; inset: auto -15% -35% 45%; height: 460px; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 20%, transparent), transparent 65%); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; min-height: 590px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); gap: 48px; align-items: center; }
.hero-panel { border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--panel) 88%, transparent); box-shadow: var(--shadow); overflow: hidden; }
.release-row { display: block; padding: 15px 18px; border-top: 1px solid var(--line); transition: background .16s ease, transform .16s ease; }
.release-row:hover { background: var(--panel-2); transform: translateX(2px); }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 22px; }
.card-link { transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.card-link:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 38%, var(--line)); box-shadow: 0 24px 60px -42px color-mix(in srgb, var(--primary) 55%, #000); }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.metric strong { display: block; font-size: 34px; letter-spacing: -.04em; }
.meta { color: var(--muted); font-size: 13px; }
.subtle-divider { height: 1px; background: var(--line); margin: 18px 0; }
.callout { border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--primary-soft) 58%, var(--panel)); padding: 18px; }
.step-list { counter-reset: steps; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.step-list li { counter-increment: steps; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.step-list li::before { content: counter(steps); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #042f2e; font-weight: 850; }
.check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 26px; color: var(--muted); }
.check-list li::before { content: ""; position: absolute; left: 0; top: .42em; width: 12px; height: 12px; border-radius: 999px; background: var(--primary); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--panel) 88%, transparent); }
.split-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 24px; align-items: start; }
.page-kicker { max-width: 780px; margin-bottom: 30px; }
.form-note { margin-top: -4px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel-2); padding: 26px; text-align: center; color: var(--muted); }
.choice-card { display: grid; gap: 16px; align-content: start; min-height: 100%; }
.choice-card h2 { font-size: 28px; }
.status-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 18px; }
.status-card strong { display: block; font-size: 17px; margin-bottom: 6px; }
.route-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft); font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: 13px; }
.compact-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.compact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.compact-list li:last-child { border-bottom: 0; }

/* Buttons */
.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; background: var(--primary); color: #042f2e; font-weight: 760; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.btn:hover { background: var(--primary-strong); transform: translateY(-1px); }
.btn.secondary { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.secondary:hover { background: var(--panel-2); border-color: color-mix(in srgb, var(--primary) 38%, var(--line)); }
.btn.danger { background: var(--danger); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--muted); padding: 4px 10px; font-size: 12px; font-weight: 760; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.badge.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

.banner { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel-2); }
.project-card-body { display: grid; gap: 14px; padding: 20px; }
.project-card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.project-top { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--bg)); padding: 44px 0 24px; }
.project-nav { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding-top: 26px; }
.project-nav a { flex: 0 0 auto; color: var(--muted); padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 680; }
.project-nav a:hover { background: var(--panel); color: var(--fg); }

/* Forms */
.form { display: grid; gap: 16px; }
.filter-form { grid-template-columns: minmax(0, 1fr) 220px 220px auto; align-items: end; }
.field { display: grid; gap: 7px; }
.field-inline { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-soft); font-size: 14px; font-weight: 680; }
.field-inline input { width: auto; margin-top: 4px; }
label { color: var(--ink-soft); font-size: 14px; font-weight: 720; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); padding: 11px 12px; transition: border-color .16s ease, box-shadow .16s ease; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { min-height: 118px; resize: vertical; }

/* Alerts and flashes */
.flash-wrap { position: fixed; top: 82px; right: 18px; z-index: 50; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.flash { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: var(--shadow); font-size: 14px; }
.flash.success { border-color: color-mix(in srgb, var(--ok) 36%, var(--line)); color: var(--ok); }
.flash.error { border-color: color-mix(in srgb, var(--danger) 36%, var(--line)); color: var(--danger); }

/* Tables */
.table { width: 100%; border-collapse: collapse; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 14px; }
.table th, .table td { padding: 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 820; letter-spacing: .06em; text-transform: uppercase; }
.table tr:last-child td { border-bottom: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--panel-2); padding: 42px 0; }
.footer a:hover { color: var(--fg); }

/* Admin layout */
.admin-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; background: var(--panel-2); }
.admin-side { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: var(--panel); padding: 18px; }
.admin-side nav { display: grid; gap: 4px; margin-top: 24px; }
.admin-side a { padding: 10px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.admin-side a:hover { background: var(--panel-2); color: var(--fg); }
.admin-section-label { margin: 22px 12px 8px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.admin-main { min-width: 0; }
.admin-top { min-height: 68px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; }
.admin-content { padding: 30px; }
.admin-page-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 24px; }
.media-card { display: grid; gap: 12px; align-content: start; }
.article-body { font-size: 16px; line-height: 1.85; }

@media print {
  .header, .footer, .admin-side, .admin-top, .btn, .flash-wrap { display: none !important; }
  body { background: #fff; color: #111; }
  .card { box-shadow: none; border-color: #ddd; }
}

@media (max-width: 900px) {
  .hero-grid, .grid-2, .grid-3, .grid-4, .admin-shell, .split-panel, .content-rail, .guide-grid { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: 1fr; }
  .hero-grid { min-height: auto; padding: 56px 0; }
  .nav { display: none; }
  .admin-side { position: static; height: auto; }
  .admin-content { padding: 22px 16px; }
  .admin-page-head, .between { align-items: flex-start; flex-direction: column; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .project-nav { padding-bottom: 8px; }
  h1 { font-size: 40px; }
}
