:root {
  --bg: #f2eee5;
  --panel: rgba(255, 252, 247, 0.84);
  --panel-strong: #fffaf2;
  --text: #1d1c19;
  --muted: #5b564a;
  --line: rgba(33, 29, 18, 0.14);
  --accent: #0c6d62;
  --accent-deep: #084640;
  --assistant: #fff3d1;
  --user: #d8f0ec;
  --shadow: 0 20px 60px rgba(42, 36, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(12, 109, 98, 0.18), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(193, 122, 50, 0.14), transparent 24rem),
    linear-gradient(160deg, #f6f2ea 0%, #ece5d8 100%);
  font-family: "Space Grotesk", sans-serif;
}

.page-shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
}

.hero-panel,
.chat-panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -3rem -6rem auto;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(12, 109, 98, 0.22), rgba(193, 122, 50, 0.18));
  filter: blur(6px);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-family: "Source Serif 4", serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.hero-copy {
  margin: 1.2rem 0 1.8rem;
  max-width: 34rem;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  gap: 0.9rem;
}

.hero-card {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid rgba(33, 29, 18, 0.08);
}

.hero-card h2 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 78vh;
  padding: 1.35rem;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 1.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.message {
  max-width: 90%;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(33, 29, 18, 0.08);
  animation: rise 180ms ease-out;
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant);
}

.message.user {
  align-self: flex-end;
  background: var(--user);
}

.message-meta {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  margin-bottom: 0.45rem;
}

.message-body {
  line-height: 1.65;
  white-space: pre-wrap;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.composer-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(33, 29, 18, 0.12);
  border-radius: 18px;
  background: var(--panel-strong);
  padding: 1rem;
  font: inherit;
  color: var(--text);
  min-height: 8rem;
  outline: none;
}

textarea:focus {
  border-color: rgba(12, 109, 98, 0.38);
  box-shadow: 0 0 0 4px rgba(12, 109, 98, 0.1);
}

.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.upload-control {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px dashed rgba(12, 109, 98, 0.35);
  color: var(--accent-deep);
  background: rgba(12, 109, 98, 0.06);
  font-size: 0.92rem;
  cursor: pointer;
}

.upload-control input {
  max-width: 16rem;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.file-chip {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(29, 28, 25, 0.07);
  color: var(--muted);
  font-size: 0.84rem;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.primary-button {
  padding: 0.85rem 1.2rem;
  background: var(--accent);
  color: #f7f3eb;
  font-weight: 700;
}

.ghost-button {
  padding: 0.7rem 1rem;
  background: rgba(29, 28, 25, 0.06);
  color: var(--muted);
}

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

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .chat-panel {
    min-height: 72vh;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .page-shell {
    width: min(100vw - 1rem, 100%);
    gap: 1rem;
  }

  .hero-panel,
  .chat-panel {
    border-radius: 22px;
  }

  .composer-actions,
  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .message {
    max-width: 100%;
  }
}
