:root {
  color-scheme: dark;
  --ink: #111111;
  --paper: #f5f0e9;
  --muted: #a8a39b;
  --pink: #f41766;
  --pink-soft: #ff5e96;
  --panel: #1b1b1d;
  --line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
  background:
    radial-gradient(circle at 12% 20%, rgba(244, 23, 102, 0.24), transparent 26rem),
    radial-gradient(circle at 88% 86%, rgba(244, 23, 102, 0.1), transparent 20rem),
    var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

.shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(370px, 500px);
  gap: clamp(40px, 8vw, 110px);
  align-items: center;
  padding: 48px 0;
}

.intro { max-width: 570px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.18em; color: #d3cdc4; }
.eyebrow span { display: inline-block; width: 34px; height: 3px; margin-right: 10px; vertical-align: middle; background: var(--pink); }
h1 { margin: 24px 0 22px; font-size: clamp(50px, 7vw, 90px); line-height: 0.92; letter-spacing: -0.06em; text-transform: uppercase; }
h1 em { color: var(--pink); font-style: normal; }
.lead { max-width: 540px; margin: 0; color: #c8c2ba; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }

.facts { display: flex; margin-top: 46px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { flex: 1; display: flex; gap: 10px; align-items: center; padding: 20px 16px 20px 0; }
.facts div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.facts strong { font-size: 27px; color: var(--paper); }
.facts span { color: var(--muted); font-size: 11px; line-height: 1.35; text-transform: uppercase; letter-spacing: 0.08em; }
.links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 26px; }
.links a { color: #d7d2cb; text-underline-offset: 4px; font-size: 14px; }
.links a:hover { color: var(--pink-soft); }

.chat-card {
  height: min(760px, calc(100vh - 70px));
  min-height: 590px;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(27, 27, 29, 0.92);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.chat-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--pink); font-size: 20px; font-weight: 900; transform: rotate(-6deg); }
.chat-head > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }
.chat-head strong { font-size: 14px; letter-spacing: 0.02em; }
.chat-head span { color: var(--muted); font-size: 12px; }
.chat-head i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #45d17d; }
.chat-head button { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%; color: #ddd7d0; background: #29292c; cursor: pointer; font-size: 18px; }

.messages { overflow-y: auto; padding: 22px 20px 8px; scrollbar-width: thin; scrollbar-color: #46464b transparent; }
.message { display: flex; margin-bottom: 14px; animation: rise 180ms ease-out; }
.message.user { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 12px 14px; border-radius: 17px 17px 17px 5px; color: #ece8e2; background: #29292c; font-size: 14px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.user .bubble { border-radius: 17px 17px 5px 17px; color: #fff; background: var(--pink); }
.typing .bubble { color: var(--muted); }

.quick { display: flex; gap: 8px; overflow-x: auto; padding: 6px 20px 12px; }
.quick:empty { display: none; }
.quick button { flex: 0 0 auto; border: 1px solid rgba(244, 23, 102, 0.55); border-radius: 999px; padding: 8px 12px; color: #ffe8ef; background: rgba(244, 23, 102, 0.08); cursor: pointer; font-size: 12px; }
.quick button:hover { background: rgba(244, 23, 102, 0.2); }

.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: #171719; }
.composer textarea { resize: none; max-height: 110px; border: 1px solid transparent; border-radius: 15px; padding: 13px 14px; outline: none; color: #f6f1eb; background: #242427; font: inherit; font-size: 14px; }
.composer textarea:focus { border-color: rgba(244, 23, 102, 0.6); }
.composer button { width: 46px; height: 46px; border: 0; border-radius: 14px; color: white; background: var(--pink); cursor: pointer; font-size: 20px; }
.composer button:disabled { opacity: 0.5; cursor: wait; }
.privacy { margin: 0; padding: 0 18px 12px; color: #77736e; background: #171719; font-size: 10px; text-align: center; }
.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; }

@keyframes rise { from { opacity: 0; transform: translateY(5px); } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 42px; padding: 38px 0; }
  .intro { max-width: none; }
  .chat-card { height: 720px; max-height: 82vh; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 22px, 1180px); padding: 24px 0; }
  h1 { font-size: 48px; }
  .facts { display: grid; grid-template-columns: repeat(3, 1fr); }
  .facts div { display: block; padding: 14px 8px; }
  .facts div + div { padding-left: 10px; }
  .facts strong, .facts span { display: block; }
  .facts span { margin-top: 5px; }
  .chat-card { min-height: 620px; border-radius: 22px; }
}
