/* Light theme is the base. Dark applies from the system setting unless the
   visitor picked light, or whenever they picked dark. */
:root {
  --bg: #f7f5f1;
  --bg-2: #efebe4;
  --surface: rgb(255 255 255 / 0.72);
  --surface-solid: #ffffff;
  --border: rgb(21 52 60 / 0.12);
  --border-strong: rgb(21 52 60 / 0.2);
  --text: #0f2a31;
  --muted: #55686e;
  --faint: #5c6d71;
  --head-a: #0f2a31;
  --head-b: #6f8f96;
  --btn-bg: #0f2a31;
  --btn-text: #fdf6ea;
  --glow-a: rgb(255 208 150 / 0.55);
  --glow-b: rgb(64 140 156 / 0.22);
  --frame-glow: rgb(255 190 120 / 0.35);
  --code-bg: rgb(21 52 60 / 0.06);
  --header-bg: rgb(247 245 241 / 0.72);
  --win-bg: #ffffff;
  --win-side: #f4f1ec;
  --bubble-in: #ece8e1;
  --bubble-out: #15343c;
  --bubble-out-text: #ffe7c7;
  --sand: #ffd096;
  --teal: #15343c;
  --accent: #c7782a;
  --desk-a: #f3d7b4;
  --desk-b: #9cc3c9;
  --desk-c: #e9b7a1;
  --taskbar: rgb(255 255 255 / 0.7);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b0c;
    --bg-2: #0c1214;
    --surface: rgb(255 255 255 / 0.035);
    --surface-solid: #101719;
    --border: rgb(255 255 255 / 0.08);
    --border-strong: rgb(255 255 255 / 0.16);
    --text: #eef2f2;
    --muted: #9aa8ab;
    --faint: #829296;
    --head-a: #ffffff;
    --head-b: #a9c6cc;
    --btn-bg: #f5f1ea;
    --btn-text: #0b1214;
    --glow-a: rgb(80 170 190 / 0.32);
    --glow-b: rgb(255 208 150 / 0.12);
    --frame-glow: rgb(80 170 190 / 0.35);
    --code-bg: rgb(255 255 255 / 0.05);
    --header-bg: rgb(7 11 12 / 0.7);
    --win-bg: #11191b;
    --win-side: #0c1315;
    --bubble-in: #1d282b;
    --bubble-out: #ffd096;
    --bubble-out-text: #15343c;
    --accent: #ffd096;
    --desk-a: #12343c;
    --desk-b: #1b4f5a;
    --desk-c: #5a3a33;
    --taskbar: rgb(16 22 24 / 0.82);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #070b0c;
  --bg-2: #0c1214;
  --surface: rgb(255 255 255 / 0.035);
  --surface-solid: #101719;
  --border: rgb(255 255 255 / 0.08);
  --border-strong: rgb(255 255 255 / 0.16);
  --text: #eef2f2;
  --muted: #9aa8ab;
  --faint: #829296;
  --head-a: #ffffff;
  --head-b: #a9c6cc;
  --btn-bg: #f5f1ea;
  --btn-text: #0b1214;
  --glow-a: rgb(80 170 190 / 0.32);
  --glow-b: rgb(255 208 150 / 0.12);
  --frame-glow: rgb(80 170 190 / 0.35);
  --code-bg: rgb(255 255 255 / 0.05);
  --header-bg: rgb(7 11 12 / 0.7);
  --win-bg: #11191b;
  --win-side: #0c1315;
  --bubble-in: #1d282b;
  --bubble-out: #ffd096;
  --bubble-out-text: #15343c;
  --accent: #ffd096;
  --desk-a: #12343c;
  --desk-b: #1b4f5a;
  --desk-c: #5a3a33;
  --taskbar: rgb(16 22 24 / 0.82);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-underline-offset: 3px; }
img { display: block; }

/* Spotlight behind the hero */
.glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1100px;
  pointer-events: none;
  background:
    radial-gradient(600px 420px at 78% -60px, var(--glow-a), transparent 70%),
    radial-gradient(700px 500px at 20% 520px, var(--glow-b), transparent 70%);
  z-index: 0;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.top-inner, .foot-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.top-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.top nav { display: flex; align-items: center; gap: 18px; font-size: 0.9rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }
