/* /guide.html - the illustrated, playable manual (v4).
   Rides on site.css for tokens, header, sheet, buttons, FAQ, banner and
   footer. Everything here is the manual's own vocabulary: the chapter rail,
   the MacBook (lid + keyboard deck), keycaps, the pill, chat/doc mocks, the
   language ring, the Google confirm card, the Image Mode panel, and the
   playgrounds guide.js drives. No external fonts, no CDNs (CSP default-src
   'self'); the only inline data is the grain texture (img-src allows data:). */

:root {
  --g-glow: rgba(0, 150, 255, 0.35);
  --g-cyan: #00D4FF;
  --g-blue: #0096FF;
  --g-violet: #9D8CFF;
  --g-key-top: #1C2540;
  --g-key-side: #0B1020;
  --g-key-edge: #2E3A5C;
  --g-sel: rgba(0, 150, 255, 0.28);
  --g-ok: #10B981;
  --g-amber: #F59E0B;
  --g-ease: cubic-bezier(.2, .8, .2, 1);
  --ring-r: 470px;
  --ring-w: 250px;
  --kb-u: 36px;           /* one key unit */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ---------- Inside the Mac app (?app=1) ---------- */

.in-app .site-header, .in-app .banner-wrap, .in-app .site-footer, .in-app .rail { display: none !important; }
.in-app .sheet { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.in-app .strip { top: 0; }
.in-app .g-hero { padding-top: 44px; }
.in-app .g-toc { display: none; }

/* ---------- Atmosphere: grain + aurora ---------- */

.sheet { position: relative; }
.sheet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.045; z-index: 2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='1'/></svg>");
  mix-blend-mode: screen;
}
.sheet > * { position: relative; z-index: 1; }
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora b { position: absolute; display: block; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; animation: g-drift 26s ease-in-out infinite alternate; }
.aurora b:nth-child(1) { width: 640px; height: 640px; left: -12%; top: 4%; background: rgba(0,150,255,0.22); }
.aurora b:nth-child(2) { width: 520px; height: 520px; right: -10%; top: 18%; background: rgba(0,212,255,0.14); animation-duration: 34s; animation-delay: -8s; }
.aurora b:nth-child(3) { width: 560px; height: 560px; left: 30%; top: 46%; background: rgba(157,140,255,0.12); animation-duration: 40s; animation-delay: -20s; }
.aurora b:nth-child(4) { width: 700px; height: 700px; right: -15%; top: 72%; background: rgba(0,150,255,0.16); animation-duration: 30s; animation-delay: -14s; }
@keyframes g-drift { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(90px, 60px, 0) scale(1.12); } 100% { transform: translate3d(-60px, 120px, 0) scale(.95); } }

/* ---------- Progress + chapter rail ---------- */

.progress { position: fixed; left: 0; top: 0; height: 2px; width: 0; z-index: 50; background: linear-gradient(90deg, var(--g-blue), var(--g-cyan)); box-shadow: 0 0 12px var(--g-glow); }
.rail { position: fixed; left: 22px; top: 50%; transform: translateY(-50%); z-index: 40; display: none; flex-direction: column; gap: 4px; padding: 10px 8px; background: rgba(10, 14, 23, 0.72); border: 1px solid var(--hairline); border-radius: 14px; backdrop-filter: blur(10px); }
.rail a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; text-decoration: none; color: var(--text-3); font-size: 12px; font-weight: 500; white-space: nowrap; transition: color .15s, background-color .15s; }
.rail a i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--hairline); transition: background-color .2s, box-shadow .2s; }
.rail a span { max-width: 0; overflow: hidden; opacity: 0; transition: max-width .3s var(--g-ease), opacity .2s; }
.rail:hover a span, .rail a.on span { max-width: 140px; opacity: 1; }
.rail a:hover { color: var(--ink); background: var(--nav-active); }
.rail a.on { color: var(--ink); }
.rail a.on i { background: var(--g-cyan); box-shadow: 0 0 10px var(--g-cyan); }
@media (min-width: 1240px) { .rail { display: flex; } }
.strip { position: sticky; top: 0; z-index: 30; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 16px; background: rgba(13, 21, 38, 0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); }
.strip::-webkit-scrollbar { display: none; }
.strip a { flex: 0 0 auto; text-decoration: none; color: var(--text-2); font-size: 12.5px; font-weight: 500; padding: 7px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--hairline); }
.strip a.on { color: var(--ink); border-color: var(--g-blue); }
@media (min-width: 1240px) { .strip { display: none; } }

/* ---------- Chapters ---------- */

