:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #09100e;
  color: #e8f0ec;
  font-synthesis: none;
  --surface: rgba(21, 32, 29, 0.9);
  --surface-strong: #17231f;
  --line: rgba(177, 207, 193, 0.18);
  --muted: #9fb2aa;
  --accent: #8ce3b1;
  --accent-strong: #5bc98a;
  --danger: #ff9e94;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(55, 128, 91, 0.2), transparent 30rem),
    radial-gradient(circle at 96% 16%, rgba(58, 94, 111, 0.16), transparent 34rem),
    #09100e;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

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

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-block: 72px 36px;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  font-weight: 620;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.runtime {
  flex: 0 0 auto;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 16, 14, 0.7);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.runtime[data-state="ready"] {
  border-color: rgba(140, 227, 177, 0.35);
  color: var(--accent);
}

.runtime[data-state="error"],
[data-state="error"] {
  color: var(--danger) !important;
}

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

.card {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.model-tag {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(140, 227, 177, 0.2);
  border-radius: 8px;
  background: rgba(140, 227, 177, 0.06);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.note,
.status,
.footer,
.warning {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.note {
  min-height: 86px;
  margin-bottom: 22px;
}

.controls {
  display: flex;
  gap: 10px;
}

.model-controls {
  margin-bottom: 10px;
}

button,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

button {
  min-height: 42px;
  padding: 0 16px;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary {
  border-color: transparent;
  background: var(--accent);
  color: #07110c;
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary {
  background: transparent;
  color: var(--muted);
}

.wide {
  width: 100%;
  margin-top: 16px;
}

.status {
  min-height: 22px;
  margin-bottom: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

progress {
  width: 100%;
  height: 6px;
  margin-bottom: 18px;
  border: 0;
  border-radius: 999px;
  background: #0d1714;
  accent-color: var(--accent);
}

label {
  display: block;
  margin: 16px 0 7px;
  color: #cbd8d2;
  font-size: 0.78rem;
  font-weight: 650;
}

textarea,
input,
select {
  width: 100%;
  background: #0c1512;
  color: #e8f0ec;
  outline: none;
}

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

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

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(140, 227, 177, 0.62);
  box-shadow: 0 0 0 3px rgba(140, 227, 177, 0.08);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: end;
  gap: 12px;
}

.field-row label {
  margin-bottom: 13px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}

.metrics {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(140, 227, 177, 0.18);
  border-radius: 10px;
  background: rgba(140, 227, 177, 0.05);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
}

.result {
  min-height: 178px;
  max-height: 420px;
  margin: 18px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07100d;
  color: #c6d6cf;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.result[data-state="success"] {
  border-color: rgba(140, 227, 177, 0.22);
}

.warning {
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(243, 204, 118, 0.2);
  border-radius: 12px;
  background: rgba(91, 73, 35, 0.13);
  color: #c6bda7;
}

.warning strong {
  color: #f0d38e;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 28px 56px;
}

.footer p {
  margin-bottom: 0;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #dce8e2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(140, 227, 177, 0.35);
  text-underline-offset: 3px;
}

@media (max-width: 880px) {
  .hero,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .note {
    min-height: 0;
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 24px, 1240px);
  }

  .hero {
    padding-top: 44px;
  }

  .card {
    padding: 20px;
  }

  .card-heading,
  .field-row,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .card-heading {
    flex-direction: column;
  }

  .model-tag {
    align-self: flex-start;
  }
}
