/* DUNE STUDIOS — main stylesheet
   Layout/interaction modelled on the PORTOROCHA-SPEC (see _reference/).
   Dark theme is the token default; html.light flips all color vars. */

:root {
  --br: 16px;
  --br2: 8px;
  --pd: 16px;
  --pd2: 8px;
  --pd3: 4px;
  --color-black: #000;
  --color-white: #e2e6e3;
  --color-blue: #007aff;
  --color-gray10: hsla(135, 7%, 89%, .1);
  --color-gray20: hsla(135, 7%, 89%, .2);
  --color-gray30: hsla(135, 7%, 89%, .3);
  --color-gray50: hsla(135, 7%, 89%, .5);
  --color-white-hover: hsla(135, 7%, 89%, .5);
  --color-gray10-hover: hsla(135, 7%, 89%, .2);
  --color-gray50-hover: #e2e6e3;
  --color-card: #1a1a1a;
  --color-icon-hover: #ffffff3d;
  --color-scrim: rgba(0, 0, 0, .5);
  --color-link-dim: #ffffff80;
  --nav-width: clamp(368px, 346.67px + 2.78vw, 400px);
}

html.light {
  --color-black: #fff;
  --color-white: #000;
  --color-gray10: rgba(0, 0, 0, .04);
  --color-gray20: rgba(0, 0, 0, .2);
  --color-gray30: rgba(0, 0, 0, .3);
  --color-gray50: rgba(0, 0, 0, .5);
  --color-white-hover: rgba(0, 0, 0, .5);
  --color-gray10-hover: rgba(0, 0, 0, .08);
  --color-gray50-hover: #000;
  --color-card: #f5f5f5;
  --color-icon-hover: #0000001f;
  --color-scrim: rgba(255, 255, 255, .6);
  --color-link-dim: #00000080;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

html:not(.visible) body { opacity: 0; }

body {
  background: var(--color-black);
  color: var(--color-white);
  font-family: 'Neue Haas Unica Pro', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 125%;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .5s, color .5s;
}

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

a, h2, h3, p, button, .page__card, .page__button {
  transition: color .5s, background-color .5s;
}

.display {
  font-size: 23px;
  letter-spacing: .45px;
  line-height: 27px;
}

.mono {
  font-family: 'CS Claire Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ============ shell ============ */

main.wrapper { display: flex; min-height: 100svh; }

.nav {
  flex-shrink: 0;
  width: var(--nav-width);
  position: sticky;
  top: 0;
  max-height: 100svh;
  overflow-y: auto;
  padding: var(--pd2);
  padding-right: 0;
}

.content { flex: auto; min-width: 0; }
.page__container { padding: var(--pd2); }

/* ============ nav ============ */

.nav__inner { display: flex; flex-direction: column; }

.nav__top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 24px;
  padding: var(--pd2);
  padding-bottom: var(--pd2);
}

.nav__top__logo h1 { display: block; }
.nav__top__logo svg {
  width: 146px;
  height: auto;
  color: var(--color-white);
  transition: color .5s;
}

.nav__clock {
  font-family: 'CS Claire Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 150%;
  text-align: left;
  color: var(--color-white);
  cursor: pointer;
  transition: color .5s;
}

.nav__top__bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--pd2);
}

.nav__top__bar__right { display: flex; align-items: center; gap: var(--pd3); }

.page__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 var(--pd);
  border-radius: 40px;
  background: var(--color-gray10);
  white-space: nowrap;
}

.page__button--white {
  background: var(--color-white);
  color: var(--color-black);
}

.theme-toggle {
  width: 62px;
  height: 38px;
  border-radius: 40px;
  background: var(--color-gray10);
  position: relative;
  flex-shrink: 0;
}

.theme-toggle__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transform: translateX(23px);
  transition: transform .3s ease;
}

html.light .theme-toggle__knob { transform: translateX(0); }

.nav__play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-gray10);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav__play::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--color-white);
  margin-left: 2px;
  transition: border-color .5s;
}

