/* Xoyo site — tokens are injected by site.js from the same shapes as
   packages/brand-config (F-11). These are the Xoyo defaults as fallback. */
:root {
  --primary: #4F46E5;
  --secondary: #0EA5E9;
  --bg: #FFFFFF;
  --surface: #F5F6FA;
  --ink: #111827;
  --muted: #6B7280;
  --accent: #F97316;
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --bubble-in: var(--surface);
  --bubble-out: color-mix(in srgb, var(--primary) 12%, var(--bg));
  --radius: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #818CF8;
    --secondary: #38BDF8;
    --bg: #0B0F19;
    --surface: #151A28;
    --ink: #F9FAFB;
    --muted: #9CA3AF;
    --accent: #FB923C;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--secondary); }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 700; font-size: 22px;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.wordmark .glyph { width: 26px; height: 26px; flex: none; }
.wordmark .glyph .bubble { fill: var(--primary); }
.wordmark .glyph .dot { fill: var(--accent); }
nav.primary { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
nav.primary a {
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 7px 11px; border-radius: 8px;
}
nav.primary a:hover { color: var(--ink); background: var(--surface); }
nav.primary a[aria-current="page"] { color: var(--primary); font-weight: 600; }

@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 2px; }
  nav.primary { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav.primary::-webkit-scrollbar { display: none; }
  nav.primary a { white-space: nowrap; }
  .brand-switch { margin-left: auto; }
  .brand-switch span.hint { display: none; }
}

/* the F-11 demo: rebrand the site live */
.brand-switch { display: inline-flex; align-items: center; gap: 6px; }
.brand-switch span.hint { font-size: 11.5px; font-family: var(--mono); color: var(--muted); }
.brand-switch button {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  cursor: pointer; padding: 0;
}
.brand-switch button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }

/* ---------- shared blocks ---------- */
main { padding: 56px 0 0; }
.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 10px;
}
h1 {
  font-family: var(--display); font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 18px; font-weight: 800;
}
h2 {
  font-family: var(--display); font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 700;
}
h3 { font-size: 18px; margin: 0 0 6px; font-weight: 650; }
p.lede { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 58ch; margin: 0 0 28px; }
section { padding: 40px 0; }
section + section { border-top: 1px solid var(--line); }
.muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
code {
  background: var(--surface); padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--line);
}

.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

.chip {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line);
  vertical-align: middle; margin-left: 8px; white-space: nowrap;
}
.chip.shipped { color: #0d8a4f; border-color: color-mix(in srgb, #0d8a4f 45%, transparent); background: color-mix(in srgb, #0d8a4f 9%, transparent); }
.chip.building { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.chip.planned { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .chip.shipped { color: #34d399; border-color: color-mix(in srgb, #34d399 45%, transparent); background: color-mix(in srgb, #34d399 10%, transparent); }
}

.btn {
  display: inline-block; font-weight: 600; font-size: 16px;
  padding: 12px 22px; border-radius: 12px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; font-family: var(--body);
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--ink)); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- home hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding: 24px 0 48px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.phone {
  border: 1px solid var(--line); border-radius: 26px; background: var(--bg);
  box-shadow: 0 18px 50px -18px color-mix(in srgb, var(--ink) 25%, transparent);
  overflow: hidden; max-width: 380px; margin: 0 auto; width: 100%;
}
.phone .bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 600;
}
.phone .bar .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-family: var(--display);
}
.phone .bar .e2ee { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: #0d8a4f; }
@media (prefers-color-scheme: dark) { .phone .bar .e2ee { color: #34d399; } }
.thread { list-style: none; margin: 0; padding: 18px 14px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 320px; }
.msg {
  max-width: 82%; padding: 9px 13px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.45; opacity: 0; transform: translateY(6px);
  animation: msg-in 0.4s ease forwards;
}
.msg.in  { background: var(--bubble-in); border-bottom-left-radius: 5px; align-self: flex-start; }
.msg.out { background: var(--bubble-out); border-bottom-right-radius: 5px; align-self: flex-end; }
.msg .cipher { font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: var(--muted); }
.msg time { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; font-family: var(--mono); }
@keyframes msg-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- feature / stack lists ---------- */
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.feature-list li {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; background: var(--bg);
}
.feature-list .fid { font-family: var(--mono); font-size: 12px; color: var(--muted); float: right; margin-left: 12px; }
.feature-list p { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; }

table.plain { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.plain th, table.plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
table.plain td:first-child { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* ---------- roadmap timeline (real backlog order) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 26px 34px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--muted);
}
.timeline li.done::before { border-color: #0d8a4f; background: #0d8a4f; }
.timeline li.now::before { border-color: var(--accent); background: var(--accent); }
@media (prefers-color-scheme: dark) { .timeline li.done::before { border-color: #34d399; background: #34d399; } }
.timeline .tid { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-right: 8px; }
.timeline h3 { display: inline; font-size: 16.5px; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 15px; max-width: 62ch; }

/* ---------- architecture diagram ---------- */
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram text { font-family: var(--mono); fill: var(--ink); }
.diagram .box { fill: var(--bg); stroke: var(--line); rx: 10; }
.diagram .box.hs { stroke: var(--primary); stroke-width: 1.5; }
.diagram .box.future { stroke-dasharray: 5 4; }
.diagram .flow { stroke: var(--muted); fill: none; stroke-width: 1.4; marker-end: url(#arr); }
.diagram .boundary { stroke: var(--accent); stroke-dasharray: 7 5; stroke-width: 1.4; fill: none; }
.diagram .label { fill: var(--muted); font-size: 11px; }
.diagram .blabel { fill: var(--accent); font-size: 11px; }

/* ---------- waitlist form ---------- */
form.waitlist { display: flex; gap: 10px; flex-wrap: wrap; max-width: 520px; }
form.waitlist input[type="email"] {
  flex: 1 1 260px; font: inherit; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
form.waitlist input::placeholder { color: var(--muted); }
.form-note { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.form-ok { color: #0d8a4f; font-weight: 600; }
@media (prefers-color-scheme: dark) { .form-ok { color: #34d399; } }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px;
  font-size: 14px; color: var(--muted);
}
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }
