:root {
  --ink: #191512;
  --muted: #776756;
  --paper: #fff8ed;
  --sand: #efe1cc;
  --fog: #f8efe1;
  --teal: #152f35;
  --teal-2: #23464d;
  --copper: #c65d2f;
  --gold: #f4c977;
  --line: rgba(25, 21, 18, 0.14);
  --shadow: 0 18px 60px rgba(21, 47, 53, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 0%, rgba(244, 201, 119, 0.38), transparent 34rem),
    radial-gradient(circle at 85% 12%, rgba(198, 93, 47, 0.2), transparent 28rem),
    linear-gradient(155deg, #f1dfc3 0%, #f9efe2 52%, #e4c6a8 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Avenir Next, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  background: #e7d3b8;
  color: var(--teal);
  cursor: pointer;
  font-weight: 800;
  padding: 0.75rem 1rem;
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  display: grid;
  gap: 1rem;
  margin: 0 auto;
  max-width: 980px;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}

.hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
    var(--teal);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  color: #fff7ea;
  overflow: hidden;
  padding: 1.4rem;
  position: relative;
}

.hero::after {
  background: radial-gradient(circle, rgba(244, 201, 119, 0.35), transparent 60%);
  content: "";
  height: 14rem;
  position: absolute;
  right: -4rem;
  top: -6rem;
  width: 14rem;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

h1 {
  font-family: Iowan Old Style, Georgia, serif;
  font-size: clamp(2.45rem, 12vw, 5rem);
  letter-spacing: -0.07em;
  line-height: 0.86;
  margin: 0;
  max-width: 9ch;
}

.lede {
  color: #d9c8b6;
  font-size: 1rem;
  line-height: 1.5;
  margin: 1rem 0 0;
  max-width: 34rem;
  position: relative;
  z-index: 1;
}

.panel {
  backdrop-filter: blur(18px);
  background: rgba(255, 248, 237, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1.5rem;
  box-shadow: 0 12px 38px rgba(54, 39, 23, 0.1);
  padding: 1rem;
}

.panel-title {
  align-items: center;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 0.35rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--ink);
  outline: none;
  padding: 0.9rem 1rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(198, 93, 47, 0.12);
}

.field-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.primary {
  background: var(--copper);
  color: #fffaf2;
  font-size: 1rem;
  margin-top: 0.35rem;
  min-height: 3.4rem;
  width: 100%;
}

.lyrics {
  background: #151f22;
  border-radius: 1.25rem;
  color: #fff4df;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
  min-height: 14rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.cards {
  display: grid;
  gap: 0.75rem;
}

.card {
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0.9rem;
}

.card strong {
  color: var(--copper);
  display: block;
  margin-bottom: 0.45rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.chip {
  background: var(--teal);
  color: #fff7ea;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-top: -0.2rem;
}

@media (min-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr 1fr;
    padding: 2rem;
  }

  .hero,
  .brief-panel,
  .output-panel {
    grid-column: 1 / -1;
  }

  .brief-panel {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: 1fr 1fr;
  }

  .brief-panel .panel-title,
  .brief-panel label:nth-of-type(4),
  .brief-panel label:nth-of-type(5),
  .brief-panel label:nth-of-type(6),
  .brief-panel .primary {
    grid-column: 1 / -1;
  }
}
