:root {
  --bg: #f4eee3;
  --surface: rgba(255, 251, 245, 0.78);
  --surface-strong: #fffaf2;
  --ink: #1d1a17;
  --muted: #685f55;
  --line: rgba(29, 26, 23, 0.12);
  --accent: #1f6a52;
  --accent-soft: #d8eadf;
  --warning: #8b5f17;
  --shadow: 0 28px 60px rgba(58, 40, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 32%),
    linear-gradient(135deg, #f6efe2 0%, #eadfcd 45%, #d9e6dd 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 75%);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.hero-pane {
  padding: 4.5rem 4.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow,
.app-label,
.question-kicker,
.summary-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.hero-pane h1 {
  max-width: 10ch;
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 28rem;
  margin: 1.5rem 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-notes {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-notes span {
  border: 1px solid rgba(29, 26, 23, 0.1);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: rgba(255, 250, 242, 0.55);
  backdrop-filter: blur(8px);
}

.app-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

.app-topbar,
.question-stage,
.plan-stage {
  width: min(100%, 44rem);
  margin: 0 auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.app-step {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.question-stage,
.plan-stage {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.summary-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.intro-panel {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.intro-list {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink);
  line-height: 1.8;
}

.intro-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.intro-list li + li {
  margin-top: 0.15rem;
}

.summary-text {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.question-block h2 {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.answer-form {
  margin-top: 2rem;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 10rem;
  border: 1px solid transparent;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 1rem 1rem 1.1rem;
  font: inherit;
  line-height: 1.6;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

textarea:focus {
  border-color: rgba(31, 106, 82, 0.4);
  box-shadow: 0 0 0 5px rgba(31, 106, 82, 0.08);
}

.form-row,
.plan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.text-button {
  transition: transform 160ms ease, opacity 160ms ease, background-color 160ms ease;
}

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

.primary-button {
  padding: 0.9rem 1.25rem;
  background: var(--accent);
  color: white;
}

.secondary-button {
  padding: 0.9rem 1.25rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.text-button {
  padding: 0.4rem 0;
  background: transparent;
  color: var(--muted);
}

.plan-output {
  margin: 1.5rem 0 0;
  padding: 1.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  background: var(--surface-strong);
  border-left: 4px solid var(--warning);
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 960px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .hero-pane {
    padding: 2rem 1.25rem 1rem;
    gap: 2rem;
  }

  .hero-pane h1 {
    max-width: 12ch;
  }

  .app-pane {
    padding: 0 1rem 1rem;
  }
}

@media (max-width: 640px) {
  .topbar-actions {
    gap: 0.75rem;
  }

  .question-stage,
  .plan-stage {
    padding: 1.25rem;
  }

  .form-row,
  .plan-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
