/* =========================================================
   CGSnack — site styles
   Type rule: Kode Mono (always UPPERCASE) for headings, menu,
   buttons and labels. IBM Plex Sans (sentence case) for reading text.
   ========================================================= */

/* fonts are served from this site (no Google Fonts round trip, so text shows sooner) */
@font-face { font-family: "Kode Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/kode-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Kode Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/kode-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.2);
  --accent: #5D3FD3;

  --mono: "Kode Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 80rem;
  --container-narrow: 64rem;
  --border: 2px;
  --space: 4.5rem;           /* one spacing value for every section; grows on bigger screens */
  --page-top: calc(var(--space) * 0.8);   /* space under the menu bar on every inner page */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; scroll-behavior: smooth; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, textarea, button { font: inherit; color: inherit; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3,
.mono {
  font-family: var(--mono);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.1;
  overflow-wrap: break-word;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 10;
  padding: 0 1rem;
  background: var(--bg);
  border-bottom: var(--border) solid var(--fg);
}
.site-header__inner {                   /* lines up with the page content below */
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  max-width: var(--container);
  margin: 0 auto;
}
.brand { display: flex; align-items: center; flex-shrink: 0; padding-right: 1rem; }
.site-nav { margin-right: -0.9rem; }
.brand img { height: 24px; width: auto; }
/* header logo, the play page's logo and the footer logo (secret link to /fun) grow a little from their centre on hover */
.brand img, .play-brand img, .footer-fun img { transform-origin: center; transition: transform 0.25s ease; }
.brand:hover img, .brand:focus-visible img,
.play-brand:hover img, .play-brand:focus-visible img,
.footer-fun:hover img, .footer-fun:focus-visible img { transform: scale(1.06); }
.footer-fun { display: inline-block; position: relative; }
/* every 10 s while the footer is on screen, an aurora band sweeps through the letters (only inside the logo) */
.footer-shine {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask: url("../images/logo.png") center / contain no-repeat; mask: url("../images/logo.png") center / contain no-repeat;
  transform-origin: center; transition: transform 0.25s ease;   /* grows with the logo on hover */
}
.footer-shine::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 240%; opacity: 0;
  background: linear-gradient(135deg, transparent 0%, transparent 27%, #7ff5e0 30%, #6fb8ff 43.3%, #9c8cff 56.7%, #d59cff 70%, transparent 73%, transparent 100%);
  transform: translateX(-90%);
}
.footer-shine.is-on::after { animation: footer-shine 0.8s ease-in-out; }
@keyframes footer-shine { from { transform: translateX(-90%); opacity: 1; } to { transform: translateX(30%); opacity: 1; } }
.footer-fun:hover .footer-shine, .footer-fun:focus-visible .footer-shine { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .footer-shine { display: none; } }
@media (prefers-reduced-motion: reduce) { .brand img, .play-brand img, .footer-fun img { transition: none; } }

/* 404 page: a quiet way into /fun (the easter egg) */
.lost-play { margin-top: 2rem; font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.08em; }
.lost-play a { color: var(--muted, #9a9a9a); text-decoration: none; transition: color 0.2s ease; }
.lost-play a:hover, .lost-play a:focus-visible { color: var(--fg, #fff); }
.site-nav { display: flex; }

.nav-link {
  display: flex;
  align-items: center;
  padding: 1rem 0.9rem;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(var(--fg), var(--fg)) bottom / 100% 0 no-repeat;
  transition: all 0.15s var(--ease);
}
.nav-link:hover { color: var(--bg); background-size: 100% 100%; }
.nav-link.is-current { background-size: 100% 3px; }
.nav-link.is-current:hover { background-size: 100% 100%; }
@media (max-width: 23rem) { .brand { display: none; } }   /* too narrow for logo + menu: hide the logo */

/* ---------- Layout ---------- */
main { position: relative; flex-grow: 1; overflow-x: clip; }   /* nothing may cause sideways scrolling */

.section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space) 1rem;
  background: var(--bg);
}
.container { width: 100%; max-width: var(--container); }
.container--narrow { max-width: var(--container-narrow); }

h2, .section-title { font-size: 2rem; }

/* section heading row: title (+ line) on the left, optional button on the right, hairline below */
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.section-head p { margin-top: 0.6rem; color: var(--muted); font-size: 1.05rem; }

/* two columns on large screens: heading + intro on the left, content on the right */
.split { display: grid; gap: 2.5rem; }
.split__aside p { margin-top: 1rem; max-width: 28rem; font-size: 1.05rem; line-height: 1.65; color: var(--muted); }

.eyebrow {
  margin-bottom: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--bg);
  color: var(--fg);
  border: var(--border) solid var(--fg);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { transform: translateY(-6px); box-shadow: 0 6px var(--fg); }
.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { box-shadow: 0 6px var(--muted); }
.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex-shrink: 0; }

/* ---------- Hero (text only, sits low on a tall screen) ---------- */
/* 3D grid (js/hero-tunnel.js): fades in over the matching still grid once it's running */
.hero-tunnel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.hero-tunnel.is-ready { opacity: 1; }
.hero {
  min-height: calc(88svh - 58px);
  justify-content: flex-end;
  /* still grid, rendered from the 3D tunnel (same camera, no shapes): shows instantly, and stays for anyone
     whose device can't run the 3D or who prefers reduced motion. Wide version for landscape, tall for portrait. */
  background: var(--bg) url("../images/grid-wide.webp") center / cover no-repeat;
}
@media (max-aspect-ratio: 1/1) { .hero { background-image: url("../images/grid-tall.webp"); } }
.hero::after {                          /* fades the grid into the black page below */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10rem;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
/* soft dark glow around the hero text, so it stays crisp when a 3D shape passes right behind it */
.hero .eyebrow, .hero h1, .hero__sub { text-shadow: 0 0 0.35rem rgba(0, 0, 0, 0.7), 0 0 1.4rem rgba(0, 0, 0, 0.85); }
.hero h1 { max-width: 13ch; font-size: 2.6rem; line-height: 1; }
.hero__sub { margin-top: 1.5rem; max-width: 34rem; font-size: 1.1rem; line-height: 1.6; color: var(--muted); }
.hero__actions {                       /* both buttons share the width of the wider one */
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.75rem;
  margin-top: 2.25rem;
}
@media (max-width: 26rem) { .hero__actions { display: grid; grid-auto-flow: row; } }   /* small phones: stacked, full width */
/* phones: the hero fills the whole first screen and sits low, so more grid shows above the title
   and the next section starts cleanly below the fold */
@media (max-width: 39.99rem) {
  .hero { min-height: calc(100svh - 58px); padding-bottom: 3.5rem; }
}

/* ---------- Work grid & cards (no frames: image + caption) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 0.75rem;
}
.work-card { display: block; }
.work-card[hidden] { display: none; }
.work-card__img { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #111; }
.work-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease), opacity 0.3s; }
.work-card:hover .work-card__img img { transform: scale(1.04); }
.work-card__tag {                       /* small play icon on video projects */
  position: absolute; top: 0.5rem; right: 0.5rem;
  display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem;
  background: var(--bg);
  font-size: 0.6rem;
}
.work-card__title {
  display: block;
  margin-top: 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
}
.work-card:hover .work-card__title { text-decoration: underline; text-underline-offset: 3px; }
.work-card__cat {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Filters (work page) ---------- */
.filters {                              /* phones: one row you can swipe sideways */
  display: flex;
  gap: 0.5rem;
  margin: 2rem -1rem 0;
  padding: 0 1rem 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters-wrap { position: relative; }
.filters-more {                          /* phones: a small grey › at the right edge of the filter row */
  position: absolute; top: 0; bottom: 0; right: -1rem; width: 5.25rem;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 0.9rem 0.5rem 0;
  color: #8c8c8c; border: 0; cursor: pointer;
  background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.85) 40%, #000 60%);
  transition: opacity 0.25s ease;
}
.filters-wrap.is-end .filters-more { opacity: 0; pointer-events: none; }
.filter {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter:hover { border-color: var(--fg); }
.filter.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- Services (numbered list, hairlines) ---------- */
.services { list-style: none; border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 3rem 1fr;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.service__num { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); padding-top: 0.2rem; }
.service h3 { font-size: 1.3rem; }
.service p { grid-column: 2; margin-top: 0.6rem; max-width: 36rem; line-height: 1.65; color: var(--muted); }

/* ---------- How we work (4 steps, side by side on desktop) ---------- */
.steps { list-style: none; display: grid; gap: 0; }
.step { padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.step:first-child { padding-top: 0; }
.step__num { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); }
.step h3 { margin-top: 0.75rem; font-size: 1.3rem; }
.step p { margin-top: 0.6rem; line-height: 1.65; color: var(--muted); }
.steps__note { margin-top: 2rem; color: var(--muted); }

/* ---------- About ---------- */
.about__lead { font-size: 1.35rem; line-height: 1.5; }
.about > p:not(.about__lead) { margin-top: 1.25rem; max-width: 40rem; line-height: 1.7; color: var(--muted); }
.principles { list-style: none; display: grid; gap: 1.5rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.principles h3 { font-size: 1.05rem; letter-spacing: 0.05em; }
.principles p { margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.6; color: var(--muted); }

/* ---------- Clients & partners ---------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 1.5rem;
}
.logo-grid li { height: 4.5rem; }
.logo-grid img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.4); }
.clients__label {
  margin: 3.5rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

/* ---------- Contact: form (main) + "prefer to talk?" (side) ---------- */
.contact { display: grid; gap: 3rem; }

.form-grid { display: grid; gap: 2rem; }
.field { display: block; }
.field span {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.field input,
.field textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 0 0.75rem;
  background: transparent;
  color: var(--fg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--fg); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2.5rem; }
/* status message: fades in next to the button, never moves anything */
.form-status { color: var(--accent); font-size: 1rem; opacity: 0; transition: opacity 0.2s ease; }
.form-status.is-visible { opacity: 1; }

.contact__direct { padding-top: 2rem; border-top: 1px solid var(--line); }
.contact__direct h3 { margin-bottom: 1.25rem; font-size: 0.85rem; letter-spacing: 0.1em; color: var(--muted); }
.contact__direct ul { display: grid; gap: 1rem; }
.contact__direct a { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; }
.contact__direct a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Page heading (work page, thank-you page) ---------- */
.page-head { padding-top: var(--page-top); padding-bottom: 2.5rem; }
.page-head h1 { font-size: 2.75rem; line-height: 1; }
.page-head__sub { margin-top: 1rem; font-size: 1.1rem; color: var(--muted); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.cta { border-top: 1px solid var(--line); }
.section--tight { padding-top: 0; }
main > .section:last-child { padding-bottom: var(--space); }   /* same space above the footer on every page */

/* ---------- Single project: info (left, sticky) + media (right) ---------- */
.project { padding-top: var(--page-top); }
.project__layout { display: grid; gap: 3rem; }     /* one column: title, details and description first, then the media full width */
.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.15s;
}
.back-link:hover { color: var(--fg); }
.project__title { margin-top: 1.5rem; font-size: 2rem; }
.project__meta {
  display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem;
  margin-top: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.project__meta dt {                      /* label: small, grey */
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.project__meta dd { margin-top: 0.35rem; font-size: 1rem; font-weight: 500; }   /* value: normal text, white */
.project__desc { margin-top: 1.5rem; max-width: 46rem; font-size: 1.05rem; line-height: 1.7; color: var(--muted); }
.project__desc p + p { margin-top: 1em; }
.project__desc a { color: var(--fg); text-decoration: underline; }
.project__credits { margin-top: 1.75rem; max-width: 46rem; }
.project__credits h2 {                   /* same small grey label as Category / Year */
  font-family: var(--mono); font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.project__credits ul { margin-top: 0.6rem; padding: 0; list-style: none; font-size: 0.95rem; line-height: 1.6; }
.project__credits li + li { margin-top: 0.25rem; }

.project__media { display: flex; flex-direction: column; gap: 1.5rem; }
.media img, .media video { width: 100%; height: auto; }
/* project media: full width, but never taller than the screen. Anything that would be taller (portrait or
   square images and videos, YouTube on short screens) scales down to fit the height and is centred. */
.project__media { --fit-h: 90vh; --fit-h: 90svh; }
.project__media .media img,
.project__media .media video { display: block; width: auto; max-width: 100%; max-height: var(--fit-h); margin: 0 auto; }
.project__media .vid { width: fit-content; max-width: 100%; margin: 0 auto; }   /* the sound button sits on the video itself */
.project__media .media iframe { width: min(100%, calc(var(--fit-h) * 16 / 9)); margin: 0 auto; }
.project__media .yt { width: min(100%, calc(var(--fit-h) * 16 / 9)); margin: 0 auto; }
.project__media .yt img { width: 100%; height: 100%; max-height: none; object-fit: cover; }   /* cover fills the 16:9 frame */
/* image + caption: the frame is exactly as wide as the image, so the caption starts at the image's left edge
   and wraps within its width (width 0 + min-width 100% stops a long caption from widening the frame) */
.project__media .media:has(> img) { width: fit-content; max-width: 100%; margin-inline: auto; }
.project__media .media:has(> img) figcaption { width: 0; min-width: 100%; }
.media--tall video { width: auto; max-width: 100%; max-height: 85vh; margin: 0 auto; }
.media figcaption { padding-top: 0.75rem; font-size: 0.9rem; color: var(--muted); }
.media iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
/* videos: "Tap for sound" button over the top-left corner (they autoplay muted) */
.vid { position: relative; }
.media--tall .vid { width: fit-content; max-width: 100%; margin: 0 auto; }
.unmute {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.unmute:hover, .unmute:focus-visible { background: #fff; color: #000; }
.unmute[hidden] { display: none; }

.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; background: var(--bg); }
.yt img { width: 100%; height: 100%; object-fit: cover; }
.yt__play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: 1rem 1.5rem;
  background: var(--bg);
  border: var(--border) solid var(--fg);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: transform 0.15s, box-shadow 0.15s;
}
.yt:hover .yt__play { transform: translate(-50%, calc(-50% - 6px)); box-shadow: 0 6px; }

.project__nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.project__nav a { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 500; line-height: 1.35; }
.project__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.project__nav a:last-child { text-align: right; }
.project__nav span { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  background: var(--bg);
  padding: 3.5rem 1rem 2rem;
  border-top: var(--border) solid var(--fg);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
}
.footer-brand img { height: 32px; width: auto; }
.footer-brand p { margin-top: 1rem; max-width: 18rem; font-size: 0.95rem; color: var(--muted); }
.footer-label { margin-bottom: 1rem; font-size: 0.8rem; letter-spacing: 0.1em; color: var(--muted); }
.footer-col p + p { margin-top: 0.4rem; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.footer-links a {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 1px;
  transition: box-shadow 0.15s var(--ease);
}
.footer-links a:hover { text-decoration: none; box-shadow: 0 4px; }
.footer-copy {
  max-width: var(--container);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Breakpoints (sm 640 / md 768 / lg 1024) ---------- */
@media (min-width: 40rem) {
  :root { --space: 6rem; }

  .hero h1 { font-size: 4rem; }
  .btn--lg { padding: 1rem 1.4rem; font-size: 1rem; }
  h2, .section-title { font-size: 2.5rem; }
  .page-head h1 { font-size: 3.75rem; }
  .project__title { font-size: 2.75rem; }

  .work-grid { gap: 2.5rem 1.25rem; }
  .work-card__title { font-size: 1rem; }
  .work-card__tag { top: 0.75rem; right: 0.75rem; width: 2rem; height: 2rem; font-size: 0.7rem; }

  .filters { flex-wrap: wrap; overflow: visible; margin: 2rem 0 0; padding: 0; }
  .filters-more { display: none; }

  .logo-grid { grid-template-columns: repeat(4, 1fr); gap: 2.5rem 2rem; }
  .logo-grid li { height: 5.5rem; }

  .form-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
  .principles { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .form-grid .full { grid-column: 1 / -1; }

  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

@media (min-width: 48rem) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .service { grid-template-columns: 4rem 1fr; }
}

@media (min-width: 64rem) {
  :root { --space: 7.5rem; }

  .hero h1 { font-size: 5.5rem; }
  .hero__sub { font-size: 1.2rem; }
  h2, .section-title { font-size: 3rem; }
  .page-head h1 { font-size: 4.5rem; }

  .split { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: start; }
  .split__aside { position: sticky; top: 2rem; }

  .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .step, .step:first-child { padding: 1.5rem 0 0; border-bottom: 0; border-top: 1px solid var(--fg); }
  .about__lead { font-size: 1.6rem; }

  .contact { grid-template-columns: 8fr 4fr; gap: 4rem; align-items: start; }
  .contact__direct { padding: 0 0 0 2.5rem; border-top: 0; border-left: 1px solid var(--line); }

  .project__layout { gap: 4rem; }
  .project__title { font-size: 2.75rem; }

  .logo-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Pixel cursor (enabled by js/site.js on mouse devices) ---------- */
html.has-pixel-cursor,
html.has-pixel-cursor * { cursor: none !important; }

#pixel-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  width: 12px;
  height: 12px;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: width 0.15s ease, height 0.15s ease, opacity 0.15s ease;
}
#pixel-cursor.is-link  { width: 6px; height: 6px; }
#pixel-cursor.is-input { width: 4px; height: 26px; }
#pixel-cursor.is-visible { opacity: 1; }
#pixel-cursor.is-plain { mix-blend-mode: normal; }   /* over the 3D hero: no per-frame blending */
#pixel-cursor.is-hidden { opacity: 0; }
/* videos and embedded players use the normal cursor (their controls need it) */
html.has-pixel-cursor video,
html.has-pixel-cursor iframe { cursor: auto !important; }

/* respect "reduce motion" settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Update-portfolio page (update.html) ---------- */
.howto { list-style: none; max-width: 48rem; margin-top: 3rem; display: grid; gap: 2.5rem; }
.howto li { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.howto h2 { font-size: 1.1rem; letter-spacing: 0.05em; }
.howto p { margin-top: 0.9rem; line-height: 1.7; color: var(--muted); }
.howto b { color: var(--fg); font-weight: 500; }
.howto a:not(.btn) { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.howto__small { font-size: 0.9rem; }
.bookmarklet { cursor: grab; }

/* ---------- Stills band (two big renders on the home page) ---------- */
.stills__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.still { display: block; }
.still img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: #111; transition: opacity 0.3s; }
.still:hover img { opacity: 0.85; }
.still__cap {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s;
}
.still:hover .still__cap { color: var(--fg); }
@media (min-width: 40rem) { .stills__grid { gap: 1.25rem; } .still__cap { font-size: 0.85rem; } }

/* ---------- Keyboard focus: clear outline for Tab users only (mouse users never see it) ---------- */
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.field input:focus-visible,
.field textarea:focus-visible { outline: none; }        /* fields already show focus with their underline */
.btn--solid:focus-visible { outline-offset: 4px; }
.sr-only:focus {                                          /* "skip to content" link appears when tabbed to */
  position: fixed; top: 0.5rem; left: 0.5rem; z-index: 100;
  width: auto; height: auto; margin: 0; padding: 0.75rem 1rem;
  clip: auto; overflow: visible; white-space: normal;
  background: var(--fg); color: var(--bg);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em;
}


/* ---------- Phones: shorter home page ---------- */
@media (max-width: 47.99rem) {
  .work-grid[data-limit] .work-card:nth-child(n+5) { display: none; }   /* 4 recent projects instead of 6 */
  .still__cap { font-size: 0.7rem; }
  .still__cap > span { display: none; }                                   /* no arrow: captions stay on one line */
}

/* ---------- Work page: Everything | Projects switch, masonry wall, large view ---------- */
/* the switch reads as tabs (big text, underline, a line under the row), so it doesn't look like another filter */
.view-switch { display: flex; gap: 2rem; margin-top: 2.5rem; border-bottom: 1px solid var(--line); }
.view-btn {
  position: relative;
  padding: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg);
  opacity: 0.45;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.view-btn::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--fg); transform: scaleX(0); transition: transform 0.2s; }
.view-btn:hover { opacity: 0.8; }
.view-btn.is-active { opacity: 1; }
.view-btn.is-active::after { transform: scaleX(1); }
.view-switch + .filters, .view-switch + .filters-wrap > .filters { margin-top: 1.5rem; }
.gallery[hidden], .work-grid[hidden], .gallery__item[hidden] { display: none; }
.gallery { columns: 2; column-gap: 0.75rem; }
@media (min-width: 48rem) { .gallery { columns: 3; column-gap: 1rem; } }
@media (min-width: 80rem) { .gallery { columns: 4; } }
.gallery__item {
  position: relative; display: block; width: 100%; margin: 0; padding: 0;
  /* the space under each piece is a see-through border, not a margin: Safari moves a margin that falls at the
     bottom of a column to the top of the next one, which pushed the right column down */
  border: 0; border-bottom: 0.75rem solid transparent; background: #111; background-clip: padding-box;
  cursor: pointer; break-inside: avoid; overflow: hidden;
}
@media (min-width: 48rem) { .gallery__item { border-bottom-width: 1rem; } }
.gallery__item img { display: block; width: 100%; height: auto; transition: transform 0.4s ease, opacity 0.3s ease; }
.gallery__item:hover img, .gallery__item:focus-visible img { transform: scale(1.03); opacity: 0.85; }
.gallery__title {                         /* project name, shown on hover */
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem 0.75rem 0.65rem;
  font-size: 0.85rem; font-weight: 500; text-align: left; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  opacity: 0; transition: opacity 0.25s ease;
}
.gallery__item:hover .gallery__title, .gallery__item:focus-visible .gallery__title { opacity: 1; }
.gallery__item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: none) { .gallery__title { opacity: 1; } }   /* phones: always show the name */

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 3.5rem 4rem 1.5rem; background: rgba(0, 0, 0, 0.94);
}
.lightbox[hidden] { display: none; }
.lightbox__stage { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lightbox__stage img, .lightbox__stage video { display: block; max-width: 100%; max-height: calc(100svh - 8rem); width: auto; height: auto; }
.lightbox__yt { width: min(90vw, (100svh - 8rem) * 16 / 9); aspect-ratio: 16 / 9; }
.lightbox__yt iframe { display: block; width: 100%; height: 100%; border: 0; }
.lightbox__stage figcaption {
  display: flex; justify-content: space-between; gap: 1.5rem; width: 100%; padding-top: 0.85rem;
  font-size: 0.9rem; color: var(--muted);
}
.lightbox__stage figcaption a { color: var(--fg); white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.lightbox__close, .lightbox__nav {
  position: absolute; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  font-family: var(--mono); font-size: 1.4rem; color: #fff; background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4); cursor: pointer; transition: background 0.2s, color 0.2s;
}
.lightbox__close:hover, .lightbox__nav:hover, .lightbox__close:focus-visible, .lightbox__nav:focus-visible { background: #fff; color: #000; }
.lightbox__close { top: 0.75rem; right: 0.75rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 0.75rem; }
.lightbox__nav--next { right: 0.75rem; }
@media (max-width: 39.99rem) {             /* phones: arrows at the bottom, swipe also works */
  .lightbox { padding: 3.5rem 0.75rem 4.5rem; }
  .lightbox__nav { top: auto; bottom: 0.75rem; transform: none; }
}
html.lightbox-open { overflow: hidden; }
