:root {
  --bg: #07090c;
  --bg-mid: #0d1218;
  --ink: #eef3f8;
  --muted: #8b97a8;
  --mint: #3ddc97;
  --mint-dim: #2bb87a;
  --mint-glow: rgba(61, 220, 151, 0.22);
  --line: rgba(232, 238, 245, 0.08);
  --font-display: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(2rem, 5vh, 4rem) clamp(1.25rem, 4vw, 3rem);
}

.hero-layout {
  position: relative;
  z-index: 2;
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 78% 18%, var(--mint-glow), transparent 55%),
    radial-gradient(ellipse 60% 50% at 12% 88%, rgba(61, 220, 151, 0.08), transparent 50%),
    linear-gradient(165deg, #0b1016 0%, var(--bg) 48%, #05070a 100%);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(238, 243, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 243, 248, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  animation: grid-drift 28s linear infinite;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  width: min(58vw, 520px);
  height: min(58vw, 520px);
  right: max(-4vw, -40px);
  top: 6vh;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(61, 220, 151, 0.35), transparent 55%),
    radial-gradient(circle at 60% 70%, rgba(61, 220, 151, 0.12), transparent 60%);
  filter: blur(8px);
  animation: orb-breathe 7s ease-in-out infinite;
  pointer-events: none;
}

.hero-content {
  animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.version-pill {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.1);
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-preview {
  animation: mark-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
  min-height: min(72vh, 540px);
}

#chat-demo {
  height: min(72vh, 540px);
}

/* —— Chatterina app shell (matches style.app_qss dark) —— */
.cd-window {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid #232a33;
  background: #0d0f12;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  font-family: "Segoe UI", "Segoe UI Variable", system-ui, sans-serif;
  font-size: 14px;
  color: #e8eef5;
}

.cd-win-titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  height: 32px;
  background: #161a21;
  border-bottom: 1px solid #232a33;
  color: #9aa6b5;
  font-size: 12px;
  font-weight: 600;
}

.cd-win-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.cd-win-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-win-controls {
  display: flex;
  align-items: stretch;
  margin-right: -4px;
}

.cd-win-controls button {
  width: 46px;
  border: none;
  background: transparent;
  color: #9aa6b5;
  font-size: 11px;
  cursor: default;
  padding: 0;
}

.cd-win-controls button.close {
  font-size: 14px;
}

.cd-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 0 10px 0 6px;
  background: #161a21;
  border-bottom: 1px solid #232a33;
}

.cd-tabs {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  gap: 1px;
  min-width: 0;
}

.cd-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 8px 9px;
  color: #9aa6b5;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: default;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-tab.active {
  color: #e8eef5;
  border-bottom-color: #3ddc97;
  background: #12161c;
}

.cd-tab-add,
.cd-emote-btn,
.cd-settings {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #8b97a8;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  min-width: 30px;
  min-height: 30px;
  padding: 2px 6px;
  cursor: default;
}

.cd-account {
  flex: 0 0 auto;
  background: #1a222c;
  border: 1px solid #232a33;
  border-radius: 8px;
  color: #e8eef5;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 32px;
  cursor: default;
  white-space: nowrap;
}

.cd-emote-btn,
.cd-settings {
  background: #1a222c;
  border: 1px solid #232a33;
  font-size: 14px;
  min-width: 34px;
}

.cd-streambar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 10px;
  background: #10141a;
  border-bottom: 1px solid #232a33;
  font-size: 11px;
}

.cd-stream-dot {
  color: #8b97a8;
  font-size: 11px;
  line-height: 1;
}

.cd-stream-badge {
  color: #8b97a8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cd-stream-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #e8eef5;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-chat-col {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #12161c;
}

.cd-chat-wrap {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  background: #12161c;
}

.cd-chat-body {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 2px 0 2px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  font-size: 16px;
  line-height: 1.35;
  background: #12161c;
}

