/* ==========================================================================
   Dominik Lyko — Portfolio
   Design grid is based on a 1600px artboard; sizes scale with the viewport.
   ========================================================================== */

:root {
  --bg: #000;
  --fg: #fff;
  --muted: #7a7a7a;
  --faint: #4a4a4a;
  --line: #222;
  --ghost: #0d0d0d;

  --gutter: clamp(16px, 3.3vw, 64px);
  --fs-sm: clamp(14px, 1.19vw, 20px);
  --fs-md: clamp(16px, 1.25vw, 22px);
  --fs-lg: clamp(26px, 2.3vw, 44px);
  --fs-xl: clamp(34px, 3.4vw, 66px);

  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h, 80px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Switzer", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: var(--fs-sm);
  line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
sup { font-size: .55em; vertical-align: top; position: relative; top: -.15em; margin-left: .35em; letter-spacing: .05em; }
::selection { background: #fff; color: #000; }

.dot {
  display: inline-block;
  width: .45em; height: .45em;
  border-radius: 50%;
  background: #3dff8a;
  margin-right: .55em;
  vertical-align: .12em;
}

/* Underline-on-hover links */
.nav a, .link, .footer a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .45s var(--ease), color .3s;
}
.nav a:hover, .link:hover, .footer a:hover { background-size: 100% 1px; }
/* Nav links are grid cells; shrink them to their text so the underline does too */
.nav a { width: fit-content; }
.link--muted { color: var(--muted); }
.link--muted:hover { color: var(--fg); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  padding: var(--nav-h, 140px) var(--gutter) clamp(40px, 6vw, 110px);
}

/* Fixed on every page; compacts and gains a backdrop once scrolled */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 278fr 388fr 506fr 240fr auto;
  align-items: start;
  padding: clamp(20px, 2.9vw, 52px) var(--gutter) clamp(14px, 1.4vw, 24px);
  transition: padding .5s var(--ease);
}
.nav.is-scrolled { padding-top: clamp(14px, 1.4vw, 24px); }
.nav__services ul { margin-top: .55em; padding-left: .85em; max-height: 8em; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s, margin .5s var(--ease); }
.nav.is-scrolled .nav__services ul { max-height: 0; margin-top: 0; opacity: 0; }
.nav.is-measuring, .nav.is-measuring * { transition: none !important; }
.nav__services li { line-height: 1.5; }
.nav__email { justify-self: end; }

.hero__stage {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 calc(var(--gutter) * -1);
  min-height: clamp(280px, 36vw, 640px);
}
/* Full-viewport particle cloud behind the nav, work strip and hero text */
.hero__nebula {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
}
.hero__stage, .hero__bottom { z-index: 1; }
.js .hero__nebula { opacity: 0; transition: opacity 2.6s ease .2s; }
.js .hero__nebula.is-ready { opacity: 1; }

.strip {
  --marquee-duration: 58s; /* scales with tile count (14) to keep speed */
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}
/* Infinite marquee: main.js appends one copy of the tiles, so sliding the
   track by -50% lands exactly on the start of the copy. Tiles use
   margin-right (not gap) so both halves are the same width. */
.strip__track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-duration, 25s) linear infinite;
  will-change: transform;
}
.strip:hover .strip__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }
.strip__tile {
  flex: 0 0 23.6vw;
  margin-right: .6vw;
  aspect-ratio: 377 / 183;
  overflow: hidden;
  background: #fff;
}
.strip__tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .9s var(--ease);
}
.strip__tile:hover img { transform: scale(1.06); }