.gh { display: inline-flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 8px 24px rgb(0 0 0 / 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pill-btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 12px 30px rgb(0 0 0 / 0.24); }
.pill-btn.small { padding: 6px 14px; font-size: 0.85rem; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Layout */
main { position: relative; z-index: 1; }

section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.block { padding-top: 120px; }

h1, h2, h3 { margin: 0; letter-spacing: -0.025em; font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; }

h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.04;
  font-weight: 700;
  color: var(--head-a);
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.06;
  font-weight: 650;
  color: var(--head-a);
}

h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

.grad {
  background: linear-gradient(180deg, var(--head-a) 0%, var(--head-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 .grad { background: linear-gradient(90deg, var(--head-b), var(--head-a) 50%, var(--head-b)); -webkit-background-clip: text; background-clip: text; }

.eyebrow {
  font: 500 0.72rem/1 "Cascadia Mono", Consolas, ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 18px;
}

.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; margin: 22px auto 0; }
.lede.left { margin-left: 0; font-size: 1.05rem; }

/* Hero */
.hero { text-align: center; padding-top: 72px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  text-decoration: none;
  margin-bottom: 28px;
}
.badge:hover { border-color: var(--border-strong); }
.badge-sep { width: 1px; height: 12px; background: var(--border-strong); }
.muted { color: var(--muted); }

.cta { margin-top: 34px; display: flex; justify-content: center; }

.sub-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 18px 0 0;
  font-size: 0.82rem;
  color: var(--faint);
}
.sub-links a { text-decoration: none; color: var(--muted); }
.sub-links a:hover { color: var(--text); }

/* App window mockup */
.stage {
  position: relative;
  margin: 64px auto 0;
  max-width: 940px;
  padding: 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--border-strong), transparent 70%);
}
.stage::before {
  content: "";
  position: absolute;
  inset: 10% 8% -4%;
  background: var(--frame-glow);
  filter: blur(70px);
  z-index: -1;
  border-radius: 50%;
}

.window {
  text-align: left;
  border-radius: 14px;
  overflow: hidden;
  background: var(--win-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.28);
  font-size: 0.85rem;
}

.win-bar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 12px;
  background: var(--win-side);
  border-bottom: 1px solid var(--border);
}
.win-title { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--muted); }
.win-ctrls { display: flex; height: 100%; }
.win-ctrls i { width: 44px; height: 100%; position: relative; }
.win-ctrls i::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 10px; height: 1px; background: var(--muted); transform: translate(-50%, -50%); }
.win-ctrls i:nth-child(2)::after { height: 9px; border: 1px solid var(--muted); background: none; }
.win-ctrls i.x::after { width: 12px; background: none; border: 0; content: "\00d7"; font-style: normal; height: auto; color: var(--muted); font-size: 16px; line-height: 1; text-align: center; }

.win-body { display: grid; grid-template-columns: 280px 1fr; height: 400px; }

