:root {
  --bg: #09111a;
  --bg-elevated: rgba(16, 28, 40, 0.82);
  --bg-strong: #101b27;
  --panel: rgba(13, 23, 34, 0.92);
  --panel-border: rgba(141, 180, 216, 0.16);
  --text: #ecf4fb;
  --text-soft: #9eb0c2;
  --text-muted: #72859a;
  --accent: #79d8ff;
  --accent-strong: #4aa9d4;
  --accent-warm: #b6ebff;
  --shadow: 0 18px 60px rgba(3, 10, 20, 0.35);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
  --gutter: clamp(1.25rem, 3vw, 2rem);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(68, 132, 173, 0.22), transparent 30%),
    linear-gradient(180deg, #0c1520 0%, #09111a 55%, #070d15 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 156, 188, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 156, 188, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 85%);
}

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

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

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
  color: var(--accent-warm);
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.site-header,
.site-footer,
.hero,
.section,
.page-hero,
.tool-layout,
.experiment-layout {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(121, 216, 255, 0.28);
  background: linear-gradient(180deg, rgba(121, 216, 255, 0.18), rgba(21, 37, 52, 0.95));
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-text {
  font-size: 1rem;
}

.site-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav a {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  color: var(--text-soft);
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
  border: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(17, 30, 44, 0.8);
  border-color: rgba(121, 216, 255, 0.16);
}

.hero,
.page-hero {
  display: grid;
  gap: 1.5rem;
  padding: clamp(3rem, 9vw, 6rem) 0 2rem;
}

.hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  align-items: center;
}

.page-hero {
  max-width: 760px;
}

.page-hero-compact {
  padding-bottom: 0.5rem;
}

.eyebrow,
.panel-kicker,
.result-label,
.card-tag,
.status-pill,
.badge {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.84rem;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(1.6rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-text,
.panel-copy,
.card p,
.stack p,
.site-footer p,
.input-help,
.form-message {
  color: var(--text-soft);
  line-height: 1.7;
}

.hero-text {
  max-width: 62ch;
  margin-bottom: 0;
  font-size: 1.04rem;
}

.hero-actions,
.tool-actions,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.option-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.option-button {
  min-height: 2.5rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 216, 255, 0.16);
  background: rgba(10, 18, 28, 0.7);
  color: var(--text-soft);
  font: inherit;
  font-family: "IBM Plex Mono", monospace;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.button-compact {
  min-height: 2.5rem;
  padding: 0.65rem 0.95rem;
  font-size: 0.95rem;
}

.option-button:hover,
.option-button:focus-visible {
  border-color: rgba(121, 216, 255, 0.28);
  color: var(--text);
}

.option-button.is-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(110, 208, 245, 0.2), rgba(28, 56, 74, 0.72));
  border-color: rgba(121, 216, 255, 0.28);
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 216, 255, 0.16);
  font-weight: 600;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(121, 216, 255, 0.32);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.button-primary {
  background: linear-gradient(180deg, rgba(110, 208, 245, 0.24), rgba(43, 83, 102, 0.58));
  color: var(--text);
}

.button-secondary {
  background: rgba(13, 23, 34, 0.6);
  color: var(--text-soft);
}

.panel,
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 28, 40, 0.95), rgba(10, 18, 28, 0.98));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel {
  padding: 1.5rem;
}

.card {
  padding: 1.5rem;
  min-height: 100%;
}

.hero-panel-link {
  display: block;
  transition: transform 140ms ease, border-color 140ms ease;
}

.hero-panel-link:hover,
.hero-panel-link:focus-visible,
.card:hover,
.card:focus-within {
  transform: translateY(-1px);
  border-color: rgba(121, 216, 255, 0.28);
}

.stretched-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.panel-header,
.card-meta,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-header,
.card-meta {
  margin-bottom: 1rem;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.76rem;
  border: 1px solid rgba(121, 216, 255, 0.16);
  background: rgba(8, 16, 25, 0.6);
}

.badge-live,
.status-pill {
  color: var(--accent-warm);
}

.metric-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(158, 176, 194, 0.12);
}

.metric-list dt {
  color: var(--text-muted);
}

.metric-list dd {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  text-align: right;
}

.section {
  padding: 1.5rem 0 2rem;
}

.section-tight {
  padding-top: 0.5rem;
}

.section-heading {
  margin-bottom: 1.4rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent-warm);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card-grid-tools {
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
}

.card-feature {
  background: linear-gradient(180deg, rgba(16, 30, 44, 0.95), rgba(8, 16, 25, 0.98));
}

.feature-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.tool-layout,
.experiment-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  padding: 0.5rem 0 2rem;
}

.tool-form {
  display: grid;
  gap: 0.9rem;
}

.tool-form label {
  font-weight: 600;
}

.tool-form input {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(121, 216, 255, 0.18);
  background: rgba(5, 11, 18, 0.76);
  color: var(--text);
  font: inherit;
}

.tool-form input:focus {
  outline: 2px solid rgba(121, 216, 255, 0.24);
  outline-offset: 2px;
}

.input-help,
.form-message {
  margin: 0;
  font-size: 0.95rem;
}

.form-message[data-state="error"] {
  color: #ffb4b4;
}

.form-message[data-state="success"] {
  color: var(--accent-warm);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.result-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(121, 216, 255, 0.12);
  background: rgba(6, 12, 20, 0.62);
}

.result-item strong {
  display: block;
  margin-top: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.signal-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  min-height: 280px;
  padding-top: 0.5rem;
}

.signal-stage span {
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(7, 17, 27, 0.7), rgba(13, 36, 52, 0.95)),
    linear-gradient(90deg, transparent, rgba(121, 216, 255, 0.28), transparent);
  border: 1px solid rgba(121, 216, 255, 0.14);
  position: relative;
  overflow: hidden;
}

.signal-stage span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 25%, rgba(121, 216, 255, 0.18) 50%, transparent 75%);
  transform: translateX(-100%);
  animation: sweep 6s linear infinite;
}

.signal-stage span:nth-child(2)::after,
.signal-stage span:nth-child(5)::after {
  animation-delay: 1.2s;
}

.signal-stage span:nth-child(3)::after,
.signal-stage span:nth-child(6)::after {
  animation-delay: 2.4s;
}

.stack {
  display: grid;
  gap: 1rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(121, 216, 255, 0.1);
}

.footer-links a {
  color: var(--text-soft);
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 980px) {
  .hero,
  .tool-layout,
  .experiment-layout,
  .card-grid,
  .card-grid-tools {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 14ch;
  }

  .site-footer,
  .section-heading,
  .panel-header,
  .card-meta {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 720px) {
  .site-shell {
    width: min(calc(100% - 1.25rem), var(--max-width));
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .panel,
  .card {
    padding: 1.2rem;
  }

  .signal-stage {
    min-height: 220px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
