/* Glitch Lab — site styles. "Laboratory instrument" design from Stitch.
   Palette and rules: AGENTS.md → «Дизайн». No frameworks, plain CSS. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-500-normal.ab4861869c91.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-600-normal.49f2dd2d2132.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-700-normal.f9e147a59a93.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-400-normal.c7c6c5403943.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-500-normal.217fdb926a60.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-600-normal.dc87336aed76.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.caf0dfde4e44.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-600-normal.075ec35bc15b.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-700-normal.69002db50656.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ground: #08090A;     /* behind previews and shaders */
  --panel: #0D0E10;      /* page background, module chassis */
  --elevated: #141619;   /* code, inspector, overlays */
  --raised: #1B1D21;     /* hover on elevated */
  --border: #1F2226;     /* 1px hairlines */
  --text: #F3F4F6;
  --muted: #8E9296;      /* secondary text, code comments */
  --deco: #5A5F66;       /* ticks, line numbers — never body text */
  --lime: #D4FF00;       /* primary accent */
  --mint: #00FFA3;       /* live readouts only */
  --red: #FF3131;        /* second glitch channel, LED, heavy */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Geist", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gap: 24px;
  --r: 10px;      /* panels, cards, windows */
  --r-sm: 6px;    /* buttons, inputs, chips */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--panel); color: var(--text);
  font: 400 15px/1.55 var(--body); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--ground); }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img, video, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--lime); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--lime); color: var(--ground); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Type scale (DESIGN.md) */
.caps  { font: 500 12px/15px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.micro { font: 700 11px/14px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.tele  { font: 600 14px/18px var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.h-sm  { font: 600 16px/22px var(--display); letter-spacing: .02em; }
.h-lg  { font: 600 20px/26px var(--display); letter-spacing: -.02em; }
.h-xl  { font: 700 32px/38px var(--display); letter-spacing: -.03em; }
.muted { color: var(--muted); }
.deco  { color: var(--deco); }
.lime  { color: var(--lime); }
.mint  { color: var(--mint); }
.red   { color: var(--red); }
.num   { font-variant-numeric: tabular-nums; }

/* ---------- Small parts ---------- */
.led { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.led--red  { background: var(--red);  box-shadow: 0 0 6px rgba(255,49,49,.8); }
.led--lime { background: var(--lime); box-shadow: 0 0 6px rgba(212,255,0,.8); }
.led--mint { background: var(--mint); box-shadow: 0 0 8px rgba(0,255,163,.8); }
.leds { display: inline-flex; gap: 4px; align-items: center; }
.blink { animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }

.box { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); white-space: nowrap; }
.box--lime { color: var(--lime); border-color: rgba(212,255,0,.35); background: rgba(212,255,0,.06); }
.box--red  { color: var(--red);  border-color: rgba(255,49,49,.4); background: rgba(255,49,49,.06); }
.box--mint { color: var(--mint); border-color: rgba(0,255,163,.3); background: rgba(8,9,10,.85); }
.box--solid { color: var(--ground); background: var(--lime); border-color: var(--lime); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 1px solid #2C3036; border-radius: var(--r-sm);
  font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); background: var(--panel); white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--muted); background: var(--elevated); }
.btn[hidden] { display: none; }
.btn:active { transform: translateY(1px); }
.btn--lime { background: var(--lime); border-color: var(--lime); color: var(--ground); }
.btn--lime:hover { background: var(--lime); box-shadow: 0 0 14px rgba(212,255,0,.35); border-color: var(--lime); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 11px; letter-spacing: .08em; }
.btn--text { height: auto; padding: 4px 6px; border: 0; background: none; color: var(--muted); }
.btn--text:hover { color: var(--lime); }
.btn--text.lime { color: var(--lime); }
.arrow { color: var(--lime); }
.btn--lime .arrow { color: inherit; }

/* Corner brackets for "instrument" frames */
.brackets { position: relative; }
.brackets::before, .brackets::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none; z-index: 2;
  border-color: var(--deco); border-style: solid;
}
.brackets::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.brackets::after { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar__row { height: 92px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; flex-direction: column; gap: 6px; }
.brand__row { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 32px; height: 32px; mix-blend-mode: screen; }   /* crystal logo: its black square melts into the bar */
.brand__name { font: 700 30px/1 var(--display); letter-spacing: .04em; color: var(--lime); }
.brand__sub { color: var(--muted); white-space: nowrap; }
.topnav { margin: 0 auto; display: flex; height: 92px; gap: clamp(16px, calc(4.5vw - 41px), 48px); }
.topnav a { white-space: nowrap; display: flex; align-items: center; height: 100%; color: var(--muted); font-size: 14px; letter-spacing: .12em; border-bottom: 2px solid transparent; padding-top: 2px; }
.topnav a:hover { color: var(--text); }
.topnav a[aria-current] { color: var(--lime); border-bottom-color: var(--lime); font-weight: 600; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.iconlink { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; border-radius: var(--r-sm); }
.iconlink:hover { color: var(--lime); background: var(--elevated); }
.iconlink svg { width: 20px; height: 20px; }
/* Holiday cards button (→ /cards/): a tiny looping fireworks video behind the label (poster when reduced motion) */
.nybtn {
  position: relative; isolation: isolate; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px;
  border: 1px solid rgba(212,255,0,.45); border-radius: var(--r-sm); background: var(--ground);
  transition: border-color .2s;
}
.nybtn__video { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.nybtn__label {
  white-space: nowrap; color: var(--text); font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 8px rgba(0,0,0,.9);   /* dark halo: readable over a bright burst */
}
.nybtn:hover, .nybtn:focus-visible, .nybtn[aria-current] { border-color: var(--lime); }
.nybtn:hover .nybtn__label, .nybtn[aria-current] .nybtn__label { color: var(--lime); }
/* ☰ and the phone menu: shown at ≤720 px only */
.menubtn { display: none; flex: none; width: 40px; height: 40px; place-items: center; padding: 0; background: none; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); cursor: pointer; }
.menubtn__bars { display: grid; gap: 4px; width: 18px; }
.menubtn__bars i { display: block; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s; }
.menubtn[aria-expanded=true] { color: var(--lime); border-color: rgba(212,255,0,.5); }
.menubtn[aria-expanded=true] .menubtn__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menubtn[aria-expanded=true] .menubtn__bars i:nth-child(2) { opacity: 0; }
.menubtn[aria-expanded=true] .menubtn__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 56px); overflow: auto; padding: 4px 32px 16px; background: var(--panel); border-bottom: 1px solid var(--border); box-shadow: 0 24px 40px rgba(0,0,0,.6); }
.menu[hidden] { display: none; }
.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__list a { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--border); color: var(--text); font: 600 14px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.menu__list a[aria-current] { color: var(--lime); }
.menu__group { margin: 16px 0 0; }
.menu__group a { color: var(--muted); }
.menu__list--cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.menu__list--cards a { justify-content: center; min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 12px; }
.menu__theme { display: flex; justify-content: space-between; margin-top: 16px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ground); border-bottom: 1px solid var(--border); }
.hero__shader { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.hero__inner { position: relative; padding-top: 20px; padding-bottom: 28px; }
.readouts { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--deco); padding-bottom: 20px; border-bottom: 1px dashed var(--border); }
.readouts > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 44px 0 36px; }
.hero__eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--deco); }
.hero__title {
  font: 700 clamp(48px, 7.4vw, 104px)/.9 var(--display); letter-spacing: -.045em; text-transform: uppercase;
}
.hero__title span { display: block; position: relative; }
.hero__title .l1 { color: var(--text); text-shadow: -3px 0 rgba(255,49,49,.85), 3px 0 rgba(212,255,0,.35); }
.hero__title .l2 { color: var(--lime); text-shadow: 3px 0 rgba(255,49,49,.7); animation: tear 7s steps(1) infinite; }
@keyframes tear {
  0%, 93%, 100% { transform: none; clip-path: none; }
  94% { transform: translateX(-6px); clip-path: inset(10% 0 55% 0); }
  95% { transform: translateX(5px);  clip-path: inset(60% 0 8% 0); }
  96% { transform: translateX(-2px); clip-path: none; }
}
.hero__lead { margin-top: 22px; max-width: 460px; font: 400 16px/1.5 var(--body); color: var(--muted); }
.hero__lead .cursor { display: inline-block; width: 8px; height: 16px; margin-left: 4px; background: var(--lime); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hero__channels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hero__channels .box { color: var(--muted); }
.hero__channels b { color: var(--text); font-weight: 700; }
.calib { position: relative; height: 1px; background: var(--border); margin-top: 4px; }
.calib::before { content: ""; position: absolute; left: 50%; top: -2px; width: 6px; height: 5px; margin-left: -3px; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.calib::after { content: ""; position: absolute; left: calc(50% - 60px); width: 120px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--lime), transparent); }
.calib__label { display: flex; justify-content: flex-end; padding-top: 8px; color: var(--deco); }

/* ---------- Panels (module chassis) ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); position: relative; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 20px; background: var(--elevated); border-bottom: 1px solid var(--border);
}
/* "Hover the preview": effects that only play under the cursor; phones get "Tap" */
.hover-tag { display: inline-flex; align-items: center; gap: 8px; }
.hover-tag__touch { display: none; }
@media (hover: none) {
  .hover-tag__mouse { display: none; }
  .hover-tag__touch { display: inline; }
}
.panel__head .title { display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.panel__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border); color: var(--muted); background: var(--panel);
}

