:root {
  --bg: #f4efe3;
  --bg-deep: #f0e8d8;
  --panel: rgba(255, 250, 240, 0.88);
  --panel-strong: rgba(255, 248, 234, 0.94);
  --line: rgba(18, 46, 52, 0.12);
  --text: #18343b;
  --muted: #526e72;
  --accent: #0e6d6a;
  --accent-deep: #0a5150;
  --gold: #c28a2e;
  --danger: #9e3f2b;
  --shadow: 0 24px 60px rgba(24, 52, 59, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Georgia", serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(194, 138, 46, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14, 109, 106, 0.18), transparent 30%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: var(--font-body);
}

.background-glow {
  position: fixed;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}

.glow-a {
  top: -8rem;
  right: -10rem;
  background: rgba(194, 138, 46, 0.22);
}

.glow-b {
  bottom: -10rem;
  left: -10rem;
  background: rgba(14, 109, 106, 0.22);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 3.2rem;
}

.hero,
.grid-shell,
.response-grid {
  display: grid;
  gap: 1.2rem;
}

.hero {
  grid-template-columns: 1.6fr 0.95fr;
  align-items: stretch;
  margin-bottom: 1.2rem;
}

.hero-copy,
.hero-panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-copy {
  padding: 2rem;
}

.hero-panel {
  padding: 1.4rem;
  display: grid;
  gap: 0.95rem;
  align-content: start;
}

.eyebrow,
.section-kicker,
.panel-label {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.45rem;
}

.hero-text {
  max-width: 64ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-pills,
.button-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-pills {
  margin-top: 1.25rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(14, 109, 106, 0.12);
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

.pill.muted {
  background: rgba(24, 52, 59, 0.08);
  color: var(--muted);
}

.metric {
  display: grid;
  gap: 0.12rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid rgba(18, 46, 52, 0.08);
}

.metric span {
  font-size: 0.86rem;
  color: var(--muted);
}

.metric strong {
  font-size: 1rem;
}

.grid-shell {
  grid-template-columns: 1.55fr 0.95fr;
  margin-bottom: 1.2rem;
}

.response-grid {
  grid-template-columns: 1.2fr 0.9fr;
  margin-bottom: 1.2rem;
}

.card {
  padding: 1.35rem;
}

.card-large {
  padding: 1.45rem;
}

.raw-card {
  padding-bottom: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-header.compact {
  margin-bottom: 0.8rem;
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.prompt-input,
.token-input {
  width: 100%;
  border: 1px solid rgba(24, 52, 59, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 247, 0.96);
  color: var(--text);
  font: inherit;
  padding: 0.95rem 1rem;
}

.prompt-input {
  resize: vertical;
  min-height: 8.75rem;
  line-height: 1.55;
}

.action-row,
.sample-prompts {
  margin-top: 1rem;
}

.sample-prompts p {
  margin: 0 0 0.6rem;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.05rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #f7f3e9;
  box-shadow: 0 16px 30px rgba(14, 109, 106, 0.22);
}

.primary-button.secondary-tone {
  background: linear-gradient(135deg, #154f72, #113c56);
}

.primary-button.danger-tone,
.danger-button {
  background: linear-gradient(135deg, #ba543a, var(--danger));
  color: #fff8f2;
  box-shadow: 0 16px 30px rgba(158, 63, 43, 0.2);
}

.secondary-button {
  background: linear-gradient(135deg, #ebd5aa, #c28a2e);
  color: #3a2910;
}

.ghost-button {
  background: rgba(24, 52, 59, 0.06);
  color: var(--text);
}

.ghost-button.emphasis {
  background: rgba(194, 138, 46, 0.14);
  color: #7e5414;
}

.stack-buttons {
  display: grid;
  gap: 0.8rem;
}

.summary-panel,
.proof-panel {
  display: grid;
  gap: 0.9rem;
}

.status-banner {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font-weight: 600;
}

.status-banner.info {
  background: rgba(14, 109, 106, 0.1);
  color: var(--accent-deep);
}

.status-banner.success {
  background: rgba(40, 120, 74, 0.12);
  color: #245d38;
}

.status-banner.error {
  background: rgba(158, 63, 43, 0.12);
  color: #7f311e;
}

.info-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(24, 52, 59, 0.09);
  background: rgba(255, 251, 245, 0.96);
}

.info-card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
}

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

.info-item {
  display: grid;
  gap: 0.12rem;
}

.info-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.info-item strong {
  font-size: 0.96rem;
  word-break: break-word;
}

.chip-block {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.mini-chip {
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: rgba(14, 109, 106, 0.1);
  color: var(--accent-deep);
  font-size: 0.86rem;
  line-height: 1.3;
}

.warning-chip {
  background: rgba(194, 138, 46, 0.14);
  color: #845619;
}

.placeholder {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.json-output {
  margin: 0;
  padding: 1.1rem;
  max-height: 32rem;
  overflow: auto;
  border-radius: var(--radius-md);
  background: #11272d;
  color: #edf6f5;
  font: 0.9rem/1.5 "Cascadia Code", "Consolas", monospace;
}

.operator-console {
  margin-top: 1rem;
  border-top: 1px dashed rgba(24, 52, 59, 0.14);
  padding-top: 1rem;
}

.operator-console summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-deep);
}

@media (max-width: 980px) {
  .hero,
  .grid-shell,
  .response-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 1rem 0.8rem 2rem;
  }

  .hero-copy,
  .hero-panel,
  .card {
    border-radius: 22px;
  }

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