.cd-hl-rail {
  flex: 0 0 8px;
  position: relative;
  margin: 4px 1px 4px 0;
  background: transparent;
}

.cd-rail-mark {
  position: absolute;
  left: 2px;
  right: 0;
  height: 3px;
  border-radius: 2px;
}

.cd-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  background: #161a21;
  border-top: 1px solid #232a33;
}

.cd-input {
  flex: 1 1 auto;
  min-width: 0;
  background: #14181e;
  border: 1px solid #232a33;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e8eef5;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.cd-input::placeholder {
  color: #5c6b7a;
}

.cd-send {
  flex: 0 0 auto;
  background: #3ddc97;
  color: #04140c;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 36px;
  cursor: default;
  white-space: nowrap;
}

.cd-statusbar {
  flex: 0 0 auto;
  padding: 4px 10px 5px;
  background: #10141a;
  border-top: 1px solid #232a33;
  color: #8b97a8;
  font-size: 12px;
}

.cd-row {
  position: relative;
}

.cd-hl-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.cd-hl-strip {
  width: 3px;
  min-width: 3px;
  max-width: 3px;
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.cd-hl-cell {
  padding: 3px 8px;
  vertical-align: top;
}

.cd-hl-label {
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.cd-reply {
  color: #8b97a8;
  font-size: 0.85em;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-line {
  line-height: 1.4;
  word-break: break-word;
}

.cd-ts {
  color: #8b97a8;
  font-size: 0.8em;
  margin-right: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.cd-badge-img {
  display: inline;
  height: 18px;
  width: auto;
  margin-right: 2px;
  vertical-align: middle;
  pointer-events: none;
  user-select: none;
}

.cd-user {
  font-weight: 700;
}

.cd-colon {
  color: #e8eef5;
}

.cd-text {
  color: #e8eef5;
}

.cd-emote-img {
  display: inline;
  height: 28px;
  width: auto;
  max-height: 28px;
  margin: 0 1px;
  vertical-align: middle;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
}

.cd-system {
  font-style: italic;
  font-weight: 500;
}

@media (max-width: 720px) {
  .cd-account {
    display: none;
  }
}

.brand {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 11vw, 6.4rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.brand span {
  color: var(--mint);
}

.headline {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 18ch;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.125rem);
  max-width: 34ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.45rem;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--mint);
  color: #04140c;
}

.btn-primary:hover {
  background: #55e6a8;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(61, 220, 151, 0.45);
  color: var(--mint);
}

.cta-note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.section {
  position: relative;
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-mid), var(--bg));
}

.section-inner {
  width: min(880px, 100%);
  margin: 0 auto;
}

.section h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.section p {
  margin: 0;
  color: var(--muted);
  max-width: 46ch;
}

.section-alt {
  background: linear-gradient(180deg, var(--bg), var(--bg-mid));
}

.steps {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.steps li {
  counter-increment: step;
  padding: 1.1rem 1.1rem 1.1rem 3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(22, 26, 33, 0.6);
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: #04140c;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
}

.steps strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  color: var(--ink);
}

.steps span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.steps code {
  font-size: 0.85em;
  color: var(--mint);
}

.features {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.1rem 2rem;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}

.features li {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.features strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.features span {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.site-footer a:hover {
  color: var(--mint);
}

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-page .legal {
  flex: 1;
  width: min(720px, 92vw);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 4rem) 0 clamp(3rem, 8vh, 5rem);
}

.legal-page .legal h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.legal-page .legal .back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--mint);
  font-size: 0.95rem;
  font-weight: 600;
}

.legal-page .legal h2 {
  margin: 1.75rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.legal-page .legal p,
.legal-page .legal li {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.legal-page .legal ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.legal-page .legal a {
  color: var(--mint);
}

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

@keyframes mark-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes orb-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes grid-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-56px, -56px, 0);
  }
}

@media (max-width: 899px) {
  .hero-preview {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
