:root {
  color-scheme: dark;
  --bg: #070908;
  --panel: rgba(10, 16, 13, 0.86);
  --panel-solid: #0b100d;
  --ink: #e9fff3;
  --muted: #87a091;
  --line: rgba(106, 255, 168, 0.22);
  --line-hot: rgba(106, 255, 168, 0.58);
  --accent: #6affa8;
  --accent-2: #ff4d35;
  --warn: #ffb86b;
  --danger: #ff5d5d;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(106, 255, 168, 0.16), transparent 31rem),
    radial-gradient(circle at 82% 8%, rgba(255, 77, 53, 0.13), transparent 28rem),
    linear-gradient(180deg, #0b0f0d 0%, #070908 52%, #030403 100%);
  color: var(--ink);
  font-family: var(--sans);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(106, 255, 168, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 255, 168, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.18));
}

button,
input {
  font: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.shell {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 72px;
}

.topbar {
  position: sticky;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  z-index: 3;
  border: 1px solid var(--line);
  background: rgba(4, 8, 6, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 12px;
  height: 12px;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(106, 255, 168, 0.72);
}

.nav-readout {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
  min-height: 74dvh;
  padding: 92px 0 56px;
}

.hero-copy {
  max-width: 1120px;
}

.eyebrow,
.empty-kicker,
.panel-index {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  max-width: 1120px;
  margin: 18px 0 0;
  font-size: clamp(3.2rem, 7.3vw, 8.4rem);
  line-height: 0.87;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lede {
  max-width: 780px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.24rem);
  line-height: 1.65;
}

.hero-terminal {
  border: 1px solid var(--line-hot);
  background:
    linear-gradient(135deg, rgba(106, 255, 168, 0.12), transparent 48%),
    rgba(6, 12, 9, 0.92);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transform: translateY(26px);
}

.terminal-head {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.terminal-head span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
}

.terminal-head span:nth-child(2) {
  background: var(--warn);
}

.terminal-head span:nth-child(3) {
  background: var(--accent-2);
}

pre {
  margin: 0;
  padding: 26px;
  white-space: pre-wrap;
  color: #caffdd;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1vw, 1.08rem);
  line-height: 1.9;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  align-items: stretch;
  padding: 48px 0 90px;
}

.stack-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stack-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, rgba(106, 255, 168, 0.12), transparent 16%, transparent 84%, rgba(255, 77, 53, 0.08));
}

.query-panel {
  grid-column: span 5;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 22px;
}

.result-area {
  grid-column: span 7;
  min-height: 520px;
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  font-family: var(--mono);
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  background: #050806;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  font-family: var(--mono);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(106, 255, 168, 0.12);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.submit-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(106, 255, 168, 0.8);
  background: var(--accent);
  color: #031008;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.submit-button:hover {
  filter: brightness(1.08);
}

.submit-button:active {
  transform: translateY(1px) scale(0.99);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-icon,
.button-icon svg {
  width: 20px;
  height: 20px;
}

.button-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.signal-strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050806;
}

.signal-strip span {
  flex: 1 0 170px;
  border-right: 1px solid var(--line);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 474px;
  align-content: center;
  border: 1px dashed var(--line-hot);
  padding: 28px;
}

.empty-state h2 {
  margin: 12px 0 0;
  font-size: 1.65rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state p:last-child {
  max-width: 48ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.skeleton-line,
.skeleton-block {
  position: relative;
  overflow: hidden;
  background: rgba(106, 255, 168, 0.1);
}

.skeleton-line {
  height: 18px;
}

.skeleton-line.short {
  width: 42%;
}

.skeleton-block {
  height: 180px;
}

.skeleton-line::after,
.skeleton-block::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(106, 255, 168, 0.28), transparent);
  animation: shimmer 1.1s infinite;
}

.result-header {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.result-header h2 {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(1.25rem, 2vw, 2rem);
  overflow-wrap: anywhere;
}

.result-url {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  border: 1px solid var(--line);
  background: rgba(3, 7, 5, 0.82);
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.detail-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.detail-row dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-row dd {
  margin: 0;
  color: #d7ffe6;
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.error-box {
  border: 1px solid rgba(255, 93, 93, 0.45);
  background: rgba(255, 93, 93, 0.08);
  color: var(--danger);
  padding: 18px;
  line-height: 1.6;
}

.desire-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.1fr 0.8fr;
  grid-auto-flow: dense;
  gap: 0;
  border: 1px solid var(--line);
  margin-bottom: 90px;
}

.accord {
  min-height: 320px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent, rgba(106, 255, 168, 0.08)),
    rgba(5, 8, 6, 0.8);
  padding: 22px;
  overflow: hidden;
  transition: background 280ms ease, transform 280ms ease;
}

.accord:last-child {
  border-right: 0;
}

.accord:hover {
  background: rgba(106, 255, 168, 0.12);
  transform: translateY(-4px);
}

.accord span {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(2.8rem, 6vw, 7rem);
  font-weight: 900;
  line-height: 0.88;
  writing-mode: vertical-rl;
}

.accord p {
  max-width: 28ch;
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.footer-cta {
  border-top: 1px solid var(--line);
  padding: 42px 0 0;
}

.footer-cta p {
  max-width: 900px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 5.8rem);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
}

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

@media (max-width: 980px) {
  .shell {
    width: min(100% - 22px, 760px);
  }

  .nav-readout {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 58px;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 5.5rem);
  }

  .query-panel,
  .result-area,
  .signal-strip {
    grid-column: 1 / -1;
  }

  .metric-grid,
  .desire-grid {
    grid-template-columns: 1fr;
  }

  .accord {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .accord span {
    writing-mode: horizontal-tb;
  }

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