:root {
  --bg-top: #13242c;
  --bg-bottom: #0a1218;
  --panel: rgba(14, 26, 33, 0.82);
  --panel-strong: rgba(18, 33, 42, 0.94);
  --panel-soft: rgba(255, 248, 232, 0.08);
  --line: rgba(255, 240, 206, 0.16);
  --text: #f6f1e4;
  --muted: #cdbf9a;
  --accent: #d89b3c;
  --accent-strong: #f2bd62;
  --success: #77c7a3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --font-display: "Avenir Next Condensed", "Trebuchet MS", "Gill Sans", sans-serif;
  --font-body: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(216, 155, 60, 0.18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(97, 175, 160, 0.15), transparent 20%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body.is-locked {
  overflow: hidden;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black, transparent 90%);
  pointer-events: none;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  transition: filter 180ms ease, transform 180ms ease, opacity 180ms ease;
}

body.is-locked .site-shell {
  filter: blur(18px) saturate(0.8);
  opacity: 0.3;
  transform: scale(0.985);
  pointer-events: none;
  user-select: none;
}

.hero,
.panel,
.gate__panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(30, 53, 63, 0.94), rgba(11, 20, 25, 0.95)),
    rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 700;
}

.hero h1,
.panel h2,
.gate h1 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.hero__lede,
.gate__copy,
.notes-copy {
  margin: 14px 0 0;
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.55;
}

.hero__stats {
  display: grid;
  gap: 14px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(255, 248, 232, 0.09), rgba(255, 248, 232, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card__value {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-family: var(--font-display);
  color: var(--accent-strong);
}

.stat-card__label {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.9fr);
  gap: 20px;
  margin-top: 20px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(12px);
}

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

.search {
  flex: 0 1 320px;
}

.search input,
.gate__form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.search input::placeholder,
.gate__form input::placeholder {
  color: rgba(246, 241, 228, 0.55);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 250px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.08), rgba(255, 248, 232, 0.03)),
    var(--panel-strong);
}

.tool-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.status-badge {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(119, 199, 163, 0.16);
  color: var(--success);
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge.is-planned {
  background: rgba(216, 155, 60, 0.14);
  color: var(--accent-strong);
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tool-tags,
.tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-tags span {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.82rem;
}

.tool-links {
  margin-top: auto;
}

.tool-links a,
.gate__form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #23170a;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.tool-links a:hover,
.gate__form button:hover,
.tool-links a:focus-visible,
.gate__form button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.tool-links a.tool-links__secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.empty-state {
  padding: 28px;
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.code-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  overflow: auto;
  background: rgba(5, 11, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-card pre {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 10, 0.52);
  backdrop-filter: blur(12px);
}

.gate__panel {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(26, 45, 54, 0.96), rgba(9, 16, 20, 0.98));
}

.gate__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 22px;
}

.gate__hint {
  margin: 14px 0 0;
  min-height: 1.4em;
  color: var(--muted);
}

.gate__details {
  margin-top: 14px;
  color: var(--muted);
}

.gate__details summary {
  cursor: pointer;
  color: var(--accent-strong);
}

.gate__hint--error,
.gate__hint.is-error {
  color: #ffb3a2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.is-unlocked {
  overflow: auto;
}

body.is-unlocked .gate {
  display: none;
}

@media (max-width: 900px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  .hero,
  .panel,
  .gate__panel {
    padding: 20px;
    border-radius: 22px;
  }

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