body[data-has-gallery] .nav__play { display: inline-flex; }

.nav__top__bottom { display: none; justify-content: center; padding-bottom: var(--pd2); }
.nav.nav--expanded .nav__top__bottom { display: flex; }

.nav__cards { display: flex; flex-direction: column; row-gap: var(--pd2); }

/* "Selected projects" section label — slim divider, label treatment only, not a link */
.nav__card__label .nav__card__inner {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
  cursor: default;
}
.nav__card__label .nav__card__inner::after { display: none; }
.nav__card__label .nav__card__info h2 {
  font-family: 'CS Claire Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-gray50);
}

.nav__card__inner {
  display: flex;
  align-items: center;
  column-gap: 12px;
  min-height: 98px;
  padding: var(--pd);
  border-radius: 10px;
  background: var(--color-card);
  position: relative;
  overflow: hidden;
}

.nav__card__inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-gray10);
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
}

html.device-mouse .nav__card:hover .nav__card__inner::after { opacity: 1; }

.nav__card.is-active .nav__card__inner { background: var(--color-gray10-hover); }

.nav__card__img {
  flex-shrink: 0;
  width: 65px;
  height: 65px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-gray10);
}

.nav__card__img img { width: 100%; height: 100%; object-fit: cover; }

.nav__card__info h2 { color: var(--color-white); }
.nav__card__info p { color: var(--color-gray50); }

.nav__card__about .nav__card__info h2 {
  font-family: 'CS Claire Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-gray50);
  margin-bottom: var(--pd3);
}

/* ============ generic cards ============ */

.page__card {
  background: var(--color-gray10);
  border-radius: var(--br);
  padding: var(--pd);
  position: relative;
  overflow: hidden;
}

html.device-mouse .page__card:hover,
html.device-mouse .page__button:hover { background-color: var(--color-gray10-hover); }
html.device-mouse .page__button--white:hover { background-color: var(--color-white-hover); }
html.device-mouse .theme-toggle:hover,
html.device-mouse .nav__play:hover,
html.device-mouse .page__button__close:hover { background-color: var(--color-icon-hover); }

.card__label {
  color: var(--color-gray50);
  margin-bottom: var(--pd);
}

.card__media {
  border-radius: var(--br2);
  overflow: hidden;
  background: var(--color-gray10);
  position: relative;
}

.card__media img, .card__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* JS masonry columns */
.cards { display: grid; gap: var(--pd2); align-items: start; }
.cards__col { display: flex; flex-direction: column; gap: var(--pd2); min-width: 0; }

/* ============ home ============ */

.home__hero {
  aspect-ratio: 1496/998;
  padding: 0;
}

.home__hero__img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.home__hero__img.selected { opacity: 1; }

.home__hero__img img { width: 100%; height: 100%; object-fit: cover; }

.home__cards { margin-top: var(--pd2); }

.home__journal { margin-top: var(--pd2); }

.home__card { display: block; }
.home__card__title { margin-top: var(--pd); }
.home__card__tagline { color: var(--color-gray50); margin-top: var(--pd3); }

html.device-mouse .home__card:hover .home__card__tagline,
html.device-mouse .case__studies__card:hover .case__studies__card__tagline,
html.device-mouse .more__work__card:hover .case__studies__card__tagline { color: var(--color-gray50-hover); }

/* ============ /all ============ */

body[data-template="all"] .content { width: 100%; }

.case__studies__filters {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--pd2);
  z-index: 10;
}

.case__studies__filters::before {
  content: '';
  position: absolute;
  inset: 0;
  height: 120px;
  background: linear-gradient(180deg, var(--color-scrim), transparent);
  pointer-events: none;
}

.case__studies__filters__top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pd2);
  position: relative;
}

.case__studies__filters__input {
  width: 100%;
  height: 40px;
  border: 0;
  outline: 0;
  border-radius: var(--br2);
  background: var(--color-gray10);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  color: var(--color-white);
  font: inherit;
  padding: 0 44px 0 12px;
}

