@font-face {
  font-family: "Adwaita Sans";
  src: url("AdwaitaSans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090b10;
  --bg-elev: #111520;
  --card: #141925;
  --card-hover: #181f2e;
  --line: rgba(214, 226, 248, 0.11);
  --line-strong: rgba(214, 226, 248, 0.22);
  --text: #f1f4f9;
  --muted: #9ea9b8;
  --amber: #f7be72;
  --amber-ink: #171005;
  --sapphire: #84b4ff;
  --crimson: #f08362;
  --violet: #bca0f8;
  --cyan: #67e0e6;
  --emerald: #6ee7b7;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 20px 50px -26px rgba(0, 0, 0, 0.78);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Adwaita Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(960px 440px at 22% -140px, rgba(247, 190, 114, 0.13), transparent 72%),
    radial-gradient(1100px 520px at 84% -160px, rgba(132, 180, 255, 0.12), transparent 74%),
    var(--bg);
  background-repeat: no-repeat;
  min-height: 100vh;
}

a {
  color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: #ffe0b5; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mb-14 { margin-bottom: 14px; }
.pill-lg { vertical-align: middle; font-size: 16px; }
.verify-note { margin-top: 12px; font-size: 15px; color: var(--muted); }
.change-list { margin: 10px 0 0; padding-left: 20px; color: #cfd7e4; }
.title-link { color: inherit; text-decoration: none; }
.title-link:hover { color: var(--amber); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
  border-radius: 8px;
}
.skip:focus { left: 16px; top: 12px; }

.wrap {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 11, 16, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 720;
  letter-spacing: -0.02em;
  font-size: 17px;
  white-space: nowrap;
}
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), var(--sapphire));
  box-shadow: 0 0 14px rgba(247, 190, 114, 0.55);
}
.brand-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a {
  color: #cfd7e4;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 540;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Hero */
.hero {
  padding: 56px 0 34px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 620;
  color: var(--amber);
  letter-spacing: 0.015em;
  margin: 0 0 12px;
}
h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.07;
  letter-spacing: -0.03em;
  font-weight: 760;
}
h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.024em;
}
h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.28;
  letter-spacing: -0.015em;
}
.lead {
  margin: 0 0 24px;
  font-size: clamp(17px, 2vw, 20px);
  color: #cbd4e2;
  max-width: 70ch;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 14px;
  color: #d6deea;
}
.stat-pill strong { color: var(--text); }

/* OS Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 28px;
  padding: 10px 14px;
  background: rgba(20, 25, 37, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.filter-label {
  font-size: 13.5px;
  color: var(--muted);
  margin-right: 4px;
}
.filter-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: #d0d8e6;
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.filter-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.filter-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
  font-weight: 680;
}

/* Project grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s;
}
.card:hover {
  border-color: var(--line-strong);
}
.card.hidden { display: none; }
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0e15;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-media.contain img {
  object-fit: contain;
  padding: 8px;
}
.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 720;
}
.card-title a {
  color: var(--text);
  text-decoration: none;
}
.card-title a:hover { color: var(--amber); }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 640;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  white-space: nowrap;
}
.pill.accent-amber { border-color: rgba(247, 190, 114, 0.45); background: rgba(247, 190, 114, 0.13); color: #ffd9a0; }
.pill.accent-sapphire { border-color: rgba(132, 180, 255, 0.45); background: rgba(132, 180, 255, 0.13); color: #b8d4ff; }
.pill.accent-crimson { border-color: rgba(240, 131, 98, 0.45); background: rgba(240, 131, 98, 0.13); color: #ffb9a2; }
.pill.accent-violet { border-color: rgba(188, 160, 248, 0.45); background: rgba(188, 160, 248, 0.13); color: #dcd0ff; }
.pill.accent-cyan { border-color: rgba(103, 224, 230, 0.45); background: rgba(103, 224, 230, 0.13); color: #b0f4f7; }
.pill.accent-emerald { border-color: rgba(110, 231, 183, 0.45); background: rgba(110, 231, 183, 0.13); color: #aef5d8; }
.pill.muted { color: var(--muted); border-color: var(--line); background: transparent; font-weight: 520; }

.card-summary {
  margin: 0;
  color: #c7d0df;
  font-size: 15px;
}
.mini-changes {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}
.mini-changes li { margin-bottom: 4px; }

.dl-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}
.btn.primary:hover { background: #ffd191; color: var(--amber-ink); }
.btn.disabled {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}
.btn.small { padding: 6px 12px; font-size: 14.5px; border-radius: 8px; }

/* Sections & detail pages */
.section {
  padding: 28px 0 42px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.two-col {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 24px;
  align-items: start;
}
.detail-hero-shot {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0e15;
}
.detail-hero-shot img {
  width: 100%;
  height: auto;
  display: block;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.025);
}
tr:last-child td { border-bottom: none; }

code, pre {
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, monospace;
}
code {
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 2px 6px;
  color: #e9eff9;
  word-break: break-all;
}
.sha-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sha-short {
  font-size: 14px;
  color: #b7c4d9;
}
.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #0b0e15;
  border: 1px solid var(--line);
  overflow-x: auto;
}
.code-box code {
  background: none;
  border: none;
  padding: 0;
  white-space: nowrap;
  word-break: normal;
}

/* Gallery & lightbox */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.shot-btn {
  appearance: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: #0b0e15;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: inherit;
}
.shot-btn:hover { border-color: var(--amber); }
.shot-btn img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.shot-cap {
  padding: 10px 12px;
  font-size: 13.5px;
  color: #cbd4e2;
  border-top: 1px solid var(--line);
}

dialog.lightbox {
  max-width: min(94vw, 1180px);
  max-height: 92vh;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #0d111a;
  color: var(--text);
}
dialog.lightbox::backdrop { background: rgba(3, 5, 9, 0.84); }
dialog.lightbox img {
  max-width: 100%;
  max-height: 76vh;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}
.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.install-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
}
.install-card h3 { font-size: 16px; margin-bottom: 6px; }
.install-card p { margin: 0; font-size: 14.5px; color: #c7d0df; }

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(132, 180, 255, 0.35);
  background: rgba(132, 180, 255, 0.09);
  color: #d8e7ff;
  font-size: 14.5px;
  margin: 14px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 46px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 860px) {
  .projects-grid, .two-col { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 22px; }
  .header-inner { flex-wrap: wrap; padding: 10px 0; }
}
@media (max-width: 520px) {
  .wrap { width: min(1160px, calc(100% - 24px)); }
  .panel { padding: 18px; }
  .card-body { padding: 16px; }
  th, td { padding: 10px; font-size: 15px; }
  /* Relay task 1517 critic: on phones each table row becomes a card so the
     Download and Copy buttons are on screen without sideways scrolling. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack tr:last-child { border-bottom: none; }
  table.stack td { border-bottom: none; padding: 6px 12px; }
  table.stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
  }
  table.stack .sha-cell { flex-wrap: wrap; }
}
