:root {
  color-scheme: light;
  --paper: #fbf8fc;
  --ink: #241b2c;
  --muted: #665770;
  --line: #ded2e6;
  --accent: #6d3684;
  --band: #f2eaf6;
  --card: #f9f4fb;
  --button-fg: #fff;
  --studio: #f4edf8;
  --selected: #68417a;
  --selected-ink: #fff;
  --sans: system-ui, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, Consolas, monospace;
}
:root.dark {
  color-scheme: dark;
  --paper: #0c0912;
  --ink: #f4ebf7;
  --muted: #c3b3ce;
  --line: #35283e;
  --accent: #e7b4f2;
  --band: #120d1a;
  --card: #15101d;
  --button-fg: #20102a;
  --studio: #100c17;
  --selected: #e5b4ef;
  --selected-ink: #24112e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--sans); }
:where(h1,h2,h3,p) { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
section { scroll-margin-top: 2rem; }
.wrap { width: min(100% - 4rem, 78rem); margin-inline: auto; }

.site-header { min-height: 5.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.site-header a, .site-footer a.wordmark { text-decoration: none; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; letter-spacing: -.045em; white-space: nowrap; }
.wordmark img { border-radius: .5rem; }
.site-header nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); font-size: .9rem; color: var(--muted); }
.site-header a:hover { color: var(--accent); }
.header-action { font: .8rem var(--mono); border: 1px solid var(--line); padding: .45rem .75rem; }
.header-tools { display: flex; gap: .45rem; align-items: center; }
.appearance { border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 2.15rem; height: 2.15rem; }

.night-sky { background-color: var(--band); }
.dark .night-sky {
  background:
    radial-gradient(circle at 37px 58px, #eedfff9c 0 1px, transparent 1.7px) 0 0 / 211px 173px,
    radial-gradient(circle at 71px 96px, #d3baff70 0 .7px, transparent 1.45px) 0 0 / 143px 151px,
    radial-gradient(circle at 22px 31px, #b893ed42 0 .6px, transparent 1.25px) 0 0 / 79px 67px,
    radial-gradient(ellipse at 2% 49%, #382257, transparent 44%),
    radial-gradient(ellipse at 99% 27%, #35224d, transparent 43%),
    #100b1b;
}
.showcase { max-width: 70rem; padding-inline: clamp(1rem,3.2vw,2.5rem); padding-bottom: clamp(1.75rem,4vw,3rem); background: var(--paper); border-inline: 1px solid var(--line); }
.hero-copy { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 1.25rem 2rem; padding-block: clamp(2.5rem,5vw,4.3rem) clamp(1.65rem,3vw,2.5rem); }
h1, .section-heading h2, .studio h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.06em; }
h1 { color: var(--accent); font-size: clamp(3rem,7vw,6.3rem); line-height: .98; margin-bottom: .75rem; }
.lead { max-width: 29rem; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .35rem; }
.button { display: inline-flex; align-items: center; gap: .8rem; padding: .72rem .85rem; font-size: .9rem; font-weight: 700; text-decoration: none; }
.action-icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.edge-icon { flex: none; }
.primary { color: var(--selected-ink); background: var(--selected); }
.primary:hover { filter: brightness(.9); }
.text-button:hover { color: var(--accent); }
.compatibility { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--muted); font: .75rem var(--mono); }
.compatibility span { border-left: 1px solid var(--line); padding-left: 1rem; }

.studio { display: grid; grid-template-columns: minmax(12rem,1fr) minmax(0,2.3fr); gap: clamp(1.1rem,3vw,2.5rem); padding: clamp(.85rem,2.2vw,1.5rem); background: var(--studio); border: 1px solid var(--line); }
.studio :focus-visible { outline-color: var(--selected); }
.studio h2 { font-size: clamp(1.85rem,3.4vw,2.9rem); line-height: 1.05; }
.studio-stage { min-width: 0; display: grid; align-content: start; gap: .7rem; }
.preview-sites { display: flex; justify-self: start; }
.preview { min-height: 18rem; border: 1px solid var(--p-border, #515151); border-radius: .45rem; overflow: hidden; background: var(--p-bg, #141414); color: #f2f0ef; }
.preview-chat { display: grid; grid-template-columns: 32% minmax(0, 1fr); min-height: 18rem; }
.chat-list { border-inline-end: 1px solid var(--p-border); }
.scene-bar { display: flex; align-items: center; gap: .5rem; min-height: 2.55rem; padding: .45rem .7rem; border-bottom: 1px solid var(--p-border); background: var(--p-surface); font-size: .86rem; font-weight: 700; }
.avatar { display: grid; place-items: center; width: 1.4rem; aspect-ratio: 1; border-radius: 50%; background: var(--p-outgoing); font-size: .68rem; }
.chat { padding: .55rem .7rem; border-bottom: 1px solid var(--p-border); font-size: .8rem; }
.preview small { display: block; color: #b7aeb4; font-size: .67rem; }
.chat.selected { background: var(--p-surface); }
.conversation { display: flex; flex-direction: column; }
.messages { display: flex; flex: 1; flex-direction: column; gap: .55rem; padding: .85rem .65rem; }
.bubble { max-width: 92%; padding: .35rem .55rem; border-radius: .55rem; font-size: .75rem; }
.incoming { align-self: flex-start; background: var(--p-incoming); }
.outgoing { align-self: flex-end; background: var(--p-outgoing); }
.composer { margin: .5rem .65rem; padding: .35rem .6rem; background: var(--p-input); border-radius: 1rem; color: #b7aeb4; font-size: .72rem; }
.preview[data-preset="system24"] { font-family: var(--mono); }
.preview[data-preset="system24"] .scene-bar { border-bottom-color: #c7a2e3; }
.preview[data-preset="system24"] .chat.selected { background: var(--p-outgoing); box-shadow: inset 2px 0 #c7a2e3; }
.preview[data-preset="system24"] :is(.avatar,.bubble,.composer,.video-player) { border-radius: 0; }
.preview[data-preset="system24"] :is(.bubble,.composer) { border: 1px solid var(--p-border); }
.video-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: .65rem; padding: .7rem; }
.video-player { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border: 1px solid var(--p-border); border-radius: .45rem; background: radial-gradient(ellipse at 65% 78%, #6d5383, transparent 65%), linear-gradient(138deg,#192137,#201727); }
.play { color: #fff; font-size: 1.35rem; }
.progress { position: absolute; inset: auto .5rem .45rem; height: .18rem; background: linear-gradient(90deg,var(--player-accent,#ff4160) 42%,#ffffff44 42%); }
.preview[data-preset="system24"] { --player-accent: #c7a2e3; }
.video-title { margin-top: .45rem; font-size: .8rem; font-weight: 700; }
.video-queue { padding: .3rem .45rem; border: 1px solid var(--p-border); background: var(--p-surface); font-size: .72rem; }
.video-item { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }
.video-item span { width: 2rem; flex: none; aspect-ratio: 16/10; background: linear-gradient(135deg,#2e365f,#534a75); }

.preset-picker { display: grid; margin-top: 1rem; }
.studio ui-segmented-control { position: relative; isolation: isolate; border: 1px solid var(--line); }
.studio ui-segmented-control-item { display: flex; align-items: center; gap: .55rem; min-height: 2.45rem; padding: .43rem .65rem; font: 600 .78rem var(--mono); cursor: pointer; }
.studio ui-segmented-control-item[data-checked] { color: var(--selected-ink); }
.studio ui-segmented-control-item[data-checked]:focus-visible { outline: 2px solid var(--selected-ink); outline-offset: -4px; }
.studio ui-segmented-control-indicator {
  position: absolute;
  z-index: -1;
  left: var(--segmented-control-indicator-left);
  top: var(--segmented-control-indicator-top);
  width: var(--segmented-control-indicator-width);
  height: var(--segmented-control-indicator-height);
  background: var(--selected);
  pointer-events: none;
  transition: left .2s, top .2s, width .2s, height .2s;
}
.preset-picker ui-segmented-control-item + ui-segmented-control-item { box-shadow: inset 0 1px var(--line); }
.preset-picker ui-segmented-control-item::before { content: ""; flex: none; width: .8rem; aspect-ratio: 1; border: 1px solid #907b9c; background: linear-gradient(135deg,var(--swatch-bg) 50%,var(--swatch-accent) 50%); }
.preset-description { margin-top: .65rem; max-width: 28ch; min-height: 3.2em; font-size: .83rem; color: var(--muted); }

.benefits { background: var(--band); border-block: 1px solid var(--line); }
.benefit-list { display: grid; grid-template-columns: repeat(3,1fr); }
.benefit-list > div { padding: 1.15rem 1.3rem; border-inline-start: 1px solid var(--line); }
.benefit-list > div:last-child { border-inline-end: 1px solid var(--line); }
.benefit-list strong, .benefit-list span { display: block; }
.benefit-list span { font-size: .84rem; color: var(--muted); }

.install, .faq { padding-block: clamp(3rem, 7vw, 6rem); }
.section-heading h2 { font-size: clamp(2.7rem,5vw,4.75rem); line-height: 1; margin-block: .65rem; }
.section-heading > p, .steps p, .faq-list p { color: var(--muted); }
.steps { display: grid; gap: .8rem; margin: 1.4rem 0 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: clamp(.75rem,2.4vw,1.5rem);
  counter-increment: steps;
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  padding: clamp(.85rem,2.6vw,1.65rem);
}
.steps li::before {
  content: counter(steps, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: clamp(2rem,5vw,3rem);
  aspect-ratio: 1;
  background: var(--selected);
  color: var(--selected-ink);
  font: 700 clamp(.85rem,2vw,1.15rem) var(--mono);
}
.step-body { max-width: 48rem; }
.steps h3 { font-size: clamp(1.1rem,2.2vw,1.4rem); line-height: 1.3; margin-bottom: .35rem; }
.steps p { font-size: 1rem; }
.steps strong { color: var(--ink); }
.faq-list p { font-size: .9rem; }
.steps a, .faq-list a { color: var(--accent); }
.steps .install-download {
  display: inline-block;
  margin-top: .75rem;
  padding: .4rem .72rem;
  background: var(--selected);
  color: var(--selected-ink);
  font-weight: 700;
  text-decoration: none;
}
.install-download:hover { filter: brightness(.9); }
.step-next { margin-top: .85rem; }
.dark-mode-paths { display: grid; gap: .45rem; margin: .75rem 0; }
.dark-mode-paths > div { padding: .45rem .65rem; border-inline-start: 2px solid var(--accent); background: var(--band); }
.dark-mode-paths dt { font-weight: 700; }
.dark-mode-paths dd { margin: 0; color: var(--muted); }
.browser-picker { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .75rem; }
.browser-picker button, .address button { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: .25rem .42rem; font-size: .76rem; }
.browser-picker button[aria-pressed="true"], .address button { background: var(--ink); color: var(--button-fg); border-color: var(--ink); }
.address { display: flex; gap: .35rem; align-items: center; justify-content: space-between; border: 1px solid var(--line); padding: .3rem; margin-top: .4rem; }
.address code { font: .75rem var(--mono); overflow-wrap: anywhere; }
.steps .address-status { font-size: .76rem; margin-top: .3rem; }
.status { border-inline-start: 3px solid var(--accent); padding: .45rem .7rem; margin-top: 1rem; color: var(--accent); }
details summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; list-style: none; cursor: pointer; font-weight: 650; }
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "";
  width: .45em;
  height: .45em;
  flex: none;
  margin-inline-end: .2em;
  border: solid var(--muted);
  border-width: 0 .1em .1em 0;
  transform: translateY(-.12em) rotate(45deg);
}
details[open] > summary::after { transform: translateY(.12em) rotate(225deg); }
.install-help { margin-top: .8rem; border: 1px solid var(--line); background: var(--card); }
.install-help summary { padding: .85rem 1rem; color: var(--accent); }
.install-help form { display: grid; gap: .55rem; padding: 0 1rem 1rem; }
.install-help label { font-weight: 650; }
.install-help textarea {
  width: 100%;
  padding: .6rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.install-help p { color: var(--muted); font-size: .85rem; }
.install-help button { justify-self: start; border: 0; }
.faq { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; border-top: 1px solid var(--line); }
.faq-list details { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list p { margin-top: .4rem; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding-block: 1.4rem; border-top: 1px solid var(--line); }
.site-footer p, .site-footer > a:not(.wordmark) { color: var(--muted); font-size: .8rem; }
.site-footer > .footer-credit { flex: 0 0 100%; margin: .35rem 0 0; text-align: center; }
.credit-signature { display: inline-block; color: var(--accent); font: italic 1.45em/1 var(--serif); text-decoration: none; transition: transform .2s ease; }
.credit-signature:hover { transform: scale(1.12) rotate(-3deg); }
.credit-agents {
  --agent-ink: #087da8;
  border: 0;
  background: transparent;
  color: var(--agent-ink);
  padding: .25rem .15rem;
  font: 650 1em var(--mono);
  text-decoration: underline wavy;
  text-underline-offset: .25em;
}
.dark .credit-agents { --agent-ink: #7dd3fc; }
.credit-agents.is-glitching { text-shadow: -1px 0 #ec4899, 1px 0 #38bdf8; }

@media (max-width: 760px) {
  .hero-copy { grid-template-columns: minmax(0,1fr); }
  .studio { grid-template-columns: minmax(0,1fr); }
  .preset-description { min-height: 0; max-width: none; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 2rem); }
  .showcase { width: calc(100% - 1.25rem); }
  .site-header { min-height: 4.2rem; }
  .site-header nav { gap: .65rem; font-size: .8rem; }
  .header-action { display: none; }
  .benefit-list, .faq { grid-template-columns: minmax(0,1fr); gap: .6rem; }
  .benefit-list > div { padding: .65rem 0; border: 0 !important; }
  .benefit-list > div + div { border-top: 1px solid var(--line) !important; }
  .faq { gap: 1rem; }
}
@media (max-width: 425px) {
  .site-header { gap: .45rem; }
  .site-header .wordmark { gap: .3rem; font-size: .88rem; }
  .site-header .wordmark img { width: 25px; height: 25px; }
  .preview-chat { grid-template-columns: minmax(0,1fr); }
  .chat-list { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .studio ui-segmented-control-indicator { transition: none; }
  .credit-signature { transition: none; }
  .credit-signature:hover { transform: none; }
}
