:root {
  --bg: #05030d;
  --bg-alt: #0d0719;
  --surface: rgba(10, 9, 25, 0.82);
  --surface-strong: rgba(14, 9, 31, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(67, 239, 255, 0.14);
  --line-hot: rgba(255, 61, 158, 0.22);
  --text: #d9e7ff;
  --text-muted: rgba(217, 231, 255, 0.68);
  --text-faint: rgba(217, 231, 255, 0.44);
  --headline: #f7fbff;
  --accent: #43efff;
  --accent-hot: #ff3d9e;
  --accent-lime: #d7ff5d;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --content-width: 1240px;
  --sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Sora", "Avenir Next Condensed", "Avenir Next", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(67, 239, 255, 0.13), transparent 22%),
    radial-gradient(circle at 86% 12%, rgba(255, 61, 158, 0.14), transparent 24%),
    radial-gradient(circle at 52% 40%, rgba(86, 18, 144, 0.24), transparent 34%),
    linear-gradient(180deg, #04020a 0%, #090513 46%, #04020a 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(67, 239, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 239, 255, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 16%, #000 30%, transparent 82%);
  opacity: 0.38;
}

body::after {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 2px,
      transparent 6px
    );
  opacity: 0.07;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
}

::selection {
  color: #02030a;
  background: var(--accent);
}

.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;
}

.page-shell {
  position: relative;
  min-height: 100vh;
}

.page-shell::before {
  content: "";
  position: absolute;
  top: 180px;
  right: -10vw;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 61, 158, 0.16), transparent 66%);
  filter: blur(24px);
  opacity: 0.62;
  pointer-events: none;
}

.announce-bar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(7, 5, 18, 0.96), rgba(17, 10, 34, 0.96)),
    radial-gradient(circle at 18% 50%, rgba(67, 239, 255, 0.12), transparent 20%);
}

.announce-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.announce-bar p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.announce-label,
.category-rail p,
.nav-pill,
.tool-badge,
.category-count,
.eyebrow,
.solid-link {
  font-family: var(--mono);
}

.announce-label {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(255, 61, 158, 0.24);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #ffd7ec;
  background: rgba(255, 61, 158, 0.12);
  box-shadow: 0 0 18px rgba(255, 61, 158, 0.1);
}

.announce-action {
  padding: 8px 14px;
  border: 1px solid rgba(67, 239, 255, 0.16);
  border-radius: 999px;
  color: rgba(217, 231, 255, 0.88);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.announce-action:hover,
.announce-action:focus-visible {
  border-color: rgba(255, 61, 158, 0.26);
  color: #fff2fa;
  background: rgba(255, 61, 158, 0.08);
  box-shadow: 0 0 18px rgba(255, 61, 158, 0.08);
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 40;
  width: min(calc(100% - 36px), 980px);
  margin: 18px auto 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(7, 6, 19, 0.84), rgba(12, 8, 27, 0.88)),
    radial-gradient(circle at top right, rgba(255, 61, 158, 0.12), transparent 26%);
  backdrop-filter: blur(22px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 18px 44px rgba(0, 0, 0, 0.28);
}

.header-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.header-search input {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

.header-search input::placeholder {
  color: rgba(217, 231, 255, 0.34);
}

.header-search input:focus-visible {
  border-color: rgba(67, 239, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(67, 239, 255, 0.16);
}

.header-search button,
.tool-link,
.solid-link,
.tool-detail,
.dialog-close,
.nav-pill {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.header-search button,
.tool-link,
.solid-link {
  color: #01030b;
  background:
    linear-gradient(135deg, var(--accent) 0%, #84f7ff 48%, var(--accent-lime) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 12px 28px rgba(67, 239, 255, 0.2);
}

.header-search button {
  padding: 0 24px;
  border-radius: 16px;
  cursor: pointer;
}

.header-search button:hover,
.header-search button:focus-visible,
.tool-link:hover,
.tool-link:focus-visible,
.solid-link:hover,
.solid-link:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 0 18px rgba(67, 239, 255, 0.24),
    0 14px 30px rgba(67, 239, 255, 0.22);
}

main {
  position: relative;
  z-index: 1;
}

.section {
  width: min(calc(100% - 36px), var(--content-width));
  margin: 0 auto;
}

.category-section {
  padding: 28px 0 84px;
}

.category-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 34px;
}

.category-rail {
  position: sticky;
  top: 120px;
  align-self: start;
  padding-top: 16px;
}

.category-rail p {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}

#category-nav {
  display: grid;
  gap: 10px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(67, 239, 255, 0.1);
  border-radius: 999px;
  letter-spacing: 0.08em;
  color: rgba(217, 231, 255, 0.7);
  background: rgba(255, 255, 255, 0.03);
}

.nav-pill:hover,
.nav-pill.is-active {
  border-color: rgba(255, 61, 158, 0.24);
  color: #fff2fa;
  background:
    linear-gradient(135deg, rgba(255, 61, 158, 0.14), rgba(67, 239, 255, 0.12));
  transform: translateX(4px);
  box-shadow: 0 0 20px rgba(255, 61, 158, 0.08);
}

.category-groups {
  display: grid;
  gap: 24px;
}

.category-group,
.protocol-grid {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(13, 9, 31, 0.94), rgba(8, 5, 20, 0.94)),
    radial-gradient(circle at top right, rgba(255, 61, 158, 0.12), transparent 26%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    var(--shadow);
}

.category-group {
  padding: 28px 30px 18px;
}

.category-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(67, 239, 255, 0.12);
}

.category-top h3,
.protocol-copy h2,
.tool-dialog h3 {
  margin: 0;
  font-family: var(--display);
  color: var(--headline);
}

.category-top h3 {
  font-size: 2rem;
}

.category-summary,
.tool-summary,
.protocol-copy p,
.protocol-points p,
.empty-state p,
.page-error p,
.dialog-summary {
  line-height: 1.7;
  color: var(--text-muted);
}

.category-summary {
  max-width: 620px;
  margin: 10px 0 0;
}

.category-count {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(217, 231, 255, 0.48);
}

.tool-list {
  display: grid;
}

.tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(67, 239, 255, 0.08);
}

