:root {
  --paper: #ffffff;
  --ink: #13201c;
  --muted: #5b6a63;
  --rule: #dfe4e0;
  --surface: #f2f4f1;
  --sodium: #f0b24a;
  --link: #8a5300;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  /* 5% side margins at every width, like the original Wix layout */
  --gutter: max(16px, 5vw);
  --edge: var(--gutter);
}

*, *::before, *::after { box-sizing: border-box; }
/* The root size follows the window width (~13.5px in a half-width window, 15px on a laptop,
   ~18px on Full HD, ~20px on 2K), so text and spacing keep their proportions as the window
   is resized. Phones keep a readable 14px minimum. */
html { scroll-behavior: smooth; font-size: clamp(14px, calc(9.6px + 0.42vw), 26px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.02; margin: 0; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }

.wrap { width: calc(100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--sodium); color: var(--ink); padding: 8px 12px; }

/* Header: white text over the home hero, ink on every other page */
.site-header {
  position: absolute; inset: 0 0 auto; z-index: 5; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.4rem var(--edge);
}
.site-header.solid { position: static; color: var(--ink); border-bottom: 1px solid var(--rule); padding-block: 1rem; }
.wordmark { font: 600 1.6rem/1 var(--display); text-decoration: none; letter-spacing: 0.01em; }
.site-nav { display: flex; align-items: center; gap: 2rem; font-weight: 500; }
.site-nav a { text-decoration: none; }
.site-nav a:not(.button):hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sodium); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.button {
  display: inline-block; padding: 0.7rem 1.25rem; border-radius: 2px;
  background: var(--sodium); color: var(--ink) !important; font-weight: 600; text-decoration: none;
}
.button:hover { background: #f6c66f; }
.button.ghost { background: transparent; color: #fff !important; box-shadow: inset 0 0 0 1px #fff; }
.button.ghost:hover { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 640px) {
  .site-nav .hide-sm { display: none; }
  .site-nav .button { padding: 8px 14px; }
}

/* Hero: the one dark, loud moment. Title sits low-left like a film title card. */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; background: #13201c; color: #fff; }
.hero .hero-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The demo reel's picture is a 2.4:1 band in the middle of its 16:9 frame, with captions
   under it. A player 240% as wide as the hero is tall makes that band fill the height,
   pushing the letterbox bars and captions outside the screen. Container units (cqw/cqh)
   measure the hero itself, which can be taller than the window when the window is short. */
.hero-reel { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; container-type: size; }
.hero-reel.playing { opacity: 1; }
.hero-reel iframe { position: absolute; left: 50%; top: 50%; width: max(100cqw, 240cqh); max-width: none; height: auto; aspect-ratio: 16 / 9; translate: -50% -50%; border: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 18, 15, 0.85) 0%, rgba(10, 18, 15, 0.45) 45%, rgba(10, 18, 15, 0.15) 80%);
}
.hero-copy { position: relative; z-index: 1; padding-block: 6rem max(130px, 24svh); }
/* Scroll cue: the thin arrow from the original site, pointing to the work below */
.scroll-cue {
  position: absolute; z-index: 2; left: 50%; bottom: max(20px, 7svh); translate: -50% 0;
  display: grid; justify-items: center; gap: 0.6rem; color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.scroll-cue .ring {
  display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 50%;
  border: 2px solid #fff; background: rgba(10, 18, 15, 0.45); box-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
  animation: cue 2.2s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--sodium); }