.ch { position: relative; padding: 96px 40px 104px; border-top: 1px solid var(--hairline); }
.ch > * { position: relative; }
.ch-num { font-family: var(--font-serif); font-size: 120px; line-height: .8; color: transparent; -webkit-text-stroke: 1px rgba(46, 58, 92, 0.9); position: absolute; top: 22px; left: 34px; opacity: .75; user-select: none; pointer-events: none; }
.ch-head { max-width: 1040px; margin: 0 auto 40px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: end; }
.ch-head .overline { margin: 0 0 14px; color: var(--g-cyan); }
.ch-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.012em; margin: 0; }
.ch-head h2 em { font-style: italic; color: var(--g-cyan); }
.ch-head p { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--text-2); }
.ch-head .lede { padding-bottom: 6px; }
.g-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; max-width: 1040px; margin: 0 auto; }
.g-split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.g-split.flip .g-copy { order: 2; }
.g-split.top { align-items: start; }
.g-copy h3 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0 0 12px; }
.g-copy h3 em { font-style: italic; color: var(--g-cyan); }
.g-copy p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.g-copy .overline { margin: 0 0 10px; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--g-ease), transform .7s var(--g-ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }

/* ---------- Hero ---------- */

.g-hero { padding: 64px 40px 56px; max-width: 1040px; margin: 0 auto; }
.g-hero .top { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 40px; align-items: end; }
.g-hero h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(38px, 4.8vw, 58px); line-height: 1.06; letter-spacing: -0.015em; margin: 14px 0 18px; }
.g-hero h1 em { font-style: italic; color: var(--g-cyan); }
.g-hero p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 30em; }
.g-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.g-toc a { text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--hairline); transition: background-color .14s, border-color .14s, transform .14s; }
.g-toc a:hover { background: var(--nav-active); border-color: var(--input-border); transform: translateY(-1px); }
.start { max-width: 1040px; margin: 48px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.start .s { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; padding: 18px 18px 16px; }
.start .s b { display: block; font-family: var(--font-serif); font-size: 30px; line-height: 1; color: var(--text-3); margin-bottom: 10px; }
.start .s h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.start .s p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }

/* ---------- 3D stage + device ---------- */