.hero__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
.hero__title {
  max-width: 12.4em;
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.hero__intro { max-width: 25em; padding-top: .4em; }
.hero__intro p { line-height: 1.3; }
.hero__cta { display: flex; gap: 2em; margin-top: 1.7em; }

/* ============ WORK ============ */
.work { padding: clamp(80px, 14vw, 260px) var(--gutter) 0; }
.project { padding-bottom: clamp(100px, 20vw, 380px); scroll-margin-top: 40px; }

.project__head {
  display: grid;
  grid-template-columns: 360fr 310fr 740fr auto;
  grid-template-areas:
    "title cat services year"
    "links links services year";
  align-items: start;
  row-gap: clamp(16px, 1.6vw, 30px);
  margin-bottom: clamp(28px, 3.5vw, 64px);
  font-size: var(--fs-md);
}
.project__title {
  grid-area: title;
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}
.project__title .num {
  font-size: .38em;
  letter-spacing: 0;
  vertical-align: top;
  margin-right: .45em;
  position: relative;
  top: .1em;
}
.project__cat { grid-area: cat; padding-top: .3em; }
.project__services { grid-area: services; padding-top: .3em; line-height: 1.38; }
.project__year { grid-area: year; padding-top: .3em; }
.project__links { grid-area: links; display: flex; gap: .9em; }

/* Arrow sits in the top-right corner with equal top and right spacing (--p). */
.btn {
  --p: .24em;
  display: inline-flex;
  align-items: flex-start;
  gap: .32em;
  padding: var(--p) var(--p) calc(var(--p) + .02em) .4em;
  border: 1.5px solid currentColor;
  line-height: 1.1;
  transition: background .3s, color .3s, opacity .9s var(--ease) var(--b, 0ms), transform .9s var(--ease) var(--b, 0ms);
}
.btn svg {
  flex: none;
  width: .5em; height: .5em;
  overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  transition: transform .35s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:hover svg { transform: translate(2px, -2px); }

.collage {
  position: relative;
  aspect-ratio: var(--ratio);
}
.collage figure {
  position: absolute;
  left: calc(var(--l) * 1%);
  top: calc(var(--t) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  overflow: hidden;
  background: #0b0b0b;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s var(--ease);
}
.collage figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transition: transform 1.6s var(--ease);
}
.collage.is-in figure { clip-path: inset(0 0 0 0); }
.collage.is-in figure img { transform: scale(1); }
.collage.is-in figure:hover img { transform: scale(1.035); transition-duration: .9s; }
/* Lottie previews: the fallback image sits in the box until the animation draws */
.collage figure .lottie-box { transform: scale(1.12); transition: transform 1.6s var(--ease); }
.collage figure .lottie-box img { transform: none; }
.collage.is-in figure .lottie-box { transform: scale(1); }
.collage.is-in figure:hover .lottie-box { transform: scale(1.035); transition-duration: .9s; }
.collage figure:nth-child(2) { transition-delay: .12s; }
.collage figure:nth-child(3) { transition-delay: .24s; }
.collage figure:nth-child(4) { transition-delay: .36s; }
.collage figure:nth-child(2) img { transition-delay: .12s; }
.collage figure:nth-child(3) img { transition-delay: .24s; }
.collage figure:nth-child(4) img { transition-delay: .36s; }

/* ============ SERVICES ============ */
.services { position: relative; }
.services__sticky {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.services__ghost {
  position: absolute;
  font-size: clamp(110px, 17vw, 330px);
  font-weight: 600;
  letter-spacing: -0.05em;
  color: var(--ghost);
  line-height: 1;
  user-select: none;
  white-space: nowrap;
  transform: translateY(.06em);
}
.services__list {
  position: relative;
  text-align: center;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.22;
}
.services__list li { color: var(--fg); cursor: default; }

/* ============ GALLERY / ARCHIVE ============ */
.gallery { padding: clamp(60px, 8vw, 140px) var(--gutter) clamp(100px, 16vw, 300px); }
.gallery__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 1.1em;
  margin-bottom: clamp(16px, 1.2vw, 24px);
  border-bottom: 1px solid var(--line);
}
.gallery__title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.gallery__filters { display: flex; flex-wrap: wrap; gap: .4em 1.8em; }
.gallery__filters button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .3s;
}
.gallery__filters button:hover, .gallery__filters button.is-active { color: var(--fg); }

/* Scattered editorial layout (cipher.tv-style). Each frame gets a column
   start/span, row and vertical offset from main.js on a 24-column grid. */
.gallery { position: relative; }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  column-gap: 0;
  row-gap: clamp(64px, 9vw, 170px);
  align-items: start;
  margin-top: clamp(60px, 8vw, 140px);
  transition: opacity .35s var(--ease);
}
.gallery__grid.is-swapping { opacity: 0; }

