/* ==========================================================================
   Alan Lam — Portfolio
   Ported from the "Alan Lam Portfolio" Claude Design project.

   Layout system: fluid. Sizing is clamp()-based and the cross-section layout
   decisions (row vs column, column counts, alignment) are hoisted into custom
   properties that get re-pointed at two breakpoints — 1279px and 799px. There
   is no fixed-width canvas and no body zoom; pages reflow natively.
   ========================================================================== */

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

:root {
  /* --- Colour tokens --- */
  --ink: #000;
  --paper: #fff;
  --dark: #232323;
  --card-dark: #282828;
  --navy: #12247f;
  --grey-section: #efefef;
  --grey-card: #ededed;
  --grey-apps: #d8d8d8;
  --grey-chip: #e5e5e5;
  --text-muted: #797979;
  --overlay-blue: rgba(21, 48, 106, 0.51);

  /* --- Layout tokens --- */
  --pad: clamp(20px, 5vw, 64px);
  --content: 1360px;

  --hero-dir: row; --hero-x: flex-start; --hero-ta: left;
  --hero-sub-a: block; --hero-sub-b: none;
  --hero-gap: 0px; --photo-ml: clamp(-260px, -15vw, -120px); --photo-mt: 0px;
  --hero-flex-text: 1 1 340px; --hero-flex-photo: 1 1 420px;
  --hero-sub-basis: 100%; --hero-justify: space-between;

  --cards-cols: repeat(4, 300px);
  --co-dir: row; --co-pill-w: 439px;
  --about-dir: row; --about-photo-w: clamp(280px, 34vw, 422px); --about-photo-mx: 0;
  --freq-dir: row;
  --resume-dir: row;
  --sub-dir: row; --sub-ta: left; --sub-justify: space-between; --sub-align: flex-end;
  --proj-dir: row; --proj-img-w: clamp(300px, 33vw, 520px); --arrow-display: block;
  --detail-2col: row;
  --footer-dir: row; --footer-x: flex-start; --footer-x2: flex-end; --footer-ta: left;
}

@media (max-width: 1279px) {
  :root {
    --hero-dir: column; --hero-x: center; --hero-ta: center;
    --hero-sub-a: none; --hero-sub-b: block;
    --hero-gap: 28px; --photo-ml: 0px; --photo-mt: clamp(-90px, -7vw, -48px);
    --hero-flex-text: 0 0 auto; --hero-flex-photo: 0 0 auto;
    --hero-sub-basis: auto; --hero-justify: center;

    --cards-cols: repeat(2, min(300px, 42vw));
    --co-dir: column; --co-pill-w: 100%;
    --freq-dir: column;
    --resume-dir: column;
    --sub-dir: column; --sub-ta: center; --sub-justify: center; --sub-align: center;
  }
}

@media (max-width: 799px) {
  :root {
    --cards-cols: repeat(2, min(300px, 44vw));
    --about-dir: column; --about-photo-w: min(360px, 82%); --about-photo-mx: auto;
    --proj-dir: column; --proj-img-w: 100%; --arrow-display: none;
    --detail-2col: column;
    --footer-dir: column; --footer-x: center; --footer-x2: center; --footer-ta: center;
  }
}

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }

/* Anchor jumps (nav "Work" -> the Check it out band) glide instead of snapping. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}

img { display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

.page { width: 100%; margin: 0 auto; position: relative; }

@keyframes heroFade { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes stripScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes chevBounce {
  0%, 100% { transform: translateX(-50%) scaleY(-1) translateY(0); }
  50% { transform: translateX(-50%) scaleY(-1) translateY(4px); }
}

/* ===== Navbar ===== */
.nav {
  position: sticky;
  top: 0;
  height: 55px;
  background: var(--dark);
  display: flex;
  align-items: center;
  z-index: 30;
}
.nav::before {
  content: '';
  position: absolute; inset: 0;
  background: url('assets/nav-bg.png') center/cover;
  opacity: 0.05;
  pointer-events: none;
}
.nav__logo {
  position: absolute;
  left: var(--pad); top: 50%;
  transform: translateY(-50%);
}
.nav__logo img { width: clamp(36px, 4vw, 46px); height: auto; }
.nav__links {
  position: absolute;
  right: var(--pad);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.6vw, 40px);
}
.nav__links a {
  font-size: clamp(12px, 1.6vw, 16px);
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.08px;
}

