:root {
  color-scheme: light;
  --page: #f2f5ff; --surface: #fff; --ink: #18234a; --muted: #4a5574;
  --accent: #3836a4; --on-accent: #fff; --line: #a0aed1; --panel: #e6edff; --highlight: #0c716b;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #11182e; --surface: #1a2542; --ink: #f2f6ff; --muted: #c3cee9;
  --accent: #b2bbff; --on-accent: #131846; --line: #6479a8; --panel: #273860; --highlight: #79edda;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1.0625rem/1.6 Inter, system-ui, sans-serif; }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select { font: inherit; color: inherit; }
button, input, select { min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--surface); }
button { cursor: pointer; }
button[aria-pressed="true"], .primary, #top-button { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img, video { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1150px, calc(100% - 3rem)); margin-inline: auto; }
.skip { position: fixed; z-index: 8; inset: .5rem auto auto 1rem; translate: 0 -180%; padding: .6rem 1rem; background: var(--surface); }
.skip:focus { translate: 0; }
header { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav { min-height: 68px; display: flex; align-items: center; gap: 1rem; }
.nav a { text-decoration: none; color: var(--ink); font-size: 1.12rem; font-weight: 650; }
.nav a:hover { color: var(--accent); text-decoration: underline; }
.brand { font-weight: 820 !important; }
#menu { display: none; }
#nav-links { margin-left: auto; display: flex; gap: .25rem; }
.hero { border-bottom: 1px solid var(--line); background: linear-gradient(130deg, var(--panel), var(--page)); }
.hero-grid { padding-block: clamp(2.4rem, 7vw, 6rem); display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: clamp(1.4rem, 4vw, 4rem); }
h1, h2 { font-family: "Instrument Sans", Inter, system-ui, sans-serif; line-height: 1.06; letter-spacing: -.045em; }
h1 { font-size: clamp(3.2rem, 7vw, 6rem); margin: 0; }
h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); margin: 0 0 1rem; }
p { margin: .6rem 0 1rem; }
.lead { font-size: clamp(1.15rem, 2vw, 1.45rem); max-width: 36ch; }
.actions, .filters { display: flex; flex-wrap: wrap; gap: .65rem; }
.actions a { display: inline-block; padding: .55rem .9rem; border-radius: .45rem; border: 1px solid var(--accent); font-weight: 680; text-decoration: none; }
.frame, .shot, .scroll { border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.frame { overflow: hidden; margin: 0; }
.frame figcaption { padding: .5rem .85rem; color: var(--muted); }
section { padding-block: 2.6rem; border-bottom: 1px solid var(--line); scroll-margin-top: 83px; }
.contents { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 570px; }
td, th { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
th { background: var(--panel); }
tr:last-child td { border-bottom: 0; }
pre { margin: 0; padding: 1rem; font: .95rem/1.55 "IBM Plex Mono", Consolas, monospace; }
.note { padding: .8rem 1rem; background: var(--panel); border-left: 4px solid var(--accent); }
.filters label { display: grid; gap: .25rem; font-weight: 650; }
.filters label:first-child { flex: 1 1 14rem; }
#count, .shot p { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.shot { margin: 0; }
.shot a { display: block; }
.shot img { border-radius: .6rem .6rem 0 0; }
.shot figcaption { padding: .7rem .9rem; }
.shot p { margin: .25rem 0 0; font-size: .94rem; }
video { width: min(100%, 680px); background: #081421; border-radius: .65rem; }
footer { padding-block: 1.8rem; color: var(--muted); }
#top-button { position: fixed; z-index: 5; inset: auto 1rem 1rem auto; width: 48px; height: 48px; display: grid; place-items: center; }
#top-button span { width: 23px; height: 23px; background: currentColor; clip-path: polygon(50% 3%, 100% 50%, 76% 50%, 63% 37%, 63% 97%, 37% 97%, 37% 37%, 24% 50%, 0 50%); }
dialog { width: min(1000px, calc(100% - 1.4rem)); max-width: none; max-height: calc(100% - 1.4rem); border: 1px solid var(--line); border-radius: .65rem; padding: .85rem; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #04131be0; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem; }
.viewer-bar h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); margin: 0; }
#image-box { margin-top: .6rem; max-height: 62dvh; overflow: auto; touch-action: pan-y; }
#image-box img { width: min(100%, 94dvh); margin: auto; }
#image-box.zoomed { touch-action: auto; }
#image-box.zoomed img { width: max(1440px, 140%); max-width: none; margin: 0; }
@media (max-width: 1000px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1050px) {
  .nav { gap: .45rem; }
  #menu { display: block; margin-left: auto; min-width: 44px; }
  #nav-links { display: none; position: absolute; inset: 100% 0 auto; margin: 0; padding: .55rem 1rem; max-height: calc(100dvh - 70px); overflow: auto; background: var(--surface); border-bottom: 1px solid var(--line); }
  #nav-links.open { display: flex; flex-direction: column; gap: 0; }
  #nav-links a { padding: .55rem .7rem; }
  #nav-links a:hover { background: var(--panel); }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 2rem); }
  .hero-grid, .gallery { grid-template-columns: 1fr; }
  section { padding-block: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

#nav-links a { padding: .48rem .65rem; border-radius: .45rem; white-space: nowrap; }
#nav-links a:hover, #nav-links a:focus-visible { background: var(--panel); text-decoration: none; }
#theme, #menu { width: 44px; min-width: 44px; padding: 0; }
#theme, #menu:focus-visible { border-color: var(--accent); }
#theme { display: grid; place-items: center; }
.theme-icon { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset -5px -3px currentColor; transform: translate(1px, -1px); }
[data-theme="dark"] .theme-icon { width: 11px; height: 11px; background: currentColor; transform: none; box-shadow: 0 -9px 0 -4px, 0 9px 0 -4px, 9px 0 0 -4px, -9px 0 0 -4px, 6px 6px 0 -4px, -6px -6px 0 -4px, 6px -6px 0 -4px, -6px 6px 0 -4px; }
.menu-icon { width: 20px; height: 2px; display: inline-block; vertical-align: middle; background: currentColor; box-shadow: 0 -6px currentColor, 0 6px currentColor; }
#menu[aria-expanded="true"] .menu-icon { transform: rotate(45deg); box-shadow: none; }
#menu[aria-expanded="true"] .menu-icon::before { content: ""; display: block; width: 20px; height: 2px; background: currentColor; transform: rotate(90deg); }
.workbench-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 1.25rem; }

@media (max-width: 1050px) {
  #menu { display: grid; place-items: center; border-color: var(--accent); color: var(--accent); background: var(--panel); }
  #nav-links { box-shadow: 0 12px 30px #101a2d33; }
  #nav-links a { padding: .65rem .8rem; }
}
@media (max-width: 650px) { .workbench-grid { grid-template-columns: minmax(0,1fr); } }
.video-player { position: relative; width: min(100%, 550px); aspect-ratio: 1; background: #101c36; border: 2px solid var(--line); border-radius: .8rem; overflow: hidden; }
.video-player video { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
#play-demo { position: absolute; inset: auto auto 21% 50%; translate: -50% 0; display: flex; align-items: center; gap: .6rem; max-width: 95%; padding: .55rem 1rem; color: white; background: #242273; border-color: #e1e8ff; font-weight: 750; white-space: nowrap; }
#play-demo span { width: 13px; height: 15px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
#play-demo:hover { background: #3734a0; }
.shot { border-width: 2px; border-color: var(--line); overflow: hidden; }
.shot a { background: var(--panel); border-bottom: 1px solid var(--line); }
.shot img { width: 100%; border-radius: 0; }
.shot:hover, .shot:focus-within { border-color: var(--highlight); }
.shot figcaption strong { color: var(--ink); font-size: 1.05rem; }
#nav-links a:hover, #nav-links a:focus-visible { color: var(--highlight); }
#image-box:not(.zoomed) img { width: min(100%, 100dvh); }