/* Nook site.
   Layout: a dark, left-aligned page. Colour comes from the product itself: every "desktop" stage and every
   frame uses the real style colours from the app (assets/fences.css is generated from the Swift sources).
   Type: Bricolage Grotesque (display), Instrument Sans (text). Frames use each style's own font. */
:root {
  --bg: #0b0a22;
  --bg-2: #131238;
  --bg-3: #1c1a4a;
  --fg: #f6f4ff;
  --fg-2: #b9b4dc;
  --line: rgba(255, 255, 255, .13);
  --blue: #6b81fb;
  --violet: #a96cf0;
  --mint: #5de28f;
  --link: #a9b8ff;
  --on-brand: #0f0e2b;
  --brand: linear-gradient(100deg, #7d90ff 0%, #b17dff 100%);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "Instrument Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --f-round: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --f-serif: "Lora", "New York", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-pixel: "Press Start 2P", ui-monospace, Menlo, monospace;
  --wallpaper-bloom: radial-gradient(60% 80% at 10% 6%, rgba(107, 129, 251, .95), transparent 62%),
    radial-gradient(55% 75% at 94% 14%, rgba(169, 108, 240, .95), transparent 62%),
    radial-gradient(70% 80% at 58% 108%, rgba(93, 226, 143, .8), transparent 62%),
    radial-gradient(40% 50% at 38% 58%, rgba(255, 79, 163, .35), transparent 64%), #15123a;
  --wallpaper-dusk: radial-gradient(70% 90% at 12% 0%, rgba(77, 124, 255, .85), transparent 62%),
    radial-gradient(60% 80% at 92% 100%, rgba(0, 199, 190, .7), transparent 62%), linear-gradient(160deg, #1a2150, #0b1230);
  --wallpaper-arcade: radial-gradient(60% 80% at 8% 100%, rgba(255, 0, 153, .85), transparent 62%),
    radial-gradient(60% 80% at 96% 4%, rgba(0, 230, 255, .8), transparent 62%), linear-gradient(160deg, #26104d, #0d0526);
  --wallpaper-cozy: radial-gradient(60% 80% at 8% 0%, rgba(255, 183, 120, .95), transparent 62%),
    radial-gradient(60% 80% at 96% 96%, rgba(255, 122, 168, .9), transparent 62%),
    radial-gradient(45% 55% at 60% 30%, rgba(160, 230, 200, .55), transparent 62%), linear-gradient(160deg, #6b3a7a, #3a2260);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.025em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 4.9rem); line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3.1rem); line-height: 1.06; }
h3 { font-size: 1.15rem; line-height: 1.2; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.todo { background: #ffe38a; color: #3a2d00; padding: 0 .3em; border-radius: 4px; }
kbd { font: 600 .82em var(--f-mono); padding: .1em .45em; border-radius: 6px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- header ---------- */
.top-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(11, 10, 34, .78);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none;
  font: 800 1.7rem/1 var(--display); letter-spacing: -.04em; }
.brand img { width: 36px; height: 36px; flex: none; display: block; }
.nav { display: flex; align-items: center; gap: 22px; font-weight: 500; font-size: .95rem; }
.nav a { color: var(--fg-2); text-decoration: none; }
.nav a:hover { color: #fff; }
.nav a.btn { color: var(--on-brand); }
@media (max-width: 900px) { .nav a:not(.btn) { display: none; } }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: .8em 1.4em; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font: 700 1rem/1 var(--text); text-decoration: none; border: 0; cursor: pointer;
  box-shadow: 0 8px 28px rgba(107, 129, 251, .4); transition: transform .15s, box-shadow .15s; }
.btn:hover { color: var(--on-brand); transform: translateY(-1px); box-shadow: 0 12px 34px rgba(107, 129, 251, .55); }
.btn.small { padding: .6em 1.1em; font-size: .9rem; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid rgba(255, 255, 255, .3); box-shadow: none; }
.btn.ghost:hover { color: #fff; border-color: #fff; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; box-shadow: none; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.pill { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: .5em .95em; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .06); color: var(--fg); border: 1.5px solid var(--line); font: 600 .9rem/1.1 var(--text);
  transition: background .15s, border-color .15s; }
.pill:hover { background: rgba(255, 255, 255, .12); }
.pill[aria-pressed="true"] { background: rgba(255, 255, 255, .16); border-color: var(--fg); }
.pill .sw { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--s-ac), var(--s-ac2));
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5); flex: none; }
.pill .sw.mix { background: conic-gradient(#ff9500, #ff2d55, #af52de, #00e6ff, #34c759, #ff9500); }
.pill .n { opacity: .6; font-weight: 500; }

/* ---------- sections ---------- */
section { padding-block: clamp(56px, 8vw, 104px); scroll-margin-top: 70px; }
.head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.lead { color: var(--fg-2); font-size: 1.12rem; max-width: 62ch; }
.fine { color: var(--fg-2); font-size: .9rem; }
.sp { margin-top: 18px; }
.hero-stage .stage { margin-top: 0; }

/* ---------- stages (a desktop with a wallpaper) ---------- */
.stage { position: relative; border-radius: 22px; overflow: hidden; isolation: isolate; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.wp-bloom { background: var(--wallpaper-bloom); }
.wp-dusk { background: var(--wallpaper-dusk); }
.wp-arcade { background: var(--wallpaper-arcade); }
.wp-cozy { background: var(--wallpaper-cozy); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 80px) 0; position: relative; }
.hero::before { content: ""; position: absolute; inset: -80px 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 15% 20%, rgba(107, 129, 251, .26), transparent 70%), radial-gradient(40% 60% at 85% 10%, rgba(169, 108, 240, .26), transparent 70%); }
.hero-copy { display: grid; gap: 22px; max-width: 880px; }
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 60ch; color: #d9d4f5; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.cta-note { color: var(--fg-2); font-size: .92rem; }
.hero-stage { margin-top: clamp(30px, 5vw, 56px); }
.try { display: grid; gap: 12px; margin-top: 22px; }
.try-label { font: 700 1rem var(--text); }
.caption { color: var(--fg-2); font-size: .95rem; min-height: 1.6em; }

/* ---------- frames (a Nook frame, drawn in CSS to match FenceView.swift) ---------- */
.u { width: 14px; height: 14px; flex: none; display: block; }
.fence { --is: var(--s-is, 44px); position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; isolation: isolate;
  color: var(--s-lc); font: 400 12px/1.35 var(--f-sys); text-align: left;
  border: var(--s-bw, 1px) solid var(--s-bd); border-radius: var(--s-r, 12px);
  background: var(--s-tex, linear-gradient(#0000, #0000)), var(--s-bg);
  box-shadow: var(--s-glow, 0 0 0 0 #0000), 0 12px 32px rgba(0, 0, 0, .38); transition: border-radius .2s, box-shadow .2s; }
.live .fence { -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); }
.fence .bgart { position: absolute; inset: 0; z-index: 0; opacity: var(--bgo, .5); border-radius: inherit; }
.fence .rim { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; }
.fence.px { border-radius: 0; }
.fence.px .rim { inset: 3px; border: var(--s-bw, 2px) solid var(--s-bd); border-radius: 0; }
.fence.mt .rim { border: var(--s-bw, 2px) solid transparent; background: linear-gradient(135deg, rgba(255,255,255,.85), rgba(255,255,255,.12) 45%, rgba(0,0,0,.35) 60%, rgba(255,255,255,.7)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); }
.f-bar, .f-body, .f-foot { position: relative; z-index: 1; }
.f-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; flex: none; border-bottom: 1px solid var(--s-rule, rgba(255,255,255,.12)); }
.f-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-ac); flex: none; box-shadow: 0 0 6px color-mix(in srgb, var(--s-ac) 70%, transparent); }
.fence.px .dot { border-radius: 0; box-shadow: none; }
.f-title { font: var(--s-fw, 600) var(--ts, var(--s-fs, 13px))/1.1 var(--s-ff, var(--f-sys)); color: var(--s-tc); text-transform: var(--s-up, none);
  letter-spacing: var(--s-ls, 0); text-shadow: var(--s-tglow, none); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.f-bar .lk { width: 10px; height: 10px; opacity: .6; }
.fl { flex: 1; }
.count { font: 600 10px/1 var(--f-sys); padding: 3px 7px; border-radius: 99px; background: color-mix(in srgb, var(--s-ac) 26%, transparent); color: var(--s-lc); }
.f-bar .dots, .f-bar .up { opacity: .7; }
.f-bar .dots { width: 16px; }
.f-bar .up { width: 14px; height: 14px; }
.f-body { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.grip { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; z-index: 3; display: grid; place-items: center; opacity: .5; pointer-events: none; }
.grip .u { width: 11px; height: 11px; }
.fence.med { width: min(100%, 300px); min-height: 232px; }
.fence.sm { --is: 30px; --ts: 11px; width: 100%; max-width: 232px; min-height: 126px; }
.fence.sm.px { --ts: 7px; }
.fence.sm .f-bar { height: 28px; }
.fence.sm .lb { font-size: 9px; }

/* icon cells (ItemCell) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--is) + 28px), 1fr)); gap: 10px 4px; padding: 10px 10px 14px; align-content: start; }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.fence.sm .grid { gap: 6px 2px; padding: 8px 6px 10px; }
.it { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.ic { position: relative; display: block; width: var(--is); height: var(--is); flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.ic > svg { width: 100%; height: 100%; display: block; }
.ic.th { color: var(--s-ac); }
.ic.px.a { color: var(--s-ac); } .ic.px.b { color: var(--s-ac2); } .ic.px:not(.a):not(.b) { color: var(--s-ac); }
.ic.px { filter: none; }
.ic b { position: absolute; right: -5px; bottom: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--s-ac); color: var(--s-on);
  font: 700 10px/16px var(--f-sys); text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.fence.sm .ic b { min-width: 12px; height: 12px; font-size: 8px; line-height: 12px; right: -4px; }
.ic.lk { border-radius: 22%; background: linear-gradient(145deg, var(--s-ac), var(--s-ac2)); color: var(--s-on); display: grid; place-items: center; }
.ic.lk svg { width: 58%; height: 58%; }
.lb { font-size: 11px; line-height: 1.2; color: var(--s-lc); max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.fence.px .lb { font-family: var(--f-pixel); font-size: 7px; line-height: 1.5; }

/* footers (FooterBar) */
.f-foot { display: flex; align-items: center; gap: 6px; padding: 6px 24px 6px 10px; flex: none; border-top: 1px solid var(--s-rule, rgba(255,255,255,.12)); }
.cap { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font: 500 10.5px/1.2 var(--f-sys); white-space: nowrap;
  color: var(--s-lc); background: color-mix(in srgb, var(--s-ac) 24%, transparent); }
.cap .ci { width: 11px; height: 11px; }
.ft { font-size: 10.5px; opacity: .7; white-space: nowrap; }

/* notes, checklist */
.seg2 { display: flex; margin: 8px 10px 0; padding: 2px; border-radius: 7px; background: color-mix(in srgb, var(--s-lc) 12%, transparent); font: 500 11px/1 var(--f-sys); flex: none; }
.seg2 span { flex: 1; text-align: center; padding: 4px 0; border-radius: 5px; }
.seg2 .on { background: rgba(255, 255, 255, .26); color: var(--s-tc); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ta { flex: 1; padding: 8px 12px; font-size: 13px; line-height: 1.4; overflow: hidden; }
.cl { display: grid; gap: 5px; padding: 10px; align-content: start; flex: 1; overflow: hidden; }
.cr { display: flex; align-items: center; gap: 8px; }
.box { position: relative; width: 14px; height: 14px; flex: none; border: 1.6px solid var(--s-ac); border-radius: 3px; }
.done .box { background: var(--s-ac); }
.done .box::after { content: ""; position: absolute; left: 3.5px; top: .5px; width: 4px; height: 8px; border: solid var(--s-on); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.cr .tx { flex: 1; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr.done .tx { opacity: .45; }
.cr .rm { width: 9px; height: 9px; opacity: .5; }
.addrow { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12px; opacity: .85; flex: none; }
.addrow > span:last-child { opacity: .55; }
.pc { position: relative; width: 15px; height: 15px; flex: none; color: var(--s-ac); }
.pc .u { position: absolute; inset: 0; width: 15px; height: 15px; }
.pc .pcp { color: var(--s-on); }

/* timer, clock */
.tm { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; flex: 1; min-height: 0; overflow: hidden; }
.seg { display: inline-flex; padding: 2px; border-radius: 7px; background: color-mix(in srgb, var(--s-lc) 12%, transparent); font: 500 11px/1 var(--f-sys); }
.seg span { padding: 4px 9px; border-radius: 5px; }
.seg .on { background: rgba(255, 255, 255, .26); color: var(--s-tc); }
.big { font: var(--s-fw, 600) 38px/1.1 var(--s-ff, var(--f-round)); color: var(--s-tc); font-variant-numeric: tabular-nums; text-shadow: var(--s-tglow, none); margin-top: 4px; }
.fence.px .big { font-size: 20px; }
.up2 { font-size: 4px; line-height: 1; }
.btnrow, .presets { display: flex; gap: 6px; }
.chip { padding: 5px 13px; border-radius: 99px; font: 500 11px/1 var(--f-sys); background: color-mix(in srgb, var(--s-lc) 14%, transparent); }
.chip.on { background: var(--s-ac); color: var(--s-on); }
.chip.hid { visibility: hidden; }
.presets .chip { padding: 4px 9px; }
.laps { width: 100%; max-width: 180px; display: grid; gap: 2px; font: 500 10.5px/1.3 var(--f-sys); font-variant-numeric: tabular-nums; opacity: .8; }
.laps div { display: flex; justify-content: space-between; }
.clk { flex: 1; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 6px; }
.clk b { font: var(--s-fw, 600) 38px/1.1 var(--s-ff, var(--f-round)); color: var(--s-tc); font-variant-numeric: tabular-nums; text-shadow: var(--s-tglow, none); }
.fence.px .clk b { font-size: 20px; }
.clk span { font-size: 12px; opacity: .8; }

/* clipboard */
.clips { display: grid; gap: 6px; padding: 8px; align-content: start; flex: 1; overflow: hidden; }
.cc { padding: 8px; border-radius: 8px; background: color-mix(in srgb, var(--s-ac) 12%, transparent); display: grid; gap: 3px; min-width: 0; }
.cc p { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.cc small { font-size: 9px; opacity: .55; }
.cc u { display: block; height: 62px; border-radius: 5px; text-decoration: none; background: linear-gradient(135deg, var(--s-ac), var(--s-ac2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }

/* system */
.sys { display: grid; gap: 8px; padding: 10px 12px; align-content: start; flex: 1; overflow: hidden; }
.mh, .srw { display: flex; align-items: baseline; gap: 6px; font-size: 11px; }
.mh em { font-style: normal; font-size: 10px; opacity: .6; }
.mh b { font-weight: 600; font-variant-numeric: tabular-nums; }
.srw .v { opacity: .85; font-variant-numeric: tabular-nums; }
.bar { height: 6px; margin-top: 3px; border-radius: 99px; background: color-mix(in srgb, var(--s-lc) 17%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--val, 30%); border-radius: inherit; background: linear-gradient(90deg, var(--s-ac), var(--s-ac2)); transition: width 1.1s ease; }

/* video */
.vid { position: relative; margin: 10px; flex: 1; min-height: 80px; overflow: hidden; border-radius: min(10px, calc(var(--s-r, 12px) * .6)); isolation: isolate;
  background: radial-gradient(50% 70% at 28% 100%, rgba(255, 190, 90, .95), transparent 70%), radial-gradient(60% 80% at 78% 10%, rgba(255, 90, 140, .7), transparent 70%), linear-gradient(180deg, #2a2a6e, #ff7a59 85%); }
.vid::before { content: ""; position: absolute; left: -5%; right: -5%; bottom: 0; height: 36%; z-index: 0; background: #1a1230;
  clip-path: polygon(0 60%, 14% 25%, 28% 55%, 46% 10%, 64% 52%, 80% 28%, 100% 58%, 100% 100%, 0 100%); }
.vid .play { position: absolute; left: 50%; top: 46%; z-index: 1; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: rgba(255, 255, 255, .9); display: grid; place-items: center; }
.vid .play::after { content: ""; margin-left: 3px; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #1b1030; }
.vid .tl { position: absolute; left: 8px; right: 8px; bottom: 7px; z-index: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .35); }
.vid .tl::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: inherit; background: #fff; }

/* ---------- a desktop: frames placed freely (script scales it) ---------- */
.wp-ventura { background: radial-gradient(70% 90% at 88% 0%, rgba(255, 176, 103, .95), transparent 62%), radial-gradient(60% 90% at 0% 100%, rgba(43, 111, 224, .95), transparent 62%),
  radial-gradient(45% 60% at 55% 55%, rgba(233, 80, 127, .45), transparent 70%), linear-gradient(160deg, #6a3fd0, #1b3a9e); }
.free { position: relative; }
.free-in { display: grid; gap: 14px; padding: 14px; }
.free:not(.on) .fence { width: 100%; min-height: 150px; }
.free:not(.on) .m-hide { display: none; }
.free.on { height: calc(var(--fh) * var(--k, 1)); }
.free.on .free-in { position: absolute; left: 0; top: 0; width: 1160px; height: var(--fh); padding: 0; display: block; transform: scale(var(--k, 1)); transform-origin: 0 0; }
.free.on .fence { position: absolute; }
.bgdemo { margin-bottom: 36px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 30px; justify-items: center; }
.trio .fence.med { width: 100%; }
@media (max-width: 760px) { .trio { grid-template-columns: minmax(0, 1fr); padding: 18px; } }
.sub { margin: 8px 0 18px; font-size: 1.3rem; }
.bgwall { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 14px; }
.bgcell { margin: 0; display: grid; gap: 6px; min-width: 0; }
.bgcell .bgart { position: relative; inset: auto; opacity: 1; aspect-ratio: 16 / 10; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); }
.bgcell figcaption { font: 600 .85rem/1.25 var(--text); }
.bgcell figcaption span { display: block; font-weight: 400; color: var(--fg-2); font-size: .76rem; }
@media (max-width: 1000px) { .bgwall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bgwall { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note-line { margin-top: 10px; color: var(--fg-2); font-size: .85rem; }



/* ---------- section: frame types ---------- */
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
.kind { display: grid; gap: 14px; align-content: start; min-width: 0; }
.kind .st { display: grid; place-items: center; padding: 22px 20px; min-height: 270px; border-radius: 18px; position: relative; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12); }
.kind p { color: var(--fg-2); font-size: .98rem; max-width: 44ch; }
.kind h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
@media (max-width: 960px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kinds { grid-template-columns: minmax(0, 1fr); } }

/* ---------- section: style wall ---------- */
.filters { display: grid; gap: 12px; margin-bottom: 26px; }
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.tile { display: grid; gap: 10px; align-content: start; margin: 0; min-width: 0; }
.tile .st { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 14px; border-radius: 16px; background: var(--s-wp); overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12); transition: transform .2s; }
.tile:hover .st { transform: translateY(-3px); }
.tile .st { padding: 14px; }
.tile figcaption { display: grid; gap: 2px; }
.tile .nm { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 700 1rem/1.2 var(--text); }
.tile .meta { color: var(--fg-2); font-size: .85rem; }
.badge { flex: none; padding: 2px 9px; border-radius: 999px; font: 700 .72rem/1.5 var(--text); background: var(--brand); color: var(--on-brand); }
.badge.free { background: rgba(255, 255, 255, .1); color: var(--fg-2); font-weight: 600; }
@media (max-width: 1000px) { .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } .tile .st { padding: 8px; } }
@media (max-width: 440px) { .wall { grid-template-columns: minmax(0, 1fr); } }

/* ---------- section: effects ---------- */
.fxwall { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.fxcell { display: grid; gap: 8px; margin: 0; min-width: 0; }
.fxcell .st { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: var(--s-wp); display: grid; place-items: center; padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12); }
.fxcell .fence { width: 100%; max-width: none; height: 100%; }
.fxcell figcaption { font: 600 .92rem/1.3 var(--text); }
.fxcell figcaption span { display: block; color: var(--fg-2); font-weight: 400; font-size: .8rem; }
.skel { display: grid; gap: 5px; }
.skel s { display: block; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--s-lc) 28%, transparent); text-decoration: none; }
.skel s:nth-child(1) { width: 80%; } .skel s:nth-child(2) { width: 56%; } .skel s:nth-child(3) { width: 68%; }
@media (max-width: 1100px) { .fxwall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) { .fxwall { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- section: customizer ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: stretch; }
.lab .stage { min-height: 420px; display: flex; flex-direction: column; }
.lab .fence { width: min(calc(100% - 40px), 340px); min-height: 280px; margin: 28px auto; }
.panel { display: grid; gap: 18px; align-content: start; padding: clamp(18px, 2.4vw, 28px); border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); }
.ctl { display: grid; gap: 8px; }
.ctl > label, .ctl > .lbl { font: 700 .92rem var(--text); display: flex; justify-content: space-between; }
.ctl > label output { color: var(--fg-2); font-weight: 500; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--c); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .25); padding: 0; }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--c); }
input[type="range"] { width: 100%; accent-color: #7d90ff; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: #7d90ff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.list-can { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; list-style: none; color: var(--fg-2); }
.list-can li { position: relative; padding-left: 22px; }
.list-can li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; border-radius: 3px; background: var(--brand); }
@media (max-width: 900px) { .lab { grid-template-columns: minmax(0, 1fr); } .list-can { grid-template-columns: minmax(0, 1fr); } .lab .stage { min-height: 360px; } }

/* ---------- section: sample desktops ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab { padding: .6em 1.2em; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--fg); font: 700 .98rem var(--text); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.scene-note { margin-top: 16px; color: var(--fg-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.scene-note b { color: var(--fg); }

/* ---------- behaviour, pricing, privacy, faq ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.split .head { margin-bottom: 0; }
.behave { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.behave li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.behave li:last-child { border-bottom: 1px solid var(--line); }
.behave strong { font-family: var(--display); font-weight: 700; }
.behave span { color: var(--fg-2); }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .behave li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 880px; }
.plan { display: grid; gap: 14px; align-content: start; padding: 28px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line); }
.plan.premium { position: relative; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--brand) border-box; border: 2px solid transparent; box-shadow: 0 20px 60px rgba(107, 129, 251, .22); }
.plan .price { font: 800 2.3rem/1.1 var(--display); letter-spacing: -.03em; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--fg-2); }
.plan li { position: relative; padding-left: 22px; }
.plan li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 9px; height: 9px; border-radius: 3px; background: var(--brand); }
.plan .btn { justify-self: start; }
@media (max-width: 720px) { .plans { grid-template-columns: minmax(0, 1fr); } }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; margin: 0; padding: 0; list-style: none; max-width: 900px; }
.facts li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--fg-2); }
.facts b { color: var(--fg); }
@media (max-width: 720px) { .facts { grid-template-columns: minmax(0, 1fr); } }

details { border-top: 1px solid var(--line); padding: 16px 0; max-width: 820px; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font: 700 1.08rem var(--text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 500; font-size: 1.4rem; line-height: 1; color: var(--link); }
details[open] summary::after { content: "\2013"; }
details p { color: var(--fg-2); margin-top: 10px; max-width: 64ch; }

.final { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(32px, 6vw, 72px); isolation: isolate; background: var(--wallpaper-bloom);
  display: grid; gap: 22px; justify-items: start; }
.final h2 { max-width: 16ch; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.final p { color: #fff; max-width: 52ch; text-shadow: 0 1px 14px rgba(0, 0, 0, .4); }
.final .btn { background: #fff; color: #0f0e2b; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.final .btn[aria-disabled="true"] { opacity: .75; }

/* ---------- document pages ---------- */
.doc { max-width: 760px; margin-inline: auto; padding: 48px max(16px, env(safe-area-inset-right, 0px)) 72px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.doc h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 4px; }
.doc h2 { font-size: 1.45rem; margin-top: 22px; }
.doc ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--fg-2); }
.doc p { color: #d6d1f0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); color: #d6d1f0; }
.doc th { color: var(--fg); }
.note { color: var(--fg-2); font-size: .92rem; }
.steps { display: grid; gap: 14px; padding-left: 1.3em; color: #d6d1f0; }
.keybox { padding: 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 8px; }

footer { border-top: 1px solid var(--line); padding-block: 30px 44px; display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; color: var(--fg-2); font-size: .92rem; }
footer nav { display: flex; gap: 20px; }
footer a { color: var(--fg-2); }
footer a:hover { color: #fff; }

/* ---------- effects ----------
   Everything that moves is a transform or an opacity change on its own layer, so the browser animates it on the
   graphics card and never redraws it. Patterns are drawn once on a layer that is a little larger than the frame and
   slid by exactly whole tiles, so each loop is seamless. --spd (set by the builder) scales every duration. */
.fx { position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; overflow: hidden; contain: layout paint; }
.fence.fxb .fx { filter: brightness(var(--fxb, 1)) saturate(calc(1 + (var(--fxb, 1) - 1) * .6)); }
/* Effects out of sight (scrolled away) rest, like they do in the app */
.fence.off .fx, .fence.off .fx::before, .fence.off .fx::after, .fence.off .fx s { animation-play-state: paused; }

@keyframes fx-up { to { transform: translate3d(0, calc(var(--sh) * -1), 0); } }
@keyframes fx-down { from { transform: translate3d(0, calc(var(--sh) * -1), 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes fx-drop80 { to { transform: translate3d(0, 80px, 0); } }
@keyframes fx-drop64 { to { transform: translate3d(0, 64px, 0); } }
@keyframes fx-twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes fx-flicker { 0%, 100% { opacity: .55; } 40% { opacity: 1; } 70% { opacity: .7; } }
@keyframes fx-sway { from { translate: -12px 0; } to { translate: 12px 0; } }
@keyframes fx-slide { from { transform: translate3d(-108%, 0, 0); } to { transform: translate3d(48%, 0, 0); } }
@keyframes fx-slide2 { from { transform: translate3d(-111%, 0, 0); } to { transform: translate3d(49%, 0, 0); } }
@keyframes fx-breathe { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes fx-roll { from { transform: translate3d(0, -90%, 0); } to { transform: translate3d(0, 240%, 0); } }
@keyframes fx-aur1 { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-15%, -10%, 0); } }
@keyframes fx-aur2 { from { transform: translate3d(-33%, -33%, 0); } to { transform: translate3d(-18%, -18%, 0); } }
@keyframes fx-gridmove { to { transform: translate3d(0, 18px, 0); } }
@keyframes fx-wave { to { transform: translate3d(80px, 0, 0); } }
@keyframes fx-spin { from { transform: translate(-50%, -50%) rotate(0turn); } to { transform: translate(-50%, -50%) rotate(1turn); } }
@keyframes fx-eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }

/* Two layers of drifting dots, one tile pattern each: the first loops over 4 tiles of 64px, the second over 4 of 52px */
.fx-particles, .fx-snow, .fx-fireflies, .fx-embers, .fx-bubbles { --sh1: 256px; --sh2: 208px; }
.fx-leaves, .fx-blossoms { --sh1: 220px; --sh2: 192px; }
.fx-particles::before, .fx-particles::after, .fx-snow::before, .fx-snow::after, .fx-fireflies::before, .fx-fireflies::after,
.fx-embers::before, .fx-embers::after, .fx-bubbles::before, .fx-bubbles::after,
.fx-leaves::before, .fx-leaves::after, .fx-blossoms::before, .fx-blossoms::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(100% + var(--sh)); will-change: transform;
  animation-duration: calc(var(--dur) / var(--spd, 1)); animation-timing-function: linear; animation-iteration-count: infinite; }
.fx-particles::before, .fx-snow::before, .fx-fireflies::before, .fx-embers::before, .fx-bubbles::before, .fx-leaves::before, .fx-blossoms::before { --sh: var(--sh1); }
.fx-particles::after, .fx-snow::after, .fx-fireflies::after, .fx-embers::after, .fx-bubbles::after, .fx-leaves::after, .fx-blossoms::after { --sh: var(--sh2); }

.fx-particles { --dur: 16s; opacity: .8; }
.fx-particles::before, .fx-particles::after { animation-name: fx-up; }
.fx-particles::before { background: radial-gradient(circle, var(--s-ac) 0 1.6px, transparent 2.6px) 0 0 / 46px 64px; }
.fx-particles::after { background: radial-gradient(circle, var(--s-ac2) 0 1.3px, transparent 2.2px) 18px 22px / 70px 52px; }

.fx-snow { --dur: 14s; opacity: .9; }
.fx-snow::before, .fx-snow::after { animation-name: fx-down; }
.fx-snow::before { background: radial-gradient(circle, #fff 0 1.7px, transparent 2.6px) 0 0 / 50px 64px; }
.fx-snow::after { background: radial-gradient(circle, rgba(255, 255, 255, .8) 0 1.2px, transparent 2px) 21px 17px / 80px 52px; }

.fx-fireflies { --dur: 40s; animation: fx-flicker calc(3.2s / var(--spd, 1)) ease-in-out infinite; }
.fx-fireflies::before, .fx-fireflies::after { animation-name: fx-up; }
.fx-fireflies::before { background: radial-gradient(circle, #fff7a8 0 1.6px, rgba(255, 240, 120, .45) 3px, transparent 7px) 0 0 / 64px 64px; }
.fx-fireflies::after { background: radial-gradient(circle, #d6ff9a 0 1.3px, rgba(190, 255, 120, .4) 3px, transparent 6px) 30px 26px / 104px 52px; }

.fx-embers { --dur: 9s; animation: fx-flicker calc(1.6s / var(--spd, 1)) ease-in-out infinite; }
.fx-embers::before, .fx-embers::after { animation-name: fx-up; }
.fx-embers::before { background: radial-gradient(circle, #ffd27a 0 1.4px, rgba(255, 120, 30, .6) 2.6px, transparent 5px) 0 0 / 46px 64px; }
.fx-embers::after { background: radial-gradient(circle, #ff8a3d 0 1.2px, rgba(255, 60, 20, .5) 2.4px, transparent 4.5px) 20px 24px / 70px 52px; }

.fx-bubbles { --dur: 12s; }
.fx-bubbles::before, .fx-bubbles::after { animation-name: fx-up; }
.fx-bubbles::before { background: radial-gradient(circle, transparent 0 5px, rgba(255, 255, 255, .55) 5.5px 6.5px, transparent 7.2px) 0 0 / 56px 64px; }
.fx-bubbles::after { background: radial-gradient(circle, transparent 0 3px, rgba(255, 255, 255, .45) 3.5px 4.3px, transparent 5px) 24px 30px / 72px 52px; }

/* Falling leaves and blossoms: a slow fall (transform) with a gentle sway (the separate translate property) */
.fx-leaves, .fx-blossoms { --dur: 15s; }
.fx-leaves::before, .fx-leaves::after, .fx-blossoms::before, .fx-blossoms::after {
  left: -14px; right: -14px;
  animation: fx-down calc(var(--dur) / var(--spd, 1)) linear infinite, fx-sway calc(4.4s / var(--spd, 1)) ease-in-out infinite alternate; }
.fx-leaves::after, .fx-blossoms::after { animation-duration: calc(var(--dur) / var(--spd, 1)), calc(5.6s / var(--spd, 1)); animation-direction: normal, alternate-reverse; }
.fx-leaves::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110'%3E%3Cg%3E%3Cpath transform='translate(18 18) rotate(35)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%23d9611f'/%3E%3Cpath transform='translate(72 44) rotate(-50)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%23b8321f'/%3E%3Cpath transform='translate(34 82) rotate(80)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%23eead26'/%3E%3Cpath transform='translate(92 98) rotate(10)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%238c521f'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 110px 110px; }
.fx-leaves::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cg transform='scale(.8)'%3E%3Cpath transform='translate(50 14) rotate(-30)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%23eead26'/%3E%3Cpath transform='translate(14 58) rotate(60)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%238c521f'/%3E%3Cpath transform='translate(76 84) rotate(120)' d='M0 -8 C6 -4 6 4 0 9 C-6 4 -6 -4 0 -8Z' fill='%23d9611f'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 96px 96px; }
.fx-blossoms::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110'%3E%3Cg%3E%3Cellipse cx='20' cy='20' rx='3.2' ry='5' transform='rotate(30 20 20)' fill='%23ffb8d1'/%3E%3Cellipse cx='74' cy='38' rx='3' ry='4.6' transform='rotate(-40 74 38)' fill='%23ffffff'/%3E%3Cellipse cx='36' cy='80' rx='3.2' ry='5' transform='rotate(70 36 80)' fill='%23fa99bf'/%3E%3Cellipse cx='92' cy='96' rx='2.6' ry='4' transform='rotate(10 92 96)' fill='%23ffd6e6'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 110px 110px; }
.fx-blossoms::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cg%3E%3Cellipse cx='52' cy='14' rx='2.6' ry='4' transform='rotate(-30 52 14)' fill='%23ffffff'/%3E%3Cellipse cx='14' cy='56' rx='2.8' ry='4.4' transform='rotate(60 14 56)' fill='%23ffb8d1'/%3E%3Cellipse cx='78' cy='78' rx='2.8' ry='4.4' transform='rotate(120 78 78)' fill='%23fa99bf'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 96px 96px; }

.fx-stars { animation: fx-twinkle calc(2.8s / var(--spd, 1)) ease-in-out infinite;
  background: radial-gradient(circle, #fff 0 1px, transparent 1.7px) 0 0 / 37px 41px, radial-gradient(circle, var(--s-ac2) 0 1.1px, transparent 1.8px) 13px 9px / 53px 47px; }

/* A band of light sliding across */
.fx-shimmer::before, .fx-sheen::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 250%; will-change: transform;
  animation: fx-slide calc(3.4s / var(--spd, 1)) linear infinite;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .38) 50%, transparent 60%); }
.fx-sheen::before { width: 260%; animation-name: fx-slide2; animation-duration: calc(5s / var(--spd, 1));
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .6) 47%, rgba(255, 255, 255, .12) 56%, transparent 70%); }

/* Pulse glow: the strong glow is drawn once and only faded in and out */
.fx-pulse::before, .fx-pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.fx-pulse::before { box-shadow: inset 0 0 0 1px var(--s-ac), inset 0 0 8px 0 color-mix(in srgb, var(--s-ac) 40%, transparent); }
.fx-pulse::after { opacity: 0; will-change: opacity; animation: fx-breathe calc(2.6s / var(--spd, 1)) ease-in-out infinite;
  box-shadow: inset 0 0 0 1px var(--s-ac), inset 0 0 26px 5px color-mix(in srgb, var(--s-ac) 75%, transparent); }

.fx-scanlines { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px); }
.fx-scanlines::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; will-change: transform;
  background: linear-gradient(transparent, rgba(255, 255, 255, .12), transparent); animation: fx-roll calc(4.5s / var(--spd, 1)) linear infinite; }

/* Aurora: two soft glows drifting (no blur filter, the gradients are already soft) */
.fx-aurora { opacity: .85; }
.fx-aurora::before, .fx-aurora::after { content: ""; position: absolute; top: 0; left: 0; width: 150%; height: 150%; will-change: transform; }
.fx-aurora::before { background: radial-gradient(50% 60% at 30% 30%, color-mix(in srgb, var(--s-ac) 75%, transparent), transparent);
  animation: fx-aur1 calc(9s / var(--spd, 1)) ease-in-out infinite alternate; }
.fx-aurora::after { background: radial-gradient(50% 60% at 75% 60%, color-mix(in srgb, var(--s-ac2) 70%, transparent), transparent);
  animation: fx-aur2 calc(9s / var(--spd, 1)) ease-in-out infinite alternate; }

/* Synthwave grid: the floor is tilted once; only its horizontal lines slide */
.fx-grid { top: auto; height: 58%; bottom: 0; transform: perspective(150px) rotateX(58deg); transform-origin: 50% 100%; opacity: .85;
  -webkit-mask-image: linear-gradient(transparent, #000 70%); mask-image: linear-gradient(transparent, #000 70%);
  background: linear-gradient(90deg, var(--s-ac) 1px, transparent 1px) 0 0 / 22px 100%; }
.fx-grid::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; bottom: 0; will-change: transform;
  background: linear-gradient(var(--s-ac) 1px, transparent 1px) 0 0 / 100% 18px; animation: fx-gridmove calc(1.6s / var(--spd, 1)) linear infinite; }

.fx-waves { top: auto; height: 46%; bottom: 0; opacity: .8; }
.fx-waves::before { content: ""; position: absolute; top: 0; bottom: 0; left: -80px; width: calc(100% + 80px); will-change: transform;
  background: linear-gradient(to top, color-mix(in srgb, var(--s-ac) 70%, transparent), transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cpath d='M0 20 Q20 4 40 20 T80 20 V40 H0Z' fill='%23000'/%3E%3C/svg%3E") 0 100% / 80px 100% repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cpath d='M0 20 Q20 4 40 20 T80 20 V40 H0Z' fill='%23000'/%3E%3C/svg%3E") 0 100% / 80px 100% repeat-x;
  animation: fx-wave calc(5s / var(--spd, 1)) linear infinite; }

/* Falling shapes: the shape pattern is a mask on a taller layer, and the layer drops by exactly one tile */
.fx-rain::before, .fx-matrix::before, .fx-pixelrain::before { content: ""; position: absolute; left: 0; right: 0; top: -80px; bottom: 0; will-change: transform; }
.fx-pixelrain::before { top: -64px; }
.fx-rain { opacity: .55; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='80'%3E%3Cg stroke='%23000' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M10 4 L7 18'/%3E%3Cpath d='M38 40 L35 56'/%3E%3Cpath d='M52 8 L49 20'/%3E%3Cpath d='M22 58 L19 72'/%3E%3C/g%3E%3C/svg%3E"); }
.fx-rain::before { background: var(--s-ac2); -webkit-mask: var(--m) 0 0 / 60px 80px; mask: var(--m) 0 0 / 60px 80px; animation: fx-drop80 calc(1.1s / var(--spd, 1)) linear infinite; }
.fx-matrix { opacity: .32; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='80'%3E%3Cg stroke='%23000' stroke-width='5' stroke-dasharray='5 4'%3E%3Cpath d='M6 0V80'/%3E%3Cpath d='M24 -12V80' stroke-dashoffset='7'/%3E%3Cpath d='M42 0V80' stroke-dashoffset='3'/%3E%3Cpath d='M60 -6V80' stroke-dashoffset='10'/%3E%3C/g%3E%3C/svg%3E"); }
.fx-matrix::before { background: var(--s-ac); -webkit-mask: var(--m) 0 0 / 72px 80px; mask: var(--m) 0 0 / 72px 80px; animation: fx-drop80 calc(2.2s / var(--spd, 1)) linear infinite; }
.fx-pixelrain { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='64' shape-rendering='crispEdges'%3E%3Cg fill='%23000'%3E%3Crect x='8' y='4' width='3' height='9'/%3E%3Crect x='30' y='30' width='3' height='9'/%3E%3Crect x='20' y='50' width='3' height='9'/%3E%3Crect x='40' y='12' width='3' height='9'/%3E%3C/g%3E%3C/svg%3E"); }
.fx-pixelrain::before { background: var(--s-ac2); -webkit-mask: var(--m) 0 0 / 48px 64px; mask: var(--m) 0 0 / 48px 64px; animation: fx-drop64 calc(1.2s / var(--spd, 1)) steps(8) infinite; }
.fx-pixelstars { background: linear-gradient(90deg, var(--s-ac), var(--s-ac2)); animation: fx-twinkle calc(1.6s / var(--spd, 1)) steps(3) infinite; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='48' shape-rendering='crispEdges'%3E%3Cg fill='%23000'%3E%3Crect x='6' y='8' width='3' height='3'/%3E%3Crect x='28' y='30' width='3' height='3'/%3E%3Crect x='36' y='6' width='2' height='2'/%3E%3Crect x='14' y='38' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask: var(--m) 0 0 / 44px 48px; mask: var(--m) 0 0 / 44px 48px; }

/* Border effects: the ring is cut out once, and a big conic gradient turns underneath it */
.fx-rainbow, .fx-flow { padding: var(--s-bw, 2px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.fx-rainbow s, .fx-flow s { position: absolute; left: 50%; top: 50%; width: 300%; height: 300%; will-change: transform; animation: fx-spin calc(4s / var(--spd, 1)) linear infinite; }
@supports (width: 1cqmax) {
  .fx-rainbow, .fx-flow { container-type: size; }
  .fx-rainbow s, .fx-flow s { width: 150cqmax; height: 150cqmax; }
}
.fx-rainbow s { background: conic-gradient(#ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff3b30); }
.fx-flow s { background: conic-gradient(var(--s-ac), var(--s-ac2), var(--s-ac)); }

.fx-equalizer { top: auto; height: 46%; bottom: 0; display: flex; align-items: flex-end; gap: 5%; padding: 0 9%; opacity: .7; }
.fx-equalizer s { --d: 1.1s; flex: 1; height: 100%; border-radius: 3px 3px 0 0; background: linear-gradient(to top, var(--s-ac), var(--s-ac2)); transform-origin: bottom; will-change: transform;
  animation: fx-eq calc(var(--d) / var(--spd, 1)) ease-in-out infinite alternate; }
.fx-equalizer s:nth-child(2n) { --d: .8s; animation-delay: -.35s; }
.fx-equalizer s:nth-child(3n) { --d: 1.4s; animation-delay: -.7s; }
.fx-equalizer s:nth-child(5n) { --d: .65s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fx, .fx::before, .fx::after, .fx s, .btn, .tile .st, .bar i, .ring .pg { animation: none !important; transition: none !important; }
}

#key { display: block; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.08); font: 600 .85rem/1.5 var(--f-mono); word-break: break-all; user-select: all; }
.keyrow { display: flex; flex-wrap: wrap; gap: 10px; }


/* Make the hidden attribute win over display rules (style filter buttons) */
[hidden] { display: none !important; }

/* Features page */
.doc.features { max-width: 900px; }
.doc.features .toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.doc.features .toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg-2); text-decoration: none; font-size: .9rem; }
.doc.features .toc a:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.doc.features h2 { scroll-margin-top: 90px; }
.doc.features table td:first-child { color: var(--fg); font-weight: 600; min-width: 150px; }
.doc.features code { font: 600 .85em var(--f-mono); padding: .1em .4em; border-radius: 6px; background: rgba(255, 255, 255, .1); }
.doc.features td[colspan] { padding-top: 22px; color: var(--fg); border-top: 1px solid var(--line); }

/* ---------- effects wall extras and the builder's extra controls ---------- */
.fxmore { display: grid; margin: 0; min-width: 0; }
.fxmore .st { aspect-ratio: 1 / 1; display: grid; place-content: center; gap: 6px; text-align: center; padding: 16px; border-radius: 16px; text-decoration: none;
  color: var(--fg); border: 1.5px dashed rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .04); transition: background .2s, border-color .2s; }
.fxmore .st:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .5); }
.fxmore b { font: 700 1rem var(--display, var(--text)); }
.fxmore span { color: var(--fg-2); font-size: .82rem; line-height: 1.35; }
.panel select { width: 100%; padding: .6em .8em; border-radius: 12px; background: rgba(255, 255, 255, .08); color: var(--fg); border: 1px solid var(--line); font: 600 .92rem var(--text); }
.panel select option, .panel select optgroup { background: #1b1a3a; color: #fff; }
.ctl .hint { font-weight: 400; color: var(--fg-2); font-size: .8rem; margin-left: 8px; }
.ctl > .lbl { justify-content: flex-start; align-items: baseline; }
.pills.dense { gap: 6px; }
.pills.dense .pill { padding: .38em .75em; font-size: .85rem; }
.bgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.bgsw { position: relative; height: 32px; border-radius: 8px; border: 1.5px solid rgba(255, 255, 255, .2); padding: 0; overflow: hidden; cursor: pointer; background: rgba(255, 255, 255, .06); color: var(--fg-2); font: 600 .72rem var(--text); }
.bgsw .bgart { position: absolute; inset: 0; }
.bgsw[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
/* the builder's frame: its glass is drawn by ::before, so "see-through" fades only the glass, not the contents */
#lab-fence { background: none; }
#lab-fence::before { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; opacity: var(--fo, 1);
  background: var(--s-tex, linear-gradient(#0000, #0000)), var(--s-bg); }
/* the builder's frame stays in view while you scroll through the long list of controls */
@media (min-width: 901px) { .lab .stage { position: sticky; top: 84px; align-self: start; } }
.fxcell .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.fstat { font: 500 10px/1.2 var(--f-sys); color: var(--s-lc); opacity: .8; margin-top: 2px; white-space: nowrap; }