.gallery__item {
  display: block;
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.gallery__item[hidden] { display: none; }
.gallery__media {
  display: block;
  aspect-ratio: 916 / 560;
  overflow: hidden;
  background: #0d0d0d;
}
.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.gallery__item:hover img { transform: scale(1.03); }

/* 3D entry: frames start tilted back and pushed into depth, then swing up.
   --side (set in main.js) is 1 for left frames, -1 for right, 0 for centred. */
.gallery__item { perspective: 1400px; }
.gallery__media {
  transform-origin: 50% 100%;
  transform: translate3d(0, 110px, -220px) rotateX(32deg) rotateY(calc(var(--side, 0) * 16deg));
  opacity: 0;
  transition: transform 1.5s cubic-bezier(.16, .84, .24, 1), opacity 1s var(--ease);
}
.gallery__item.is-in .gallery__media { transform: none; opacity: 1; }
.gallery__item:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 4px; }

.gallery__cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  margin-top: .75em;
  opacity: 0;
  transition: opacity .8s var(--ease) .35s;
}
.gallery__item.is-in .gallery__cap { opacity: 1; }
.gallery__num { font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.gallery__num::before {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-right: 6px;
  vertical-align: middle;
  background: currentColor;
}
.gallery__name {
  font-size: clamp(14px, 1.15vw, 19px);
  text-transform: uppercase;
  letter-spacing: .01em;
  transition: transform .5s var(--ease);
}
.gallery__item:hover .gallery__name { transform: translateX(-6px); }

/* small mark that stays centred in the viewport while the archive scrolls */
.gallery__mark {
  position: sticky;
  top: 50vh;
  z-index: 3;
  display: block;
  width: max-content;
  height: 0;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 0;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: clamp(16px, 3vw, 48px);
  background: rgba(0, 0, 0, .94);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.lightbox__figure { grid-column: 2; display: grid; justify-items: center; gap: 14px; min-width: 0; }
.lightbox__figure img { max-width: 100%; max-height: calc(100svh - 140px); object-fit: contain; }
.lightbox__figure figcaption { color: var(--muted); font-size: 14px; letter-spacing: 0; }
.lightbox button { font: inherit; color: var(--fg); background: none; border: 0; cursor: pointer; padding: 8px; }
.lightbox button:hover { color: var(--muted); }
.lightbox__close { position: absolute; top: clamp(12px, 2vw, 28px); right: clamp(12px, 2vw, 32px); }
.lightbox__prev { grid-column: 1; }
.lightbox__next { grid-column: 3; }
body.is-locked { overflow: hidden; }

/* ============ FOOTER ============ */
.footer { padding: 0 var(--gutter) clamp(20px, 2vw, 32px); font-size: clamp(13px, 1vw, 16px); }
.footer__grid {
  display: grid;
  grid-template-columns: 290fr 90fr 137fr 137fr 63fr 138fr;
  column-gap: 14px;
  padding-bottom: clamp(60px, 6vw, 110px);
}
.footer__col { border-top: 1px solid #3a3a3a; padding-top: 1.1em; }
.footer__col:nth-child(2) { grid-column: 3; }
.footer h3 { font: inherit; font-weight: 500; margin-bottom: 2.1em; }
.footer ul { line-height: 1.75; }
.footer .is-muted { color: var(--muted); line-height: 1.45; margin-top: .3em; }
.footer li svg { width: .55em; height: .55em; margin-left: .3em; fill: none; stroke: currentColor; stroke-width: 1.5; }
.footer__email { display: inline-block; font-size: clamp(20px, 1.75vw, 30px); letter-spacing: -0.02em; line-height: 1.2; }
.footer__phone { display: table; margin-top: .9em; }
.footer__cta {
  display: inline-block;
  margin-top: 1.9em;
  padding: .95em 1.1em;
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
  transition: background .3s, opacity .9s var(--ease) var(--b, 0ms), transform .9s var(--ease) var(--b, 0ms);
}
.footer .footer__cta { background: var(--fg); }
.footer .footer__cta:hover { background: #cfcfcf; }
.footer__note { margin-top: 1.4em; color: var(--muted); }
.footer .dot { width: .4em; height: .4em; margin-right: .8em; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 1em;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer__top { color: var(--fg); }


/* ============ SPLIT-LINE HEADLINES ============ */
/* main.js wraps each rendered line in .split-line > span; lines rise from a mask. */
.js [data-split]:not(.is-split), .js [data-split-children]:not(.is-split) { visibility: hidden; }
.split-line {
  display: block;
  overflow: hidden;
  /* headroom so raised counters (sup) and arrow icons aren't clipped */
  padding: .2em 0 .12em;
  margin: -.2em 0 -.12em;
}
.split-line > span {
  display: block;
  position: relative;
  transform: translate3d(0, 115%, 0);
  /* --i: line within the element, --d: fixed offset, --b: ripple order within a batch */
  transition: transform 1.1s cubic-bezier(.2, .75, .1, 1) calc(var(--i, 0) * 90ms + var(--d, 0ms) + var(--b, 0ms));
}
/* buttons fade (and lift slightly) instead of splitting */
.js [data-fade]:not(.is-split-in) { opacity: 0; transform: translateY(8px); }

/* inline hosts need a box for the block-level masks */
:where(a[data-split]:not(.btn), span[data-split]) { display: inline-block; } /* zero specificity: component display rules still win */
.services__ghost .split-line { padding-bottom: .2em; margin-bottom: -.2em; }
.is-split-in .split-line > span { transform: none; }
.services__list .split-line { margin-inline: auto; }
/* Hero intro: lines step by --line-gap; main.js sets each element's start (--b) */
.hero .split-line > span { transition-delay: calc(var(--i, 0) * var(--line-gap, 90ms) + var(--b, 0ms)); }
.hero__title { --line-gap: 160ms; }

/* Marquee tiles rise in left to right after the nav */
.js .strip__tile {
  clip-path: inset(100% 0 0 0);
  transform: translateY(40px);
  transition: clip-path 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(400ms + var(--t, 0) * 110ms);
}
.js .strip.is-in .strip__tile { clip-path: inset(0); transform: none; }

/* ============ REVEAL ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }
.hero [data-reveal] { animation: rise 1.2s var(--ease) .25s both; opacity: 1; transform: none; transition: none; }
.hero .hero__intro { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

@media (prefers-reduced-motion: reduce) {
  .strip__track, .strip__tile, .hero__nebula, [data-reveal], .collage figure, .collage figure img, .collage figure .lottie-box, .gallery__media, .split-line > span, [data-fade], .gallery__cap, .lightbox { transition: none !important; animation: none !important; opacity: 1; transform: none; clip-path: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .nav { grid-template-columns: 1fr auto; row-gap: 6px; }
  .nav__status { grid-column: 1; grid-row: 2; color: var(--muted); }
  .nav__services, .nav__work { display: none; }
  .nav__email { grid-column: 2; grid-row: 1; }

  .strip__tile { flex-basis: 44vw; }
  .strip__tile { margin-right: 8px; }

  .hero__bottom { flex-direction: column; gap: 28px; }

  .project__head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title year"
      "cat cat"
      "services services"
      "links links";
    row-gap: 12px;
  }
  .project__services { color: var(--muted); }

  .collage { aspect-ratio: auto; display: grid; gap: 8px; }
  .collage figure { position: static; width: 100%; height: auto; aspect-ratio: 2 / 1; }

  .gallery__head { flex-direction: column; align-items: flex-start; }
  .gallery__grid { row-gap: 56px; }
  .gallery__mark { display: none; }
  .lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .lightbox__figure { grid-column: 1 / -1; grid-row: 1; }
  .lightbox__prev { grid-column: 1; grid-row: 2; justify-self: start; }
  .lightbox__next { grid-column: 2; grid-row: 2; justify-self: end; }

  .footer__grid { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .footer__contact { grid-column: 1 / -1; }
  .footer__col:nth-child(2) { grid-column: auto; }
}

@media (max-width: 600px) {
  .strip__tile { flex-basis: 72vw; }
}

/* ==========================================================================
   CASE STUDY (novae.html)
   ========================================================================== */
.cs-top { padding: var(--nav-h, 80px) var(--gutter) 0; }
.cs-back { color: var(--muted); }

.cs-hero { margin-top: clamp(90px, 13vw, 240px); }
.cs-eyebrow { color: var(--muted); margin-bottom: 1.2em; }
.cs-title {
  max-width: 13ch;
  font-size: clamp(42px, 6.4vw, 124px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -0.05em;
}
.cs-hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6vw;
  margin-top: clamp(40px, 5vw, 90px);
}
.cs-lede { max-width: 30em; font-size: var(--fs-md); line-height: 1.4; }
.cs-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6em 2em; margin: 0; }
.cs-meta dt { color: var(--muted); margin-bottom: .35em; }
.cs-meta dd { margin: 0; }
.cs-live { margin-top: clamp(28px, 3vw, 52px); font-size: var(--fs-md); }

.cs-figure { margin: 0; overflow: hidden; background: #0b0b0b; }
.cs-figure img { width: 100%; height: 100%; object-fit: cover; }
.cs-figure--bleed { margin: clamp(48px, 6vw, 110px) var(--gutter) 0; }

/* Sections: label on the left, content on the right */
.cs-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  column-gap: 4vw;
  padding: clamp(90px, 11vw, 200px) var(--gutter) clamp(40px, 4vw, 70px);
}
.cs-num { color: var(--muted); padding-top: .5em; }
.cs-h2 {
  max-width: 17ch;
  margin-bottom: .8em;
  font-size: clamp(30px, 3.4vw, 62px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.cs-body > p { max-width: 36em; margin-bottom: 1.1em; font-size: var(--fs-md); line-height: 1.45; color: #cdcdcd; }
.cs-body b { color: var(--fg); font-weight: 500; }

.cs-goals { margin-top: 2.2em; font-size: var(--fs-md); }
.cs-goals li { display: grid; grid-template-columns: 2.6em 1fr; align-items: baseline; padding: .9em 0; border-top: 1px solid var(--line); }
.cs-goals .k { color: var(--muted); font-size: .75em; }

.cs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2em 2.5vw; margin-top: 2.6em; }
.cs-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-card { border-top: 1px solid #333; padding-top: 1.1em; }
.cs-card h3 { margin-bottom: .6em; font-size: var(--fs-md); font-weight: 500; }
.cs-card p { color: var(--muted); line-height: 1.45; }

.cs-list { margin: 1.6em 0; font-size: var(--fs-md); }
.cs-list li { padding: .85em 0; border-top: 1px solid var(--line); color: #cdcdcd; line-height: 1.4; }

.cs-shipped { margin: .6em 0 2.2em; font-size: var(--fs-md); }
.cs-shipped li { display: grid; grid-template-columns: 7em 1fr; align-items: baseline; padding: .9em 0; border-top: 1px solid var(--line); }
.cs-shipped .k { color: var(--muted); }

/* Image rows between sections */
.cs-gallery { display: grid; gap: 1vw; padding: 0 var(--gutter); }
.cs-gallery--2 { grid-template-columns: 1fr 1fr; }
.cs-figure--span { grid-column: 1 / -1; }
.cs-gallery .cs-figure img { aspect-ratio: 16 / 10; }

.cs-phones { display: flex; justify-content: center; gap: 3vw; padding: 0 var(--gutter); }
.cs-phone { margin: 0; width: min(24vw, 320px); border: 6px solid #1c1c1c; border-radius: 30px; overflow: hidden; background: #0c0d11; }
.cs-phone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; }

/* ---- Moodboard ---- */
.cs-board {
  grid-column: 1 / -1;
  margin: clamp(40px, 5vw, 90px) 0 0;
  padding: clamp(8px, 1vw, 18px);
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
}
.cs-board img { width: 100%; height: auto; }
/* Capped near the source image's width so lower-res boards stay sharp */
.cs-board--narrow { width: min(100%, 880px); margin-inline: auto; }
.cs-takeaways {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.2em 2.5vw;
  margin-top: clamp(32px, 3.5vw, 60px);
}
.cs-swatches {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: clamp(160px, 14vw, 260px) clamp(56px, 4.5vw, 84px) auto;
  gap: .8vw;
  margin-top: clamp(32px, 3.5vw, 60px);
}
.mb--palette { display: flex; }
.mb--palette span {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: .6em .4em;
  background: var(--c);
  font-size: clamp(9px, .62vw, 12px);
  line-height: 1.3;
  letter-spacing: 0;
}
.mb--palette span.is-light { color: #0c0d11; }
.mb--type { display: flex; flex-direction: column; justify-content: space-between; padding: 1.2em; background: #121318; overflow: hidden; }
.mb-type__big { font-family: "Matter", "Switzer", system-ui, sans-serif; font-size: clamp(40px, 5vw, 96px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.mb-type__label { color: var(--muted); font-size: 13px; }
.mb-type__mono { font-family: "Geist Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .08em; color: #5c7aff; }
.mb--horizon {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  padding: .6em .8em;
  background: linear-gradient(90deg, #05060a 0%, #061641 22%, #0d2c82 40%, #1e4bbe 58%, #3a6ce8 74%, #5b8dfb 88%, #a9b4ff 100%);
  font-size: clamp(9px, .62vw, 12px);
}

.mb--scale {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 1.2em;
  list-style: none;
  background: #05060a;
  border: 1px solid #17181b;
}
.mb--scale li {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1.5em;
  padding: 1.1em 0;
  border-top: 1px solid #17181b;
}
.mb--scale li:first-child { border-top: 0; }
.mb-scale__tag, .mb-scale__spec { font-family: "Geist Mono", ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: .06em; color: #a3aab9; text-transform: uppercase; }
.mb-scale__sample {
  font-family: "Matter", "Switzer", system-ui, sans-serif;
  font-size: min(calc(var(--s) * 1px), calc(var(--s) * .1vw + 6px));
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #f2f4f8;
  overflow-wrap: anywhere;
}
.mb-scale__sample.is-mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; letter-spacing: .08em; color: #5c7aff; }

/* ---- Lottie boxes ---- */
.lottie-box { position: relative; width: 100%; height: 100%; overflow: hidden; }
.lottie-box > svg { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.lottie-box.is-lottie > img { visibility: hidden; }
.cs-figure--wide { aspect-ratio: 16 / 9; }

/* ---- Video and natural-ratio figures ---- */
.cs-figure video { display: block; width: 100%; height: auto; }
.cs-figure--natural img { height: auto; }
.cs-gallery .cs-figure--natural img { aspect-ratio: auto; }

/* ---- Corelogic: terminal type, alert yellow ---- */
/* VT323 stands in for VCR OSD Mono, which isn't on a public font CDN */
.cs--corelogic .mb--palette span:first-child { box-shadow: inset 0 0 0 1px #1f1f1f; }
.cs--corelogic .mb--type { background: #000; border: 1px solid #1f1f1f; }
.cs--corelogic .mb-type__big { font-family: "VT323", "IBM Plex Mono", monospace; font-weight: 400; letter-spacing: 0; }
.cs--corelogic .mb-type__mono { font-family: "IBM Plex Mono", ui-monospace, monospace; color: #dee50d; }
.cs--corelogic .mb--horizon {
  background: repeating-linear-gradient(-45deg, #dee50d 0 14px, #000 14px 28px);
  color: #000;
}
.cs--corelogic .mb--horizon span { background: #dee50d; padding: .2em .5em; }
.cs--corelogic .mb--scale { background: #000; border-color: #1f1f1f; }
.cs--corelogic .mb--scale li { border-color: #1f1f1f; }
.cs--corelogic .mb-scale__sample { font-family: "IBM Plex Mono", ui-monospace, monospace; color: #fafcfc; }
.cs--corelogic .mb-scale__sample.is-display { font-family: "VT323", "IBM Plex Mono", monospace; text-transform: uppercase; line-height: 1; }
.cs--corelogic .mb-scale__sample.is-mono { font-family: "IBM Plex Mono", ui-monospace, monospace; color: #dee50d; }

/* ---- Trace: soft, noisy, blurred ---- */
/* Soft corners on every brand tile */
.cs--trace .mb--palette, .cs--trace .mb--type, .cs--trace .mb--scale { border-radius: 20px; overflow: hidden; }
.cs--trace .mb--palette span:nth-child(-n+3) { color: #080c0d; }
.cs--trace .mb--type { background: #effafc; color: #080c0d; }
.cs--trace .mb-type__big {
  font-family: "Zalando Sans", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #080c0d 30%, #3d6b78);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cs--trace .mb-type__label { color: #4b5a5e; }
.cs--trace .mb-type__mono { color: #5679f9; }

.cs--trace .cs-swatches { grid-template-rows: clamp(160px, 14vw, 260px) auto; }
.cs--trace .mb--scale { background: #effafc; border-color: #d6e9ed; }
.cs--trace .mb--scale li { border-color: #d6e9ed; }
.cs--trace .mb-scale__tag, .cs--trace .mb-scale__spec { color: #5b6b70; }
.cs--trace .mb-scale__sample { font-family: "Zalando Sans", system-ui, sans-serif; color: #080c0d; letter-spacing: -0.02em; }
.cs--trace .mb-scale__sample.is-grad {
  background: linear-gradient(90deg, #080c0d 40%, #3d6b78);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cs--trace .mb-scale__sample.is-chip {
  justify-self: start;
  padding: .3em .8em;
  border-radius: 999px;
  background: #fbefd9;
  color: #b7791f;
  letter-spacing: 0;
}

/* ---- AI-generated wireframe options ---- */
.cs-options { grid-column: 1 / -1; width: min(100%, 920px); margin: clamp(40px, 5vw, 90px) auto 0; }
.cs-options__frame { padding: clamp(8px, 1vw, 16px); background: #0a0a0a; border: 1px solid #1f1f1f; }
.cs-options__frame img { width: 100%; height: auto; }
.cs-options__labels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2%;
  margin-top: .9em;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted);
}
.cs-options__labels em { display: block; margin-top: .3em; font-style: normal; color: #5d7bff; }
.cs-subhead { grid-column: 1 / -1; margin-top: clamp(60px, 7vw, 120px); color: var(--muted); }

/* ---- Wireframes (drawn in CSS) ---- */
.wire {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 3.4fr) minmax(0, 1.8fr);
  gap: 3vw;
  align-items: start;
  margin-top: clamp(40px, 5vw, 90px);
}
.wire__desk, .wire__phone { padding: 14px; background: #0d0d0d; border: 1px solid #262626; }
.wire__phone { border-radius: 22px; padding: 12px 10px; }
.wf {
  position: relative;
  margin-bottom: 8px;
  padding: 14px;
  border: 1px dashed #343434;
}
.wf b, .wf i, .wf em, .wf s { display: block; }
.wf b { height: 7px; background: #2b2b2b; }
.wf i { background: #1b1b1b; }
.wf em { width: 74px; height: 18px; background: #5a5a5a; }
.wf s { height: 1px; margin: 14px 0; background: #333; }
.wf .wf-l--xl { width: 62%; height: 14px; }
.wf .wf-l--lg { width: 44%; height: 11px; }
.wf .wf-l--sm { width: 34%; }
.wf-tag {
  position: absolute; top: 6px; left: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px; color: #5d7bff; letter-spacing: .05em;
}
.wf-nav { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.wf-nav i { width: 46px; height: 10px; background: #3a3a3a; }
.wf-nav b { width: 34px; height: 6px; }
.wf-nav em { width: 56px; height: 14px; margin-left: auto; }
.wf-hero { height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.wf-circle { width: 86px; height: 86px; margin-bottom: 8px; border: 1px dashed #4a4a4a; border-radius: 50%; }
.wf-logos { display: flex; justify-content: space-around; align-items: center; }
.wf-logos b { width: 9%; height: 8px; }
.wf-modules > div:first-child { display: grid; gap: 8px; margin-bottom: 14px; }
.wf-grid4, .wf-grid3, .wf-grid1 { display: grid; gap: 8px; }
.wf-grid4 { grid-template-columns: repeat(4, 1fr); height: 110px; }
.wf-grid3 { grid-template-columns: repeat(3, 1fr); height: 90px; margin-top: 14px; }
.wf-grid1 { grid-template-columns: 1fr; margin-top: 10px; }
.wf-grid1 i { height: 70px; }
.wf-statement { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.wf-how { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; height: 170px; }
.wf-int { height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.wf-arc { display: flex; gap: 12px; align-items: flex-end; }
.wf-arc i { width: 18px; height: 18px; border: 1px solid #444; background: none; }
.wf-arc i:nth-child(4) { background: #5d7bff; border-color: #5d7bff; transform: translateY(-14px); }
.wf-arc i:nth-child(3), .wf-arc i:nth-child(5) { transform: translateY(-8px); }
.wf-proof { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 64px; gap: 8px; }
.wf-proof i.is-stat { background: #1f2a5c; }
.wf-cta { height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.wf-foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; width: 100%; margin-top: 18px; }
.wf-foot i { height: 34px; }
.wf-foot i:first-child { background: #1f2a5c; }
.wire__phone .wf-hero { height: 190px; }
.wire__phone .wf-circle { width: 56px; height: 56px; }
.wire__phone .wf-logos b { width: 22%; }

.wire__notes { font-size: clamp(13px, 1vw, 16px); }
.wire__notes li { padding: .85em 0; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.4; }
.wire__notes b { display: block; margin-bottom: .2em; color: var(--fg); font-weight: 500; }

/* ---- How I work + next project ---- */
.cs-approach { border-top: 1px solid var(--line); margin: clamp(60px, 6vw, 110px) var(--gutter) 0; padding-left: 0; padding-right: 0; }
.cs-next {
  display: block;
  margin: clamp(60px, 8vw, 150px) var(--gutter) clamp(80px, 9vw, 170px);
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}
.cs-next__title {
  display: block;
  margin-top: .3em;
  font-size: clamp(48px, 9vw, 180px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  transition: transform .6s var(--ease), color .3s;
}
.cs-next:hover .cs-next__title { transform: translateX(1.5vw); color: #5d7bff; }

@media (max-width: 960px) {
  .cs-back { display: none; }
  .cs-hero__row { grid-template-columns: 1fr; gap: 36px; }
  .cs-section { grid-template-columns: 1fr; row-gap: 14px; }
  .cs-cards, .cs-cards--3 { grid-template-columns: 1fr; }
  .cs-gallery--2 { grid-template-columns: 1fr; gap: 8px; }
  .cs-phones { justify-content: flex-start; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; }
  .cs-phone { flex: 0 0 62vw; width: auto; scroll-snap-align: start; }
  /* board is detailed: show it large and let people swipe across it */
  .cs-board { margin-inline: calc(var(--gutter) * -1); border-inline: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cs-board img { width: 240vw; max-width: none; }
  .cs-board::after { content: "Swipe to explore →"; display: block; margin-top: 10px; color: var(--muted); font-size: 12px; letter-spacing: 0; position: sticky; left: 0; }
  .cs-options { width: auto; margin-inline: calc(var(--gutter) * -1); overflow-x: auto; }
  .cs-options__frame, .cs-options__labels { width: 190vw; }
  .cs-options__labels { padding: 0 var(--gutter); box-sizing: content-box; width: calc(190vw - 2 * var(--gutter)); }
  .cs-takeaways { grid-template-columns: 1fr; }
  .cs-swatches { grid-template-columns: 1fr; height: auto; }
  .cs-swatches > * { min-height: 150px; }
  .wire { grid-template-columns: 1fr; }
  .wire__phone { display: none; }
  .wf-hero { height: 180px; }
}

/* ---- Particle explorations (TouchDesigner tiles) ---- */
.cs-explore {
  grid-column: 1 / -1;
  margin: clamp(40px, 5vw, 90px) 0 0;
  padding: clamp(8px, 1vw, 18px);
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
}
.cs-explore ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, .6vw, 12px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-explore li { flex: 0 0 clamp(84px, 9.4vw, 170px); }
.cs-explore img { width: 100%; aspect-ratio: 188 / 272; object-fit: cover; }
