:root {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  background: #eee5d8;
  color: #33271f;
  --paper: #f7efe5;
  --paper-deep: #eadbc8;
  --ink: #33271f;
  --muted: #6f5d4f;
  --line: #cbb9a3;
  --brown: #8f4b25;
  --brown-dark: #5d321f;
  --blue: #405f7d;
  --shadow: 0 16px 35px rgba(65, 44, 28, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.55), transparent 28%),
    repeating-linear-gradient(0deg, rgba(77, 52, 31, 0.035) 0 1px, transparent 1px 5px),
    #eee5d8;
}

button,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-bottom: 1px solid rgba(67, 45, 28, 0.28);
  background: #bba98f;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.28) saturate(0.85) contrast(0.96);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(244, 236, 222, 0.22), rgba(244, 236, 222, 0.16) 45%, rgba(55, 37, 24, 0.22)),
    radial-gradient(circle at 50% 14%, rgba(247, 239, 229, 0.58), transparent 34%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 44px;
  text-align: center;
  color: #fffaf0;
  text-shadow: 0 2px 8px rgba(44, 30, 20, 0.68);
}

.hero-copy p {
  margin: 0 0 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1,
.hero-copy h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.92;
}

.hero-copy h1 {
  font-size: clamp(48px, 8vw, 98px);
  font-weight: 500;
}

.hero-copy h2 {
  font-size: clamp(38px, 6vw, 78px);
  font-style: italic;
  font-weight: 400;
}

.hero-copy span {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 18px;
  color: #342720;
  background: rgba(248, 238, 220, 0.78);
  text-shadow: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.content-grid {
  width: min(1340px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.28fr 1fr;
  gap: 26px;
  padding: 34px 44px 42px;
}

.panel {
  min-width: 0;
  padding: 4px 0 0;
}

.panel + .panel {
  border-left: 1px solid var(--line);
  padding-left: 26px;
}

.section-head {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-head.centered {
  text-align: center;
}

.section-head h2 {
  margin: 0 0 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0;
  color: #30251e;
}

.episode {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 24px;
}

.play {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #261b16;
  color: transparent;
  box-shadow: 0 3px 8px rgba(38, 27, 22, 0.2);
  cursor: pointer;
}

.play::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 14px 0 0 19px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid #fff7e9;
}

.episode h3,
.chat-card h3 {
  margin: 0 0 9px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.25;
  color: #3c2b20;
}

.player {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 39px;
  padding: 8px 12px;
  background: #2b221c;
  color: #fff9ed;
  box-shadow: 0 3px 8px rgba(38, 27, 22, 0.18);
}

.player span {
  height: 5px;
  background: linear-gradient(90deg, #fff4df 0 42%, rgba(255, 244, 223, 0.28) 42% 100%);
  border-radius: 999px;
}

.player strong {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.brown-button {
  min-height: 44px;
  padding: 0 28px;
  border: 0;
  background: linear-gradient(180deg, #9c542a, #753719);
  color: #fff8ed;
  box-shadow: 0 4px 9px rgba(68, 39, 25, 0.22);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  cursor: pointer;
}

.feature img {
  width: 100%;
  aspect-ratio: 16 / 5.3;
  object-fit: cover;
  object-position: center 58%;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  filter: sepia(0.2) saturate(0.8);
}

.feature p {
  margin: 0 0 24px;
  font-size: 20px;
  line-height: 1.55;
}

.chat-card h3 {
  color: #8b4d29;
}

.chat {
  min-height: 210px;
  max-height: 330px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(202, 178, 144, 0.22);
  box-shadow: inset 0 0 18px rgba(75, 50, 31, 0.1);
}

.message {
  max-width: 92%;
  padding: 12px 14px;
  border: 1px solid rgba(120, 95, 70, 0.28);
  background: #fffaf1;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 4px 9px rgba(68, 39, 25, 0.1);
}

.message.user {
  align-self: flex-end;
  background: #f2dfbd;
}

.message.assistant {
  align-self: flex-start;
}

.message.error {
  align-self: center;
  background: #fff1ef;
  border-color: #b35d4b;
  color: #7f241a;
}

.prompt-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #f5e5c9;
  border: 1px solid rgba(120, 95, 70, 0.26);
  box-shadow: 0 5px 12px rgba(68, 39, 25, 0.1);
}

.prompt-card button {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(120, 95, 70, 0.25);
  background: transparent;
  color: #3c2b20;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}

.prompt-card button:last-child {
  border-bottom: 0;
}

.prompt-card button::before {
  content: "- ";
  font-weight: 900;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  background: rgba(218, 197, 170, 0.74);
  box-shadow: 0 5px 12px rgba(68, 39, 25, 0.14);
}

textarea {
  width: 100%;
  min-height: 46px;
  max-height: 140px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid rgba(120, 95, 70, 0.26);
  background: #f8efe4;
  color: var(--ink);
  outline-color: var(--blue);
}

#send {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  cursor: pointer;
}

#send:disabled {
  opacity: 0.58;
  cursor: wait;
}

@media (max-width: 1080px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chat-card {
    grid-column: 1 / -1;
    border-left: 0 !important;
    padding-left: 0 !important;
  }
}

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.66), transparent 34%),
      #eee5d8;
  }

  .hero {
    min-height: 250px;
  }

  .hero img {
    object-position: center center;
  }

  .hero-copy {
    width: min(100% - 28px, 520px);
    padding-top: 30px;
  }

  .hero-copy p {
    font-size: 11px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 14vw, 64px);
  }

  .hero-copy h2 {
    font-size: clamp(34px, 11vw, 54px);
  }

  .hero-copy span {
    max-width: 92%;
    margin-top: 14px;
    padding: 7px 12px;
    font-size: 14px;
    line-height: 1.25;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 18px 14px 30px;
  }

  .panel {
    padding: 0;
  }

  .panel + .panel {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 22px;
  }

  .chat-card {
    order: -1;
    border-top: 0 !important;
    padding-top: 0 !important;
  }

  .section-head {
    margin-bottom: 15px;
  }

  .section-head h2 {
    font-size: 23px;
  }

  .chat-card h3,
  .episode h3 {
    font-size: 16px;
  }

  .chat {
    min-height: 180px;
    max-height: 42vh;
    padding: 12px;
  }

  .message {
    max-width: 96%;
    padding: 11px 12px;
    font-size: 16px;
  }

  .prompt-card {
    padding: 10px 12px;
  }

  .prompt-card button {
    min-height: 44px;
    padding: 10px 0;
    font-size: 15px;
  }

  .composer {
    grid-template-columns: 1fr 76px;
    gap: 8px;
    padding: 8px;
  }

  textarea {
    min-width: 0;
    min-height: 48px;
    max-height: 116px;
    font-size: 16px;
  }

  #send {
    min-height: 48px;
    padding: 0 12px;
  }

  .episode {
    grid-template-columns: 44px 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .play {
    width: 44px;
    height: 44px;
  }

  .play::before {
    margin: 12px 0 0 17px;
  }

  .player {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .brown-button {
    width: 100%;
    min-height: 48px;
  }

  .feature img {
    aspect-ratio: 16 / 8.5;
    margin-bottom: 16px;
  }

  .feature p {
    font-size: 17px;
    line-height: 1.55;
  }
}

@media (max-width: 380px) {
  .hero {
    min-height: 230px;
  }

  .content-grid {
    padding-left: 10px;
    padding-right: 10px;
  }

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

  #send {
    width: 100%;
  }
}