.scroll-cue:hover .ring { border-color: var(--sodium); }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
.hero h1 {
  font-size: min(8.5rem, 10vw, 15svh); font-weight: 700; line-height: 0.82; letter-spacing: -0.02em;
  margin-left: -0.04em;
}
.hero p { font-size: max(1.05rem, min(1.3rem, 1.6vw)); max-width: 34ch; margin: min(2rem, 3svh) 0 min(1.9rem, 3svh); line-height: 1.4; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.credits-line { border-bottom: 1px solid var(--rule); padding: 24px 0; color: var(--muted); font-size: 1.05rem; }
.credits-line strong { color: var(--ink); font-weight: 600; }

/* Sections */
section { padding-block: 6rem; }
/* the hero is a section too, but sizes itself to the window */
.hero { padding-block: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.25rem 2.5rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: 3.4rem; }
.section-head p { color: var(--muted); max-width: 46ch; margin: 0; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.25rem; }
.filters button {
  font: 500 0.95rem var(--body); color: var(--ink); background: none; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.45rem 1rem;
}
.filters button:hover { border-color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Work grid: posters with credit captions */
/* 3 posters per row like the Wix gallery, with gaps at 5% of the width */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.5rem 5vw; list-style: none; padding: 0; margin: 0; }
.work-grid li[hidden] { display: none; }
.card { display: block; text-decoration: none; }
.card .poster { aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover img, .card:focus-visible img { transform: scale(1.03); }
.card h3 { font-size: 1.7rem; margin-top: 0.9rem; }
.card .meta { color: var(--muted); margin: 0.25rem 0 0; font-size: 0.95rem; line-height: 1.4; }
.card .view { display: inline-block; margin-top: 0.6rem; color: var(--link); font-weight: 600; border-bottom: 2px solid var(--sodium); }
@media (max-width: 700px) { .work-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem 1.25rem; } }
@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr 1fr; gap: 36px 14px; }
  .card h3 { font-size: 1.3rem; margin-top: 10px; }
  .card .meta { font-size: 0.93rem; }
}

