:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #a7b0c0;
  --panel: #182132;
  --panel-2: #202b3f;
  --line: #334155;
  --accent: #65f5bb;
  --accent-ink: #06291d;
  --warm: #ffca76;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0d1421;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 90% 0, #1d3944 0, transparent 32rem), #0d1421; }
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.hero { min-height: 590px; display: grid; grid-template-columns: 1.35fr .8fr; gap: 70px; align-items: center; padding: 76px 0; }
.eyebrow, .section-number { color: var(--accent); font-size: .77rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 14px 0 22px; max-width: 760px; font-size: clamp(3.3rem, 8vw, 7.6rem); line-height: .84; letter-spacing: -.07em; }
h1 span { color: var(--accent); }
h2 { margin: 6px 0 10px; font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.045em; }
h3 { margin: 0; font-size: 1.5rem; }
.lede { max-width: 650px; color: var(--muted); font-size: 1.2rem; line-height: 1.7; }

.connection-panel { padding: 28px; border: 1px solid #46605e; border-radius: 24px; background: rgb(24 33 50 / 86%); box-shadow: 0 28px 80px rgb(0 0 0 / 24%); backdrop-filter: blur(15px); }
.status-row { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; font-weight: 750; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 5px rgb(255 202 118 / 12%); }
#server-status[data-state="online"] + .pulse, .status-row:has(#server-status[data-state="online"]) .pulse { background: var(--accent); }
dl { margin: 0; }
dl div { padding: 17px 0; border-top: 1px solid var(--line); }
dt { margin-bottom: 6px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.copy-actions, .card-actions, .filters { display: flex; flex-wrap: wrap; gap: 9px; }

button, .button { border: 1px solid var(--line); border-radius: 10px; padding: 11px 15px; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 720; transition: transform .15s, border-color .15s, background .15s; }
button:hover, .button:hover { transform: translateY(-1px); border-color: var(--accent); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.secondary { background: var(--panel-2); }
.text-link { align-self: center; padding: 8px; color: var(--accent); font-weight: 750; text-underline-offset: 4px; }
.planned-web { align-self: center; padding: 8px 3px; color: var(--warm); font-size: .78rem; font-weight: 750; }

.quick-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; padding: 65px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quick-switch p, .boundary p { color: var(--muted); line-height: 1.65; }
.switch-control { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.switch-control label { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; font-weight: 700; }
select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }

.section-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; padding: 82px 0 32px; }
.filters { justify-content: end; }
.filter { border-radius: 99px; padding: 8px 12px; color: var(--muted); font-size: .83rem; }
.filter.active { border-color: var(--accent); color: var(--ink); background: rgb(101 245 187 / 9%); }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.client-card { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, var(--panel), #121b2a); }
.client-card::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 180px; height: 180px; border: 1px solid rgb(101 245 187 / 12%); border-radius: 50%; }
.client-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.card-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.family-badge { padding: 6px 9px; border-radius: 99px; background: rgb(255 255 255 / 6%); color: var(--muted); font-size: .7rem; white-space: nowrap; }
.summary { color: #ced5e1; line-height: 1.55; }
.platform-list { display: flex; flex-wrap: wrap; gap: 7px; }
.platform { padding: 5px 8px; border: 1px solid #3d4a60; border-radius: 6px; color: var(--warm); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.client-note { flex: 1; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.card-actions { position: relative; z-index: 1; align-items: center; }
.choose-client { margin-left: auto; border-color: transparent; color: var(--muted); font-size: .8rem; }

.boundary { margin: 90px 0 40px; padding: 44px; border-radius: 22px; background: var(--panel); }
.boundary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.boundary strong { color: var(--ink); }
footer { padding: 35px 20px 50px; color: #718096; text-align: center; font-size: .82rem; }

.invite-body { min-height: 100vh; display: grid; place-items: center; }
.invite-shell { width: min(760px, calc(100% - 32px)); margin: 40px auto; }
.invite-card { padding: clamp(28px, 7vw, 64px); border: 1px solid #46605e; border-radius: 28px; background: rgb(24 33 50 / 94%); box-shadow: 0 28px 100px rgb(0 0 0 / 32%); }
.invite-title { margin: 14px 0 24px; font-size: clamp(3.1rem, 11vw, 6.4rem); }
.invite-step { display: flex; gap: 12px; align-items: center; margin: 26px 0 12px; color: #d5dbe5; font-weight: 700; }
.invite-step span { display: inline-grid; flex: 0 0 29px; height: 29px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .78rem; }
.token-panel { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #0d1421; }
.token-panel code { align-self: center; padding: 0 8px; overflow-wrap: anywhere; color: var(--warm); font-size: .92rem; }
.invite-continue { width: 100%; margin-top: 28px; }
.privacy-note { margin: 18px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.invite-error { margin: 30px 0; padding: 22px; border: 1px solid #a04b58; border-radius: 14px; background: rgb(160 75 88 / 12%); }
.invite-error h2 { margin-top: 0; font-size: 1.55rem; }
.invite-error p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.invite-home { display: inline-block; margin-top: 26px; }

@media (max-width: 820px) {
  main { width: min(100% - 24px, 680px); }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 36px; padding: 55px 0; }
  .quick-switch, .client-grid, .boundary-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .filters { justify-content: start; }
  .boundary { padding: 28px; }
}

@media (max-width: 500px) {
  h1 { font-size: 3.6rem; }
  .switch-control { grid-template-columns: 1fr; }
  .card-heading { flex-direction: column; }
  .choose-client { width: 100%; margin-left: 0; }
  .token-panel { grid-template-columns: 1fr; }
}

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