:root {
  --bg: #0b0c0f;
  --panel: #111318;
  --panel-2: #15181e;
  --line: #22252d;
  --line-soft: #1a1d24;
  --text: #f2f3f5;
  --muted: #8d93a0;
  --accent: #9aa6ff;
  --accent-deep: #2a2f57;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Page frame: exactly one screen on desktop ---------- */
.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  background:
    radial-gradient(700px circle at 78% 45%, rgba(154,166,255,.07), transparent 65%),
    var(--bg);
}
@media (min-width: 900px) and (min-height: 620px) {
  .page { height: 100dvh; min-height: 0; overflow: hidden; }
}

/* ---------- Navbar ---------- */
.nav {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11,12,15,.8);
  backdrop-filter: blur(10px);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1160px;
  height: 64px;
  margin: 0 auto;
  padding: 0 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-right: auto;
  white-space: nowrap;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--text);
  position: relative;
  flex: none;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 3px;
  bottom: 3px;
  border-left: 2px solid var(--bg);
  border-radius: 1px;
}
.brand-mark::before { transform: skewX(-10deg); left: 8px; right: 12px; }
.brand-mark::after  { transform: skewX(10deg);  left: 12px; right: 8px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn-light { background: var(--text); color: #0b0c0f; }
.btn-light:hover { background: #ffffff; }
.btn-dark { background: var(--panel-2); color: var(--text); border: 1px solid #2c303a; }
.btn-dark:hover { border-color: var(--accent); }

/* ---------- Main: two columns, vertically centered ---------- */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 32px;
  min-height: 0;
}

.intro { min-width: 0; }

h1 {
  font-weight: 650;
  font-size: clamp(2.3rem, min(5vw, 8.4vh), 4.3rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  max-width: 14ch;
  text-wrap: balance;
  margin-bottom: 18px;
}
.lede {
  color: var(--muted);
  font-size: clamp(1rem, 1.9vh + .3rem, 1.15rem);
  max-width: 40ch;
  margin-bottom: clamp(20px, 3.4vh, 30px);
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Support card ---------- */
.support {
  margin-top: clamp(24px, 5vh, 48px);
  max-width: 460px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.support h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.support p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.support-action {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.support-action .btn { min-height: 40px; font-size: 14px; padding: 0 16px; border-radius: 10px; }
.pwyw { font-size: 13px; color: var(--muted); }

/* ---------- Sidebar mockup ---------- */
.stage {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.sidebar {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 12px 18px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8);
}
.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}
.sb-title { font-size: 13px; color: var(--muted); font-weight: 500; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px;
}
.switch-track {
  width: 32px; height: 18px;
  border-radius: 999px;
  background: #1c2028;
  border: 1px solid var(--line);
  position: relative;
  transition: background .3s var(--ease), border-color .3s;
}
.switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .3s var(--ease), background .3s;
}
.switch[aria-checked="true"] { color: var(--text); }
.switch[aria-checked="true"] .switch-track { background: var(--accent-deep); border-color: var(--accent); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(14px); background: var(--accent); }

.group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 0 8px;
  overflow: hidden;
  max-height: 34px;
  opacity: 1;
  transition: max-height .5s var(--ease), opacity .4s, padding .5s var(--ease), margin .5s var(--ease);
}
.group + .group .group-head { margin-top: 8px; }

.chev {
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .3s var(--ease);
  flex: none;
}
.group-head[aria-expanded="false"] .chev { transform: rotate(-45deg) translate(-1px, -1px); }
.group-head:hover { color: #c3caff; }

.chats { list-style: none; }
.chats li {
  font-size: 14px;
  color: #d3d6dd;
  padding: 9px 10px;
  border-radius: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-height: 44px;
  transition: background .2s, opacity .3s, max-height .4s var(--ease), padding .4s var(--ease);
}
.chats li:hover { background: var(--panel-2); }
.group.is-collapsed .chats li {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* Segregate-specific row states */
.chats li.is-segregated {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: #3a3f4c;
  opacity: .6;
}
.chats li.row-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
}
.chats li.row-action .keep {
  flex: none;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--accent);
  border: 1px solid #33396a;
  background: var(--accent-deep);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-soft); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 32px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Load-in ---------- */
@media (prefers-reduced-motion: no-preference) {
  .intro > * { animation: rise .7s var(--ease) both; }
  .intro > .lede { animation-delay: .07s; }
  .intro > .cta-row { animation-delay: .14s; }
  .intro > .support { animation-delay: .21s; }
  .stage { animation: rise .9s var(--ease) .2s both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- Smaller screens: stack and allow normal scroll ---------- */
@media (max-width: 899px) {
  .main {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 20px 48px;
  }
  .nav-inner { padding: 0 20px; gap: 16px; }
  .nav-links { display: none; }
  .footer-inner { padding: 16px 20px; }
  .support { max-width: none; }
}
@media (max-width: 480px) {
  .cta-row .btn { flex: 1 1 100%; }
  .support-action .btn { flex: 1 1 100%; }
  .pwyw { width: 100%; text-align: center; }
}

/* Short desktop windows: shrink instead of scroll */
@media (min-width: 900px) and (max-height: 760px) and (min-height: 620px) {
  .support { padding: 18px 20px; }
  .support p { margin-bottom: 12px; }
  .sidebar { padding: 12px 10px 14px; }
  .chats li { padding: 7px 10px; }
}