/* Live window (hero + effect page) */
.screen { position: relative; background: var(--ground); overflow: hidden; }
.screen--dots { background-image: radial-gradient(rgba(90,95,102,.22) 1px, transparent 1px); background-size: 16px 16px; }
.screen iframe { width: 100%; height: 100%; border: 0; background: transparent; }
.screen__ro { position: absolute; z-index: 3; display: flex; gap: 12px; align-items: center; pointer-events: none; }
.screen__ro--tl { top: 14px; left: 26px; }
.screen__ro--tr { top: 12px; right: 14px; }
.screen__ro--bl { bottom: 14px; left: 26px; }
.screen__ro--br { bottom: 14px; right: 26px; }
.hero .screen { aspect-ratio: 16 / 10; }
.home-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }   /* New Year season: the sparkler card */

/* ---------- Gallery ---------- */
.filterbar { border-bottom: 1px solid var(--border); background: var(--panel); }
.filterbar__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-current] { color: var(--lime); border-color: var(--lime); background: rgba(212,255,0,.06); }
.chip[aria-current]::before { content: ""; width: 6px; height: 6px; background: var(--lime); }
.filterbar__meta { color: var(--deco); }
.filterbar__meta b { color: var(--lime); font-weight: 500; }

.gallery { padding-top: 36px; padding-bottom: 56px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); position: relative; transition: border-color .15s; }
.card:hover { border-color: #33383E; }
.card:hover .card__title { color: var(--lime); }
.card__head { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--deco); }
.card__head .right { margin-left: auto; color: var(--deco); }
.card__stage { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--ground); overflow: hidden; }
.card__stage video, .card__stage img { width: 100%; height: 100%; border: 0; object-fit: cover; pointer-events: none; }
/* Live card preview renders at 2x size and is scaled down, so big effects fit small cards */
.card__stage iframe { position: absolute; top: 0; left: 0; max-width: none; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; }
.card__stage .box--mint { position: absolute; top: 8px; right: 8px; z-index: 2; }
.card__stage .kind { position: absolute; left: 8px; bottom: 8px; z-index: 2; }
.card__fallback { position: absolute; inset: 0; display: grid; place-items: center; font: 700 28px/1 var(--mono); letter-spacing: .1em; color: var(--text); text-shadow: -2px 0 var(--red), 2px 0 var(--lime); }
.card__body { display: grid; gap: 10px; padding: 16px 18px 18px; border-top: 1px solid var(--border); }
.card__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__title { font: 600 17px/22px var(--display); letter-spacing: .01em; transition: color .15s; }
.card__tags { color: var(--deco); font: 500 12px/16px var(--mono); }
.card__actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.card__actions .btn--text { margin-left: auto; }

.card--slot { border-style: dashed; background: transparent; min-height: 100%; }
.card--slot .card__stage { background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(31,34,38,.5) 10px 11px); }
.card--slot .card__fallback { font-size: 12px; color: var(--deco); text-shadow: none; letter-spacing: .14em; }

/* "Seen it on TikTok" + stats */
.callout { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 30px; border: 1px solid var(--border); border-left: 2px solid var(--lime); border-radius: var(--r); background: var(--elevated); }
.callout p.muted { max-width: 640px; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--ground); }
.stat { padding: 18px 24px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 2px solid var(--lime); }
.stat__value { font: 700 28px/1.1 var(--mono); letter-spacing: -.03em; margin: 6px 0 4px; }
.stat__value small { font-size: 12px; color: var(--deco); font-weight: 400; margin-left: 2px; }

/* ---------- Footer + status bar ---------- */
.footer { border-top: 1px solid var(--border); background: var(--panel); }
/* Home: the two tracks of the lab (Effects Lab / Motion Makers) */
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 32px; padding-bottom: 8px; }
.tracks__item { display: grid; gap: 10px; align-content: start; justify-items: start; padding: 20px 22px; color: inherit; text-decoration: none; transition: border-color .2s; }
.tracks__item:hover { border-color: var(--lime); }
.tracks__title { margin: 0; }
@media (max-width: 720px) { .tracks { grid-template-columns: 1fr; } }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px; padding-top: 36px; padding-bottom: 36px; }
.footer__title { margin-bottom: 12px; color: var(--deco); }
.footer__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__grid a:hover { color: var(--lime); }
.statusbar { border-top: 1px solid var(--border); background: var(--ground); }
.statusbar__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 32px; color: var(--muted); }
.statusbar__row > span { display: inline-flex; align-items: center; gap: 14px; }
.statusbar .box { padding: 2px 6px; }

/* ---------- Effect page ---------- */
.fx-top { padding-top: 28px; padding-bottom: 28px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--text); }
.fx-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fx-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; }
.fx-tag {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  font: 600 13px/1 var(--mono); letter-spacing: .04em; color: var(--muted);
  border: 1px solid #2C3036; background: var(--panel); transition: color .2s, border-color .2s;
}
a.fx-tag:hover { color: var(--lime); border-color: rgba(212,255,0,.6); }
.fx-tag--kind { color: var(--lime); border-color: rgba(212,255,0,.45); background: rgba(212,255,0,.06); }
.fx-tag--light { color: var(--ground); background: var(--lime); border-color: var(--lime); font-weight: 700; }
.fx-tag--heavy { color: var(--red); border-color: rgba(255,49,49,.45); background: rgba(255,49,49,.06); }
.fx-summary { color: var(--muted); margin-top: 12px; max-width: 720px; font-size: 16px; }

.fx-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--gap); align-items: start; padding-bottom: 56px; }
.fx-col { display: grid; gap: var(--gap); min-width: 0; }
.fx-col--side { position: sticky; top: 116px; }
.fx-viewport .screen { height: clamp(210px, 20vw, 290px); }   /* wide and low: sliders fit on screen */
.motion-note {
  position: absolute; z-index: 4; left: 50%; bottom: 44px; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px;
  width: max-content; max-width: calc(100% - 32px); padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--elevated); border: 1px solid var(--border); color: var(--muted); text-align: center;
}
.motion-note[hidden] { display: none; }


/* ---------- Neon (like the warehouse app) ----------
   Buttons: light up at once on hover with a short, uneven ignition — clickable things never wait.
   Panels and cards: the border is a neon tube. Hover 0.5 s → it ignites with 1–2 dim flickers and
   a flash, two highlights run round the frame; mouse leaves → 0.5 s later it dies with flickers.
   Only one tube at a time, 0.7 s of darkness between them (static/js/neon.js). */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --b { syntax: "<angle>"; inherits: false; initial-value: 180deg; }
@keyframes spin-a { to { --a: 360deg; } }
@keyframes spin-b { from { --b: 180deg; } to { --b: 540deg; } }

:is(.panel, .card) > :first-child { border-top-left-radius: calc(var(--r) - 1px); border-top-right-radius: calc(var(--r) - 1px); }
:is(.panel, .card) > :last-child { border-bottom-left-radius: calc(var(--r) - 1px); border-bottom-right-radius: calc(var(--r) - 1px); }

/* Buttons */
:is(.btn:not(.btn--text), .seg button, .chip, .theme-pick select) { position: relative; }
:is(.btn:not(.btn--text), .seg button, .chip, .copy-snippet)::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(212,255,0,.85);
  box-shadow: 0 0 0 1px rgba(212,255,0,.25), 0 0 10px 1px rgba(212,255,0,.45), 0 0 26px rgba(212,255,0,.18), inset 0 0 8px rgba(212,255,0,.18);
  opacity: 0; transition: opacity .25s;
}
:is(.btn:not(.btn--text), .seg button, .chip, .copy-snippet).is-lit::after,
:is(.btn:not(.btn--text), .seg button, .chip, .copy-snippet):focus-visible::after {   /* lit by neon.js; keyboard: at once */
  opacity: 1;
}
:is(.btn:not(.btn--lime):not(.btn--text), .seg button:not([aria-pressed=true]), .chip, .copy-snippet).is-lit {
  color: var(--lime); border-color: transparent; text-shadow: 0 0 8px rgba(212,255,0,.55);
}
.btn--lime.is-lit, .seg button[aria-pressed=true].is-lit { box-shadow: 0 0 16px rgba(212,255,0,.45), 0 0 40px rgba(212,255,0,.15); }
.theme-pick { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
/* "Code theme": a neon sign that burns steadily and now and then stutters, dies and re-ignites */
.theme-pick__label {
  color: #F4FFC2;
  text-shadow: 0 0 2px #fff, 0 0 6px var(--lime), 0 0 14px var(--lime), 0 0 28px rgba(212,255,0,.45);
  animation: sign-flicker 11s steps(1) infinite;
}
@keyframes sign-flicker {
  0%, 61%, 63.5%, 66%, 71%, 100% { opacity: 1; }
  62%, 64.5% { opacity: .25; }
  65% { opacity: .7; }
  67% { opacity: .08; text-shadow: none; }      /* goes out… */
  69% { opacity: .5; }                           /* …catches… */
  70% { opacity: .12; text-shadow: none; }      /* …and ignites again */
}
/* The picker box: soft glow and two highlights running round it all the time */
.theme-pick__box { position: relative; display: inline-flex; border-radius: var(--r-sm); }
.theme-pick__box::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 1;
  background:
    conic-gradient(from var(--a), transparent 0 81%, rgba(212,255,0,.75) 88%, rgba(255,255,255,.9) 91%, rgba(212,255,0,.75) 93.5%, transparent 97%),
    conic-gradient(from var(--b), transparent 0 90%, rgba(212,255,0,.7) 94%, transparent 98%);
  -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;
  animation: spin-a 4.2s linear infinite, spin-b 6.8s linear infinite;
}
.theme-pick__box select { border-color: rgba(212,255,0,.5); color: var(--lime); box-shadow: 0 0 10px rgba(212,255,0,.22), inset 0 0 8px rgba(212,255,0,.08); }
.theme-pick select:hover { border-color: rgba(212,255,0,.85); box-shadow: 0 0 10px rgba(212,255,0,.35); color: var(--lime); }
/* Uneven start of a real tube: dim blinks, then full light with a small surge */
@keyframes btn-ignite {
  0% { opacity: 0; } 12% { opacity: .55; } 20% { opacity: .08; } 34% { opacity: .8; }
  42% { opacity: .2; } 60% { opacity: 1; filter: brightness(1.6); } 100% { opacity: 1; filter: none; }
}
/* Lime buttons: a highlight sweeps across on hover */
.btn--lime { overflow: hidden; }
.btn--lime::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
  transform: skewX(-20deg); transition: left .8s cubic-bezier(.2,.7,.2,1);
}
.btn--lime:hover::before { left: 130%; }
.btn--lime::after { inset: 0; }   /* overflow hidden: keep the glow ring inside */

