:root {
  color-scheme: dark;
  --navy: #0A1832;
  --yellow: #FED523;
  --text: #DBDBDB;
  --black: #000000;
  --panel: #081225;
  --surface: #111f3a;
  --line: #293a56;
  --muted: #a8b4c8;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--navy); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }

.page { max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }
.top, .bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 79px;
}
.top { border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.65rem; font-weight: 780; letter-spacing: -.06em; }
.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--black);
  font-size: 1.3rem;
  letter-spacing: 0;
}
.period, .eyebrow { color: var(--yellow); }
.network-logo { display: block; width: 54px; height: auto; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(32px, 7vw, 88px);
  padding-block: clamp(40px, 7vw, 84px);
}
.eyebrow { margin: 0 0 16px; font-size: .875rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 750; }
h1 { font-size: clamp(3rem, 5.35vw, 5rem); line-height: .99; letter-spacing: -.078em; margin: 0; font-weight: 800; }
h1 em { display: block; color: var(--yellow); font-style: normal; }
.lead { max-width: 33ch; margin: 22px 0 0; color: var(--text); font-size: 1.125rem; line-height: 1.6; }
.small-note { margin: 14px 0 0; max-width: 38ch; color: var(--muted); font-size: .875rem; line-height: 1.5; }

.illustration { position: relative; height: 140px; max-width: 360px; margin: 22px 0 0; }
.orbit {
  position: absolute;
  inset: 15px 0 15px 4px;
  border: 1px dashed #536077;
  border-radius: 50%;
  transform: rotate(-14deg);
}
.sample {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 17px 4px;
}
.sample i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.sample-first { top: 22px; left: 15%; color: var(--black); background: var(--yellow); border-color: var(--yellow); transform: rotate(-8deg); }
.sample-second { top: 62px; right: 15%; color: var(--text); background: var(--surface); border-radius: 17px 17px 4px 17px; transform: rotate(8deg); }

.chat {
  min-width: 0;
  height: clamp(500px, 66dvh, 600px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 48px #0005;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.chat-ident { display: flex; align-items: center; gap: 12px; }
.chat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--yellow);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.chat-head h2 { font-size: 1rem; margin: 0 0 3px; }
.chat-head p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .875rem; }
.dot { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; flex: none; }
.dot[data-mode="waiting"], .dot[data-mode="connecting"], .dot[data-mode="matched"] { background: var(--yellow); }

.scene { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.scene-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  border: 1px solid #68603a;
  border-radius: 22px;
  background: #1e2432;
  color: var(--yellow);
  font-size: 2rem;
}
.scene[data-mode="waiting"] .scene-icon, .scene[data-mode="connecting"] .scene-icon { animation: breathe 1.35s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: .55; transform: scale(.92); } }
.scene h3 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.12; letter-spacing: -.045em; }
.scene p { max-width: 31ch; margin: 10px 0 24px; color: var(--muted); line-height: 1.5; }

.primary, .send {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--black);
  font-weight: 750;
}
.primary:hover, .send:hover { background: #ffe56e; }
.quiet { min-height: 40px; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--yellow); background: transparent; font-size: .875rem; font-weight: 650; }
.quiet:hover { background: var(--surface); border-color: var(--line); }
.chat-foot { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); text-align: center; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 18px; }
.message { display: flex; flex-direction: column; align-self: flex-start; max-width: 85%; gap: 4px; }
.message.me { align-self: flex-end; align-items: flex-end; }
.label { margin-inline: 4px; color: var(--muted); font-size: .8125rem; font-weight: 650; }
.bubble { margin: 0; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.me .bubble { border-radius: 14px 14px 4px 14px; background: var(--yellow); color: var(--black); }
.notice { margin: 0; padding: 8px 16px; background: var(--surface); color: var(--yellow); font-size: .875rem; }
.compose { border-top: 1px solid var(--line); padding: 12px 14px 6px; }
.form { display: flex; gap: 8px; }
.form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface); }
.form input::placeholder { color: var(--muted); }
.send { padding-inline: 12px; }
.compose-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.bottom { min-height: 58px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.bottom span:first-child { font-weight: 750; color: var(--text); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }

@media (min-width: 700px) {
  .layout {
    transition: grid-template-columns .28s ease, column-gap .28s ease, padding-block .28s ease;
  }
  .chat {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: 100%;
    max-width: 880px;
    transition: height .28s ease;
  }
  body:is([data-mode="connecting"], [data-mode="waiting"], [data-mode="matched"], [data-mode="ended"], [data-mode="offline"]) .layout {
    grid-template-columns: minmax(0, 0fr) minmax(0, 1fr);
    column-gap: 0;
    padding-block: 24px;
  }
  body:is([data-mode="connecting"], [data-mode="waiting"], [data-mode="matched"], [data-mode="ended"], [data-mode="offline"]) .intro {
    position: absolute;
    visibility: hidden;
  }
  body:is([data-mode="connecting"], [data-mode="waiting"], [data-mode="matched"], [data-mode="ended"], [data-mode="offline"]) .chat {
    height: clamp(335px, calc(100dvh - 134px), 720px);
  }
}

@media (width < 700px) {
  .top { min-height: 64px; }
  .network-logo { width: 46px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 26px 22px; }
  h1 { font-size: clamp(2.7rem, 9vw, 4.4rem); }
  h1 em { display: inline; }
  .eyebrow { margin-bottom: 9px; }
  .lead { margin-top: 10px; font-size: 1rem; }
  .small-note { margin-top: 8px; }
  .illustration { display: none; }
  .chat { height: clamp(370px, 57dvh, 476px); border-radius: 18px; }
  .chat-head { padding: 12px 14px; }
  .scene-icon { width: 54px; height: 54px; margin-bottom: 14px; border-radius: 17px; }
  .scene p { margin-bottom: 16px; }
  .chat-foot { padding: 12px 14px; }
  body[data-mode="matched"] .intro, body[data-mode="matched"] .bottom { display: none; }
  body[data-mode="matched"] .layout { padding-block: 10px; }
  body[data-mode="matched"] .chat { height: calc(100dvh - 84px); min-height: 250px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-icon { animation: none !important; }
  .layout, .chat { transition: none; }
}

.top-actions { display: flex; align-items: center; gap: clamp(.5rem, 2vw, 1.25rem); }
.languages { display: inline-flex; gap: .15rem; padding: .2rem; border: 1px solid var(--line); border-radius: 100px; }
.languages button { appearance: none; border: 0; border-radius: 100px; background: transparent; color: var(--text); font: inherit; font-size: .75rem; font-weight: 800; min-height: 36px; min-width: 36px; cursor: pointer; }
.languages button[aria-pressed="true"] { background: var(--yellow); color: #0A1832; }