.tool-row:last-child {
  border-bottom: 0;
}

.tool-row:hover {
  background:
    linear-gradient(90deg, rgba(67, 239, 255, 0.08), rgba(255, 61, 158, 0.05) 34%, transparent 70%);
}

.tool-leading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(67, 239, 255, 0.16);
  border-radius: 14px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #03101a;
  background:
    linear-gradient(135deg, var(--accent) 0%, #8ff7ff 56%, #ffffff 100%);
  box-shadow: 0 0 24px rgba(67, 239, 255, 0.16);
}

.tool-row h4 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--headline);
}

.tool-summary {
  margin: 8px 0 0;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-tags span,
.dialog-tags span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(67, 239, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(217, 231, 255, 0.72);
  font-size: 13px;
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-link,
.tool-detail,
.solid-link,
.dialog-close {
  padding: 12px 18px;
  border-radius: 999px;
}

.solid-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tool-detail,
.dialog-close {
  border: 1px solid rgba(67, 239, 255, 0.14);
  color: rgba(217, 231, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.tool-detail:hover,
.tool-detail:focus-visible,
.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: rgba(255, 61, 158, 0.26);
  color: #fff5fb;
  background: rgba(255, 61, 158, 0.08);
}

.empty-state,
.page-error {
  padding: 36px 0 8px;
}

.empty-state p,
.page-error p {
  max-width: 520px;
  margin: 0;
  font-size: 15px;
}

.protocol-section {
  padding-bottom: 128px;
}

.protocol-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 30px;
  padding: 38px;
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: rgba(67, 239, 255, 0.82);
}

.protocol-copy h2 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.96;
}

.protocol-points {
  display: grid;
  gap: 14px;
}

.protocol-points article {
  padding: 20px 22px;
  border: 1px solid rgba(67, 239, 255, 0.1);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(255, 255, 255, 0.02);
}

.protocol-points span {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.tool-dialog {
  width: min(calc(100% - 24px), 560px);
  padding: 24px;
  border: 1px solid rgba(67, 239, 255, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(8, 6, 20, 0.98), rgba(15, 8, 31, 0.96)),
    radial-gradient(circle at top right, rgba(255, 61, 158, 0.14), transparent 32%);
  color: var(--text);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.login-dialog {
  width: min(calc(100% - 24px), 480px);
  padding: 24px;
  border: 1px solid rgba(67, 239, 255, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(8, 6, 20, 0.98), rgba(15, 8, 31, 0.96)),
    radial-gradient(circle at top right, rgba(255, 61, 158, 0.14), transparent 32%);
  color: var(--text);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.login-dialog::backdrop {
  background: rgba(3, 2, 9, 0.7);
  backdrop-filter: blur(8px);
}

.tool-dialog::backdrop {
  background: rgba(3, 2, 9, 0.7);
  backdrop-filter: blur(8px);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.tool-dialog h3 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1;
}

.dialog-summary {
  margin: 16px 0 0;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  font-size: 13px;
  color: var(--text-faint);
}

.login-form input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(67, 239, 255, 0.12);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.login-form input:focus-visible {
  border-color: rgba(67, 239, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(67, 239, 255, 0.16);
}

.login-error {
  margin: -2px 0 0;
  color: #ff9ecf;
}

.login-submit {
  justify-content: center;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.dialog-link {
  display: inline-flex;
  margin-top: 24px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .section {
    width: min(calc(100% - 28px), var(--content-width));
  }

  .category-layout,
  .protocol-grid {
    grid-template-columns: 1fr;
  }

  .category-rail {
    position: static;
    padding-top: 0;
  }

  #category-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .tool-row {
    grid-template-columns: 1fr;
  }

  .tool-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .announce-bar {
    align-items: flex-start;
    flex-direction: column;
    padding-left: 16px;
    padding-right: 16px;
  }

  .announce-main {
    width: 100%;
  }

  .announce-action {
    align-self: flex-end;
  }

  .site-header {
    top: 12px;
    width: min(calc(100% - 20px), 980px);
    margin-top: 12px;
    padding: 10px;
    border-radius: 18px;
  }

  .header-search {
    grid-template-columns: 1fr;
  }

  .header-search button {
    padding: 16px 18px;
  }

  .section {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .category-section {
    padding-top: 20px;
    padding-bottom: 72px;
  }

  .category-top {
    grid-template-columns: 1fr;
  }

  .category-group,
  .protocol-grid {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