.convos {
  background: var(--win-side);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search { height: 32px; border-radius: 999px; background: var(--bubble-in); margin: 0 4px 10px; }

.convo { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; }
.convo.on { background: var(--bubble-in); }
.c-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.c-txt b { font-weight: 600; font-size: 0.86rem; }
.c-txt small { color: var(--muted); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.av {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 0.8rem;
  color: #fff;
}
.a1 { background: #c7782a; }
.a2 { background: #2d7a86; }
.a3 { background: #7d5aa6; }
.a4 { background: #4f8a4b; }
.a5 { background: #a6505a; }

.thread { display: flex; flex-direction: column; min-width: 0; }
.t-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.t-head .av { width: 28px; height: 28px; font-size: 0.72rem; }

.msgs { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 18px; }
.msgs p { margin: 0; max-width: 70%; padding: 8px 14px; border-radius: 18px; line-height: 1.4; }
.msgs .in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 6px; }
.msgs .out { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-text); border-bottom-right-radius: 6px; }

.compose {
  margin: 0 18px 16px;
  height: 40px;
  border-radius: 999px;
  background: var(--bubble-in);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 16px;
  color: var(--faint);
}
.compose i { width: 30px; height: 30px; border-radius: 50%; background: var(--bubble-out); }

/* Desktop scene */
.desktop {
  position: relative;
  margin-top: 48px;
  height: 440px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(70% 90% at 15% 10%, var(--desk-b), transparent 70%),
    radial-gradient(60% 80% at 95% 100%, var(--desk-c), transparent 70%),
    var(--desk-a);
}

.toast {
  position: absolute;
  right: 20px;
  bottom: 70px;
  width: 300px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.25);
  font-size: 0.85rem;
}
.toast-head { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--muted); margin-bottom: 8px; }
.toast-head span { margin-left: auto; color: var(--faint); }
.toast p { margin: 2px 0 0; color: var(--muted); }

.tray-menu {
  position: absolute;
  left: 32px;
  top: 32px;
  width: 230px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.22);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
}
.tray-menu span { padding: 6px 10px 6px 30px; border-radius: 6px; position: relative; }
.tray-menu span:first-child { background: var(--code-bg); }
.tray-menu .sep { padding: 0; height: 1px; margin: 4px 6px; background: var(--border); }
.tray-menu .check::before { content: "\2713"; position: absolute; left: 11px; color: var(--accent); }

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--taskbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}
.taskbar > span { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; position: relative; }
.tb-start { background: linear-gradient(135deg, #4aa3df, #2b6cb0); transform: scale(0.6); border-radius: 4px !important; }
.tb-app { background: var(--border-strong); transform: scale(0.7); }
.tb-app.me { background: var(--code-bg); transform: none; }
.tb-app em, .badge-demo em {
  position: absolute;
  right: -3px;
  bottom: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d64545;
  color: #fff;
  font: 700 0.68rem/18px "Segoe UI", sans-serif;
  text-align: center;
}
.tb-tray {
  position: absolute !important;
  right: 14px;
  width: auto !important;
  display: flex !important;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Bento cards */
.bento {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--border-strong); }
.card p { margin: 8px 0 0; color: var(--muted); font-size: 0.94rem; }
.card.wide { grid-column: span 2; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips span { font-size: 0.78rem; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }

.badge-demo { position: relative; width: 44px; margin-top: 18px; }
.badge-demo em { right: -8px; bottom: auto; top: -6px; }

.keys { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
kbd {
  font: 600 0.78rem/1 "Segoe UI", sans-serif;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 3px;
  background: var(--surface-solid);
}

/* Privacy */
.stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.stats div { padding: 22px; text-align: center; border-left: 1px solid var(--border); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font: 650 2.4rem/1 "Segoe UI Variable Display", "Segoe UI", sans-serif; color: var(--head-a); }
.stats span { font-size: 0.82rem; color: var(--faint); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.split > *, .bento > *, .steps > * { min-width: 0; }
.links { display: flex; gap: 18px; }
.links a { color: var(--text); }

code {
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 5px;
}
pre { margin: 16px 0 0; padding: 12px 14px; background: var(--code-bg); border-radius: 10px; overflow-x: auto; }
pre code { padding: 0; background: none; font-size: 0.78rem; }

/* Install */
.steps {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: "0" counter(step);
  display: block;
  font: 500 0.75rem/1 "Cascadia Mono", Consolas, monospace;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.steps a { color: var(--text); }
.after { color: var(--muted); margin: 20px 0 0; font-size: 0.94rem; }
.after a { color: var(--text); }

/* Final call */
.final {
  margin-top: 140px;
  padding-top: 80px;
  padding-bottom: 100px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  border-top: 1px solid var(--border);
  background: radial-gradient(500px 260px at 50% 0%, var(--glow-b), transparent 70%);
}

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--faint); font-size: 0.85rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0; }
footer nav a { text-decoration: none; color: var(--muted); }
footer nav a:hover { color: var(--text); }
footer p { max-width: 78ch; margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .card.wide { grid-column: span 2; }
  .steps, .split { grid-template-columns: 1fr; }
  .win-body { grid-template-columns: 220px 1fr; }
}

@media (max-width: 640px) {
  .top-inner, section, .foot-inner { padding-left: 16px; padding-right: 16px; }
  .hide-sm { display: none; }
  .top nav { gap: 10px; }
  .hero { padding-top: 48px; }
  .block { padding-top: 88px; }
  .stage { padding: 6px; margin-top: 44px; }
  .win-body { grid-template-columns: 1fr; height: 340px; }
  .convos { display: none; }
  .bento { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .desktop { height: 480px; }
  .tray-menu { left: 16px; top: 16px; width: 200px; }
  .toast { right: 16px; left: 16px; width: auto; }
  .taskbar > .tb-app:not(.me) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill-btn, .card { transition: none; }
}