/* Panels and cards: neon tube on the border + two running highlights */
:is(.panel, .card)::after {
  content: ""; position: absolute; inset: -1px; z-index: 6; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(212,255,0,.7);
  box-shadow: 0 0 0 1px rgba(212,255,0,.22), 0 0 14px 1px rgba(212,255,0,.4), 0 0 42px rgba(212,255,0,.12);
  opacity: 0;
}
:is(.panel, .card)::before {
  content: ""; position: absolute; inset: -1px; z-index: 7; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background:
    conic-gradient(from var(--a), transparent 0 81%, rgba(212,255,0,.75) 88%, rgba(255,255,255,.9) 91%, rgba(212,255,0,.75) 93.5%, transparent 97%),
    conic-gradient(from var(--b), transparent 0 90%, rgba(212,255,0,.7) 94%, transparent 98%);
  -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;
  opacity: 0;
}
:is(.panel, .card).is-lit::after { opacity: 1; }
:is(.panel, .card).is-lit::before {
  opacity: 1;
  animation: spin-a 4.2s linear var(--sheen-delay, 0s) infinite, spin-b 6.8s linear var(--sheen-delay, 0s) infinite;
}
.card:hover { border-color: var(--border); }

/* Text field under the live viewport: glows like the lime buttons, ignites on focus */
.textbar { display: flex; align-items: center; gap: 16px; padding: 22px 20px; border-top: 1px solid var(--border); background: var(--panel); }
.textbar__label { flex: none; color: #9DBF00; text-shadow: 0 0 8px rgba(212,255,0,.25); }
.textbox { position: relative; flex: 1; min-width: 0; display: block; border-radius: var(--r-sm); }
.textbox input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--ground); color: var(--lime); caret-color: transparent;   /* our block cursor instead */
  border: 1px solid rgba(212,255,0,.55);
  box-shadow: 0 0 0 1px rgba(212,255,0,.12), 0 0 12px rgba(212,255,0,.18), inset 0 0 10px rgba(212,255,0,.06);
  font: 600 17px/1 var(--mono); letter-spacing: .06em; transition: border-color .2s, box-shadow .25s;
}
.textbox::after {      /* full neon ring, lit on hover/focus like the buttons */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(212,255,0,.9);
  box-shadow: 0 0 0 1px rgba(212,255,0,.3), 0 0 12px 1px rgba(212,255,0,.5), 0 0 30px rgba(212,255,0,.2), inset 0 0 10px rgba(212,255,0,.15);
  opacity: 0; transition: opacity .25s;
}
.textbox:hover::after, .textbox:focus-within::after { opacity: 1; animation: btn-ignite .42s linear; }
.textbox input:focus { outline: none; }
/* Placeholder: dim, softly pulsing lime, with our blinking block cursor */
.textbox__ph {
  position: absolute; left: 17px; top: 50%; translate: 0 -50%; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 17px/1 var(--mono); letter-spacing: .06em; color: rgba(212,255,0,.38);
  animation: ph-pulse 2.6s ease-in-out infinite;
}
.textbox__cursor { display: inline-block; width: 9px; height: 18px; background: var(--lime); box-shadow: 0 0 8px rgba(212,255,0,.7); animation: blink 1s steps(1) infinite; }
.textbox input:not(:placeholder-shown) + .textbox__ph { display: none; }
/* Block cursor that follows the text (static/js/effect.js): solid while typing, blinks when idle */
.textbox__caret {
  position: absolute; top: 50%; left: 17px; width: 9px; height: 20px; translate: 0 -50%; pointer-events: none;
  background: var(--lime); box-shadow: 0 0 8px rgba(212,255,0,.7); animation: blink 1s steps(1) infinite;
}
.textbox__caret.is-typing { animation: none; }
.textbox input:placeholder-shown ~ .textbox__caret { display: none; }   /* empty: the placeholder has its own */
.textbox__measure { position: absolute; visibility: hidden; white-space: pre; font: 600 17px/1 var(--mono); letter-spacing: .06em; }
@keyframes ph-pulse {
  0%, 100% { color: rgba(212,255,0,.32); text-shadow: none; }
  50% { color: rgba(212,255,0,.6); text-shadow: 0 0 10px rgba(212,255,0,.35); }
}

/* Get the code: Copy HTML / Copy CSS, "or", Download .zip */
.get-code { display: grid; justify-items: end; gap: 6px; }
.get-code__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.get-code__or { color: var(--deco); padding-right: 34px; }
.get-code__or::before, .get-code__or::after { content: "—"; margin: 0 6px; color: var(--border); }

/* "?" hints (effects/_hint.html, static/js/hints.js) — like the warehouse app */
.hint { position: relative; display: inline-flex; }
.hint-btn {
  position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  font: 700 12px/1 var(--mono); color: var(--lime); background: rgba(212,255,0,.08);
  border: 1px solid rgba(212,255,0,.45); cursor: help; transition: background .2s, box-shadow .3s;
}
.hint-btn::before { content: ""; position: absolute; inset: -9px; }   /* easier to hit with a finger */
.hint-btn:hover, .hint-btn:focus-visible, .hint-btn[aria-expanded="true"] { background: rgba(212,255,0,.2); box-shadow: 0 0 0 3px rgba(212,255,0,.15), 0 0 12px rgba(212,255,0,.35); }
.hint-pop {
  position: absolute; z-index: 70; top: calc(100% + 10px); right: 0; width: max-content; max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px; border-radius: var(--r-sm); font: 400 14px/1.5 var(--body); color: var(--text); text-transform: none; letter-spacing: 0;
  background: var(--elevated); border: 1px solid rgba(212,255,0,.45); box-shadow: 0 12px 32px rgba(0,0,0,.55), 0 0 18px rgba(212,255,0,.12);
  opacity: 0; visibility: hidden; translate: 0 -4px; pointer-events: none;
  transition: opacity .2s, translate .2s, visibility 0s .2s;
}
/* Opens to the left so a hidden bubble never widens the page; near the left edge it opens right */
.hint-pop.is-right { right: auto; left: 0; }
.hint-pop.is-open { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
@media (hover: hover) {
  .hint-btn:hover + .hint-pop, .hint-btn:focus-visible + .hint-pop { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
}

/* Number with arrows (pauses, delays): a green neon box, − / + buttons, keyboard ↑ ↓ */
.stepper-row { display: flex; align-items: center; gap: 14px; }
.stepper { display: inline-flex; align-items: stretch; justify-content: center; gap: 6px; flex: 1; }   /* centred in the space left of the note */
.stepper__note { color: var(--muted); text-align: left; }   /* same type as the slider labels (.caps) */
.stepper input {
  width: 64px; height: 34px; padding: 0 6px; text-align: center; border-radius: var(--r-sm);
  background: rgba(212,255,0,.06); color: var(--lime); border: 1px solid rgba(212,255,0,.6);
  box-shadow: 0 0 0 1px rgba(212,255,0,.12), 0 0 12px rgba(212,255,0,.22), inset 0 0 10px rgba(212,255,0,.08);
  font: 700 18px/1 var(--mono); text-shadow: 0 0 8px rgba(212,255,0,.5);
  -moz-appearance: textfield; appearance: textfield; transition: box-shadow .25s, border-color .2s;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:hover, .stepper input:focus { outline: none; border-color: rgba(212,255,0,.95); box-shadow: 0 0 0 1px rgba(212,255,0,.3), 0 0 14px 1px rgba(212,255,0,.5), 0 0 32px rgba(212,255,0,.2), inset 0 0 10px rgba(212,255,0,.15); animation: btn-ignite .42s linear; }
.stepper__btn {
  width: 34px; flex: none; border-radius: var(--r-sm); border: 1px solid #2C3036; background: var(--panel);
  color: var(--lime); font: 700 18px/1 var(--mono); transition: border-color .2s, box-shadow .2s;
}
.stepper__btn:hover { border-color: rgba(212,255,0,.85); box-shadow: 0 0 10px rgba(212,255,0,.4); text-shadow: 0 0 8px rgba(212,255,0,.7); }
.stepper__btn:active { transform: translateY(1px); }

/* Inspector */
.inspector { border-top: 1px solid var(--border); }
.inspector__body { padding: 16px 20px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; align-items: end; }
.ctl__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; color: var(--muted); }
.ctl__top output { color: var(--lime); }
.ctl__ticks { display: flex; justify-content: space-between; color: var(--deco); margin-top: 4px; font: 400 11px/1 var(--mono); }
.channels { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 28px; padding-top: 4px; }
.channels__list { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 14px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 500 13px/1 var(--mono); }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); }
.swatch:focus-within i { outline: 1px solid var(--lime); outline-offset: 2px; }
.inspector__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 20px 14px; border-top: 1px solid var(--border); }
.inspector__foot .lime { display: inline-flex; align-items: center; gap: 6px; }
.inspector__foot .btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Range slider: thin track, round lime thumb */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0; cursor: pointer;
  --pct: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--lime) var(--pct), #2A2E33 var(--pct)); }