.case__studies__filters__input::placeholder { color: var(--color-gray50); }

.case__studies__filters__top__submit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.case__studies__filters__top__submit::before {
  content: '→';
  color: var(--color-gray50);
  font-size: 14px;
}

.page__button__close {
  position: absolute;
  right: var(--pd2);
  top: var(--pd2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-gray10);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .5s;
}

.page__button__close::before,
.page__button__close::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 1.5px;
  background: var(--color-white);
  transition: background-color .5s;
}

.page__button__close::before { transform: rotate(45deg); }
.page__button__close::after { transform: rotate(-45deg); }

.case__studies__cards { margin-top: calc(40px + 16px); }

.case__studies__card { display: block; margin-bottom: 24px; }
.case__studies__card h2 { margin-top: var(--pd3); }
.case__studies__card__tagline { color: var(--color-gray50); transition: color .5s; }

/* ============ case study ============ */

.case__study__list > .nav__card { display: block; }

.case__study__meta {
  margin-top: var(--pd2);
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: var(--pd3);
  color: var(--color-gray50);
}

.case__study__meta b { color: var(--color-white); font-weight: 400; margin-left: var(--pd3); }

.case__study__slices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pd2);
  margin-top: var(--pd2);
}

.cs-media {
  padding: 0;
  cursor: zoom-in;
  border-radius: var(--br);
}

.cs-media img, .cs-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-media--full { grid-column: 1 / -1; }

.cs-text {
  grid-column: 1 / -1;
  aspect-ratio: 1496/998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray10);
  border-radius: var(--br);
  padding: var(--pd);
}

/* case-study text boxes: same full-row discipline as the media grid —
   paired boxes are square with generous inner air, content centered;
   odd one out spans the full row at natural height */
.cs-textbox {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-textbox--square { aspect-ratio: 1/1; }
.cs-textbox--auto { aspect-ratio: auto; } /* long-paragraph fallback: natural height */
.cs-textbox--square, .cs-textbox--auto { padding: 12%; } /* real margin from box edges */
.cs-textbox--full { grid-column: 1 / -1; padding: 48px; }
.cs-textbox p {
  margin: 0;
  max-width: 62ch;
  font-size: 19px;
  letter-spacing: .35px;
  line-height: 135%;
}

.cs-text__inner {
  width: 52%;
  font-size: 23px;
  letter-spacing: .45px;
  line-height: 27px;
}

.case__study__info {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--pd2);
  margin-top: var(--pd2);
}

.case__study__info__project__information p { margin-bottom: 1em; }
.case__study__info__project__information p:last-child { margin-bottom: 0; }

.case__study__info__credits .credit { margin-bottom: var(--pd); }
.case__study__info__credits .credit:last-child { margin-bottom: 0; }
.case__study__info__credits .credit__role { color: var(--color-gray50); }

.more__work__label {
  color: var(--color-gray50);
  margin: 24px var(--pd2) var(--pd2);
}

/* ============ about ============ */

.about__hero { aspect-ratio: 1496/998; padding: 0; }
.about__hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.about__content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pd2);
  margin-top: var(--pd2);
  align-items: start;
}

.about__content__left {
  grid-column: 1 / 3;
  display: flex;
  flex-direction: column;
  row-gap: var(--pd2);
}

.about__content__right {
  grid-column: 3 / -1;
  display: flex;
  flex-direction: column;
  row-gap: var(--pd2);
  position: sticky;
  bottom: var(--pd2);
  align-self: end;
}

.about__our__studio .about__lead {
  font-size: 23px;
  letter-spacing: .45px;
  line-height: 27px;
  margin-bottom: 1em;
}

.about__our__studio p:not(.about__lead) { color: var(--color-gray50); margin-bottom: 1em; }
.about__our__studio p:last-child { margin-bottom: 0; }