.stage { perspective: 1400px; perspective-origin: 60% 40%; position: relative; }
.tilt { transform-style: preserve-3d; transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -12deg)); transition: transform .5s var(--g-ease); will-change: transform; }
.stage:hover .tilt { transition-duration: .15s; }
.device { position: relative; border-radius: 18px; background: linear-gradient(160deg, #1B2238, #0C1120 60%); padding: 12px; box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 0 0 1px rgba(255,255,255,0.05), 0 40px 80px -30px rgba(0,0,0,0.9), 0 30px 60px -40px var(--g-glow); }
.device::after { content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(0,212,255,0.55), transparent); }
.screen { position: relative; border-radius: 10px; overflow: hidden; background: var(--shell); border: 1px solid var(--hairline); }
.screen img { display: block; width: 100%; height: auto; }
.screen.crop { max-height: 430px; }
.screen.crop img { object-fit: cover; object-position: top; }
/* Screenshots stay FLAT: a rotated bitmap resamples into a blur, and a
   screenshot exists to be read. The 3D is for the built scenes. */
.frame { position: relative; }
.frame .device { transform: none; }
.float { position: absolute; transform: translateZ(60px); will-change: transform; }
.caption { margin: 18px 0 0; font-size: 13px; color: var(--text-3); text-align: center; }
.caption b { color: var(--text-2); font-weight: 500; }

/* ---------- The MacBook: lid + keyboard deck ---------- */

.macbook { position: relative; transform-style: preserve-3d; }
.macbook .lid { position: relative; transform-origin: 50% 100%; transform: rotateX(-6deg); transform-style: preserve-3d; }
.macbook .lid .device { border-radius: 16px 16px 4px 4px; }
.macbook .hinge { height: 10px; margin: 0 4%; border-radius: 0 0 6px 6px; background: linear-gradient(#1C2238, #0B0F1A); box-shadow: 0 2px 0 rgba(255,255,255,0.05) inset; }
.macbook .deck { transform-origin: 50% 0%; transform: rotateX(32deg); transform-style: preserve-3d; margin: 0 -3%; padding: 12px 14px 14px; border-radius: 6px 6px 18px 18px; background: linear-gradient(#242A3C, #171C2B); box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 40px 60px -30px rgba(0,0,0,0.95), 0 0 0 1px rgba(255,255,255,0.05); }
.macbook .trackpad { margin: 10px auto 0; width: 34%; height: 46px; border-radius: 8px; background: linear-gradient(#1D2334, #161B2A); box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset; }
.hero-pill { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%) translateZ(30px); z-index: 4; }

/* ---------- Keyboard (built by guide.js) ---------- */

.kb { display: flex; flex-direction: column; gap: 4px; --u: var(--kb-u); }
.kb .row { display: flex; gap: 4px; }
.kc { position: relative; flex: 1 0 0; height: calc(var(--u) * 0.86); min-width: 0; border-radius: 5px; background: linear-gradient(180deg, #14161C, #0A0B0F); border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 2px 0 #000, 0 3px 0 rgba(255,255,255,0.03); color: #E6E8EE; font-family: var(--font-sans); font-size: calc(var(--u) * 0.26); display: flex; align-items: flex-end; justify-content: center; padding: 0 3px 3px; overflow: visible; transition: transform .08s var(--g-ease), box-shadow .08s var(--g-ease), background-color .2s; user-select: none; }
.kc .g { position: absolute; top: 3px; right: 5px; font-size: calc(var(--u) * 0.28); color: #B7BCC8; }
.kc .g.l { right: auto; left: 5px; }
.kc .g svg { width: calc(var(--u) * 0.34); height: calc(var(--u) * 0.34); fill: none; stroke: #B7BCC8; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kc .w { font-size: calc(var(--u) * 0.22); color: #C9CDD6; letter-spacing: .01em; white-space: nowrap; }
.kc.fkey { height: calc(var(--u) * 0.5); font-size: calc(var(--u) * 0.2); color: #9AA0AE; align-items: center; padding: 0; }
.kc.space { flex-grow: 5.6; }
.kc.arrows { flex-grow: 3; background: transparent; border: 0; box-shadow: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; }
.kc.arrows i { display: flex; align-items: center; justify-content: center; border-radius: 4px; background: linear-gradient(180deg, #14161C, #0A0B0F); border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 2px 0 #000; font-style: normal; font-size: calc(var(--u) * 0.22); color: #B7BCC8; }
.kc.arrows i:nth-child(1) { grid-column: 1; grid-row: 2; } .kc.arrows i:nth-child(2) { grid-column: 2; grid-row: 1; } .kc.arrows i:nth-child(3) { grid-column: 2; grid-row: 2; } .kc.arrows i:nth-child(4) { grid-column: 3; grid-row: 2; }
.kc.is-down { transform: translateY(2px); box-shadow: 0 0 0 #000; background: #06070A; }
.kc.hi { border-color: rgba(0,212,255,0.9); box-shadow: 0 2px 0 #000, 0 0 0 3px rgba(0,212,255,0.28), 0 0 26px rgba(0,212,255,0.55); z-index: 3; animation: g-ring 1.6s ease-in-out infinite; }
.kc.hi.is-down { animation: none; box-shadow: 0 0 0 3px rgba(0,212,255,0.4), 0 0 30px rgba(0,212,255,0.7); }
.kc.hi::after { content: attr(data-callout); position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 999px; background: var(--g-cyan); color: #04121C; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 10px 24px -8px rgba(0,212,255,0.6); pointer-events: none; }
.kc.hi::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 12px; background: var(--g-cyan); transform: translateX(-50%); }
.kc.hi.left::after { left: 0; transform: none; } .kc.hi.left::before { left: 12px; }
.kc.hi.right::after { left: auto; right: 0; transform: none; } .kc.hi.right::before { left: auto; right: 12px; }
.kc.hi.second { animation-delay: .8s; }
.kc.hi.second::after { bottom: auto; top: calc(100% + 12px); }
.kc.hi.second::before { bottom: auto; top: 100%; }
@keyframes g-ring { 0%, 100% { box-shadow: 0 2px 0 #000, 0 0 0 3px rgba(0,212,255,0.28), 0 0 22px rgba(0,212,255,0.45); } 50% { box-shadow: 0 2px 0 #000, 0 0 0 6px rgba(0,212,255,0.12), 0 0 34px rgba(0,212,255,0.7); } }
/* the bottom-row strip used inside chapters */
.kbstrip { --kb-u: 44px; padding: 14px 14px 12px; border-radius: 14px; background: linear-gradient(#242A3C, #171C2B); box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 30px 50px -30px rgba(0,0,0,0.9); margin-top: 44px; }
.kbstrip .kb { --u: var(--kb-u); }
.kbstrip.mini { --kb-u: 30px; padding: 10px; margin-top: 34px; }

/* ---------- Keycaps (inline, for HUDs) ---------- */

.keycap { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 10px; font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); background: linear-gradient(180deg, #232D4B, var(--g-key-top)); border: 1px solid var(--g-key-edge); box-shadow: 0 6px 0 var(--g-key-side), 0 7px 0 rgba(255,255,255,0.04), 0 14px 24px -8px rgba(0,0,0,0.8); transform: translateY(0); transition: transform .09s var(--g-ease), box-shadow .09s var(--g-ease); user-select: none; }
.keycap.xl { height: 72px; min-width: 96px; padding: 0 22px; font-size: 18px; border-radius: 14px; box-shadow: 0 10px 0 var(--g-key-side), 0 11px 0 rgba(255,255,255,0.04), 0 24px 40px -12px rgba(0,0,0,0.85); }
.keycap.is-down { transform: translateY(5px); box-shadow: 0 1px 0 var(--g-key-side), 0 2px 0 rgba(255,255,255,0.03), 0 4px 10px -4px rgba(0,0,0,0.8); }
.keycap.xl.is-down { transform: translateY(8px); box-shadow: 0 2px 0 var(--g-key-side), 0 6px 12px -6px rgba(0,0,0,0.8); }
.keycap.glow { box-shadow: 0 6px 0 var(--g-key-side), 0 0 0 3px rgba(0,150,255,0.25), 0 0 28px var(--g-glow); }
.keycap.xl.glow { box-shadow: 0 10px 0 var(--g-key-side), 0 0 0 3px rgba(0,150,255,0.25), 0 0 34px var(--g-glow); }
.keycap.latched { box-shadow: 0 6px 0 var(--g-key-side), 0 0 0 3px rgba(245,158,11,0.35), 0 0 30px rgba(245,158,11,0.45); }
.keycap .sub { font-size: 10px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; }
.keycap svg.globe { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.keys { display: inline-flex; align-items: center; gap: 8px; }
.keys .plus { color: var(--text-3); font-size: 14px; }
.keycap.sm { height: 26px; min-width: 0; padding: 0 8px; font-size: 11px; border-radius: 7px; box-shadow: 0 3px 0 var(--g-key-side), 0 8px 14px -8px rgba(0,0,0,0.8); }

/* ---------- The pill ---------- */

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 34px; padding: 0 18px; border-radius: 999px; background: #0A0B10; border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 12px 30px -10px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.6); }
.pill i { display: block; width: 4px; height: 4px; border-radius: 2px; background: #5B6070; transition: height .18s var(--g-ease), background-color .18s; }
.pill.listening i { background: #F2F4F8; animation: g-bar .9s ease-in-out infinite; }
.pill.listening i:nth-child(2n) { animation-delay: .12s; } .pill.listening i:nth-child(3n) { animation-delay: .24s; } .pill.listening i:nth-child(5n) { animation-delay: .36s; }
.pill.listening i:nth-child(1), .pill.listening i:nth-child(11) { animation-name: g-bar-edge; }
.pill.working i { background: #8A76FF; animation: g-pulse 1.1s linear infinite; }
.pill.working i:nth-child(1) { animation-delay: 0s; } .pill.working i:nth-child(2) { animation-delay: .09s; } .pill.working i:nth-child(3) { animation-delay: .18s; } .pill.working i:nth-child(4) { animation-delay: .27s; } .pill.working i:nth-child(5) { animation-delay: .36s; } .pill.working i:nth-child(6) { animation-delay: .45s; } .pill.working i:nth-child(7) { animation-delay: .54s; } .pill.working i:nth-child(8) { animation-delay: .63s; } .pill.working i:nth-child(9) { animation-delay: .72s; } .pill.working i:nth-child(10) { animation-delay: .81s; } .pill.working i:nth-child(11) { animation-delay: .9s; }
.pill.done i { background: var(--g-amber); }
@keyframes g-bar { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@keyframes g-bar-edge { 0%, 100% { height: 4px; } 50% { height: 8px; } }
@keyframes g-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.micdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 10px rgba(245,158,11,0.8); }

/* ---------- Mocks: chat / document ---------- */

.mock { background: #0B1222; border-radius: 10px; min-height: 300px; display: flex; flex-direction: column; font-size: 14px; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--hairline); font-size: 12px; color: var(--text-3); }
.mock-bar b { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2A3550; }
.mock-bar b:nth-child(1) { background: #FF5F57; } .mock-bar b:nth-child(2) { background: #FEBC2E; } .mock-bar b:nth-child(3) { background: #28C840; }
.mock-bar span { margin-left: 8px; }
.mock-bar .right { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.mock-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { align-self: flex-start; max-width: 82%; padding: 9px 12px; border-radius: 12px 12px 12px 4px; background: #141C33; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: #0E2A45; color: var(--ink); border-radius: 12px 12px 4px 12px; }
.msg.pic { padding: 4px; background: #0E2A45; }
.msg.pic img { display: block; width: 190px; height: 190px; border-radius: 9px; object-fit: cover; }
.compose { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #0F1629; border: 1px solid var(--input-border); color: var(--ink); min-height: 42px; line-height: 1.5; }
.compose .ph { color: var(--text-3); }
.caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -0.2em; background: var(--g-blue); margin-left: 1px; animation: g-blink 1.1s step-end infinite; }
@keyframes g-blink { 50% { opacity: 0; } }
.typed { white-space: pre-wrap; }
.doc { position: relative; background: #F7F5EF; color: #1B1B1F; border-radius: 10px; padding: 24px 26px 28px; min-height: 300px; font-family: var(--font-serif); font-size: 18px; line-height: 1.55; }
.doc .rule { height: 1px; background: #E4E0D6; margin: 12px 0; }
.doc .faint { color: #8A8A93; font-size: 14.5px; font-family: var(--font-sans); }
.doc .ins { min-height: 1.6em; white-space: pre-wrap; }
.doc .ins .caret { background: #0B6BFF; }
.sel { display: block; position: relative; }
.sel::before { content: ""; position: absolute; left: -3px; right: -3px; top: -2px; bottom: -2px; background: var(--g-sel); border-radius: 3px; transform: scaleX(0); transform-origin: left center; transition: transform .5s var(--g-ease); z-index: 0; }
.sel.on::before { transform: scaleX(1); }
.sel > span { position: relative; z-index: 1; transition: opacity .3s; }
.sel .alt { position: absolute; left: 0; right: 0; top: 0; opacity: 0; white-space: pre-wrap; }
.sel.swap > .orig { opacity: 0; }
.sel.swap > .alt { opacity: 1; }
.spoken { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--font-sans); font-size: 12px; color: #6B7280; opacity: 0; transition: opacity .3s; }
.spoken.on { opacity: 1; }
.spoken .wave { height: 16px; gap: 2px; }
.spoken .wave i { width: 3px; background: var(--g-blue); animation-duration: .9s; }
@keyframes g-wave { 0%, 100% { height: 6px; opacity: .6; } 50% { height: 16px; opacity: 1; } }
.say-bubble { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px; background: var(--ink); color: #0A0E17; font-size: 13.5px; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(0,0,0,0.8); opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .3s var(--g-ease), transform .3s var(--g-ease); white-space: nowrap; z-index: 5; max-width: 95%; overflow: hidden; text-overflow: ellipsis; }
.say-bubble.on { opacity: 1; transform: none; }
.say-bubble::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; animation: g-blink 1s step-end infinite; }
.overlay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translateZ(90px); width: 82%; background: #0A0B10; color: var(--ink); border-radius: 14px; padding: 12px 16px 14px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.08); opacity: 0; transition: opacity .25s; z-index: 6; font-family: var(--font-sans); font-size: 14px; line-height: 1.45; }
.overlay.on { opacity: 1; }
.overlay .k { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.overlay .k .wave { height: 14px; gap: 2px; } .overlay .k .wave i { width: 3px; background: var(--ink); }
.overlay .streamed { white-space: pre-wrap; }
.hud { position: absolute; left: 50%; bottom: -26px; display: flex; align-items: center; gap: 14px; transform: translateX(-50%) translateZ(70px); }
.web { background: #FFFFFF; color: #222; border-radius: 10px; overflow: hidden; font-family: var(--font-sans); min-height: 250px; position: relative; }
.snap { position: absolute; inset: 0; background: #FFFFFF; opacity: 0; pointer-events: none; z-index: 3; }
.snap.on { animation: g-snap .5s ease-out; }
@keyframes g-snap { 0% { opacity: .95; } 100% { opacity: 0; } }
.answer { position: absolute; right: 16px; bottom: 16px; max-width: 80%; padding: 10px 13px; border-radius: 12px 12px 4px 12px; background: #0E2A45; color: var(--ink); font-size: 13.5px; line-height: 1.5; box-shadow: 0 14px 30px -10px rgba(0,0,0,0.6); opacity: 0; transform: translateY(8px); transition: opacity .35s var(--g-ease), transform .35s var(--g-ease); z-index: 4; }
.answer.on { opacity: 1; transform: none; }
.answer::before { content: "Speech · spoken and typed"; display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--g-cyan); margin-bottom: 3px; }

/* ---------- Playground ---------- */

.play { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.play button { position: relative; overflow: hidden; appearance: none; border: 1px solid var(--hairline); background: var(--card); color: var(--ink); font-family: var(--font-sans); font-size: 13.5px; padding: 9px 13px; border-radius: 999px; cursor: pointer; transition: border-color .15s, transform .15s var(--g-ease), background-color .15s; text-align: left; }
.play button .q::before { content: "\201C"; color: var(--text-3); } .play button .q::after { content: "\201D"; color: var(--text-3); }
.play button:hover { border-color: var(--g-blue); transform: translateY(-1px); }
.play button.on { border-color: var(--g-cyan); background: var(--chip-purple); }
.play button .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--g-cyan); }
.play button.on .bar { animation: g-fill var(--dur, 6s) linear forwards; }
@keyframes g-fill { to { width: 100%; } }
.play-hint { margin-top: 10px; font-size: 12px; color: var(--text-3); }
.play-hint b { color: var(--text-2); font-weight: 500; }

/* ---------- Cards / grids ---------- */

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 1040px; margin: 40px auto 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 1040px; margin: 40px auto 0; }
.card { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; padding: 20px 20px 18px; transition: transform .2s var(--g-ease), border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: var(--input-border); }
.card .ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--chip-purple); color: var(--g-cyan); margin-bottom: 12px; }
.card .ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.card .mini { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--shell); border: 1px solid var(--hairline); font-size: 13px; color: var(--text-2); }
.card .mini b { color: var(--ink); font-weight: 500; }
.card .art { display: flex; align-items: center; justify-content: center; min-height: 96px; margin: 4px 0 14px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--chip-purple); color: var(--accent-purple); vertical-align: middle; }
.wave { display: flex; align-items: center; gap: 5px; height: 60px; }
.wave i { width: 5px; border-radius: 3px; background: var(--g-cyan); height: 8px; animation: g-wave 1.2s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .4s; } .wave i:nth-child(6) { animation-delay: .5s; } .wave i:nth-child(7) { animation-delay: .6s; } .wave i:nth-child(8) { animation-delay: .7s; } .wave i:nth-child(9) { animation-delay: .8s; }
.g-note { margin: 22px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--hairline); font-size: 14px; line-height: 1.6; color: var(--text-2); }
.g-note strong { color: var(--ink); }
.g-list { margin: 20px 0 0; padding: 0; list-style: none; }
.g-list li { position: relative; padding-left: 20px; margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.g-list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--g-cyan); opacity: .8; }
.g-list strong { color: var(--ink); font-weight: 600; }
.say-group { margin: 22px 0 0; }
.say-group .overline { margin: 0 0 10px; }
.say { display: flex; flex-wrap: wrap; gap: 8px; }
.say span { display: inline-block; padding: 8px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--hairline); font-size: 14.5px; color: var(--ink); }
.say span::before { content: "\201C"; color: var(--text-3); } .say span::after { content: "\201D"; color: var(--text-3); }

/* ---------- Language ring ---------- */

.ring-wrap { max-width: 1040px; margin: 24px auto 0; }
.ring-stage { position: relative; height: 380px; perspective: 1300px; perspective-origin: 50% 40%; }
.ring { position: absolute; left: 50%; top: 50%; width: var(--ring-w); height: 170px; margin-left: calc(var(--ring-w) / -2); margin-top: -85px; transform-style: preserve-3d; transform: rotateX(-6deg) rotateY(var(--ring-angle, 0deg)); transition: transform 1s var(--g-ease); }
.ring .lc { position: absolute; inset: 0; --lift: 0px; background: linear-gradient(170deg, #161E36, #0E1527); border: 1px solid var(--hairline); border-radius: 16px; padding: 16px 18px; backface-visibility: hidden; box-shadow: 0 30px 50px -30px rgba(0,0,0,0.9); cursor: pointer; transition: border-color .3s, box-shadow .3s, transform .6s var(--g-ease); }
.ring .lc.front { --lift: 36px; border-color: rgba(0,212,255,0.6); box-shadow: 0 0 0 1px rgba(0,212,255,0.25), 0 30px 60px -25px var(--g-glow); }
.ring .lc .name { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; }
.ring .lc .name b { color: var(--g-cyan); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 15px; }
.ring .lc .line { margin-top: 12px; font-size: 16.5px; line-height: 1.45; color: var(--ink); }
.ring-focus { max-width: 720px; margin: 14px auto 0; text-align: center; }
.ring-focus .src { font-size: 13px; color: var(--text-3); }
.ring-focus .src b { color: var(--text-2); font-weight: 500; }
.ring-focus .out { margin-top: 10px; font-size: 22px; line-height: 1.4; color: var(--ink); font-family: var(--font-serif); min-height: 2.9em; }
.ring-ctl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.ring-ctl button { appearance: none; border: 1px solid var(--hairline); background: var(--card); color: var(--ink); font-family: var(--font-sans); font-size: 12.5px; padding: 7px 11px; border-radius: 999px; cursor: pointer; }
.ring-ctl button:hover { border-color: var(--g-blue); }
.ring-ctl button.on { border-color: var(--g-cyan); background: var(--chip-purple); }
.globe-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--hairline); color: var(--ink); font-size: 13px; font-weight: 600; }
.globe-pill svg { width: 13px; height: 13px; color: var(--g-cyan); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Google: connect steps, confirm card, calendar, toast ---------- */

.connect { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 1040px; margin: 0 auto 44px; }
.connect .c { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; padding: 18px 18px 16px; font-size: 14px; color: var(--text-2); line-height: 1.55; }
.connect .c b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.connect .c .row { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--shell); border: 1px solid var(--hairline); font-size: 13px; color: var(--ink); }
.connect .c .row .btn-mini { padding: 5px 12px; border-radius: 999px; background: var(--g-blue); color: #fff; font-weight: 600; font-size: 12px; }
.connect .c .row .g { display: inline-flex; align-items: center; gap: 8px; }
.glogo { width: 18px; height: 18px; flex: 0 0 auto; }
.connect .c .gpage { margin-top: 12px; padding: 12px; border-radius: 10px; background: #FFFFFF; color: #202124; font-size: 12px; line-height: 1.4; }
.connect .c .gpage .h { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.connect .c .gpage .acct { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #DADCE0; border-radius: 8px; }
.connect .c .gpage .acct i { width: 22px; height: 22px; border-radius: 50%; background: #1A73E8; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 700; }
.chip-ok { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(16,185,129,0.13); color: var(--g-ok); font-size: 11.5px; font-weight: 600; }
.chip-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--g-ok); }
.cal { background: #0B1222; border-radius: 10px; min-height: 300px; padding: 14px 16px; font-family: var(--font-sans); }
.cal .h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.cal .h b { color: var(--ink); font-size: 14px; font-weight: 600; }
.cal .slot { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--hairline); min-height: 34px; }
.cal .slot .t { font-size: 11px; color: var(--text-3); padding-top: 4px; }
.cal .ev { border-radius: 7px; padding: 6px 9px; font-size: 12.5px; color: var(--ink); background: #143352; border-left: 3px solid var(--g-blue); }
.cal .ev small { display: block; color: var(--text-2); font-size: 11px; margin-top: 2px; }
.cal .ev.new { background: #0E3A2B; border-left-color: var(--g-ok); opacity: 0; transform: scale(.96); transition: opacity .4s var(--g-ease), transform .4s var(--g-ease); }
.cal .ev.new.on { opacity: 1; transform: none; }
.confirm { position: absolute; left: 50%; top: 50%; width: 88%; transform: translate(-50%, -46%) translateZ(80px) scale(.96); background: #0A0B10; color: var(--ink); border-radius: 18px; padding: 18px 20px 18px; box-shadow: 0 40px 80px -20px rgba(0,0,0,0.95), 0 0 0 1px rgba(255,255,255,0.08); opacity: 0; transition: opacity .3s var(--g-ease), transform .3s var(--g-ease); z-index: 8; font-family: var(--font-sans); }
.confirm.on { opacity: 1; transform: translate(-50%, -50%) translateZ(80px) scale(1); }
.confirm .t { display: flex; align-items: center; gap: 12px; }
.confirm .t .gi { width: 34px; height: 34px; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; }
.confirm .t .gi svg { width: 20px; height: 20px; }
.confirm .t h4 { margin: 0; font-size: 17px; font-weight: 600; }
.confirm .t small { display: block; color: var(--text-2); font-size: 12.5px; }
.confirm .body { margin: 14px 0 12px; padding: 12px 14px; border-radius: 12px; background: #15161C; font-size: 14px; line-height: 1.5; white-space: pre-wrap; color: #E6E8EE; }
.confirm .fine { font-size: 12px; color: var(--text-3); }
.confirm .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.confirm .btns span { padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; background: #22242C; color: var(--ink); transition: transform .1s, background-color .2s; }
.confirm .btns span.ok { background: #0B57D0; }
.confirm .btns span.ok.press { transform: scale(.95); background: #0847A8; }
.toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%) translateY(10px) translateZ(70px); padding: 9px 14px; border-radius: 999px; background: var(--ink); color: #0A0E17; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .3s var(--g-ease), transform .3s var(--g-ease); z-index: 9; white-space: nowrap; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0) translateZ(70px); }
.toast::before { content: "\2713"; margin-right: 8px; color: var(--g-ok); }
.spoke { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 10px 13px; border-radius: 12px; background: #0E2A45; color: var(--ink); font-size: 13.5px; line-height: 1.5; opacity: 0; transform: translateY(8px); transition: opacity .35s var(--g-ease), transform .35s var(--g-ease); z-index: 4; white-space: pre-wrap; }
.spoke.on { opacity: 1; transform: none; }
.spoke::before { content: "Speech says"; display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--g-cyan); margin-bottom: 3px; }

/* ---------- Image Mode ---------- */

.shimmer { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translateZ(60px); width: 58%; aspect-ratio: 1; border-radius: 14px; background: linear-gradient(110deg, #141C33 30%, #22305A 50%, #141C33 70%); background-size: 200% 100%; animation: g-shimmer 1.2s linear infinite; opacity: 0; transition: opacity .3s; z-index: 5; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; font-size: 12.5px; color: var(--text-2); }
.shimmer.on { opacity: 1; }
@keyframes g-shimmer { to { background-position: -200% 0; } }
.panel { position: absolute; left: 50%; top: 50%; width: 92%; transform: translate(-50%, -44%) translateZ(90px) scale(.97); opacity: 0; transition: opacity .35s var(--g-ease), transform .35s var(--g-ease); z-index: 7; border-radius: 16px; box-shadow: 0 40px 80px -20px rgba(0,0,0,0.95); }
.panel.on { opacity: 1; transform: translate(-50%, -50%) translateZ(90px) scale(1); }
.panel img { display: block; width: 100%; height: auto; border-radius: 16px; }

/* ---------- Fix a word ---------- */

.fix-word { position: relative; display: inline-block; }
.fix-word .orig { text-decoration: underline wavy #EF4444 1.5px; text-underline-offset: 4px; transition: opacity .3s; }
.fix-word .alt { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; color: #0B6B3A; }
.fix-word.swap .orig { opacity: 0; } .fix-word.swap .alt { opacity: 1; }
.fix-pop { position: absolute; left: 28px; top: 130px; background: #0D1526; color: var(--ink); border: 1px solid var(--input-border); border-radius: 10px; padding: 10px 12px; font-family: var(--font-sans); font-size: 13px; box-shadow: 0 20px 40px -14px rgba(0,0,0,0.8); opacity: 0; transform: translateY(6px) scale(.97); transition: opacity .25s var(--g-ease), transform .25s var(--g-ease); z-index: 2; }
.fix-pop.on { opacity: 1; transform: none; }
.fix-pop .k { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.fix-pop .field { padding: 6px 9px; border-radius: 7px; background: var(--shell); border: 1px solid var(--hairline); min-width: 160px; font-size: 14px; }
.taps { position: absolute; right: 24px; bottom: 22px; display: flex; gap: 8px; align-items: center; }
.taps .x { font-size: 12px; color: #6B7280; font-family: var(--font-sans); }

/* ---------- Permissions ---------- */

.perms { margin: 22px 0 0; border-top: 1px solid var(--hairline); }
.perm { display: grid; grid-template-columns: 168px 1fr; gap: 16px; padding: 14px 2px; border-bottom: 1px solid var(--hairline); font-size: 14.5px; line-height: 1.55; }
.perm b { color: var(--ink); font-weight: 600; }
.perm span { color: var(--text-2); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 1040px; margin: 40px auto 0; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  :root { --ring-r: 300px; --ring-w: 200px; --kb-u: 24px; }
  .g-hero .top, .g-split, .g-split.flip, .ch-head { grid-template-columns: 1fr; gap: 32px; }
  .g-split.flip .g-copy { order: 0; }
  .grid3, .grid2, .gallery, .start, .connect { grid-template-columns: 1fr; }
  .ch-num { font-size: 72px; top: 30px; left: 20px; }
  .ch { padding: 64px 20px 72px; }
  .g-hero { padding: 40px 20px 36px; }
  .tilt { transform: none; }
  .say-bubble { left: 4% !important; right: 4%; top: -14px !important; white-space: normal; font-size: 12.5px; }
  .stage { margin-bottom: 44px; }
  .hud { bottom: -30px; }
  .float { transform: none; }
  .perm { grid-template-columns: 1fr; gap: 4px; }
  .ring-stage { height: 300px; }
  .ring { height: 150px; margin-top: -75px; }
  .ring .lc .line { font-size: 13.5px; }
  .ring-focus .out { font-size: 18px; }
  .msg.pic img { width: 150px; height: 150px; }
  .macbook .deck { transform: rotateX(18deg); margin: 0; }
  .kc .w { display: none; }
  .kc.hi::after { font-size: 10.5px; }
  .kbstrip { --kb-u: 30px; }
}
@media (max-width: 480px) {
  .site-header nav .nav-link[href="/support.html"] { display: none; }
  :root { --kb-u: 19px; }
  .kc.fkey { display: none; }
}