input[type=range]::-moz-range-track { height: 2px; background: #2A2E33; }
input[type=range]::-moz-range-progress { height: 2px; background: var(--lime); }
/* Knob = small neon bulb. Off: plain lime. Lit (static/js/neon.js puts .is-lit / .is-dying on the input):
   pale hot core + halo; it ignites with flickers and dies with flickers, like the panel borders. */
input[type=range] {
  --knob-off: #C4EB00;
  --glow-off: none;
  --knob-on: #F6FFC8;
  --glow-on: 0 0 6px 2px rgba(212,255,0,.95), 0 0 16px 5px rgba(212,255,0,.5), 0 0 34px 8px rgba(212,255,0,.2);
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border-radius: 50%; background: var(--knob-off); border: 0; box-shadow: var(--glow-off); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--knob-off); border: 0; box-shadow: var(--glow-off); }
input[type=range].is-lit::-webkit-slider-thumb { background: var(--knob-on); box-shadow: var(--glow-on); animation: knob-ignite .45s linear; }
input[type=range].is-lit::-moz-range-thumb { background: var(--knob-on); box-shadow: var(--glow-on); animation: knob-ignite .45s linear; }
input[type=range].is-dying::-webkit-slider-thumb { animation: knob-die .5s linear forwards; }
input[type=range].is-dying::-moz-range-thumb { animation: knob-die .5s linear forwards; }
@keyframes knob-ignite {
  0%, 20%, 44% { background: var(--knob-off); box-shadow: var(--glow-off); }
  12%, 34% { background: var(--knob-on); box-shadow: var(--glow-on); filter: brightness(.7); }
  60% { background: var(--knob-on); box-shadow: var(--glow-on); filter: brightness(1.8); }
  100% { background: var(--knob-on); box-shadow: var(--glow-on); filter: none; }
}
@keyframes knob-die {
  0%, 28%, 56% { background: var(--knob-on); box-shadow: var(--glow-on); }
  14%, 42%, 100% { background: var(--knob-off); box-shadow: var(--glow-off); }
}
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible:not(.is-lit)::-webkit-slider-thumb { box-shadow: 0 0 0 2px rgba(212,255,0,.6); }

/* Code panel */
.code__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: 12px 16px; background: var(--elevated); border-bottom: 1px solid var(--border); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { height: 34px; padding: 0 14px; color: var(--text); background: var(--panel); border: 1px solid #2C3036; border-radius: var(--r-sm); font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.seg button:hover { border-color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--lime); border-color: var(--lime); color: var(--ground); }
/* the dot is always there (invisible when off), so switching never changes widths */
.seg button[aria-pressed]::before { content: "● "; opacity: 0; }
.seg button[aria-pressed=true]::before { opacity: 1; }
.code__bar--get { justify-content: space-between; }
.get-code__title { color: var(--lime); }
.tabs button[aria-selected=true] { background: rgba(212,255,0,.08); color: var(--lime); border-color: var(--lime); }
.code__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.code__view { position: relative; display: flex; max-height: 560px; overflow: auto; background: var(--c-bg); font: 400 13.5px/21px var(--mono); }
.code__view pre { margin: 0; padding: 18px 20px 18px 0; flex: 1; min-width: 0; tab-size: 2; color: var(--c-fg); counter-reset: ln; }
/* Long lines wrap instead of scrolling sideways; each line keeps its number
   (CSS counter), and its continuation is indented under the code */
.code__view pre code { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.code__view .ln { display: block; position: relative; min-height: 21px; padding-left: calc(4.2em + 2ch); text-indent: -2ch; }
.code__view .ln::before {
  counter-increment: ln; content: counter(ln, decimal-leading-zero);
  position: absolute; left: 0; width: 3em; padding-right: .6em; text-align: right; text-indent: 0;
  color: var(--c-gutter); border-right: 1px solid var(--border); user-select: none;
}

/* Code themes. Only the code windows change; the site keeps its palette.
   Colours are our own takes "in the spirit of" each editor theme. */
:root, [data-code-theme=glitch] {
  --c-bg: #141619; --c-fg: #F3F4F6; --c-gutter: #5A5F66; --c-comment: #8E9296;
  --c-punct: #9AA0A6; --c-selector: #F3F4F6; --c-tag: #F3F4F6; --c-property: #B6E84A;
  --c-attr: #B6E84A; --c-keyword: #D4FF00; --c-function: #00FFA3; --c-string: #7CF3C4;
  --c-number: #FF8A7A;
}
[data-code-theme=dark-plus] {
  --c-bg: #1E1E1E; --c-fg: #D4D4D4; --c-gutter: #858585; --c-comment: #6A9955;
  --c-punct: #D4D4D4; --c-selector: #D7BA7D; --c-tag: #569CD6; --c-property: #9CDCFE;
  --c-attr: #9CDCFE; --c-keyword: #C586C0; --c-function: #DCDCAA; --c-string: #CE9178;
  --c-number: #B5CEA8;
}
[data-code-theme=darcula] {
  --c-bg: #2B2B2B; --c-fg: #A9B7C6; --c-gutter: #606366; --c-comment: #808080;
  --c-punct: #CC7832; --c-selector: #E8BF6A; --c-tag: #E8BF6A; --c-property: #9876AA;
  --c-attr: #BABABA; --c-keyword: #CC7832; --c-function: #FFC66D; --c-string: #6A8759;
  --c-number: #6897BB;
}
[data-code-theme=one-dark] {
  --c-bg: #282C34; --c-fg: #ABB2BF; --c-gutter: #636D83; --c-comment: #5C6370;
  --c-punct: #ABB2BF; --c-selector: #D19A66; --c-tag: #E06C75; --c-property: #E06C75;
  --c-attr: #D19A66; --c-keyword: #C678DD; --c-function: #61AFEF; --c-string: #98C379;
  --c-number: #D19A66;
}
[data-code-theme=monokai] {
  --c-bg: #272822; --c-fg: #F8F8F2; --c-gutter: #90908A; --c-comment: #75715E;
  --c-punct: #F8F8F2; --c-selector: #A6E22E; --c-tag: #F92672; --c-property: #66D9EF;
  --c-attr: #A6E22E; --c-keyword: #F92672; --c-function: #66D9EF; --c-string: #E6DB74;
  --c-number: #AE81FF;
}
[data-code-theme=dracula] {
  --c-bg: #282A36; --c-fg: #F8F8F2; --c-gutter: #6272A4; --c-comment: #6272A4;
  --c-punct: #F8F8F2; --c-selector: #50FA7B; --c-tag: #FF79C6; --c-property: #8BE9FD;
  --c-attr: #50FA7B; --c-keyword: #FF79C6; --c-function: #50FA7B; --c-string: #F1FA8C;
  --c-number: #BD93F9;
}
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--c-comment); font-style: italic; }
.token.punctuation, .token.operator { color: var(--c-punct); }
.token.selector { color: var(--c-selector); }
.token.tag { color: var(--c-tag); }
.token.property { color: var(--c-property); }
.token.attr-name { color: var(--c-attr); }
.token.atrule, .token.keyword, .token.rule, .token.important { color: var(--c-keyword); }
.token.function { color: var(--c-function); }
.token.string, .token.attr-value, .token.url { color: var(--c-string); }
.token.number, .token.unit, .token.hexcode, .token.boolean { color: var(--c-number); }
.token.variable, .token.class-name { color: var(--c-fg); }

.theme-pick select {
  height: 38px; padding: 0 10px; background: var(--panel); color: var(--text); border-radius: var(--r-sm);
  border: 1px solid #2C3036; font: 700 11px/1 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer;
}
.theme-pick select:hover { color: var(--text); }