.about__getintouch { align-self: flex-start; }

.about__offerings__item { border-top: 1px solid var(--color-gray30); }
.about__offerings__item:first-of-type { border-top: 0; }

.about__offerings__head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--pd);
  padding: var(--pd) 0;
  text-align: left;
}

.about__offerings__id { color: var(--color-gray50); }
.about__offerings__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease, opacity .5s ease;
  opacity: 0;
}

.about__offerings__item.selected .about__offerings__body { opacity: 1; }
.about__offerings__body-inner { padding-bottom: var(--pd); }
.about__offerings__body p { color: var(--color-gray50); margin-bottom: 1em; }
.about__offerings__body p:last-child { margin-bottom: 0; }

.about__clients__list { display: flex; flex-wrap: wrap; gap: var(--pd3); }
.about__clients__list span {
  background: var(--color-gray10);
  border-radius: 40px;
  padding: var(--pd3) 12px;
}

.about__locations { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pd2); }
.about__location__city { margin-bottom: var(--pd3); }
.about__location__address { color: var(--color-gray50); }

.about__contact__item { margin-bottom: var(--pd); }
.about__contact__label { color: var(--color-gray50); margin-bottom: var(--pd3); }
.about__contact__item a {
  text-decoration: underline;
  text-decoration-thickness: .75px;
  text-underline-offset: 4px;
  color: var(--color-link-dim);
  transition: color .5s;
}
html.device-mouse .about__contact__item a:hover { color: var(--color-white); }
.about__contact__socials a { margin-right: 12px; }
.about__privacy__policy__button { color: var(--color-gray50); text-align: center; }

/* ============ lightbox ============ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open { display: flex; }

.lightbox__stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
}

.lightbox__stage img, .lightbox__stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--br2);
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsla(135, 7%, 89%, .1);
  z-index: 2;
}

.lightbox__close::before, .lightbox__close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: #e2e6e3;
}
.lightbox__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lightbox__close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsla(135, 7%, 89%, .1);
  z-index: 2;
  color: #e2e6e3;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__arrow--prev { left: 16px; }
.lightbox__arrow--next { right: 16px; }
.lightbox__arrow--prev::before { content: '←'; }
.lightbox__arrow--next::before { content: '→'; }

.lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: hsla(135, 7%, 89%, .5);
}

/* ============ breakpoints ============ */

@media (max-width: 1024px) {
  .case__studies__filters__top { grid-template-columns: repeat(3, 1fr); }
  .case__study__info { grid-template-columns: 1fr; }
  .about__content { grid-template-columns: 1fr 1fr; }
  .about__content__left { grid-column: 1 / -1; }
  .about__content__right {
    grid-column: 1 / -1;
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--pd2);
    align-items: start;
  }
  .cs-text__inner { width: 76%; }
}

@media (max-width: 896px) {
  .about__content__right { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --br: 12px; }
  body { font-size: 14.5px; letter-spacing: -.31px; }
  .display, .cs-text__inner, .about__our__studio .about__lead {
    font-size: 16px;
    letter-spacing: .25px;
    line-height: 130%;
  }
  .theme-toggle { width: 55px; height: 33px; }
  .theme-toggle__knob { width: 25px; height: 25px; transform: translateX(22px); }
  .nav__play { width: 33px; height: 33px; }
  .nav__top { row-gap: 16px; padding-bottom: 24px; }
  .nav__top__logo svg { width: 124px; }
  .nav__clock { font-size: 11px; }
  .nav__cards { row-gap: 6px; }
  .nav__card__inner { min-height: 80px; padding: 12px; column-gap: 9px; }
  .nav__card__img { width: 56px; height: 56px; }
  .page__button { height: 34px; }
  .case__studies__filters__input { height: 30px; }
  .case__studies__cards { margin-top: calc(30px + 16px); }
  .page__button__close { width: 30px; height: 30px; }
  .cs-text__inner { width: 90%; }
  .cs-textbox--square, .cs-textbox--auto { padding: 8%; }
  .cs-textbox--full { padding: 24px; }
  .cs-textbox p { font-size: 15px; letter-spacing: .2px; line-height: 135%; }
  .lightbox__stage { padding: 48px 8px; }
}

