:root {
  color-scheme: light;
  --bg: #f3efe8;
  --bg-accent: #f9f6f0;
  --ink: #1f1b16;
  --muted: #6c5f52;
  --accent: #c7673a;
  --accent-strong: #9a4a27;
  --card: #fff9f2;
  --shadow: 0 22px 50px rgba(31, 27, 22, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Shippori Mincho", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #fde7d7 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, #f1d6bf 0%, transparent 40%),
    linear-gradient(135deg, var(--bg) 0%, #e6dccf 100%);
  min-height: 100vh;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero {
  text-align: center;
  display: grid;
  gap: 16px;
  animation: float-in 700ms ease-out;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 12px;
  margin: 0;
  color: var(--muted);
}

h1 {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(28px, 4vw, 44px);
  margin: 0;
}

.lead {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  animation: fade-up 600ms ease both;
}

.card:nth-of-type(2) {
  animation-delay: 120ms;
}

.card:nth-of-type(3) {
  animation-delay: 220ms;
}

h2 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

label,
.label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

textarea,
select,
button {
  font-family: inherit;
}

textarea,
select {
  border: 1px solid #d9c9b7;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  font-size: 15px;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  background: #f2e5d9;
  padding: 4px;
  border-radius: 999px;
  gap: 6px;
}

.segmented-button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: all 150ms ease;
}

.segmented-button.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(199, 103, 58, 0.35);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e1d2c2;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.chip input {
  accent-color: var(--accent);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border-radius: 999px;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 30px rgba(199, 103, 58, 0.35);
}

.primary:hover {
  background: var(--accent-strong);
}

.ghost {
  background: transparent;
  border: 1px solid #d9c9b7;
  color: var(--ink);
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.output {
  background: #15120f;
  color: #f7efe6;
  padding: 20px;
  border-radius: 16px;
  min-height: 120px;
  white-space: pre-wrap;
  font-size: 14px;
}

.note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 40px 18px 64px;
  }

  .card {
    padding: 22px;
  }

  .output-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