/* ===== Home hero ===== */
.hero {
  position: relative;
  background: url('assets/hero-bg.png') center/cover;
  overflow: hidden;
  padding: clamp(56px, 8vw, 110px) var(--pad) clamp(72px, 9vw, 120px);
  min-height: clamp(460px, 58vw, 845px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__inner {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  display: flex;
  flex-direction: var(--hero-dir);
  align-items: center;
  gap: var(--hero-gap);
  justify-content: var(--hero-justify);
}
.hero__text {
  flex: var(--hero-flex-text);
  max-width: 560px;
  display: flex;
  flex-direction: column;
  text-align: var(--hero-ta);
  align-items: var(--hero-x);
  position: relative;
  z-index: 2;
}
.hero__greeting {
  font-family: 'Playwrite US Trad', cursive;
  font-size: clamp(18px, 2.2vw, 25px);
  color: #fff;
}
.hero__name {
  width: min(598px, 88vw);
  max-width: 100%;
  height: auto;
  margin-top: clamp(12px, 2vw, 22px);
}
/* The role line renders in one of two slots depending on breakpoint: inside the
   text column on wide screens, below the whole hero once it stacks.

   It must never wrap. Set in Inter 500 with em-based tracking, the string
   "MARKETING STRATEGIST | CREATIVE MEDIA PRODUCER" is ~28.75x as wide as its
   font-size, so each variant's size is derived from the space it actually has:
   the 560px text column inline, the full content width when stacked. Divisor 30
   leaves ~4% headroom. */
.hero__role {
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.hero__role--inline {
  display: var(--hero-sub-a);
  margin-top: clamp(16px, 2.4vw, 26px);
  font-size: 19px; /* 19 x 28.75 = 546px, fits the 560px column */
}
.hero__role--stacked {
  display: var(--hero-sub-b);
  flex-basis: var(--hero-sub-basis);
  order: 3;
  text-align: center;
  font-size: min(21px, calc((100vw - 2 * var(--pad)) / 30));
}

/* Below 400px one line would force the type under ~11px, so break at the
   separator into two centred lines instead. The longer half is only ~14.79x its
   font-size, so the type grows back to the full 21px on most phones. */
@media (max-width: 399.98px) {
  /* Capped just under the 18px greeting so the two sit as a pair. */
  .hero__role--stacked {
    font-size: min(18px, calc((100vw - 2 * var(--pad)) / 19));
    line-height: 1.35;
  }
  .hero__role--stacked .hero__role-part { display: block; }
  .hero__role--stacked .hero__role-sep { display: none; }
}
.hero__photo {
  flex: var(--hero-flex-photo);
  max-width: 700px;
  width: 100%;
  aspect-ratio: 701/522;
  border-radius: 20px;
  object-fit: cover;
  object-position: 50% 100%;
  position: relative;
  z-index: 1;
  margin-left: var(--photo-ml);
  margin-top: var(--photo-mt);
  animation: heroFade 1s ease 0.2s both;
}
.hero__chevron {
  position: absolute;
  left: 50%;
  /* Pulled closer to the floor on small screens so the space above the arrow
     isn't crushed against the role line. */
  bottom: clamp(24px, 3vw, 40px);
  transform: translateX(-50%) scaleY(-1);
  cursor: pointer;
  z-index: 3;
  background: none; border: 0; padding: 0;
  line-height: 0;
}
/* The source SVG is a 70x21 viewBox stretched to 100x22 by design
   (preserveAspectRatio="none"), so hold that ratio while scaling. */
.hero__chevron img {
  width: clamp(48px, 12vw, 100px);
  height: auto;
  aspect-ratio: 100 / 22;
}
.hero__chevron:hover { animation: chevBounce 0.4s ease 1; }

/* ===== Home about + cards ===== */
.about {
  background: var(--grey-section);
  padding: clamp(56px, 9vw, 148px) var(--pad) clamp(48px, 7vw, 80px);
}
.about__title { font-size: clamp(24px, 3.4vw, 30px); font-weight: 600; text-align: center; }
.about__bio {
  max-width: 822px;
  margin: 18px auto 0;
  font-size: clamp(15px, 1.6vw, 16px);
  line-height: 1.35;
  text-align: center;
}
.cards {
  max-width: var(--content);
  width: 100%;
  margin: clamp(34px, 5vw, 52px) auto 0;
  display: grid;
  grid-template-columns: var(--cards-cols);
  gap: 15px;
  justify-content: center;
}
.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 30px;
  display: block;
}
.card img { width: 100%; height: 100%; border-radius: 30px; object-fit: cover; }
.card__overlay { position: absolute; inset: 0; border-radius: 30px; background: var(--overlay-blue); }
.card__label {
  position: absolute;
  left: 24px; bottom: 26px;
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 600;
  color: #fff;
  line-height: 0.9;
}

/* ===== Check it out / Check out my other work ===== */
.checkout {
  position: relative;
  background: linear-gradient(90deg, rgb(70,93,142) 0%, rgb(87,125,190) 53%, rgb(75,109,150) 77%, rgb(64,93,110) 100%);
  padding: clamp(44px, 6vw, 70px) var(--pad);
  overflow: hidden;
  /* Keep the band's heading clear of the sticky navbar when jumped to. */
  scroll-margin-top: 55px;
}
.checkout::before {
  content: '';
  position: absolute; inset: 0;
  background: url('assets/checkout-bg.png') center/cover;
  opacity: 0.1;
  pointer-events: none;
}
.checkout__inner {
  position: relative;
  display: flex;
  flex-direction: var(--co-dir);
  gap: clamp(26px, 4vw, 40px);
  align-items: flex-start;
  justify-content: space-between;
  max-width: var(--content);
  margin: 0 auto;
}
.checkout__copy { flex: 1 1 auto; max-width: 511px; color: #fff; }
.checkout__title { font-size: clamp(24px, 3.2vw, 30px); font-weight: 600; }
.checkout__sub { margin-top: 10px; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.22; }
.checkout__pills {
  display: flex;
  flex-direction: column;
  gap: 19px;
  width: var(--co-pill-w);
  max-width: 100%;
  flex: none;
}
.pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 10px 20px;
  background: var(--navy);
  border-radius: 10px;
  transition: filter 0.2s ease;
}
.pill:hover { filter: brightness(1.15); }
.pill__icon { width: clamp(60px, 12vw, 84px); height: clamp(60px, 12vw, 84px); flex: none; object-fit: contain; }
.pill--creative .pill__icon { width: clamp(62px, 13vw, 92px); height: clamp(62px, 13vw, 92px); }
.pill--social .pill__icon { width: clamp(56px, 11vw, 76px); height: clamp(56px, 11vw, 76px); }
.pill__label { flex: 1; font-size: clamp(18px, 2vw, 25px); font-weight: 600; color: #fff; line-height: 0.9; }
.pill__arrow { width: 30px; height: 29px; flex: none; }

/* ===== Footer ===== */
.footer {
  position: relative;
  background: var(--dark);
  padding: clamp(28px, 4vw, 40px) var(--pad);
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute; inset: 0;
  background: url('assets/blue-texture.png') center/cover;
  opacity: 0.05;
  pointer-events: none;
}
.footer__inner {
  position: relative;
  display: flex;
  flex-direction: var(--footer-dir);
  gap: clamp(20px, 3vw, 30px);
  align-items: var(--footer-x);
  justify-content: space-between;
  text-align: var(--footer-ta);
}
.footer__brand { display: flex; flex-direction: column; align-items: var(--footer-x); }
.footer__logo { width: 46px; height: 46px; }
.footer__tagline {
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 600;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, #cfcfcf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer__tagline .f-i { font-family: 'Playwrite US Trad', cursive; font-weight: 400; }
.footer__tagline .f-d { font-family: 'Playfair Display', serif; font-weight: 400; }
.footer__tagline .f-e { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 400; }
.footer__tagline .f-a { font-family: 'Potta One', cursive; }
.footer__tagline .f-s { font-family: 'Reggae One', cursive; }
.footer__contact { display: flex; flex-direction: column; gap: 16px; align-items: var(--footer-x2); }
.footer__socials { display: flex; gap: 19px; align-items: center; height: 46px; }
.footer__socials img { width: 34px; height: 34px; }
.footer__email { font-size: 20px; font-weight: 500; color: #fff; letter-spacing: -0.3px; line-height: 1.5; }

/* ===== Showcase sub-header band =====
   Sticks under the navbar. script.js nudges it up while the reader is
   scrolling down, tucking the title away but leaving the tabs reachable
   (the distance is measured per layout — see stickyBand). */
.band {
  position: sticky;
  top: 55px;
  z-index: 15;
  background: url('assets/hero-bg.png') center/cover;
  transition: transform 0.3s ease;
  padding: clamp(18px, 3vw, 26px) var(--pad);
  min-height: clamp(120px, 15vw, 195px);
  display: flex;
  flex-direction: var(--sub-dir);
  align-items: var(--sub-align);
  justify-content: var(--sub-justify);
  gap: clamp(12px, 2vw, 24px);
  text-align: var(--sub-ta);
}
.band__title { font-size: clamp(30px, 6vw, 60px); font-weight: 700; color: #fff; line-height: 1.1; }
.band__sub { font-size: clamp(16px, 2.4vw, 30px); color: #fff; }
.band__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 28px);
}
.band__tab {
  font-size: clamp(12px, 1.6vw, 15px);
  font-weight: 600;
  color: #fff;
  padding: 9px 20px;
  border-radius: 20px;
  cursor: pointer;
  background: none; border: 0;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}
.band__tab.is-active { background: #fff; color: #000; }

/* ===== Project list sections ===== */
.plist {
  background: #fff;
  padding: clamp(24px, 3vw, 30px) var(--pad) 30px;
  scroll-margin-top: clamp(150px, 22vw, 265px);
}
.plist__heading { font-size: clamp(22px, 3vw, 30px); font-weight: 600; margin-bottom: 20px; }
.plist__soon { font-size: clamp(20px, 2.6vw, 25px); font-weight: 700; color: var(--text-muted); padding: 80px 0; }
.pcard {
  position: relative;
  display: flex;
  flex-direction: var(--proj-dir);
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto 14px;
  padding: 16px;
  background: var(--grey-card);
  border-radius: 30px;
}
.pcard__media {
  flex: none;
  width: var(--proj-img-w);
  max-width: 100%;
  aspect-ratio: 460/346;
  border-radius: 15px;
  object-fit: cover;
}
.pcard__frame {
  flex: none;
  width: var(--proj-img-w);
  max-width: 100%;
  aspect-ratio: 460/346;
  border-radius: 15px;
  border: 0;
}
.pcard__body { flex: 1; min-width: 0; padding: 8px clamp(24px, 2vw, 36px) 8px 0; }
.pcard__title { font-size: clamp(18px, 2vw, 20px); font-weight: 700; line-height: 1.35; }
.pcard__desc { font-size: 16px; color: var(--text-muted); line-height: 1.35; margin-top: 11px; }
.pcard__meta { font-size: 16px; line-height: 1.45; margin-top: 15px; }
.pcard__arrow {
  display: var(--arrow-display);
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%) rotate(90deg);
  width: 36px; height: 11.66px;
}

/* ===== Click-to-play YouTube ===== */
/* Sizing comes from a companion class (.pcard__frame) or an inline style;
   script.js swaps the button for the real player on click. */
.yt-lite {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.yt-lite img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-lite__badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 48px;
  background: rgba(0, 0, 0, .72);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yt-lite__badge::after {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

/* ===== Social media cards ===== */
.social-grid {
  background: #fff;
  padding: clamp(24px, 3vw, 30px) var(--pad);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 15px 20px;
  max-width: var(--content);
  margin: 0 auto;
}
.scard {
  position: relative;
  aspect-ratio: 566/472;
  border-radius: 30px;
  overflow: hidden;
  display: block;
  background: var(--card-dark) center/cover no-repeat;
}
.scard__shade { position: absolute; inset: 0; background: var(--card-dark); transition: opacity 0.3s ease; }
.scard:hover .scard__shade { opacity: 0.8; }
.scard__logo {
  position: absolute;
  left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  width: min(355px, 64%);
  height: auto;
  pointer-events: none;
}
.scard__year {
  position: absolute;
  bottom: clamp(44px, 12%, 77px);
  left: 0; right: 0;
  text-align: center;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  color: #fff;
  pointer-events: none;
}

/* ===== About page ===== */
.aboutme { background: var(--grey-section); padding: clamp(56px, 8vw, 91px) var(--pad) clamp(40px, 6vw, 64px); }
.aboutme__hello { font-size: clamp(38px, 7vw, 60px); font-weight: 700; line-height: 0.85; }
.aboutme__grid {
  display: flex;
  flex-direction: var(--about-dir);
  gap: clamp(28px, 4vw, 48px);
  align-items: flex-start;
  margin-top: clamp(28px, 4vw, 40px);
}
.aboutme__photo-wrap {
  width: var(--about-photo-w);
  margin-inline: var(--about-photo-mx);
  flex: none;
  aspect-ratio: 422/593;
  border-radius: 20px;
  overflow: hidden;
}
.aboutme__photo-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.aboutme__col { flex: 1 1 auto; min-width: 0; font-size: clamp(15px, 1.6vw, 16px); line-height: 1.3; }
.aboutme__col .gap { height: 19px; }
.aboutme__col h3 { font-size: 16px; font-weight: 600; }
.aboutme__col ul { list-style: disc; margin-left: 24px; }
.aboutme__btns { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.btn-outline {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 18px;
  border: 1.5px solid #000;
  border-radius: 21px;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline:hover { background: #000; color: #fff; }

/* ===== About page: frequently-used applications ===== */
.apps { background: var(--grey-apps); padding: clamp(40px, 6vw, 48px) var(--pad) clamp(44px, 6vw, 60px); }
.apps__title { font-size: clamp(22px, 3vw, 30px); font-weight: 600; }
.apps__sub { font-size: clamp(15px, 1.6vw, 16px); line-height: 1.3; margin-top: 12px; }
.apps__row {
  display: flex;
  flex-direction: var(--freq-dir);
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
  margin-top: clamp(28px, 4vw, 40px);
}
.appbox {
  flex: 1 1 300px;
  width: 100%;
  max-width: 420px;
  min-height: 287px;
  background: var(--grey-chip);
  border-radius: 30px;
  padding: clamp(24px, 3vw, 30px);
}
.appbox h4 { font-size: 16px; font-weight: 600; }
.appbox__icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
.appbox__icons img { width: 84px; height: 84px; border-radius: 17px; object-fit: cover; }
.appbox__icons img.is-wide { width: 181px; height: 73px; }
.appbox__icons img.is-tall { width: 100px; height: 94px; border-radius: 0; object-fit: contain; }

/* ===== Resume page ===== */
.resume {
  background: #fff;
  padding: clamp(56px, 8vw, 96px) var(--pad) clamp(40px, 6vw, 60px);
  display: flex;
  flex-direction: var(--resume-dir);
  gap: clamp(28px, 4vw, 48px);
  align-items: flex-start;
}
.resume__copy { flex: 1 1 auto; max-width: 420px; }
.resume__title { font-size: clamp(38px, 7vw, 60px); font-weight: 700; }
.resume__updated { font-size: 16px; margin-top: 18px; }
.resume__download { margin-top: 24px; }
.resume__preview { flex: none; width: min(732px, 100%); aspect-ratio: 732/947; border: 0; }

/* ===== Contacts page ===== */
.contacts { background: #fff; padding: clamp(56px, 8vw, 95px) var(--pad) clamp(48px, 7vw, 80px); }
.contacts__title { font-size: clamp(38px, 7vw, 60px); font-weight: 700; line-height: 0.9; }
.contacts__body { margin-top: 15px; font-size: 16px; line-height: 1.35; }
.contacts__body .lead { font-weight: 500; }
.contacts__body .gap { height: 19px; }
.contacts__body strong { font-weight: 700; }
.contacts__socials { display: flex; gap: 25px; margin-top: 15px; }
.contacts__socials img { width: 28px; height: 28px; }

/* ===== Project detail pages ===== */
.detail { background: #fff; padding: clamp(24px, 3vw, 30px) var(--pad) 30px; }
/* Body content is centred to the content rail; the back pill and title block
   sit against the page padding, as in the design. */
.detail__meta,
.detail__embed,
.detail__label,
.detail__doc,
.detail__gallery { max-width: var(--content); margin-inline: auto; }
.detail__back {
  display: inline-block;
  padding: 8px 17px;
  border: 1.5px solid #d5d5d5;
  border-radius: 21px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s ease;
}
.detail__back:hover { background: #f2f2f2; }
.detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(28px, 3vw, 41px);
}
.detail__title { font-size: clamp(38px, 6vw, 60px); font-weight: 700; line-height: 0.9; }
.detail__subtitle { font-size: clamp(18px, 2vw, 20px); font-weight: 500; margin-top: 6px; }
.detail__logo {
  max-width: min(317px, 60%);
  max-height: clamp(80px, 10vw, 124px);
  width: auto; height: auto;
  object-fit: contain;
}
.detail__meta { margin-top: clamp(28px, 3vw, 39px); font-size: 16px; line-height: 1.25; }
.detail__meta .gap { height: 19px; }
.detail__embed { display: block; width: 100%; aspect-ratio: 1150/648; margin-top: 27px; border: 0; }
.detail__label { margin-top: clamp(28px, 4vw, 50px); font-size: 16px; font-weight: 700; }
.detail__doc { display: block; width: min(649px, 100%); aspect-ratio: 649/438; margin-top: 15px; border: 0; border-radius: 4px; }
.detail__gallery { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 20px; }
.detail__gallery img { max-width: 100%; border-radius: 15px; }

/* ===== Case-study pages (sfubass, caseit) ===== */
.case {
  background: #fff;
  padding: clamp(24px, 3vw, 30px) var(--pad) clamp(40px, 6vw, 60px);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 40px);
}
.case__back { align-self: flex-start; }
.case__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.case__title { flex: 1 1 300px; font-size: clamp(30px, 4.6vw, 60px); font-weight: 700; line-height: 0.9; }
.case__logo { flex: none; }
.case__meta { max-width: var(--content); font-size: 16px; line-height: 1.25; }
.case__meta a { text-decoration: underline; }
.case h2 { font-size: clamp(22px, 2.6vw, 25px); font-weight: 700; }
.case__roles { font-size: clamp(17px, 2vw, 20px); margin-top: 6px; }
.case__body { max-width: var(--content); font-size: 16px; line-height: 1.25; margin-top: 18px; }
.case__caption { font-size: 16px; font-weight: 500; margin-bottom: 14px; }
.case__figure { width: 100%; max-width: var(--content); height: auto; }
.case__divider { width: 66px; height: 11px; margin: 10px auto 0; }

/* Embed grids collapse from a row of cards to a single column on narrow screens. */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  justify-items: center;
}
.igframe {
  width: 100%;
  max-width: 372px;
  height: 545px;
  border: 0;
  border-radius: 4px;
  background: #fff;
}

/* Infinite photo marquee. Track holds the sequence twice so the -50% wrap is
   seamless; --strip-dir flips one row to travel the other way. */
.strip { overflow: hidden; }
.cx-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: stripScroll 40s linear infinite;
  animation-direction: var(--strip-dir, normal);
}
.strip--reverse .cx-track { --strip-dir: reverse; }
.cx-track img { height: clamp(160px, 20vw, 260px); width: auto; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .cx-track { animation: none !important; } }

/* ===== Lightbox ===== */
[data-lb] { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox__close {
  position: absolute;
  top: 28px; right: 36px;
  font-size: 34px;
  font-weight: 300;
  color: #fff;
  cursor: pointer;
  background: none; border: 0;
  line-height: 1;
}

/* ===== Reveal-on-scroll ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