@media (max-width: 656px) {
  main.wrapper { flex-direction: column; }
  .nav {
    width: auto;
    position: static;
    max-height: none;
    overflow: visible;
    padding: var(--pd2);
    padding-bottom: 0;
  }
  body[data-template="index"] .nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-black);
    transition: background-color .5s;
  }
  .page__container { padding-top: 2px; }
  .nav__cards .nav__card { display: none; }
  .nav__cards > .nav__card:nth-child(-n+2) { display: block; } /* About us + label */
  .nav__listarea .nav__card:nth-child(-n+3) { display: block; } /* first 3 projects */
  .nav.nav--expanded .nav__cards .nav__card { display: block; }
  .case__studies__filters__top { grid-template-columns: 1fr; }
  .about__locations { grid-template-columns: 1fr; }
}

/* ============ video thumbs & hero video ============ */

.nav__card__img video,
.home__hero__img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ journal ============ */

.journal__intro { margin-bottom: var(--pd2); }
.journal__tagline { color: var(--color-gray50); }

.journal__card { display: block; }
.journal__card__date { color: var(--color-gray50); }
.journal__card__title { margin-top: var(--pd3); }
.journal__card__excerpt { color: var(--color-gray50); margin-top: var(--pd3); }
.journal__card__media { margin-top: 20px; }

/* article page */
.article__header .article__date { color: var(--color-gray50); }
.article__header .article__title { margin-top: var(--pd3); }
.article__header .article__excerpt { color: var(--color-gray50); margin-top: var(--pd); }
.article__hero { margin-top: var(--pd2); }
.article__text { margin-top: var(--pd2); }
.article__image { margin-top: var(--pd2); }

.about__offerings__intro { color: var(--color-gray50); margin-bottom: var(--pd); }

/* ============ service pages & pill row ============ */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pd3);
  margin-bottom: var(--pd);
}

.pill-row .page__button { height: 30px; padding: 0 12px; font-size: 13px; }

.service__intro { margin-bottom: var(--pd2); }
.service__title { margin-bottom: var(--pd); }
.service__copy p { color: var(--color-gray50); margin-bottom: 1em; max-width: 68ch; }
.service__copy p:first-child { color: var(--color-white); }
.service__copy p:last-child { margin-bottom: 0; }

.service__projects { margin-bottom: var(--pd2); }
.service__faq { margin-bottom: var(--pd2); }

/* ============ fill-mode nav (desktop, tall viewports, fine pointers) ============ */
/* Fixed 100svh column: logo+clock on top, flexible empty spacer, then a compact
   bottom cluster (pill row, About card, label, 6 compact project cards).
   Dock growth is absorbed by the spacer — nothing below the hovered card moves. */

.nav__spacer { display: none; }

.nav--fill {
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}

.nav--fill .nav__inner { height: 100%; display: flex; flex-direction: column; }
.nav--fill .nav__top { flex: none; }
.nav--fill .nav__spacer { display: block; flex: 1 1 auto; min-height: 0; }
.nav--fill .nav__top__bar { flex: none; margin-bottom: var(--pd2); }
.nav--fill .nav__cards { flex: none; display: flex; flex-direction: column; }

.nav--fill .nav__cards .nav__card__about,
.nav--fill .nav__cards .nav__card__label { flex: none; }

/* fixed list area: exactly 50svh, never resizes — pill row and About stay put.
   Cards are top-anchored inside; leftover space stays empty at the bottom. */
.nav--fill .nav__listarea {
  flex: none;
  height: 50svh;
  display: flex;
  flex-direction: column;
  row-gap: var(--pd2);
  overflow: hidden;
}