/* Sponsor + article */
.sponsor { display: flex; gap: 16px; padding: 20px; }
.sponsor__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--elevated); color: var(--lime); }
.article { padding: 0 28px 32px; }
.prose { max-width: 720px; color: #C7CACE; font-size: 16px; line-height: 1.7; }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 28px; color: var(--text); font: 600 22px/28px var(--display); letter-spacing: -.01em; }
.prose h3 { margin-top: 22px; color: var(--text); font: 600 17px/24px var(--display); }
.prose h2 + *, .prose h3 + * { margin-top: 8px; }
.prose a { color: var(--lime); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { margin-bottom: 0; padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 12px 0 0; padding: 10px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 2px solid var(--lime); background: var(--elevated); }
.prose table { border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; }
.prose th { color: var(--text); background: var(--elevated); }
.prose :not(pre) > code { border-radius: 4px; font: 500 13.5px var(--mono); color: var(--lime); background: var(--elevated); border: 1px solid var(--border); padding: 1px 4px; }
.prose pre { position: relative; margin-bottom: 0; padding: 12px 14px; overflow: auto; background: var(--c-bg); color: var(--c-fg); border: 1px solid var(--border); border-radius: var(--r-sm); font: 400 13.5px/21px var(--mono); tab-size: 2; }
.prose pre code { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.prose .copy-snippet { position: absolute; top: 6px; right: 6px; height: 28px; padding: 0 10px; color: var(--text); background: var(--elevated); border: 1px solid #2C3036; border-radius: var(--r-sm); font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy-snippet, .prose .copy-snippet:focus-visible { opacity: 1; }
.prose .copy-snippet:hover { color: var(--lime); }
@media (hover: none) { .prose .copy-snippet { opacity: 1; } }
.step-demo { margin: 16px 0 0; }
.step-demo iframe { width: 100%; height: 180px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--ground); }
.step-demo figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.step-demo figcaption::before { content: "▶ live  "; color: var(--mint); font: 700 11px/1 var(--mono); letter-spacing: .1em; }
/* animated card GIFs in holiday guides (```gif blocks) */
.card-gifs { margin-top: 16px; }
.card-gifs--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card-gif { margin: 0; max-width: 360px; }
.card-gif img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r-sm); background: #000; }
.card-gif figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-gif figcaption a { white-space: nowrap; }
@media (max-width: 520px) { .card-gifs--grid { grid-template-columns: 1fr; } }

.related { padding-bottom: 64px; }
.related__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; margin-bottom: 24px; background: var(--elevated); border: 1px solid var(--border); border-radius: var(--r); }

/* ---------- Guides (/guides/): articles without a video, cards of text ---------- */
.guides { padding-bottom: 64px; }
.guides__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.guide-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px 18px 14px; }
.guide-card__title { font: 600 18px/24px var(--display); letter-spacing: -.01em; }
.guide-card:hover .guide-card__title { color: var(--lime); }
.guide-card__text { color: var(--muted); font-size: 14px; }
.guide-card__fx { color: var(--deco); }
.guide-card__fx a { color: var(--muted); }
.guide-card__fx a:hover { color: var(--lime); }
.guide-card__go { align-self: flex-start; margin-top: auto; padding-left: 0; }
.guide__title { max-width: 900px; }
.guide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.guide__meta a:hover { color: var(--lime); }
.guide-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); align-items: start; padding-bottom: 56px; }
.guide-article .prose { max-width: 760px; }
.guide-side { position: sticky; top: 116px; display: grid; gap: var(--gap); }
.guide-toc__list { margin: 0; padding: 12px 20px 16px; display: grid; gap: 8px; list-style: none; color: var(--muted); font-size: 14px; }   /* no numbers: headings may have their own */
.guide-toc__list a:hover { color: var(--lime); }
.prose :target { scroll-margin-top: 90px; }
/* Contents on narrow screens: folded, at the top of the article */
.guide-toc-sm { display: none; margin: 4px 0 16px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--elevated); }
.guide-toc-sm summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; cursor: pointer; }
.guide-toc-sm .guide-toc__list { padding-top: 0; }

/* ```effect block inside an article: a small live card that links to the effect page */
.fx-ref { display: grid; grid-template-columns: 240px minmax(0, 1fr); margin: 20px 0 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--elevated); overflow: hidden; }
.fx-ref__stage { display: block; height: 140px; background: var(--ground); }
.fx-ref__stage iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
.fx-ref__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.prose .fx-ref__title { color: var(--text); font: 600 18px/24px var(--display); text-decoration: none; }
.prose .fx-ref__title:hover { color: var(--lime); }
.fx-ref__text { color: var(--muted); font-size: 14px; line-height: 1.5; }
.prose .fx-ref__go { margin-top: auto; text-decoration: none; }

/* Mobile bottom bar */
.tabbar { display: none; }

/* ---------- Card maker hub (/cards/): one card per holiday ---------- */
.cards-hub { padding-bottom: 56px; }
.cards-hub .guides__grid { align-items: start; }
.cards-hub__item { display: flex; flex-direction: column; overflow: hidden; }
.cards-hub__item img, .cards-hub__soon { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--ground); }
.cards-hub__media { position: relative; display: block; background: var(--ground); }   /* a live card over its picture */
.cards-hub__media img { display: block; }
.cards-hub__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cards-hub__soon { display: grid; place-items: center; color: var(--deco); border-bottom: 1px dashed var(--border); }
.cards-hub__body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.cards-hub__item--soon { opacity: .6; }

