/* amazing-glass demo. One committed look: night ground, saturated colour fields, glass on top. */
:root {
  color-scheme: dark;
  --ground: #08090d;
  --ground-2: #10121a;
  --ink: #f4f5f7;
  --ink-2: #a3a8b3;
  --ink-3: #6d7380;
  --line: rgb(244 245 247 / 0.1);
  --blue: #3d8bff;
  --orange: #ff8d28;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ag-accent: var(--blue);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
a { color: inherit; }
code { font: 500 0.88em var(--mono); background: rgb(255 255 255 / 0.07); padding: 0.1em 0.35em; border-radius: 6px; }
h1, h2 { font-family: var(--display); text-wrap: balance; margin: 0; }

/* ------------------------------------------------ Hero */
.hero { position: relative; min-height: min(100svh, 980px); display: flex; flex-direction: column; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.nav { display: flex; justify-content: space-between; align-items: center; padding-block: 22px; position: relative; z-index: 3; }
.logo { font: 800 20px/1 var(--display); letter-spacing: -0.03em; }
.logo span { color: var(--blue); }
.nav-links { display: flex; gap: 22px; font-size: 15px; color: var(--ink-2); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.hero-copy { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 40px 90px; position: relative; }
.hero-title { font-weight: 800; font-size: clamp(52px, 11vw, 164px); line-height: 0.92; letter-spacing: -0.045em; display: flex; flex-direction: column; }
.hero-title span { display: block; animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; }
.hero-title span:nth-child(2) { animation-delay: 0.08s; }
.hero-title span:nth-child(3) { animation-delay: 0.16s; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.hero-sub { max-width: 34em; font-size: clamp(17px, 2vw, 21px); color: var(--ink-2); margin: 32px 0 0; animation: rise 0.9s 0.25s cubic-bezier(.2,.8,.2,1) both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; animation: rise 0.9s 0.35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { transform: translateY(28px); opacity: 0; } }

.drops { z-index: 2; pointer-events: none; }
/* GPU hero: the stage canvas shows the colour field and the headline; the page's own
   headline stays in place for screen readers but draws nothing. */
.hero-stage { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero.gpu .hero-bg { visibility: hidden; }
.hero.gpu .hero-title span { color: transparent !important; -webkit-text-stroke-color: transparent !important; }
.drops.ag-field-gl { position: absolute; inset: 0; }
/* The GPU renderer only sees the stage canvas, so page content it cannot bend stays above it. */
.hero.gpu .hero-sub, .hero.gpu .hero-actions, .hero.gpu .nav { position: relative; z-index: 3; }
.renderer-note { position: absolute; right: 20px; bottom: 16px; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); z-index: 3; }
.drops.ag-glass[data-variant] { --ag-tint: rgb(255 255 255 / 0.05); }
.drop-handle { position: absolute; left: 0; top: 0; z-index: 3; border-radius: 50%; cursor: grab; touch-action: none; }
.drop-handle:active { cursor: grabbing; }

/* ------------------------------------------------ Chapters */
.chapter { padding-block: clamp(80px, 12vw, 150px) 0; }
.chapter-head { max-width: 780px; margin-bottom: 44px; }
.chapter-head h2 { font-weight: 800; font-size: clamp(38px, 6vw, 76px); line-height: 0.98; letter-spacing: -0.035em; margin: 14px 0 20px; }
.chapter-head p { color: var(--ink-2); font-size: 19px; max-width: 36em; margin: 0 0 12px; }
.kicker { font: 500 14px/1 var(--mono); color: var(--blue); letter-spacing: 0.08em; }
.fine { font-size: 14px !important; color: var(--ink-3) !important; }
.reveal.armed { opacity: 0; transform: translateY(40px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.8,.2,1); }
.reveal.armed.in { opacity: 1; transform: none; }
/* Blocks that contain glass move but never fade: an ancestor with opacity below 1
   becomes a backdrop root and the glass inside would see nothing behind it. */
.reveal-y.armed { transform: translateY(48px); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.reveal-y.armed.in { transform: none; }

/* 01: blur vs glass */
.marquee-stage { position: relative; padding-block: 60px 20px; overflow: hidden; }
.marquee { position: absolute; inset: 0 0 110px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.marquee-row { white-space: nowrap; font: 800 clamp(60px, 9vw, 120px)/1 var(--display); letter-spacing: -0.04em; color: #fff; }
.marquee-row span { display: inline-block; animation: slide 28s linear infinite; }
.marquee-row.alt { color: transparent; -webkit-text-stroke: 2px var(--orange); }
.marquee-row.alt span { animation-direction: reverse; animation-duration: 34s; }
.marquee-stripes { height: 70px; background: repeating-linear-gradient(90deg, #ff383c 0 40px, #ffcc00 40px 80px, #34c759 80px 120px, #0088ff 120px 160px, #cb30e0 160px 200px); background-size: 200px 100%; animation: stripes 6s linear infinite; }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes stripes { to { background-position: 200px 0; } }
.versus { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 28px; }
.vs-card { margin: 0; display: grid; gap: 14px; justify-items: center; }
.fake-glass, .real-glass { width: min(100%, 420px); height: 240px; border-radius: 60px; }
.fake-glass { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgb(255 255 255 / 0.18); border: 1px solid rgb(255 255 255 / 0.25); }
.vs-card figcaption { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 15px; color: var(--ink-2); min-height: 60px; }
.vs-card { gap: 34px; }
.real-glass.ag-glass[data-variant] { --ag-tint: rgb(255 255 255 / 0.06); }

/* 02: physics */
.physics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 28px; align-items: start; }
.diagram { margin: 0; background: var(--ground-2); border: 1px solid var(--line); border-radius: 28px; padding: 18px; }
.diagram canvas { width: 100%; aspect-ratio: 16 / 10; display: block; }
.diagram figcaption { font-size: 14px; color: var(--ink-3); margin-top: 10px; }
.playground { display: grid; gap: 18px; }
.play-stage { position: relative; height: 300px; border-radius: 28px; overflow: hidden; isolation: isolate; }
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.play-glass { position: absolute; left: 50%; top: 50%; width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: end center; transform: translate(-50%, -50%); cursor: grab; touch-action: none; }
.play-hint { transform: translateY(26px); font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.play-controls { display: grid; gap: 12px; }
.play-controls label { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.play-controls ag-segmented { justify-self: start; }
.play-controls .note { font-size: 13px; color: var(--ink-3); margin: 4px 0 0; }

/* 03: proof */
.wipe { position: relative; aspect-ratio: 2 / 1; border-radius: 24px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize; --split: 50%; background: #000; }
.wipe img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.wipe-apple { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.wipe-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 44px; margin-left: -22px; cursor: ew-resize; display: grid; place-items: center; outline: none; }
.wipe-handle::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 12px rgb(0 0 0 / 0.4); }
.wipe-handle span { width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgb(0 0 0 / 0.35); position: relative; }
.wipe-handle span::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; color: #111; font: 700 14px/1 var(--mono); }
.wipe-handle:focus-visible span { box-shadow: 0 0 0 3px var(--blue); }
.wipe-label { position: absolute; top: 14px; font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; background: rgb(0 0 0 / 0.55); color: #fff; padding: 7px 10px; border-radius: 8px; pointer-events: none; }
.wipe-label.left { left: 14px; } .wipe-label.right { right: 14px; }
.proof-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; margin-top: 22px; }
.scores { display: grid; gap: 10px; flex: 1; min-width: min(100%, 360px); max-width: 560px; }
.score { display: grid; grid-template-columns: 70px 1fr 110px; align-items: center; gap: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.score span { font-family: var(--mono); text-align: right; }
.score s { color: var(--ink-3); margin-right: 6px; }
.bar { height: 10px; border-radius: 5px; background: rgb(255 255 255 / 0.06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--blue), #7cc4ff); width: calc(var(--from) / 20 * 100%); transition: width 1.6s cubic-bezier(.2,.8,.2,1) 0.3s; }
.in .bar i, .bar.done i { width: calc(var(--to) / 20 * 100%); }
.proof-row + .fine { margin-top: 18px; max-width: 60em; }

/* 04: controls */
.control-stage { position: relative; padding-block: 70px; overflow: hidden; isolation: isolate; }
.control-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; align-items: center; }
.tile { border-radius: 32px; padding: 22px; display: grid; gap: 14px; }
.tile .row { display: flex; align-items: center; justify-content: space-between; font: 600 17px var(--body); }
.tile ag-slider { color: inherit; }
.tile-bare { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; min-height: 60px; }
.t-search ag-search { width: min(100%, 360px); }

/* 05: app */
.app-row { display: grid; grid-template-columns: 1fr minmax(0, 390px); gap: 48px; align-items: center; }
@media (max-width: 860px) { .app-row { grid-template-columns: 1fr; } }
.phone { position: relative; width: 100%; max-width: 390px; height: 800px; margin-inline: auto; border-radius: 55px; overflow: hidden; background: #fff; color: #000; box-shadow: 0 0 0 10px #1c1d22, 0 0 0 11px #34363d, 0 40px 80px rgb(0 0 0 / 0.5); isolation: isolate; }
.phone-scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; }
.phone-scroll::-webkit-scrollbar { display: none; }
.phone-content { padding: 110px 16px 140px; }
.phone-title { font: 700 34px/41px var(--ag-font-display); letter-spacing: 0.4px; margin: 0 4px 12px; }
.albums { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.album { all: unset; cursor: pointer; display: grid; gap: 4px; }
.album canvas { width: 100%; aspect-ratio: 1; border-radius: 12px; display: block; }
.album b { font: 600 14px/1.25 var(--ag-font); letter-spacing: -0.15px; }
.album span { font: 400 13px/1.2 var(--ag-font); color: rgb(60 60 67 / 0.6); }
.album:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 12px; }
.phone-status { position: absolute; top: 16px; left: 0; right: 0; z-index: 7; display: flex; justify-content: space-between; padding: 0 34px; font: 600 16px/1 var(--ag-font); pointer-events: none; }
.phone-status .dots { letter-spacing: -2px; }
.phone-edge { position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: 4; pointer-events: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); mask-image: linear-gradient(#000 40%, transparent); -webkit-mask-image: linear-gradient(#000 40%, transparent); background: linear-gradient(rgb(255 255 255 / 0.7), rgb(255 255 255 / 0)); }
.phone-top { position: absolute; top: 52px; left: 16px; right: 16px; z-index: 5; display: flex; justify-content: space-between; }
.phone-tabs { position: absolute; left: 16px; right: 16px; bottom: 26px; z-index: 6; }
.phone ag-sheet { color: #000; }
.np-title { font: 700 22px/28px var(--ag-font-display); margin-top: 4px; }
.np-artist { font: 400 15px var(--ag-font); opacity: 0.65; margin-bottom: 18px; }
.np-buttons { display: flex; justify-content: center; gap: 18px; margin: 18px 0; }

/* 06: liquid */
.liquid-stage { touch-action: pan-y; position: relative; height: clamp(320px, 45vw, 520px); overflow: hidden; isolation: isolate; margin-inline: 20px; border-radius: 32px; }
.liquid-field { position: absolute; inset: 0; }

/* 07: code */
.code-box { display: grid; gap: 14px; }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.code-box pre { margin: 0; background: var(--ground-2); border: 1px solid var(--line); border-radius: 22px; padding: 22px; overflow-x: auto; font: 400 14px/1.7 var(--mono); color: #d7dbe3; }
.code-box pre code { background: none; padding: 0; font: inherit; }
.tok-tag { color: #7cc4ff; } .tok-attr { color: #ffb86b; } .tok-str { color: #9be7a3; } .tok-com { color: var(--ink-3); } .tok-kw { color: #d6a6ff; }

/* Footer */
.footer { padding-block: 120px 60px; display: grid; gap: 14px; color: var(--ink-2); font-size: 15px; max-width: 900px; }
.footer b { color: var(--ink); }
.footer-links { color: var(--ink-3); }
.engine-note { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; background: #1b1d25; color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); }

:focus-visible { outline-color: var(--blue); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; transition-duration: 0.01s !important; }
  html { scroll-behavior: auto; }
}

/* Small screens: keep the two cards side by side so both sit on the marquee. */
@media (max-width: 720px) {
  .versus { grid-template-columns: 1fr 1fr; gap: 12px; }
  .fake-glass, .real-glass { height: 150px; border-radius: 40px; }
  .vs-card { gap: 22px; }
  .vs-card figcaption { font-size: 13px; }
  .vs-card figcaption code { font-size: 11px; }
  .marquee { inset: 0 0 130px; }
  .marquee-row { font-size: 64px; }
}

/* Draggables: no text selection, no native image drag, no long-press callout. */
.hero, .play-glass, .liquid-stage { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* The demo is for touching, not reading: no text selection, no image dragging, no
   long-press callouts. Code and inputs stay selectable so snippets can be copied. */
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
img, canvas { -webkit-user-drag: none; }
pre, pre *, code, input, textarea { user-select: text; -webkit-user-select: text; }