.nav--fill .nav__listarea .nav__card {
  flex: 1 1 0; /* equal share of the fixed area at rest; JS animates the grow factor */
  min-height: 0;
  display: flex;
}

.nav--fill .nav__cards .nav__card:not(.nav__card__about):not(.nav__card__label) .nav__card__inner {
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 7px 16px;
  column-gap: 10px;
}

/* rest = slim text-only bar: media and tagline fully hidden until the card is big */
.nav--fill .nav__cards .nav__card:not(.nav__card__about):not(.nav__card__label) .nav__card__img {
  display: none;
}

.nav--fill .nav__cards .nav__card:not(.nav__card__about):not(.nav__card__label) .nav__card__info p {
  display: none;
}

/* expanded (dock) state: column layout, tagline + media become the visual.
   Note: reveal rules carry the same :not() guards as the hiding rules to win specificity. */
.nav--fill .nav__cards .nav__card.is-big:not(.nav__card__about):not(.nav__card__label) .nav__card__inner {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  row-gap: 8px;
}

.nav--fill .nav__cards .nav__card.is-big:not(.nav__card__about):not(.nav__card__label) .nav__card__info { order: -1; flex: none; }
.nav--fill .nav__cards .nav__card.is-big:not(.nav__card__about):not(.nav__card__label) .nav__card__info p { display: block; }

.nav--fill .nav__cards .nav__card.is-big:not(.nav__card__about):not(.nav__card__label) .nav__card__img {
  display: block;
  width: 100%;
  height: auto;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 8px;
}

/* short-viewport fallback (fine pointer but not enough height): page scrolls naturally */
.nav--static {
  position: static;
  max-height: none;
  overflow: visible;
}

/* note: the brand logo animation intentionally ignores prefers-reduced-motion
   (owner decision — it's the studio's identity mark, not decorative motion) */

/* rich journal articles */
.article__h2 {
  color: var(--color-gray50);
  margin-bottom: var(--pd);
}
.article__text p { margin-bottom: 1em; }
.article__text p:last-child { margin-bottom: 0; }
.article__text a {
  text-decoration: underline;
  text-decoration-thickness: .75px;
  text-underline-offset: 4px;
  color: var(--color-link-dim);
  transition: color .5s;
}
html.device-mouse .article__text a:hover { color: var(--color-white); }
.article__faq { margin-top: var(--pd2); }

/* end fill-mode nav */

/* case-study video hero: first media on the page, autoplays on entry */
.cs-media--hero video { width: 100%; height: 100%; }
.cs-media--hero-vertical {
  width: 66%;
  justify-self: center;
}
@media (max-width: 768px) {
  .cs-media--hero-vertical { width: 100%; }
}

/* case-study vertical pairs: equal height, natural per-image aspect/width */
.cs-pair {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--pd2);
  align-items: flex-start;
}
.cs-pair .cs-media { flex: 1 1 0; min-width: 0; }
.cs-pair--uniform .cs-media { flex: 1 1 0; }
@media (max-width: 656px) {
  .cs-pair { flex-direction: column; }
  .cs-pair .cs-media { width: 100%; }
}

/* media + text pair: halves share width and height; media fills (cover) */
.cs-pair--mediatext { align-items: stretch; }
.cs-pair--mediatext .cs-media--fill { flex: 1 1 0; min-width: 0; min-height: 280px; }
.cs-pair--mediatext .cs-media--fill img,
.cs-pair--mediatext .cs-media--fill video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

/* percentage padding counts toward the flex base size in Chrome — use fixed padding here */
.cs-pair--mediatext .cs-textbox { padding: 48px; }
@media (max-width: 768px) { .cs-pair--mediatext .cs-textbox { padding: 24px; } }

/* keep both mediatext halves' flex bases equal (padding counts toward base size) */
.cs-pair--mediatext .cs-media--fill { padding: 48px; }
@media (max-width: 768px) { .cs-pair--mediatext .cs-media--fill { padding: 24px; } }