/* ---------- New Year card maker (/cards/new-year/): canvas card + settings + downloads ---------- */
@font-face { font-family: "Sacramento"; src: url("../newyear/fonts/sacramento.526cc0748a39.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Pacifico"; src: url("../newyear/fonts/pacifico.d150e652cabc.woff2") format("woff2"); font-display: swap; }
/* card text fonts (NY.FONTS): a file loads only when shown or picked */
@font-face { font-family: "Great Vibes"; src: url("../newyear/fonts/great-vibes.51c0e8c2cd33.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Allura"; src: url("../newyear/fonts/allura.9ff52664b6eb.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Alex Brush"; src: url("../newyear/fonts/alex-brush.615e0b8ce13a.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Lobster"; src: url("../newyear/fonts/lobster.9b5d1dc4d335.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Mountains of Christmas"; src: url("../newyear/fonts/mountains.9cd3fc5859f5.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Berkshire Swash"; src: url("../newyear/fonts/berkshire.f675315c2710.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../newyear/fonts/playfair.53169c2447b2.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../newyear/fonts/cormorant.bf1e09fb81d7.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url("../newyear/fonts/bodoni.5fac8efe058c.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../newyear/fonts/dm-serif.c27d5a47c09e.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("../newyear/fonts/cinzel.bd1fede05376.woff2") format("woff2"); font-display: swap; }
.ny-top { padding-top: 28px; padding-bottom: 20px; }
.ny-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
/* Slogan: a lime neon sign in hand-written script, flickers like "Code theme" */
.ny-slogan {
  flex: none; margin-right: 12px; transform: rotate(-6deg); white-space: nowrap;
  font: 400 73px/1 "Sacramento", cursive; color: #F4FFC2;
  text-shadow: 0 0 2px #fff, 0 0 8px var(--lime), 0 0 18px var(--lime), 0 0 36px rgba(212,255,0,.45);
  animation: sign-flicker 13s steps(1) infinite;
}
.ny-features { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; margin: 20px 0 0; padding: 0; }
.ny-features li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ny-also { margin: 14px 0 0; }
.ny-more-sum { display: none; margin-top: 4px; padding: 4px 0; background: none; border: 0; color: var(--lime); cursor: pointer; }   /* phone: the intro opens from one line */
.ny-also a { color: var(--lime); text-decoration: none; }
.ny-also a:hover { text-decoration: underline; }
/* quick texts under the text field (Christmas: Happy Holidays, 7 January …) */
.ny-presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ny-presets .btn { padding: 0 10px; text-transform: none; letter-spacing: .02em; }
.ny-features svg { width: 22px; height: 22px; fill: none; stroke: var(--lime); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.ny-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: var(--gap); align-items: start; padding-bottom: 40px; }
.ny-view { position: sticky; top: 116px; }
.ny-stage { height: clamp(380px, calc(100vh - 290px), 820px); display: grid; place-items: center; }
.ny-stage canvas { display: block; border-radius: 4px; box-shadow: 0 0 0 1px var(--border), 0 18px 50px rgba(0,0,0,.6); }
.ny-dllink { display: none; flex: none; }   /* "↓ Download" under the card: one column only */
.ny-nogl { position: absolute; inset: auto 16px 16px; text-align: center; color: var(--red); }
.ny-transport { flex-wrap: nowrap; }
.ny-loop { position: relative; flex: 1; height: 2px; background: #2A2E33; border-radius: 2px; overflow: hidden; }
.ny-loop i { position: absolute; inset: 0; background: var(--lime); transform-origin: left; transform: scaleX(0); }
.ny-side { display: grid; gap: var(--gap); min-width: 0; }
.ny-ctl { display: grid; gap: 18px; padding: 18px 20px; }
.ny-label { display: block; margin-bottom: 8px; color: var(--muted); }
.ny-note { margin-top: 6px; grid-column: 1 / -1; }
.ny-texts { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 0 12px; }
.ny-texts .textbox input { height: 44px; padding: 0 12px; font-size: 15px; caret-color: var(--lime); letter-spacing: .02em; }
.ny-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
/* Font buttons (each in its own font); sparkler: writing time, after writing */
.ny-sparkler { display: grid; gap: 14px; }
.ny-sparkler[hidden] { display: none; }
/* Small text: its own field in orange (--ny-sub); the main text field stays lime */
.ny-side { --ny-sub: #FF8A1F; --ny-sub-rgb: 255,138,31; }
.ny-sub { grid-column: 1 / -1; margin-top: 12px; }
.ny-label__opt { margin-left: 6px; color: var(--deco); text-transform: none; letter-spacing: .02em; font-weight: 500; }
.textbox--sub input {
  color: var(--ny-sub); caret-color: var(--ny-sub) !important; border-color: rgba(var(--ny-sub-rgb),.55);
  box-shadow: 0 0 0 1px rgba(var(--ny-sub-rgb),.12), 0 0 12px rgba(var(--ny-sub-rgb),.18), inset 0 0 10px rgba(var(--ny-sub-rgb),.06);
}
.textbox--sub input::placeholder { color: rgba(var(--ny-sub-rgb),.38); }
.textbox--sub::after {
  border-color: rgba(var(--ny-sub-rgb),.9);
  box-shadow: 0 0 0 1px rgba(var(--ny-sub-rgb),.3), 0 0 12px 1px rgba(var(--ny-sub-rgb),.5), 0 0 30px rgba(var(--ny-sub-rgb),.2), inset 0 0 10px rgba(var(--ny-sub-rgb),.15);
}
/* Fonts: 4 in view + "All fonts" opens the rest over the page (nothing below moves).
   A button shows whose font it is: lime = main text, orange = small text, half and half = both. */
.ny-fontfield { position: relative; }
.ny-fonthead { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ny-fonthead .ny-label { margin: 0; }
.ny-for { display: flex; gap: 6px; }
.ny-for button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid #2C3036; background: var(--panel); color: var(--muted); font: 700 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.ny-for i { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); }
.ny-for [data-for=subfont] i { background: var(--ny-sub); }
.ny-for button:hover { color: var(--text); border-color: var(--muted); }
.ny-for [data-for=font][aria-pressed=true] { color: var(--lime); border-color: var(--lime); box-shadow: 0 0 10px rgba(212,255,0,.25); }
.ny-for [data-for=subfont][aria-pressed=true] { color: var(--ny-sub); border-color: var(--ny-sub); box-shadow: 0 0 10px rgba(var(--ny-sub-rgb),.3); }
.ny-fonts button { font: 400 19px/1 var(--hand); letter-spacing: 0; text-transform: none; }
.ny-ctl .seg.ny-fonts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ny-ctl .seg.ny-fonts button { min-width: 0; height: 38px; padding: 0 4px; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ny-ctl .seg.ny-fonts button::before { content: none; }
/* who uses the font: fill in that text's colour; the pressed one (for the chosen text) also glows */
.ny-ctl .seg.ny-fonts button[aria-pressed=true] { background: var(--panel); color: var(--text); border-color: #2C3036; }
.ny-ctl .seg.ny-fonts button[data-pick=main] { background: var(--lime); border-color: var(--lime); color: var(--ground); }
.ny-ctl .seg.ny-fonts button[data-pick=sub] { background: var(--ny-sub); border-color: var(--ny-sub); color: var(--ground); }
.ny-ctl .seg.ny-fonts button:is([data-pick=main], [data-pick=sub], [data-pick=both]).is-lit { color: var(--ground); text-shadow: none; }
.ny-ctl .seg.ny-fonts button[data-pick=both] { background: linear-gradient(115deg, var(--lime) 50%, var(--ny-sub) 50%); border-color: transparent; color: var(--ground); }
.ny-fontfield[data-for=font] .ny-fonts button[aria-pressed=true] { box-shadow: 0 0 0 1px var(--ground), 0 0 0 2px var(--lime), 0 0 12px rgba(212,255,0,.45); }
.ny-fontfield[data-for=subfont] .ny-fonts button[aria-pressed=true] { box-shadow: 0 0 0 1px var(--ground), 0 0 0 2px var(--ny-sub), 0 0 12px rgba(var(--ny-sub-rgb),.5); }
.ny-more { position: relative; margin-top: 6px; }
.ny-more__btn {
  width: 100%; justify-content: center; gap: 8px; text-transform: none; letter-spacing: .02em; color: var(--lime);
  border-color: rgba(212,255,0,.75); box-shadow: 0 0 0 1px rgba(212,255,0,.15), 0 0 12px rgba(212,255,0,.3), inset 0 0 8px rgba(212,255,0,.1);
}
.ny-more__arrow { transition: transform .25s; }
.ny-more__btn[aria-expanded=true] .ny-more__arrow { transform: rotate(180deg); }
.ny-more__dots { display: inline-flex; gap: 4px; }
.ny-more__dots:empty { display: none; }
.ny-dot { width: 9px; height: 9px; border-radius: 50%; }
.ny-dot--main { background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.ny-dot--sub { background: var(--ny-sub); box-shadow: 0 0 6px var(--ny-sub); }
.ny-ctl .seg.ny-more__list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 6px;
  background: var(--elevated); border: 1px solid #2C3036; border-radius: var(--r-sm);
  box-shadow: 0 18px 40px rgba(0,0,0,.65), 0 0 0 1px rgba(212,255,0,.08);
}
.ny-ctl .seg.ny-more__list[hidden] { display: none; }
.ny-ctl .seg.ny-more__list button { height: 40px; font-size: 19px; }

/* Background tiles: a still frame of each scene */
.ny-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }   /* 4 or 5 tiles in one row */
.ny-tile { display: grid; gap: 6px; justify-items: center; padding: 6px 6px 8px; border: 1px solid #2C3036; border-radius: var(--r-sm); background: var(--ground); color: var(--muted); transition: border-color .2s, color .2s; }
.ny-tile canvas, .ny-tile__soon { width: 100%; aspect-ratio: 1; border-radius: 4px; background: #000; }
.ny-tile:hover:not(:disabled) { border-color: var(--muted); color: var(--text); }
.ny-tile[aria-pressed=true] { border-color: var(--lime); color: var(--lime); box-shadow: 0 0 0 1px rgba(212,255,0,.25), 0 0 12px rgba(212,255,0,.2); }
.ny-tile--soon { cursor: default; opacity: .55; }
.ny-tile__soon { display: grid; place-items: center; color: var(--deco); border: 1px dashed var(--border); background: none; }

/* Colour swatches: round, the colour of the light they give */
.ny-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ny-swatches button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border: 1px solid #2C3036; border-radius: 999px; color: var(--muted); background: var(--panel); }
.ny-swatches i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.ny-swatches button:hover { border-color: var(--muted); color: var(--text); }
.ny-swatches button[aria-pressed=true] { border-color: var(--lime); color: var(--lime); }

.ny-dl { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.ny-dl .btn { padding: 0 10px; }
.ny-dl .btn:disabled, .ny-tile:disabled, .seg button:disabled, .inspector__foot .btn:disabled { opacity: .45; cursor: wait; }
.ny-dl__fmt { opacity: .7; }
.ny-progress { display: flex; align-items: center; gap: 12px; color: var(--lime); }
.ny-progress[hidden] { display: none; }
.ny-status { min-height: 28px; text-transform: none; letter-spacing: .02em; font-weight: 500; line-height: 1.45; }
#ny-share { justify-self: start; }
.ny-check { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; cursor: pointer; }
.ny-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--lime); }
.ny-check[hidden] { display: none; }
.ny-send { border-top: 1px solid var(--border); gap: 10px; }
.ny-send .ny-label { margin: 0; }
.ny-send .textbox input { height: 40px; padding: 0 12px; font-size: 14px; caret-color: var(--lime); letter-spacing: .02em; }
.ny-send__row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Neon Sign maker kit (detail page, neon-maker.js): colour presets, "| = new line", Download */
.ns-note { flex: none; white-space: nowrap; }
.ns-presets { display: flex; align-items: center; gap: 8px; }
.ns-kit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ns-walls { flex-wrap: nowrap; gap: 6px; }
.ns-walls button { height: 30px; padding: 0 10px; font-size: 10px; letter-spacing: .06em; }
.ns-walls button::before { display: none; }
.ns-preset {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.2);
  background: radial-gradient(circle at 50% 50%, #fff 0 18%, var(--pa) 40%, var(--pb) 72%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--pb) 55%, transparent); transition: transform .15s, box-shadow .15s;
}
.ns-preset:hover { transform: scale(1.12); }
.ns-preset[aria-pressed=true] { outline: 2px solid var(--lime); outline-offset: 2px; box-shadow: 0 0 14px var(--pb); }
.ns-export { order: 2; }
.ns-dl-row { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.ns-dl-row .ny-field { min-width: 0; }
.ns-dl-row .seg { flex-wrap: nowrap; }
.ns-dl-row .seg button { white-space: nowrap; }
/* Panel heads of Download and Get the code: lime title + a short line what it does */
.ny-head { min-height: 64px; padding: 12px 20px; }
/* "Get the code" in the head of Card settings: a short neon copy of the panel below */
.ny-settings-head { gap: 12px; }
.ny-codelink {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(212,255,0,.8); color: var(--lime);
  box-shadow: 0 0 0 1px rgba(212,255,0,.2), 0 0 12px rgba(212,255,0,.35), inset 0 0 8px rgba(212,255,0,.12);
  transition: box-shadow .2s, background .2s;
}
.ny-codelink__t { font: 700 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 0 8px rgba(212,255,0,.5); }
.ny-codelink__sub { font: 500 12px/1 var(--body); color: var(--muted); }
.ny-codelink__arrow { font: 700 16px/1 var(--mono); color: #F4FFC2; text-shadow: 0 0 2px #fff, 0 0 6px var(--lime), 0 0 14px var(--lime); animation: ny-nudge 1.8s ease-in-out infinite; }
.ny-codelink:hover, .ny-codelink:focus-visible { background: rgba(212,255,0,.08); box-shadow: 0 0 0 1px rgba(212,255,0,.35), 0 0 18px rgba(212,255,0,.55), inset 0 0 10px rgba(212,255,0,.2); outline: none; }
/* Download and Get the code: the neon tube is always lit, highlights run round it */
.ny-getcode { scroll-margin-top: 120px; }
.panel.ny-lit::after { opacity: 1; }
.panel.ny-lit::before { opacity: 1; animation: spin-a 4.2s linear infinite, spin-b 6.8s linear infinite; }
.panel.ny-export::before { animation-delay: -2.1s, -3.4s; }   /* its highlights out of step with Get the code */
.ny-head__text { display: grid; gap: 4px; min-width: 0; }
.ny-head__title { color: var(--lime); }
.ny-head__sub { color: var(--lime); font-size: 13px; line-height: 1.35; text-transform: none; letter-spacing: .02em; }
/* size and length of the file: a small neon sign that flickers now and then */
.ny-sign { display: grid; justify-items: end; gap: 3px; flex: none; color: #F4FFC2; font-size: 15px; line-height: 1; white-space: nowrap; text-shadow: 0 0 2px #fff, 0 0 6px var(--lime), 0 0 14px rgba(212,255,0,.6); animation: sign-flicker 9s steps(1) infinite; }
/* Get the code: its own panel, closed; the blinking arrow says it opens */
.ny-head--toggle { width: 100%; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ny-getcode:not(.is-open) .ny-head--toggle { border-bottom: 0; }
.ny-head--toggle:hover .ny-head__title, .ny-head--toggle:focus-visible .ny-head__title { text-decoration: underline; text-underline-offset: 4px; }
.ny-getcode__arrow { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); font-size: 14px; animation: ny-nudge 1.8s ease-in-out infinite; transition: transform .35s cubic-bezier(.3,1.4,.5,1); }
@keyframes ny-nudge { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: .35; transform: translateY(3px); } }
.ny-getcode.is-open .ny-getcode__arrow { animation: none; transform: rotate(180deg); }
.ny-getcode__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2,.8,.2,1); }
.ny-getcode.is-open .ny-getcode__body { grid-template-rows: 1fr; }
.ny-steps { min-height: 0; overflow: hidden; margin: 0; padding: 0; list-style: none; counter-reset: step; opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .45s cubic-bezier(.2,.8,.2,1); }
.ny-getcode.is-open .ny-steps { opacity: 1; transform: none; }
.ny-steps li:last-child { padding-bottom: 20px; }
.ny-steps li { position: relative; display: grid; gap: 8px; justify-items: start; padding: 16px 20px 4px 56px; counter-increment: step; }
.ny-steps li::before { content: counter(step); position: absolute; left: 20px; top: 14px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); font: 700 11px/1 var(--mono); }
.ny-steps b { font-weight: 600; }
.ny-steps p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.ny-steps p code { font: 400 12.5px var(--mono); color: var(--text); }
.ny-size { justify-self: stretch; display: grid; gap: 6px; }
.ny-size .ny-label { margin: 0; }
.ny-size__note { text-transform: none; letter-spacing: .02em; }
.ny-code { justify-self: stretch; margin: 0; max-height: 240px; overflow: auto; padding: 10px 12px; background: var(--c-bg); color: var(--c-fg); border: 1px solid var(--border); border-radius: var(--r-sm); font: 400 12px/19px var(--mono); tab-size: 2; }
.ny-code code { font: inherit; white-space: pre; }
@media (prefers-reduced-motion: reduce) {
  .ny-getcode__body, .ny-steps, .ny-getcode__arrow, .panel.ny-lit::before, .ny-sign, .ny-codelink__arrow { transition: none; animation: none; }
}
/* Card view (?card=1): the friend sees only the card and "Make your own" */
.ny-card-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 24px; padding-bottom: 16px; text-align: center; }
.ny-card-head[hidden], .ny-card-from[hidden] { display: none; }
.ny-card-from { font: 400 30px/1.1 "Sacramento", cursive; }
.ny-card-mode .ny-top, .ny-card-mode .ny-side, .ny-card-mode .ny-info, .ny-card-mode .ny-dual, .ny-card-mode .ny-transport { display: none; }
.ny-card-mode .ny-grid { grid-template-columns: minmax(0, 1fr); }
.ny-card-mode .ny-view { position: static; }
.ny-card-mode .ny-stage { height: clamp(360px, calc(100vh - 330px), 900px); }

.ny-info { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; padding-bottom: 56px; }
.ny-how ol { margin: 0; padding: 18px 20px 20px 40px; display: grid; gap: 10px; color: var(--muted); }
.ny-how b { color: var(--text); font-weight: 600; }
/* One scene, two exports + Built with (under the maker) */
.ny-dual { display: grid; gap: 14px; padding-top: 8px; padding-bottom: var(--gap); }
.ny-dual__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.ny-dual__item { display: grid; gap: 10px; justify-items: start; padding: 18px 20px; }
.ny-info__col { display: grid; gap: var(--gap); }
.ny-built p { padding: 0 20px; }
.ny-built p:first-of-type { padding-top: 16px; }
.ny-built p:last-child { padding-bottom: 18px; margin-top: 10px; }
.ny-built a { color: var(--lime); }
@media (max-width: 720px) { .ny-dual__grid { grid-template-columns: 1fr; } }
.ny-faq details { border-top: 1px solid var(--border); padding: 0 20px; }
.ny-faq details:first-of-type { border-top: 0; }
.ny-faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.ny-faq summary::marker { color: var(--lime); }
.ny-faq details p { padding-bottom: 14px; }

@media (max-width: 1100px) {
  .ny-grid { grid-template-columns: minmax(0, 1fr); }
  .ny-settings-head .ny-codelink { display: none; }   /* "Get the code" stays at the bottom; up here — Download */
  .ny-dllink { display: inline-flex; }
  .ny-transport { gap: 10px; }
  .ny-view { position: static; }
  .ny-stage { height: clamp(360px, 62vh, 640px); }
  .ny-info { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ny-top { padding-top: 16px; padding-bottom: 12px; }
  .ny-hero { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ny-hero .h-xl { font-size: 26px; line-height: 32px; }
  .ny-slogan { order: -1; align-self: center; font-size: 32px; margin: 0 auto -6px; }   /* centred, ×1.15 */
  .ny-hero .fx-summary { font-size: 14px; line-height: 1.5; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .ny-hero .fx-summary.is-open { display: block; }
  .ny-hero .ny-more-sum { display: inline-flex; }
  /* the card sticks under the header (or the top, when the header hides); settings scroll below */
  .ny-view { position: sticky; top: 56px; z-index: 40; transition: top .25s; background: var(--panel); }
  .header-hidden .ny-view { top: 0; }
  #ny-loop-time { display: none; }   /* room for ↓ Download; the bar shows the loop */
  /* room for the sticky card at the end, or it would cover the last panel (Get the code) */
  .ny-grid::after { content: ""; height: calc(50vh + 110px); }   /* a grid row: sticky stops at the content edge, not the padding */
  .ny-card-mode .ny-grid::after { display: none; }   /* card view: nothing scrolls under the card */
  .ny-getcode, .ny-export { scroll-margin-top: 0; }
  html:has(.page-maker) { scroll-padding-top: calc(50vh + 60px); }   /* a focused field or #get-the-code lands below the card, not under it */
  .ny-view > .panel__head { display: none; }
  .ny-view .ny-stage { height: 50vh; min-height: 280px; }   /* with the transport ≈ 55 % of the screen */
  .ny-view .ny-transport { padding-top: 6px; padding-bottom: 6px; min-height: 0; }
  .ny-features li:nth-child(n+3) { display: none; }   /* the card first: two features are enough on a phone */
  .ny-features { gap: 8px 16px; margin-top: 12px; }
  .ny-features li .caps { font-size: 11px; }
  .ny-also { margin-top: 8px; }
  .ny-also > .muted:last-child { display: none; }
  .ny-ctl { padding: 12px; gap: 14px; }
  .ny-tiles { gap: 6px; }
  .ny-tile { padding: 4px 4px 6px; }
  .ny-tile .micro { font-size: 9px; letter-spacing: .06em; }
  .ny-texts { grid-template-columns: minmax(0, 1fr) 84px; gap: 0 8px; }
  .ny-dl { grid-template-columns: 1fr 1fr 1fr; }
  .ny-ctl .seg { flex-wrap: nowrap; gap: 6px; }
  .ny-ctl .seg button { flex: 1; min-width: 0; padding: 0 4px; font-size: 10px; letter-spacing: .04em; }
  .ny-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ny-swatches button { justify-content: center; gap: 5px; padding: 0 4px; }
  .ny-swatches i { width: 16px; height: 16px; flex: none; }
  .ny-swatches .micro { font-size: 9px; letter-spacing: .04em; }
  .ny-how ol { padding: 12px 12px 14px 32px; }
  .ny-faq details { padding: 0 12px; }
  .ny-card-head { padding-top: 12px; padding-bottom: 10px; gap: 6px; }
  .ny-card-head .h-xl { font-size: 24px; line-height: 30px; }
  .ny-card-mode .ny-stage { height: calc(100vh - 300px); min-height: 320px; }
  .ny-send__row .btn { flex: 1 1 auto; }
  .ny-ctl .seg.ny-fonts { display: grid; gap: 6px; }
  .ny-ctl .seg.ny-fonts button { font-size: 15px; letter-spacing: 0; padding: 0 3px; }
  .ny-ctl .seg.ny-more__list button { font-size: 17px; }
  .ny-label__opt { display: block; margin: 4px 0 0; }
  .ny-codelink { padding: 7px 12px; }
  .ny-codelink__t { font-size: 12px; }
  .ny-codelink__sub { display: none; }
}

/* Card maker, ?studio=1 — for filming Shorts: the card fills the width (on screen only),
   under it just the backgrounds, the text and the download buttons */
.ny-studio.has-tabbar { padding-bottom: 0; }
.ny-studio.has-tabbar .tabbar { display: none; }
.ny-studio :is(.topbar, .tabbar, .ny-top, .ny-info, .ny-dual, .footer, .ny-getcode, .ny-transport, .ny-settings-head, .inspector__foot, .ny-share),
.ny-studio .ny-view > .panel__head, .ny-studio .ny-stage .screen__ro, .ny-studio .ny-stage::before, .ny-studio .ny-stage::after,
.ny-studio .ny-side > .panel:first-child .ny-ctl > :nth-child(n+3),
.ny-studio :is(.ny-sub, .ny-note, .ny-presets),
.ny-studio .ny-export :is(.ny-head, .ny-field, .ny-check) { display: none; }
.ny-studio .wrap.ny-grid { max-width: 480px; padding: 0; grid-template-columns: minmax(0, 1fr); gap: 0; }
.ny-studio .ny-grid::after { content: ""; height: 45vh; }
.ny-studio .ny-view { position: sticky; top: 0; z-index: 40; border-radius: 0; border-width: 0 0 1px; }
.ny-studio .ny-view .ny-stage { height: 70vh; min-height: 0; display: block; }
.ny-studio .ny-stage canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 0; box-shadow: none; }
.ny-studio .ny-side { gap: 8px; padding: 8px 8px 0; }
.ny-studio .ny-ctl { padding: 10px; gap: 10px; }
.ny-studio .ny-label { margin-bottom: 5px; }
.ny-studio .ny-tile--soon { display: none; }
.ny-studio .ny-tile { padding: 4px 4px 5px; gap: 4px; }
.ny-studio .ny-tile canvas { aspect-ratio: 1.9; object-fit: cover; }
.ny-studio .ny-texts { grid-template-columns: minmax(0, 1fr) 84px; gap: 0 8px; }

/* ---------- Responsive ---------- */
/* Header on narrower screens: drop the decorations first, then switch to ☰ */
@media (max-width: 1480px) {
  .topbar__row { gap: 20px; }
  .topbar__row > .hide-sm, .topbar .theme-pick__label, .brand .box { display: none; }
}
@media (max-width: 1280px) {
  .nybtn__long { display: none; }
}
@media (max-width: 1180px) {
  .topnav, .topbar__right { display: none; }
  .nybtn { margin-left: auto; }
  .menubtn { display: grid; }
}
/* ---------- Links (link-in-bio, /links/): one phone screen, effects first ---------- */
.links { max-width: 560px; margin-top: 40px; margin-bottom: 64px; display: flex; flex-direction: column; gap: var(--gap); }
.links__head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.links__mark { width: 96px; height: 96px; border-radius: 50%; }
.links__list ul { list-style: none; margin: 0; padding: 0; }
.links__item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 16px; border-top: 1px solid var(--border); transition: background .15s; }
.links__item:hover, .links__item:focus-visible { background: var(--elevated); }
.links__name { font: 600 16px/1.2 var(--display); }
.links__channels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.links__channels .btn--lime { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .fx-grid { grid-template-columns: minmax(0, 1fr); }
  .fx-col--side { position: static; }
  /* One column: the panels of both columns line up in this order —
     get the code, live viewport + settings, code, article, sponsor */
  .fx-grid > .fx-col { display: contents; }
  .get-panel { order: 1; }
  .fx-viewport { order: 2; }
  .code-panel { order: 3; }
  .fx-grid .article { order: 4; }
  .sponsor-panel { order: 5; }
  .get-panel .code__bar--get { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 6px; }
  .get-panel .get-code { justify-items: start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { gap: 16px; }
  .guides__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-side { display: none; }   /* contents fold into the article; effect cards are under it */
  .guide-toc-sm { display: block; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 2px solid var(--lime); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .callout { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 12px; }
  .topnav, .brand__sub, .topbar__right .hide-sm, .readouts > span:last-child, .filterbar__meta { display: none; }
  .topbar__row { justify-content: space-between; height: 56px; }
  .theme-pick__label { display: none; }
  /* Phone header, one row: logo | New Year | ☰ (code theme is in the menu) */
  .brand .box, .topbar__right { display: none; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: 24px; }
  .nybtn { margin-left: auto; height: 36px; padding: 0 12px; }
  .nybtn__label { font-size: 11px; }
  .nybtn__long { display: none; }   /* phone: "✦ Cards" */
  .menubtn { display: grid; }
  .menu { padding: 4px 12px 16px; }
  .topbar { transition: transform .25s ease; }
  .header-hidden .topbar { transform: translateY(-100%); }
  .fx-col--side { top: 84px; }
  .grid { gap: 8px; }
  .card__head .right, .card__actions .btn:not(.btn--text), .card__tags { display: none; }
  .card__title { font-size: 13px; line-height: 17px; }
  .card--slot { display: none; }
  .fx-summary { margin-bottom: 4px; }
  .card__body { padding: 8px; }
  .inspector__body { grid-template-columns: 1fr; }
  .fx-grid > .fx-col, .fx-grid .panel { min-width: 0; max-width: 100%; }
  .code__view { max-height: 420px; font-size: 12px; }
  .statusbar__row > span:last-child { display: none; }
  .has-tabbar { padding-bottom: 52px; }
  .has-tabbar .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; border-top: 1px solid var(--border); background: var(--panel); }
  .tabbar a { flex: 1; display: grid; place-items: center; height: 52px; color: var(--muted); }
  .tabbar a[aria-current] { color: var(--lime); box-shadow: inset 0 2px 0 var(--lime); }

  /* Header: SYS: READY is not in .topbar__right, so hide it here; less gap */
  .topbar__row { gap: 10px; }
  .topbar__row > .hide-sm, .topbar__right .iconlink { display: none; }   /* TikTok / YouTube are in the tab bar and footer */
  .crumbs { flex-wrap: wrap; row-gap: 4px; }
  .statusbar .box { display: none; }   /* the footer status line was wider than a phone */

  /* Effect page on a phone: viewport + settings on one screen */
  .panel__head { min-height: 40px; padding: 0 12px; }
  .panel__head .title.h-sm { font-size: 13px; line-height: 18px; }
  .panel__tag { font-size: 9px; letter-spacing: .08em; }
  .fx-viewport .screen { height: 170px; }
  .screen__ro.tele { font-size: 11px; line-height: 14px; }
  .screen__ro--tl, .screen__ro--bl { left: 14px; }
  .screen__ro--tr { right: 10px; }
  .screen__ro--br { right: 14px; }
  .screen__ro .ro-frame, .screen__ro--br { display: none; }   /* "| FRAME: …" ran into LIVE FEED; "[ + calibrated ]" covered the effect */
  .textbar { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .ns-presets { gap: 7px; }
  .ns-preset { width: 28px; height: 28px; }
  .ns-kit { gap: 8px; }
  .ns-walls { gap: 4px; }
  .ns-walls button { height: 28px; padding: 0 6px; font-size: 9px; letter-spacing: .03em; }
  .fx-viewport--neon .screen { height: 236px; }   /* Neon Sign: 3 lines and the brick wall need the room */
  .inspector__body { grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px 8px; }
  .inspector__body > .ctl:has(.stepper), .inspector__body > .channels { grid-column: 1 / -1; }
  .ctl__ticks { display: none; }
  .imgpick__name, .swatch output { display: none; }   /* one row each: the swatch shows the colour */
  .textbar { flex-wrap: nowrap; }
  .inspector__foot { padding: 8px 12px 10px; }
  .get-panel .code__bar--get { min-height: 0; padding: 6px 12px 8px; gap: 4px; }
  .get-panel .get-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .get-panel .get-code__or { display: none; }
  .get-panel .long, .get-panel .hint { display: none; }   /* one row: ⧉ HTML ⧉ CSS ⧉ JS ↓ .zip */
  .get-panel .get-code__row { flex-wrap: nowrap; }
  .code__bar { min-height: 0; padding: 8px 12px; }

  /* Article: smaller side padding, so the text gets the width */
  .article { padding: 0 14px 20px; }
  .article > .panel__head { margin: 0 -14px 8px !important; }
  .prose { font-size: 15px; line-height: 1.6; }

  /* Guides on a phone: one column of text cards, the live card stacks */
  .guides__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .guide-card__body { padding: 12px; }
  .guide-card__title { font-size: 16px; line-height: 22px; }
  .guide-toc__list { padding: 10px 12px 12px; }
  .fx-ref { grid-template-columns: minmax(0, 1fr); }
  .fx-ref__stage { height: 120px; }
  .fx-ref__body { padding: 10px 12px; }
}
/* Narrow phones (390 px and less): every typed letter visible, no clipped buttons, no sideways scroll */
@media (max-width: 520px) {
  html, body { overflow-x: clip; }
  .textbar { flex-wrap: wrap; row-gap: 8px; }   /* label + "| = new line" on top, the input full width below */
  .textbar__label { order: 1; }
  .textbar .ns-note { order: 2; margin-left: auto; font-size: 10px; }
  .textbar .textbox { order: 3; flex: 1 1 100%; }
  .ns-dl-row .seg button { padding: 0 8px; font-size: 10px; letter-spacing: .03em; }
  .ny-dl .btn { padding: 0 6px; letter-spacing: .04em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.btn, .seg button, .chip, .copy-snippet)::after { animation: none !important; }
  :is(.panel, .card)::before { display: none; }
  :is(.panel, .card):hover::after { opacity: 1; }
  :is(.btn:not(.btn--text), .seg button, .chip, .copy-snippet):hover::after { opacity: 1; }
  input[type=range]::-webkit-slider-thumb { animation: none !important; }
  input[type=range]::-moz-range-thumb { animation: none !important; }
}
