@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,500;6..72,700&display=swap");

:root {
  --bg: #f3f5f8;
  --bg-strong: #eef2f6;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --line: rgba(17, 24, 39, 0.08);
  --ink: #102036;
  --ink-soft: #5a6678;
  --blue: #2653ff;
  --blue-soft: rgba(38, 83, 255, 0.12);
  --green: #0f8a64;
  --green-soft: rgba(15, 138, 100, 0.12);
  --amber: #b7872b;
  --amber-soft: rgba(183, 135, 43, 0.12);
  --red: #be4250;
  --red-soft: rgba(190, 66, 80, 0.12);
  --shadow: 0 24px 60px rgba(13, 28, 45, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(126, 161, 255, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 214, 153, 0.18), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

button,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
  width: 100%;
}

.hero-card,
.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}

.eyebrow,
.section-kicker,
.meta-label,
.summary-overline,
.stage-label {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card h1,
.panel h2,
.panel h3 {
  margin: 0;
  line-height: 1.05;
}

.hero-card h1 {
  font-family: "Newsreader", serif;
  font-size: clamp(2.8rem, 4vw, 4.5rem);
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 44rem;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-meta {
  display: grid;
  gap: 14px;
  align-content: end;
}

.meta-chip {
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 244, 248, 0.82));
  border: 1px solid var(--line);
}

.meta-chip strong {
  display: block;
  font-size: 1rem;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, clamp(320px, 32vw, 460px)) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.left-column,
.right-column {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
  min-width: 0;
  overflow: clip;
}

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

.panel-header h2 {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.status-pill,
.summary-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(16, 32, 54, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.analysis-form {
  display: grid;
  gap: 14px;
}

.field-label {
  font-size: 0.95rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 164px;
  max-width: 100%;
  resize: vertical;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(16, 32, 54, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  line-height: 1.7;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea:focus,
.primary-button:focus,
.example-chip:focus,
.artifact-link:focus {
  outline: none;
  border-color: rgba(38, 83, 255, 0.44);
  box-shadow: 0 0 0 4px rgba(38, 83, 255, 0.14);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.example-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(16, 32, 54, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.example-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(38, 83, 255, 0.28);
}

.form-footer {
  display: grid;
  gap: 12px;
}

.primary-button {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2f61ff, #1638d6);
  box-shadow: 0 16px 32px rgba(38, 83, 255, 0.24);
  transition: transform 200ms ease, box-shadow 200ms ease, opacity 180ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 22px 38px rgba(38, 83, 255, 0.28);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-note,
.artifact-empty,
.log-empty,
#current-stage-description {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(16, 32, 54, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5e7dff, #1b48ee 62%, #0f2d98);
  transition: width 320ms ease;
}

.progress-number {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.stage-now {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 247, 250, 0.82));
  margin-top: 18px;
  min-width: 0;
}

.stage-now h3 {
  font-size: 1.3rem;
  margin-top: 4px;
}

.stage-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
}

.stage-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.stage-card[data-status="running"] {
  border-color: rgba(38, 83, 255, 0.18);
  background: linear-gradient(180deg, rgba(38, 83, 255, 0.12), rgba(255, 255, 255, 0.88));
}

.stage-card[data-status="completed"] {
  border-color: rgba(15, 138, 100, 0.16);
  background: linear-gradient(180deg, rgba(15, 138, 100, 0.1), rgba(255, 255, 255, 0.88));
}

.stage-card[data-status="failed"] {
  border-color: rgba(190, 66, 80, 0.18);
  background: linear-gradient(180deg, rgba(190, 66, 80, 0.12), rgba(255, 255, 255, 0.88));
}

.stage-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: 6px;
  background: rgba(16, 32, 54, 0.16);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.8);
}

.stage-card[data-status="running"] .stage-dot {
  background: var(--blue);
}

.stage-card[data-status="completed"] .stage-dot {
  background: var(--green);
}

.stage-card[data-status="failed"] .stage-dot {
  background: var(--red);
}

.stage-copy h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.stage-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.stage-state {
  min-width: 86px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(16, 32, 54, 0.06);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.stage-card[data-status="running"] .stage-state {
  background: var(--blue-soft);
  color: var(--blue);
}

.stage-card[data-status="completed"] .stage-state {
  background: var(--green-soft);
  color: var(--green);
}

.stage-card[data-status="failed"] .stage-state {
  background: var(--red-soft);
  color: var(--red);
}

.log-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.log-feed {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.log-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(247, 249, 252, 0.92);
  border: 1px solid rgba(16, 32, 54, 0.05);
}

.log-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.log-message {
  margin: 0;
  line-height: 1.6;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.results-header {
  align-items: center;
}

.summary-card {
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(16, 32, 54, 0.95), rgba(29, 49, 78, 0.92));
  color: white;
  margin-bottom: 22px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-card.is-empty {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 246, 250, 0.88));
  color: var(--ink);
  border: 1px solid var(--line);
}

.summary-card h3 {
  font-family: "Newsreader", serif;
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin-top: 4px;
}

.summary-card p {
  max-width: 48rem;
  margin: 12px 0 0;
  line-height: 1.75;
}

.results-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.result-card {
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  min-width: 0;
}

.result-card h3 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.result-card .content-html {
  color: var(--ink);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-card .content-html h2 {
  margin: 22px 0 10px;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.result-card .content-html h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.result-card .content-html p,
.result-card .content-html li {
  margin: 0 0 10px;
  color: var(--ink-soft);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.result-card .content-html ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.artifact-section {
  margin-top: 28px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
  min-width: 0;
}

.artifact-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.artifact-preview {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 32, 54, 0.06), rgba(16, 32, 54, 0.02));
  border: 1px solid rgba(16, 32, 54, 0.06);
}

.artifact-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.artifact-preview--file {
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.6;
}

.artifact-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 32, 54, 0.06);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.artifact-meta h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.artifact-meta p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.artifact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(38, 83, 255, 0.16);
  background: rgba(38, 83, 255, 0.08);
  color: #1736b9;
  font-weight: 800;
  text-decoration: none;
  width: 100%;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(16, 32, 54, 0.08);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
}

@media (max-width: 1100px) {
  .hero-card,
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .page-shell {
    padding: 16px;
  }

  .hero-card,
  .panel,
  .summary-card,
  .result-card {
    padding: 20px;
    border-radius: 24px;
  }

  .panel-header,
  .subsection-header {
    flex-direction: column;
  }

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

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

  .stage-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .stage-state {
    grid-column: 2;
    width: fit-content;
  }

  .examples {
    flex-direction: column;
  }

  .example-chip,
  .primary-button,
  .artifact-link {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hero-card h1 {
    font-size: 2.4rem;
  }

  .panel-header h2 {
    font-size: 1.3rem;
  }

  .summary-card h3 {
    font-size: 1.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