/* Showreel */
.reel { aspect-ratio: 16 / 9; background: #000; }
.reel iframe { width: 100%; height: 100%; border: 0; }

/* What I build */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 2.5rem 2.25rem; }
.services div { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.services h3 { font-size: 1.6rem; margin-bottom: 10px; }
.services p { color: var(--muted); margin: 0; }
.tools { margin-top: 3rem; color: var(--muted); }
.tools strong { color: var(--ink); font-weight: 600; }

/* About teaser / prose */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem 4rem; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.split h2 { font-size: 3.4rem; }
.prose { max-width: 66ch; }
.prose p { color: #33413b; }
.text-link { color: var(--link); font-weight: 600; text-decoration-color: var(--sodium); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Contact */
.contact { background: var(--surface); }
.contact h2 { font-size: min(5.5rem, 14vw); line-height: 0.9; max-width: 12ch; }
.contact .email {
  display: inline-block; margin: 2.25rem 0 1.5rem; font: 600 min(2.1rem, 7vw)/1.1 var(--display);
  color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--sodium); word-break: break-all;
}
.contact .email:hover { color: var(--link); }
.contact ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.contact .where { color: var(--muted); margin-top: 1.75rem; }

.site-footer { padding: 1.75rem var(--edge); color: var(--muted); font-size: 0.92rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* Project page: compact info column on the left, media wall on the right,
   so the pictures and videos are visible without scrolling. */
.project { padding-block: 1.75rem 4rem; }
.project-grid { display: grid; grid-template-columns: minmax(16rem, 1fr) minmax(0, 2.6fr); gap: 2rem 3rem; align-items: start; }
.project-info { position: sticky; top: 1.5rem; }
.project-info .back { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.project-info .back:hover { color: var(--link); }
.project-info h1 { font-size: 2.5rem; margin: 0.6rem 0 1rem; }
.facts { margin: 0 0 18px; display: grid; gap: 8px; font-size: 0.9rem; }
.facts div { display: grid; grid-template-columns: 4.8rem 1fr; gap: 0.6rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.project-info .prose { font-size: 0.92rem; line-height: 1.6; border-top: 1px solid var(--rule); padding-top: 16px; }
.project-info .prose p { margin-bottom: 0.8em; }
.project-info summary { display: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 0.75rem; }
.tile { margin: 0; aspect-ratio: 16 / 9; background: #0d1512; overflow: hidden; position: relative; }
.tile iframe, .tile video { width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.tile button { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.tile button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.tile button:hover img { transform: scale(1.03); }
@media (max-width: 900px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-info { position: static; }
  .project-info summary { display: inline-block; cursor: pointer; color: var(--link); font-weight: 600; list-style: none; margin-bottom: 4px; }
  .project-info summary::-webkit-details-marker { display: none; }
  .project-info details[open] summary { display: none; }
}
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

/* Lightbox for project images */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(8, 12, 10, 0.92); }
.lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; }
.lightbox .close {
  position: fixed; top: 16px; right: 16px; font: 600 1rem var(--body); cursor: pointer;
  background: #fff; color: var(--ink); border: 0; border-radius: 2px; padding: 8px 14px;
}

.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); padding-inline: var(--edge); }
.pager a { padding: 1.5rem 1.25rem; text-decoration: none; }
.pager a:first-child { padding-left: 0; }
.pager a:last-child { padding-right: 0; }
.pager a:hover { background: var(--surface); }
.pager a + a { text-align: right; border-left: 1px solid var(--rule); }
.pager span { display: block; color: var(--muted); font-size: 0.92rem; }
.pager strong { font: 600 1.9rem/1.1 var(--display); }

/* Simple page heading (about, 404) */
.page-head { padding-block: 3.5rem 0; }
.page-head h1 { font-size: 4.2rem; }
.about-facts { display: grid; gap: 14px; border-top: 2px solid var(--ink); padding-top: 18px; margin: 0; }
.about-facts dt { color: var(--muted); font-size: 0.92rem; }
.about-facts dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card img, .tile img { transition: none; }
  .scroll-cue .ring { animation: none; }
  .hero-reel { display: none; }
}


/* Credits list (home "More credits", about "Experience") */
.credit-group { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem 2rem; border-top: 2px solid var(--ink); padding-top: 1rem; margin-bottom: 2.25rem; }
.credit-group h3 { font-size: 1.5rem; }
.credits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1.4rem 2rem; }
.credits li { display: grid; gap: 2px; font-size: 0.95rem; color: #33413b; }
.credits strong { color: var(--ink); font-weight: 600; font-size: 1rem; }
.credits strong a { color: var(--link); text-decoration-color: var(--sodium); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.credits .role { color: var(--muted); }
@media (max-width: 640px) { .credit-group { grid-template-columns: 1fr; } }
.portrait { width: 100%; max-width: 22rem; height: auto; margin-bottom: 1.75rem; }

/* Prepared project pages waiting for their images and videos */
.tile.placeholder { display: grid; place-items: center; background: var(--surface); border: 1px dashed #b9c2bc; color: var(--muted); text-align: center; padding: 1rem; font-size: 0.95rem; }

/* Waiting poster for projects whose visuals are not online yet */
.card .poster.pending {
  display: grid; align-content: end; gap: 0.5rem; padding: 1.4rem;
  background: linear-gradient(to top, rgba(10, 18, 15, 0.92), rgba(10, 18, 15, 0.35)), url("/media/2fd560_601a2dbbe6404ac7adff82b94789a47ff001-1920.jpg") center / cover;
  color: #fff;
}
.card .poster.pending strong { font: 700 min(3.2rem, 7vw)/0.95 var(--display); }
.card .poster.pending span { color: var(--sodium); font-weight: 600; font-size: 0.95rem; }

/* Short windows (a window snapped to half the screen height, a small laptop): tighten the
   hero so the title, buttons and scroll cue all stay inside the window. */
@media (max-height: 700px) and (min-width: 641px) {
  .hero-copy { padding-block: 5.5rem 110px; }
  .hero p { max-width: 52ch; font-size: 1.05rem; margin: 0.9rem 0; }
  .scroll-cue { bottom: 14px; gap: 0.35rem; }
  .scroll-cue .ring { width: 3rem; height: 3rem; }
}

/* Spacing helpers (kept in CSS so the security policy can forbid inline styles) */
section.flush-top { padding-top: 0; }
section.tight-top { padding-top: 2rem; }
.prose-head { font-size: 2rem; margin: 2.5rem 0 0.9rem; }
.page-head-end { padding-bottom: 4rem; }
.lead-gap { margin-top: 1.25rem; }

/* Plugins: teaser grid on the home page and the full list on /plugins/ */
.plugin-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 3vw; }
@media (max-width: 900px) { .plugin-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .plugin-grid { grid-template-columns: 1fr; } }
.plugin-card { display: block; text-decoration: none; }
.plugin-card .frame { aspect-ratio: 16 / 9; overflow: hidden; background: #0d1512; }
.plugin-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.plugin-card:hover img { transform: scale(1.03); }
.plugin-card h3 { font-size: 1.6rem; margin-top: 0.8rem; }
.plugin-card .meta { color: var(--muted); margin: 0.25rem 0 0; }
.plugin-list { display: grid; gap: 4rem; }
.plugin { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: start; border-top: 2px solid var(--ink); padding-top: 2rem; scroll-margin-top: 1.5rem; }
@media (max-width: 900px) { .plugin { grid-template-columns: 1fr; } }
.plugin-media { display: grid; gap: 0.75rem; }
.plugin-media .tile.square { aspect-ratio: 1 / 1; max-width: 32rem; }
.plugin-text h2 { font-size: 2.6rem; }
.plugin-text .tagline { color: var(--link); font-weight: 600; font-size: 1.1rem; margin: 0.4rem 0 1rem; }
.plugin-text p { color: #33413b; }
.plugin-text .facts { margin-top: 1.25rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.plugin-card img.square { object-position: center 85%; }

/* Small phones (320 to 400px): keep the wordmark, links and Contact button on one line */
@media (max-width: 400px) {
  .site-header { gap: 0.75rem; }
  .site-nav { gap: 0.9rem; }
  .wordmark { font-size: 1.4rem; }
  .site-nav .button { padding: 7px 10px; }
}

/* Wide and ultrawide screens: more posters per row so a row still fits in the window */
@media (min-width: 2200px) {
  .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3.5rem 3vw; }
  .plugin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Phones: a bigger title in portrait, where 10vw would be small */
@media (max-width: 640px) and (orientation: portrait) {
  .hero h1 { font-size: min(17vw, 11svh); }
}
/* Phones and small tablets held sideways: keep the info column next to the media so the
   pictures and videos are visible without scrolling */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .project-grid { grid-template-columns: minmax(13rem, 1fr) minmax(0, 1.8fr); gap: 1.5rem; }
  .project-info { position: sticky; }
  .project-info h1 { font-size: 2rem; }
  .tiles { grid-template-columns: 1fr; }
  .plugin { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

/* Polish (Emil Kowalski / Impeccable passes): pressed states, touch-safe hovers,
   themed text selection and a single ease-out curve for interactive motion. */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
::selection { background: #f7d79b; color: var(--ink); }
.button, .filters button { transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease; }
.button:active, .filters button:active { transform: scale(0.97); }
@media (hover: none) {
  .card:hover img, .tile button:hover img, .plugin-card:hover img, .doc-card:hover img { transform: none; }
}
.section-head.stacked { display: block; }
.section-head.stacked p { margin-top: 0.9rem; }

/* Plugins & scripts: one band per problem; every tool shows its videos in same-size 16:9 frames */
.tool-groups { display: grid; gap: 4rem; }
.tool-group { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2.6fr); gap: 1.5rem 4rem; border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.tool-group-head h2 { font-size: 2.4rem; }
.tool-group-head p { color: var(--muted); margin: 0.75rem 0 0; max-width: 30ch; }
.tools-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3rem; }
.tool { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem 2.25rem; align-items: start; scroll-margin-top: 1.5rem; }
.tool + .tool { border-top: 1px solid var(--rule); padding-top: 3rem; }
.tool-media { display: grid; gap: 0.75rem; }
.tool h3 { font-size: 2rem; }
.tool .tagline { color: var(--link); font-weight: 600; margin: 0.35rem 0 0.9rem; }
.tool p { color: #33413b; }
.tool .facts { margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
@media (max-width: 1100px) { .tool-group { grid-template-columns: 1fr; } .tool-group-head p { max-width: 60ch; } }
@media (max-width: 720px) { .tool { grid-template-columns: 1fr; } }

.doc-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3vw; }
@media (max-width: 700px) { .doc-cards { grid-template-columns: 1fr; } }
.doc-card { display: block; text-decoration: none; }
.doc-card .frame { aspect-ratio: 16 / 9; overflow: hidden; background: #0d1512; }
.doc-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .doc-card:hover img { transform: scale(1.03); } }
.doc-card h3 { font-size: 2rem; margin-top: 1rem; }
.doc-card p { color: var(--muted); margin: 0.35rem 0 0; }
.doc-card .view { display: inline-block; margin-top: 0.7rem; color: var(--link); font-weight: 600; border-bottom: 2px solid var(--sodium); }

/* Documentation pages: contents and key facts in a sticky side column, the guide beside it */
.doc { padding-block: 2rem 5rem; }
.doc-grid { display: grid; grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr); gap: 2rem 5rem; align-items: start; }
.doc-side { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; font-size: 0.95rem; }
.doc-side .back { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.doc-side .back:hover { color: var(--link); }
.doc-side-title { font-weight: 600; margin: 0 0 0.5rem; }
.doc-side ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; border-left: 1px solid var(--rule); }
.doc-side ol a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; transition: color 160ms ease, border-color 160ms ease; }
.doc-side ol a:hover { color: var(--ink); }
.doc-side ol a[aria-current="true"] { color: var(--ink); font-weight: 600; border-left-color: var(--sodium); }
.doc-side .facts { border-top: 1px solid var(--rule); padding-top: 1rem; margin: 0; }
.doc-body { min-width: 0; max-width: 60rem; }
.doc-head h1 { font-size: 4.2rem; }
.doc-head .tagline { color: var(--link); font-weight: 600; font-size: 1.15rem; margin: 0.5rem 0 1.25rem; }
.doc-lead p { font-size: 1.1rem; color: #33413b; max-width: 62ch; }
.doc-links { margin: 1rem 0 0; }
.doc-section { scroll-margin-top: 1.5rem; padding-top: 3rem; }
.doc-section h2 { font-size: 2.4rem; margin-bottom: 1.1rem; }
.doc-section h3 { font-size: 1.55rem; margin: 2rem 0 0.7rem; }
.doc-section p, .doc-section li { color: #33413b; max-width: 68ch; }
.doc-section ol, .doc-section ul { padding-left: 1.4rem; margin: 0 0 1.1rem; }
.doc-section li { margin-bottom: 0.45rem; }
.doc-section li > ul, .doc-section li > ol { margin: 0.45rem 0 0.2rem; }
.doc-section li::marker { color: var(--muted); font-weight: 600; }
.doc-section strong { color: var(--ink); font-weight: 600; }
code { font: 0.88em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface); padding: 0.1em 0.35em; border-radius: 2px; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin: 0.5rem 0 1.5rem; }
.table-scroll:focus-visible { outline-offset: 2px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.doc th { text-align: left; font-weight: 600; padding: 0.6rem 0.9rem 0.6rem 0; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.doc td { padding: 0.65rem 0.9rem 0.65rem 0; vertical-align: top; color: #33413b; }
.doc tbody tr + tr td { border-top: 1px solid var(--rule); }
.doc td:first-child { font-weight: 600; color: var(--ink); min-width: 9rem; }
.doc-figure { margin: 1.5rem 0 0.5rem; }
.doc-figure img { width: 100%; height: auto; background: var(--surface); }
.doc-figure.narrow { max-width: 22rem; }
.doc-figure.doc-cover { margin-top: 2rem; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.doc-gallery { list-style: none; margin: 1.5rem 0 0.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem 0.9rem; }
.doc-gallery figure { margin: 0; }
.doc-gallery button { all: unset; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; cursor: zoom-in; background: #0d1512; }
.doc-gallery button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.doc-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .doc-gallery button:hover img { transform: scale(1.03); } }
.doc-gallery figcaption { margin-top: 0.4rem; color: var(--ink); font-weight: 500; }
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .doc-side, .doc-side nav { min-width: 0; }
  .doc-side { position: static; gap: 1rem; }
  /* the contents become one swipeable row of links above the guide */
  .doc-side ol { display: flex; gap: 0.5rem; overflow-x: auto; border-left: 0; padding-bottom: 0.4rem; scroll-snap-type: x proximity; scrollbar-width: none; }
  .doc-side ol::-webkit-scrollbar { display: none; }
  .doc-side ol a { white-space: nowrap; border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.9rem; margin: 0; scroll-snap-align: start; }
  .doc-side ol a[aria-current="true"] { border-color: var(--ink); }
  .doc-side .facts { display: none; }
  .doc-head h1 { font-size: 3.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .filters button { transition: none; }
  .button:active, .filters button:active { transform: none; }
  .doc-card img, .doc-gallery img { transition: none; }
}

/* Motion. Every effect here has one job: the hero introduces the work, content settles in as
   it is reached, previews show the plugins moving, and page changes cross-fade instead of
   cutting. Nothing hides content without JS: elements are only hidden by classes that
   site.js adds, and everything is switched off for visitors who prefer reduced motion. */

/* The header stays reachable: sticky on inner pages, and on the home page it slides back in
   once the hero has scrolled away. --header-h is measured by site.js. */
html { scroll-padding-top: calc(var(--header-h, 0px) + 1rem); }
.site-header.solid { position: sticky; top: 0; z-index: 20; background: var(--paper); }
.site-header.stuck {
  position: fixed; color: var(--ink); background: var(--paper);
  border-bottom: 1px solid var(--rule); padding-block: 1rem;
  animation: header-in 320ms var(--ease-out);
}
@keyframes header-in { from { transform: translateY(-100%); } }
.project-info, .doc-side { top: calc(var(--header-h, 0px) + 1.5rem); }
/* the html scroll-padding already clears the header */
.tool, .doc-section, .plugin { scroll-margin-top: 0; }
/* Phones held sideways have little height: the header scrolls away there */
@media (orientation: landscape) and (max-height: 520px) {
  .site-header.solid { position: static; }
  .site-header.stuck { position: absolute; animation: none; }
}

/* Page changes cross-fade (browsers without view transitions simply navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 200ms var(--ease-out) both page-out; }
::view-transition-new(root) { animation: 360ms var(--ease-out) both page-in; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: no-preference) {
  /* Home hero: the title rises out of a mask, then the line, the buttons and the cue follow */
  .hero h1 { animation: title-in 1100ms var(--ease-out) both; }
  .hero-copy p { animation: rise 800ms var(--ease-out) 180ms both; }
  .hero .actions { animation: rise 800ms var(--ease-out) 300ms both; }
  .scroll-cue { animation: fade 900ms ease 700ms both; }
  @keyframes title-in {
    from { clip-path: inset(0 -5% 100% -5%); transform: translateY(35%); }
    to { clip-path: inset(-25% -5% -35% -5%); transform: none; }
  }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
  @keyframes fade { from { opacity: 0; } }

  /* As the hero scrolls away its copy drifts up and fades, handing over to the work */
  @supports (animation-timeline: view()) {
    .hero-copy { animation: hero-exit linear both; animation-timeline: view(); animation-range: exit 0% exit 70%; }
    @keyframes hero-exit { to { opacity: 0; transform: translateY(-8vh); } }
  }

  /* Content settles in as it is reached; siblings arriving together are staggered */
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .reveal.in { opacity: 1; transform: none; }

  /* Filtering the projects: the posters that stay come back in a quick cascade */
  .work-grid li.refilter { animation: refilter 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
  @keyframes refilter { from { opacity: 0; transform: scale(0.97) translateY(10px); } }
}

/* Plugin teasers: with a mouse, the ad plays muted over its poster on hover */
.plugin-card .frame { position: relative; }
.plugin-card .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 300ms ease; pointer-events: none; }
.plugin-card.square .preview { object-position: center 85%; }
.plugin-card.playing .preview { opacity: 1; }
.plugin-card.playing img { transform: none; }

/* Back to top: appears once the first screen has scrolled away (site.js toggles .show) */
.to-top {
  position: fixed; right: max(16px, 2.5vw); bottom: max(16px, 2.5vw); z-index: 15;
  display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%;
  background: var(--ink); color: #fff; box-shadow: 0 6px 20px rgba(19, 32, 28, 0.25);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms, background-color 160ms ease, color 160ms ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { background: var(--sodium); color: var(--ink); }
.to-top:active { transform: scale(0.94); }
.to-top:focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top.show { transform: none; transition: none; } }
.top-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 100vh; pointer-events: none; }
/* The button rides down the right edge with the page, like the scrollbar thumb: at the top
   of the track at the start of the page, at the bottom at the end. Browsers without
   scroll-driven animations keep it in the bottom corner. */
@supports (animation-timeline: scroll()) {
  .to-top {
    right: max(10px, 1.2vw); bottom: auto; top: calc(var(--header-h, 0px) + 12px);
    animation: ride-scrollbar linear both; animation-timeline: scroll(root block);
  }
  @keyframes ride-scrollbar {
    from { translate: 0 0; }
    to { translate: 0 calc(100svh - var(--header-h, 0px) - 3.2rem - 24px); }
  }
}
