:root {
  --bg: oklch(15% 0.012 230);
  --bg-soft: oklch(19% 0.014 230);
  --panel: oklch(23% 0.016 230);
  --panel-strong: oklch(28% 0.018 230);
  --text: oklch(92% 0.012 230);
  --muted: oklch(68% 0.018 230);
  --line: oklch(34% 0.018 230);
  --accent: oklch(72% 0.135 164);
  --accent-soft: oklch(29% 0.055 164);
  --danger: oklch(68% 0.155 28);
  --shadow: 0 24px 60px color-mix(in oklch, var(--bg) 72%, transparent);
  --radius: 8px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--bg-soft) 72%, transparent), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid color-mix(in oklch, var(--line) 80%, transparent);
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.app-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.home-hero,
.project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 5vw, 60px);
  align-items: end;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(36px, 7vw, 78px);
  line-height: .96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
}

.lede {
  max-width: 72ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
}

.home-panel {
  min-width: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-number,
.panel-label {
  display: block;
}

.panel-number {
  color: var(--accent);
  font-size: 46px;
  font-weight: 850;
  line-height: 1;
}

.panel-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  margin: 34px 0 22px;
}

.search-box {
  display: grid;
  width: min(420px, 100%);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-box input,
.unlock-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0 14px;
}

.search-box input:focus,
.unlock-form input:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in oklch, var(--accent) 20%, transparent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card-media {
  display: block;
  aspect-ratio: 21 / 9;
  background: var(--bg-soft);
}

.card-media img,
.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 18px;
}

.card-kicker,
.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-kicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.project-card h2 {
  margin-bottom: 8px;
  font-size: 21px;
}

.project-card p {
  min-height: 54px;
  color: var(--muted);
  line-height: 1.55;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid color-mix(in oklch, var(--accent) 70%, var(--line));
  border-radius: var(--radius);
  background: var(--accent);
  color: oklch(15% 0.02 164);
  cursor: pointer;
  font-weight: 800;
}

.button:hover,
.button:focus-visible {
  filter: brightness(1.07);
  outline: none;
}

.button-soft {
  background: var(--accent-soft);
  color: var(--text);
}

.button:disabled,
.button.is-disabled {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  cursor: not-allowed;
}

.project-hero {
  overflow: hidden;
  aspect-ratio: 21 / 9;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.badge-stack {
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid color-mix(in oklch, var(--accent) 55%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.badge-muted {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 28px 0 38px;
}

.stats-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: clamp(17px, 2.4vw, 25px);
  white-space: nowrap;
}

.stats-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.content-section,
.unlock-panel {
  margin-top: 34px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(32px, 1fr) auto minmax(32px, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-rule {
  height: 1px;
  background: var(--line);
}

.section-heading::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.markdown-body {
  max-width: 76ch;
  color: color-mix(in oklch, var(--text) 88%, var(--muted));
  line-height: 1.75;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 28px 0 10px;
  line-height: 1.2;
}

.markdown-body h1 {
  font-size: 30px;
}

.markdown-body h2 {
  font-size: 24px;
}

.markdown-body h3 {
  font-size: 19px;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: .92em;
}

.markdown-body pre {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.markdown-body pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.unlock-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 20px;
  align-items: end;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.unlock-panel h2,
.unlock-panel p {
  margin-bottom: 8px;
}

.unlock-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.unlock-form {
  display: grid;
  gap: 10px;
}

.unlock-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 22px;
  color: var(--danger);
}

.unlock-panel.is-unlocked .form-message {
  color: var(--accent);
}

.action-bar {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--bg-soft) 88%, transparent);
  backdrop-filter: blur(12px);
}

.source-box {
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(12% 0.011 230);
  color: oklch(86% 0.02 160);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
  tab-size: 2;
}

.loading-state,
.error-state {
  display: grid;
  min-height: 52vh;
  place-items: center;
  text-align: center;
}

.loading-state {
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

.error-state {
  justify-items: center;
}

.error-state h1 {
  font-size: clamp(34px, 6vw, 62px);
}

.empty-state {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .home-hero,
  .project-head,
  .unlock-panel {
    grid-template-columns: 1fr;
  }

  .home-panel {
    width: 100%;
  }

  .badge-stack {
    justify-content: flex-start;
  }

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

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    padding-inline: 16px;
  }

  .brand small,
  .project-only {
    display: none;
  }

  .app-shell {
    width: min(100% - 28px, 1160px);
    padding-top: 30px;
  }

  h1 {
    font-size: clamp(34px, 13vw, 52px);
  }

  .project-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .project-card p {
    min-height: auto;
  }

  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }
}
