:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-strong: #ffffff;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --text: #142033;
  --muted: #667085;
  --border: rgba(20, 32, 51, 0.12);
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --shadow: 0 24px 80px rgba(31, 41, 55, 0.14);
  --field: rgba(255, 255, 255, 0.88);
  --danger: #dc2626;
  --success: #059669;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08111f;
  --bg-strong: #111827;
  --card: rgba(17, 24, 39, 0.72);
  --card-solid: #101827;
  --text: #eef4ff;
  --muted: #aab6cc;
  --border: rgba(255, 255, 255, 0.12);
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --accent-soft: rgba(125, 211, 252, 0.16);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  --field: rgba(8, 17, 31, 0.72);
  --danger: #fb7185;
  --success: #34d399;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08111f;
    --bg-strong: #111827;
    --card: rgba(17, 24, 39, 0.72);
    --card-solid: #101827;
    --text: #eef4ff;
    --muted: #aab6cc;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #7dd3fc;
    --accent-strong: #38bdf8;
    --accent-soft: rgba(125, 211, 252, 0.16);
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
    --field: rgba(8, 17, 31, 0.72);
    --danger: #fb7185;
    --success: #34d399;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
    radial-gradient(circle at 82% 12%, rgba(14, 165, 233, 0.18), transparent 28rem),
    linear-gradient(135deg, var(--bg), var(--bg-strong));
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar,
.brand,
.hero,
.workspace,
.actions,
.examples,
.hero-panel,
.card-heading {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 64px;
}

.brand {
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  font-weight: 800;
  letter-spacing: -0.04em;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
}

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

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

.theme-toggle,
.button,
.status-chip,
.inline-copy,
.examples button {
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--card);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.theme-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), transparent 58%);
  box-shadow: inset -5px -5px 0 rgba(255, 255, 255, 0.45);
}

.hero {
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-panel {
  min-width: 270px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel div {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-radius: 18px;
  background: var(--accent-soft);
}

.metric {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-weight: 850;
}

.hero-panel small {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  align-items: stretch;
  gap: 20px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.composer {
  flex: 1.15;
  padding: 28px;
}

.details {
  flex: 0.85;
  padding: 24px;
}

.card-heading {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.card-heading.compact {
  margin-bottom: 18px;
}

.base-chip {
  max-width: 260px;
  overflow: hidden;
  padding: 8px 12px;
  color: var(--accent-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--accent-soft);
}

.input-label,
.output-wrap label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea,
input {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  background: var(--field);
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 18px;
  line-height: 1.6;
  border-radius: 24px;
}

input {
  padding: 14px 16px;
  border-radius: 16px;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  color: var(--text);
  background: var(--card-solid);
}

.button.primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-strong), #8b5cf6);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.26);
}

.button.ghost,
.inline-copy,
.examples button {
  color: var(--text);
  background: var(--field);
}

.button:hover:not(:disabled),
.inline-copy:hover:not(:disabled),
.theme-toggle:hover,
.examples button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.button:disabled,
.inline-copy:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.message {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.status-chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  background: var(--accent-soft);
}

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

.info-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--field);
}

dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

dd {
  min-height: 20px;
  margin: 0;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-wrap {
  padding-top: 4px;
}

.output-row {
  display: flex;
  gap: 10px;
}

.output-row input {
  min-width: 0;
  flex: 1;
}

.inline-copy {
  min-width: 72px;
  padding: 0 16px;
  color: var(--text);
}

.examples {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
}

.examples p {
  margin: 0 8px 0 0;
  font-weight: 700;
}

.examples button {
  padding: 9px 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .hero,
  .workspace {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    margin-bottom: 42px;
  }

  .theme-toggle {
    align-self: flex-start;
  }

  .hero-panel {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .brand small {
    display: none;
  }

  .hero-panel,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    display: grid;
  }

  .composer,
  .details {
    padding: 18px;
    border-radius: 26px;
  }

  .card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .output-row {
    flex-direction: column;
  }

  .button,
  .inline-copy {
    width: 100%;
  }
}
