/* Synapse visual restoration. Keyboard geometry adapted from 1373cdf;
   existing Moonsugar illustration assets remain byte-identical. */
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Inter; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root { --font: Inter, system-ui, sans-serif; --display: "Space Grotesk", var(--font); }
body { overflow-x: clip; }
.brand, h1, h2, h3, .mode-list dt { font-family: var(--display); }
.brand { font-size: 1.35rem; letter-spacing: -.035em; }
.wrap { width: min(1240px, calc(100% - 4rem)); max-inline-size: 1240px; padding-inline: 0; }
h1 { font-size: clamp(3rem, 5.3vw, 5rem); letter-spacing: -.04em; line-height: 1.01; max-inline-size: 14ch; }
h1 .accent { color: var(--cyan); }
h2 { font-size: clamp(2rem, 4vw, 3.6rem); letter-spacing: -.035em; line-height: 1.08; }
.hero { position: relative; isolation: isolate; grid-template-columns: .92fr 1.08fr; gap: 3rem; min-block-size: min(850px, calc(100svh - 80px)); padding-block: 6rem 5rem; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 76% 38%, #00f3ff0c 0%, transparent 45%), radial-gradient(ellipse at 61% 71%, #bd00ff13 0%, transparent 47%); }
.hero-copy { position: relative; z-index: 2; }
.hero .hero-lead { max-inline-size: 47ch; font-size: 1.08rem; }
.hero .actions { gap: 1.2rem; }
.button { box-shadow: 0 7px 24px #00f3ff13; transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.button:hover { box-shadow: 0 9px 30px #00f3ff29; }
.target-family { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-block: 1.5rem 0; color: var(--muted); font-size: .82rem; }
.target-family span + span { border-inline-start: 1px solid var(--line); padding-inline-start: 1rem; }
.hero-field { position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .68; overflow: hidden; }
.hero-field canvas { display: block; inline-size: 100%; block-size: 100%; }
.hero-field::before { content: ""; position: absolute; inset: 8% 1% 4% 37%; border: 1px solid #00f3ff15; border-radius: 50%; transform: rotate(-27deg); }
.hero-field::after { content: ""; position: absolute; inset: 20% 4% 14% 29%; border: 1px solid #bd00ff20; border-radius: 50%; transform: rotate(24deg); }
.motion-toggle { position: absolute; inset-block-end: 1rem; inset-inline-end: 0; min-block-size: 44px; border: 0; background: transparent; color: var(--muted); padding: .5rem; font-size: .75rem; text-decoration: underline; text-underline-offset: .25em; z-index: 3; }
.motion-toggle:disabled { cursor: default; text-decoration: none; }
.route-example { position: relative; border: 0; background: transparent; padding: 1rem 0; margin: 0; min-inline-size: 0; }
.mode-choices { gap: .7rem; max-inline-size: 380px; margin-inline: auto; padding-block-end: 1rem; }
.mode-choices button { background: #111118; border-radius: 8px; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.keyboard-lens { padding-block: 1.5rem 2.2rem; perspective: 1100px; }
.kb-scene { position: relative; inline-size: 100%; padding: .6rem 0; }
.keyboard-3d { transform-style: preserve-3d; transform: rotateX(28deg) rotateY(-4deg) rotateZ(-9deg); transition: transform 300ms var(--ease); inline-size: 100%; }
.kb-frame { position: relative; padding: 17px 14px 19px; border-radius: 9px; background: linear-gradient(170deg, #fafafa, #d8d8d8); box-shadow: 0 25px 32px #0007, 0 6px 0 #c51a4a, 0 8px 0 #902142, inset 0 2px 1px #fff; }
.kb-frame::after { content: ""; position: absolute; inset: 10px 14px auto auto; inline-size: 16px; block-size: 3px; background: #16a074; border-radius: 1px; }
.kb-body { border-radius: 5px; padding: 8px 5px; background: linear-gradient(#00000016, #0000000a); box-shadow: inset 0 2px 4px #0002; }
.kb-keys { display: flex; flex-direction: column; gap: 5px; }
.kr { display: flex; gap: 4px; justify-content: center; }
.k { position: relative; flex: 1; min-inline-size: 0; block-size: clamp(12px, 1.8vw, 24px); display: flex; align-items: center; justify-content: center; border: 1px solid #0001; border-radius: 3px; background: linear-gradient(#f8f8f8, #e4e4e4); color: #28282d; font: 500 clamp(5px, .7vw, 9px)/1 var(--mono); box-shadow: 0 2px 0 #b9b9bd, 0 3px 4px #0002, inset 0 1px 0 #fff; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.kr.frow { margin-block-end: 3px; }
.kr.frow .k { block-size: clamp(10px, 1.3vw, 18px); }
.k.bksp { flex: 2; } .k.tab, .k.bslash { flex: 1.5; } .k.caps { flex: 1.75; }
.k.enter, .k.shift-l { flex: 2.25; } .k.shift-r { flex: 2.75; }
.k.ctrl, .k.super { flex: 1.25; } .k.space { flex: 6.25; }
.k.super svg { inline-size: 12px; block-size: 12px; }
.k .synapse-logo { display: none; }
.route-example[data-mode="work"] .k.ctrl, .route-example[data-mode="work"] .k.fk:nth-child(8) { background: #a5f3f7; color: #063b40; }
.route-example[data-mode="play"] .kr:nth-child(3) .k:nth-child(3), .route-example[data-mode="play"] .kr:nth-child(4) .k:nth-child(2), .route-example[data-mode="play"] .kr:nth-child(4) .k:nth-child(3), .route-example[data-mode="play"] .kr:nth-child(4) .k:nth-child(4) { background: #e1c7f8; color: #41145b; }
.route-example[data-mode="agent"] .k.ctrl, .route-example[data-mode="agent"] .k.fk:nth-child(6) { background: #b6d6fa; color: #0b2b50; }
.route-map { max-inline-size: 410px; margin-inline: auto; }
.route-map .endpoint { border-radius: 7px; background: #0b141c; min-inline-size: 55px; font-family: var(--display); }
.connection { flex: 1; }
.mode-result { min-block-size: 134px; margin: 1.7rem 0 0; padding-block-start: 1.2rem; border-color: #353542aa; }
.mode-result p { font-size: .92rem; max-inline-size: 49ch; }
.route-example figcaption { font-size: .8rem; max-inline-size: 63ch; color: var(--muted); }
.section { padding-block: 6rem; }
.section-heading { max-inline-size: 800px; }
.section-heading p { max-inline-size: 65ch; }
.keyboard-story { display: grid; grid-template-columns: 1.05fr 1fr; gap: 4rem; align-items: center; }
.routing-art { margin: 0; position: relative; }
.routing-art::before { content: ""; position: absolute; z-index: -1; inset: 10%; background: radial-gradient(ellipse, #bd00ff14, transparent 66%); }
.routing-art img, .private-art img { inline-size: 100%; block-size: auto; display: block; }
.routing-art figcaption, .private-art figcaption { color: var(--muted); font-size: .8125rem; text-align: center; max-inline-size: 55ch; margin: .5rem auto 0; }
.mode-list { display: block; }
.mode-list > div { padding-block: 1.2rem; border-block-end: 1px solid var(--line); }
.mode-list > div:first-child { padding-block-start: 0; }
.mode-list > div:last-child { border-block-end: 0; }
.mode-list dt { font-size: 1.45rem; }
.mode-list dd { margin-block-start: .35rem; max-inline-size: 49ch; }
.boundary { max-inline-size: 85ch; margin-block-start: 2rem; }
.writing-grid { gap: 3rem; margin-block-start: 2.7rem; }
.writing-grid article { min-inline-size: 0; }
.writing-grid h3 { font-size: 1.5rem; }
.example-choices { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.3rem -.3rem; }
.example-choices button { min-block-size: 44px; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: 500 .875rem/1.4 var(--font); }
.example-choices button[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); background: #00f3ff0b; }
[data-writing-example="remote"] .example-choices button[aria-pressed="true"] { color: var(--purple-text); border-color: var(--purple-text); background: #bd00ff12; }
.editor-command { display: flex; flex-direction: column; align-items: center; gap: .35rem; max-inline-size: 80%; text-align: center; }
.editor-command kbd { font-size: .75rem; color: var(--muted); }
.example-cue { display: block; block-size: 2px; margin-block-start: .5rem; background: var(--cyan); transform-origin: left center; opacity: 0; }
[data-writing-example="remote"] .example-cue { background: var(--purple-text); }
.editor-scene { position: relative; margin-block: 1.5rem; background: #11121b; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 35px #0004; }
.editor-scene::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid #414252; pointer-events: none; }
.editor-toolbar { display: flex; align-items: center; gap: .4rem; padding: .9rem 1.2rem; border-block-end: 1px solid #31323e; color: var(--muted); font-size: .75rem; }
.editor-toolbar svg { inline-size: 44px; block-size: 12px; margin-inline-end: auto; }
.editor-content { padding: 1.5rem; }
.editor-source { color: #b5b5c5; min-block-size: 40px; }
.editor-transform { display: flex; align-items: center; gap: .7rem; color: var(--purple-text); margin-block: 1.2rem; font-size: .8rem; }
.editor-transform::before, .editor-transform::after { content: ""; flex: 1; block-size: 1px; background: #bd00ff4a; }
.editor-result { color: #c9fbff; min-block-size: 55px; font-family: var(--display); font-size: 1.15rem; line-height: 1.5; }
.editor-result samp { font: inherit; }
.editor-note { font-size: .8125rem; color: var(--muted); margin-block-start: 1rem; }
.editor-scene .layout-result { font-size: 2rem; letter-spacing: -.03em; }
.private-layout { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 3rem; }
.private-copy { max-inline-size: 65ch; }
.private-art { margin: 0; }
.private-route { display: flex; align-items: center; justify-content: center; gap: .6rem; color: var(--purple-text); font-size: .8rem; margin-block-start: 1rem; }
.private-route svg { inline-size: 30px; block-size: 22px; }
.setup-intro .button { display: inline-flex; margin-block-start: 1.6rem; max-inline-size: 100%; text-align: center; }
.setup-steps li { padding-block: 1.35rem; }
.disclosures { max-inline-size: 980px; margin-inline: auto; }
.disclosures > h2 { margin-block-end: 2rem; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .keyboard-lens:hover .keyboard-3d { transform: rotateX(19deg) rotateY(0deg) rotateZ(-6deg) translateY(-4px); }
  .example-choices button:hover { border-color: var(--muted); color: var(--text); }
}
@media (max-width: 1000px) {
  .hero { gap: 2rem; } .keyboard-story, .private-layout { gap: 2rem; }
  .kb-frame { padding: 14px 9px; } .kr { gap: 3px; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 2.5rem); }
  h1 { font-size: clamp(2.8rem, 9.5vw, 4.2rem); max-inline-size: 12ch; }
  .hero { display: block; padding-block: 2rem 3.5rem; min-block-size: auto; }
  .hero .hero-lead { font-size: 1rem; margin-block-start: 1.2rem; }
  .hero .actions { margin-block-start: 1.3rem; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .9rem; }
  .hero .actions .text-link { font-size: .92rem; }
  .hero .release-note { margin-block-start: 1rem; }
  .hero .route-example { margin-block-start: 1.25rem; }
  .hero-field { inset: 25% -1rem 0; opacity: .48; }
  .target-family { font-size: .75rem; margin-block-start: 1.1rem; }
  .target-family span + span { padding-inline-start: .7rem; }
  .target-family { gap: .7rem; }
  .keyboard-lens { max-inline-size: 540px; margin-inline: auto; padding-block: 1rem 1.2rem; }
  .k { block-size: clamp(13px, 3.4vw, 23px); font-size: clamp(5px, 1.2vw, 8px); }
  .kr.frow .k { block-size: clamp(10px, 2.5vw, 17px); }
  .kb-keys { gap: 4px; } .kr { gap: 3px; }
  .keyboard-story, .private-layout { display: flex; flex-direction: column; gap: 2rem; align-items: stretch; }
  .routing-art { margin-inline: -1rem; } .routing-art img { max-block-size: 390px; object-fit: contain; }
  .mode-list { margin-block-start: 1rem; }
  .section { padding-block: 3.8rem; }
  .section-heading { margin-block-end: 1.5rem; }
  .writing-grid { gap: 2.5rem; }
  .editor-content { padding: 1.3rem; }
  .private-art { order: -1; margin-inline: -1rem; }
  .private-art img { max-block-size: 360px; object-fit: contain; }
  .mode-result { min-block-size: 110px; }
  .motion-toggle { inset-block-end: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .keyboard-3d, .k, .button, .mode-choices button { transition: none; }
}
