:root {
  color-scheme: light;
  --bg: #f6f0e4;
  --bg-accent: #ead9bf;
  --surface: rgba(255, 251, 245, 0.84);
  --surface-strong: #fff9f1;
  --surface-ink: #2f2418;
  --border: rgba(76, 53, 27, 0.14);
  --text: #2c1f12;
  --muted: #6b5a49;
  --brand: #9c3f13;
  --brand-soft: #f3c7aa;
  --ok: #1c5f3f;
  --shadow: 0 30px 80px rgba(88, 55, 18, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Aptos, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(156, 63, 19, 0.12), transparent 24%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
  min-height: 100vh;
}

code,
pre {
  font-family: "Courier New", monospace;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

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

.hero-copy {
  padding: 32px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(156, 63, 19, 0.18), transparent 70%);
  pointer-events: none;
}

.eyebrow,
.hero-card-label,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
}

.hero-copy h1,
.panel-header h2,
.story-title,
.workspace-card h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.hero-copy h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 0.95;
}

.hero-text {
  max-width: 56ch;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
}

.hero-stack {
  display: grid;
  gap: 20px;
}

.hero-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 251, 245, 0.92));
  animation: float-up 420ms ease-out both;
}

.hero-card-value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.hero-card-value-compact {
  font-size: 22px;
}

.hero-card-meta {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-card-accent {
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 244, 233, 0.94));
}

.hero-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.ghost-button {
  border: 1px solid rgba(156, 63, 19, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: var(--surface-ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(156, 63, 19, 0.3);
  background: rgba(255, 255, 255, 0.92);
}

.hosted-auth-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  max-width: 460px;
}

.hosted-auth-field {
  display: grid;
  gap: 8px;
}

.hosted-auth-field span {
  font-size: 14px;
  font-weight: 700;
  color: var(--surface-ink);
}

.hosted-auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(76, 53, 27, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
}

.hosted-auth-field input:focus {
  outline: 2px solid rgba(156, 63, 19, 0.18);
  outline-offset: 1px;
}

.layout {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.panel {
  border-radius: var(--radius-md);
  padding: 22px;
  animation: float-up 420ms ease-out both;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-text {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.checklist {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.checklist li + li,
.mini-checklist li + li {
  margin-top: 8px;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
}

.rail {
  display: grid;
  gap: 20px;
}

.story-panel {
  min-height: 540px;
}

.chip-row,
.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip,
.story-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(156, 63, 19, 0.08);
  color: var(--surface-ink);
  font-size: 13px;
}

.story-state,
.story-dek,
.workspace-copy {
  color: var(--muted);
  line-height: 1.65;
}

.story-state {
  margin: 0 0 14px;
}

.story-overline {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.story-title {
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.story-dek {
  margin: 16px 0 18px;
  font-size: 18px;
}

.story-body {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.story-body p {
  margin: 0;
  padding-left: 16px;
  border-left: 3px solid rgba(156, 63, 19, 0.18);
  line-height: 1.7;
}

.story-link {
  display: inline-flex;
  margin-top: 22px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.story-link-disabled {
  pointer-events: none;
  opacity: 0.65;
}

.metric-list {
  display: grid;
  gap: 14px;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(76, 53, 27, 0.08);
}

.metric-label {
  color: var(--muted);
}

.metric-value {
  font-weight: 700;
}

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

.workspace-card {
  min-height: 280px;
}

.mini-checklist {
  margin: 16px 0 0;
  padding-left: 20px;
  line-height: 1.7;
  color: var(--muted);
}

.placeholder-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.placeholder-slot {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(156, 63, 19, 0.2);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

.inspector-panel {
  overflow: hidden;
}

.payload-view {
  margin: 0;
  min-height: 220px;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(156, 63, 19, 0.24);
  background: var(--surface-strong);
  color: #4f3a28;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(156, 63, 19, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.badge[data-state="ok"] {
  background: rgba(28, 95, 63, 0.12);
  color: var(--ok);
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .hero,
  .story-layout,
  .workspace-board {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 20px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 18px;
  }

  .panel-header,
  .hero-card-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .hero-card,
  .ghost-button {
    animation: none;
    transition: none;
  }
}
