:root {
  color-scheme: dark;
  --bg: #080c16;
  --surface: rgba(15, 22, 38, 0.82);
  --surface-strong: #121a2a;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(129, 140, 248, 0.36);
  --text: #f7f8fc;
  --muted: #9aa7bd;
  --muted-strong: #c6cfdd;
  --indigo: #818cf8;
  --blue: #38bdf8;
  --green: #34d399;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, #18203d 0, transparent 42%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
textarea,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: 180px;
  left: -260px;
  background: #4f46e5;
}

.ambient-two {
  top: 520px;
  right: -280px;
  background: #0284c7;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(129, 140, 248, 0.24), rgba(56, 189, 248, 0.08));
  color: #c7d2fe;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

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

.brand strong {
  font-size: 0.98rem;
}

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

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.07);
  color: #a7f3d0;
  font-size: 0.78rem;
  font-weight: 650;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 64px;
  align-items: center;
  min-height: 465px;
  padding: 54px 58px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.035), transparent 38%),
    rgba(12, 18, 31, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.eyebrow,
.section-kicker,
.model-kicker {
  margin: 0 0 12px;
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 690;
  letter-spacing: -0.062em;
  line-height: 0.98;
}

.hero-text {
  max-width: 700px;
  margin: 28px 0 0;
  color: var(--muted-strong);
  font-size: 1.05rem;
  line-height: 1.7;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.feature-row span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.76rem;
}

.model-card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(99, 102, 241, 0.2), transparent 40%),
    rgba(16, 24, 42, 0.88);
}

.model-card::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 16px;
  content: "";
  pointer-events: none;
}

.model-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.model-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #4f46e5, #0284c7);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
  font-size: 1.35rem;
}

.model-card h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.model-kicker {
  margin-bottom: 3px;
  color: var(--muted);
}

.model-note {
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 720;
  transition:
    transform 150ms ease,
    opacity 150ms ease,
    box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  background: linear-gradient(135deg, #6366f1, #2563eb);
  color: white;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.25);
}

.model-card .button {
  width: 100%;
}

.button-arrow {
  font-size: 1.15rem;
}

.download-wrap {
  margin-top: 20px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--indigo), var(--blue));
  transition: width 200ms ease;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.runtime-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}

.runtime-status.is-loading .status-light {
  background: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
}

.runtime-status.is-ready .status-light {
  background: var(--green);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
}

.runtime-status.is-error .status-light {
  background: var(--danger);
}

.workspace {
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.tab {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: rgba(129, 140, 248, 0.12);
  color: #c7d2fe;
}

.panel {
  display: none;
  padding: 34px;
}

.panel.is-active {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.panel-heading > p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: right;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
}

.field {
  min-width: 0;
}

.field label,
.label-row span,
.vector-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 680;
}

.label-row {
  display: flex;
  justify-content: space-between;
}

.label-row span {
  color: var(--muted);
  font-weight: 500;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: rgba(4, 8, 17, 0.52);
  color: var(--text);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

textarea,
input {
  padding: 13px 14px;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

select {
  height: 47px;
  padding: 0 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(129, 140, 248, 0.68);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.field-wide,
.field-corpus {
  grid-column: 1;
}

.field-wide + .field {
  grid-column: 2;
}

.field-stack {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  flex-direction: column;
  gap: 16px;
}

.field-stack .button {
  margin-top: auto;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

.examples > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.example-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.example-chip:hover {
  border-color: var(--border-strong);
  color: #c7d2fe;
}

.empty-state {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 26px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
}

.empty-icon {
  color: var(--indigo);
  font-size: 2rem;
}

.empty-state h3 {
  margin: 0 0 4px;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.78rem;
}

.results-list {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.result-item {
  display: grid;
  grid-template-columns: 42px 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.result-rank {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: rgba(129, 140, 248, 0.12);
  color: #c7d2fe;
  font-size: 0.78rem;
  font-weight: 800;
}

.result-score {
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.result-document {
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.5;
}

.pair-grid,
.inspect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.inline-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 18px;
}

.grow {
  flex: 1;
}

.compact {
  width: 150px;
}

.compact-button {
  min-width: 130px;
}

.score-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(99, 102, 241, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.025);
}

.score-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.score-card strong {
  display: block;
  margin-top: 5px;
  color: #c7d2fe;
  font-size: 2.5rem;
  letter-spacing: -0.05em;
}

.score-copy span {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-weight: 740;
}

.inspect-grid {
  grid-template-columns: minmax(0, 1fr) 210px;
}

.inspect-actions {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.inspect-actions .button {
  margin-top: auto;
}

.vector-output {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.metric-row > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(4, 8, 17, 0.34);
}

.metric-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}

.metric-row strong {
  color: var(--muted-strong);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

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

.vector-value {
  padding: 8px 6px;
  border-radius: 7px;
  background: rgba(129, 140, 248, 0.08);
  color: #c7d2fe;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 4px 36px;
  color: var(--muted);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--muted-strong);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(410px, calc(100% - 44px));
  padding: 13px 16px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 12px;
  background: rgba(62, 18, 30, 0.96);
  box-shadow: var(--shadow);
  color: #fecdd3;
  font-size: 0.8rem;
  line-height: 1.45;
}

.is-busy {
  cursor: wait;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 42px;
  }

  .model-card {
    max-width: 520px;
  }

  .panel-heading {
    display: block;
  }

  .panel-heading > p {
    margin-top: 10px;
    text-align: left;
  }

  .vector-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .privacy-pill {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 32px 24px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
  }

  .panel {
    padding: 26px 18px;
  }

  .control-grid,
  .pair-grid,
  .inspect-grid {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .field-corpus,
  .field-wide + .field,
  .field-stack {
    grid-column: 1;
  }

  .field-stack {
    grid-row: auto;
  }

  .inline-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .compact {
    width: auto;
  }

  .score-card {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: repeat(2, 1fr);
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 8px;
  }
}

