/* ============================================================
   THANH LAM — PORTFOLIO
   Dark editorial design system · Inter + Departure Mono
   ============================================================ */

@font-face {
  font-family: "Departure Mono";
  src: url("../assets/fonts/DepartureMono-Regular.woff2") format("woff2"),
       url("../assets/fonts/DepartureMono-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --bg-2: #121210;
  --ink: #f2efe9;
  --muted: rgba(242, 239, 233, 0.65);
  --faint: rgba(242, 239, 233, 0.5);
  --line: rgba(242, 239, 233, 0.14);
  --accent: #0057FF;
  --font-sans: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Departure Mono", Consolas, "Courier New", monospace;
  --pad: clamp(16px, 2.6vw, 44px);
  --wheel-item-h: clamp(40px, 5.6vh, 58px);
  --nav-h: 72px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  /* overflow-x: hidden would turn body into a scroll container and break
     position: sticky (the work wheel). clip prevents horizontal overflow
     without creating a scroll container. */
  overflow-x: clip;
  min-height: 100vh;
}

body.is-loading { overflow: hidden; }

::selection { background: var(--accent); color: var(--bg); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
sup { font-size: 0.55em; }

.mono {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.72vw, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- grain overlay ---------- */
.noise {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 200;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(2) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.5%); }
  50% { transform: translate(1.5%, -1%); }
  75% { transform: translate(-1%, -2%); }
  100% { transform: translate(2%, 1%); }
}

/* ---------- custom cursor ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  /* hidden until the first mousemove positions it */
  .cursor { display: block; position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
  .cursor.is-on { opacity: 1; }
  .cursor__dot {
    position: absolute; top: -3px; left: -3px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
  }
  .cursor__ring {
    position: absolute; top: -17px; left: -17px;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(242, 239, 233, 0.35);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  }
  .cursor.is-hover .cursor__ring { transform: scale(1.7); opacity: 0.9; border-color: var(--accent); }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: clamp(10px, 1.1vw, 18px); left: 0; right: 0;
  z-index: 160;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--pad);
  pointer-events: none;
}
.nav__logo { display: block; pointer-events: auto; }
.nav__logo-img {
  display: block;
  height: clamp(34px, 3.4vw, 44px);
  width: auto;
}
.nav__logo:hover .nav__logo-img { transform: rotate(-8deg) scale(1.06); }
.nav__logo-img { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

/* menu pill */
.menu-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  color: #0a0a0a;
  padding: 12px 21px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s, color 0.3s;
}
.menu-btn:hover { transform: scale(1.07); }
.menu-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
body.menu-open .menu-btn { background: #0a0a0a; color: #fff; }

/* ---------- expanding white menu panel ---------- */
.menu-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 150;
  width: min(430px, calc(100vw - 24px));
  background: #fff;
  color: #0a0a0a;
  border-radius: 28px;
  padding: 96px 36px 28px;
  transform-origin: top right;
  visibility: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}
.menu-panel__tag {
  color: rgba(10, 10, 10, 0.45);
  margin-bottom: 12px;
}
.menu-panel__links { display: flex; flex-direction: column; gap: 6px; }
.menu-panel__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(36px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #0a0a0a;
  transition: color 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.menu-panel__link sup { font-size: 11px; color: var(--accent); }
.menu-panel__link:hover { color: var(--accent); transform: translateX(8px); }
.menu-panel__foot {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(10, 10, 10, 0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(10, 10, 10, 0.55);
}
.menu-panel__foot a { color: rgba(10, 10, 10, 0.75); }
.menu-panel__foot a:hover { color: var(--accent); }
/* on small screens the panel covers the logo — flip it dark for contrast */
@media (max-width: 560px) {
  body.menu-open .nav__logo-img { filter: invert(1); }
}

/* ---------- shared section head ---------- */
.section-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px var(--pad);
  color: var(--muted);
}
.section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  transform-origin: left;
}
.section-head__label { white-space: nowrap; }
.section-head__label:last-child { display: none; }
@media (min-width: 640px) { .section-head__label:last-child { display: block; } }

/* ---------- split text helpers ---------- */
.split-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.split-char { display: inline-block; }

.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;
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.marquee__track { display: inline-block; white-space: nowrap; will-change: transform; }
.marquee__inner { display: inline-block; padding: 14px 0; color: var(--muted); }

/* ---------- work / wheel ----------
   full-viewport, input-driven project list:
   [filter rail] [project name] [origin] [scope]                       */
.work { position: relative; height: 100vh; height: 100dvh; }
.work__stage {
  position: relative;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

.work__bg { position: absolute; inset: 0; z-index: 1; background: var(--bg-2); }
.work__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.work__shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to bottom, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.2) 40%, rgba(10,10,10,0.2) 70%, rgba(10,10,10,0.6) 100%),
    rgba(10, 10, 10, 0.62);
}

/* filter rail — fixed left, vertically centered */
.work__filters {
  position: absolute;
  left: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.work__filter {
  position: relative;
  padding: 2px 0 2px 18px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-align: left;
  transition: color 0.3s;
}
.work__filter::before {
  content: "▶";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
.work__filter:hover { color: var(--ink); }
.work__filter.is-active { color: var(--ink); }
.work__filter.is-active::before { opacity: 1; }
.work__filter sup { display: none; }

/* the list */
.work__list {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 100%;
}
.work__item {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: var(--wheel-item-h);
  margin-top: calc(var(--wheel-item-h) / -2);
  will-change: transform, opacity;
  transition: opacity 0.25s ease;
}
.work__row {
  display: grid;
  grid-template-columns: 1fr clamp(130px, 15vw, 230px) clamp(210px, 24vw, 380px);
  align-items: center;
  gap: clamp(16px, 2.5vw, 40px);
  width: 100%;
  height: 100%;
  padding-left: clamp(220px, 18vw, 380px);
  padding-right: var(--pad);
  text-align: left;
  color: inherit;
}
.work__item.is-hovered .work__row {
  opacity: 1 !important;
}
.work__row-name {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s, text-shadow 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.work__item.is-hovered .work__row-name,
.work__item.is-preview .work__row-name {
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.32);
  transform: translateX(8px);
}
.work__row-origin,
.work__row-scope {
  font-family: var(--font-mono);
  font-size: clamp(9px, 0.72vw, 12px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s, opacity 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.work__item.is-hovered .work__row-origin,
.work__item.is-hovered .work__row-scope,
.work__item.is-preview .work__row-origin,
.work__item.is-preview .work__row-scope {
  color: #fff;
  opacity: 1;
  transform: translateX(8px);
}

/* mobile: filters become a top row, side columns drop away */
@media (max-width: 767px) {
  .work__filters {
    left: var(--pad);
    right: var(--pad);
    top: calc(var(--nav-h) + 12px);
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 18px;
  }
  .work__row {
    grid-template-columns: 1fr;
    padding-left: var(--pad);
  }
  .work__row-origin,
  .work__row-scope { display: none; }
  .work__row-name { font-size: clamp(20px, 5.6vw, 26px); }

  /* fade rows out under the nav/filters and at the bottom edge */
  .work__stage::before,
  .work__stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 5;
    pointer-events: none;
  }
  .work__stage::before {
    top: 0;
    height: calc(var(--nav-h) + 64px);
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.95) 40%, rgba(10, 10, 10, 0));
  }
  .work__stage::after {
    bottom: 0;
    height: 64px;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0));
  }
}

/* ---------- archive ---------- */
.project-detail {
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}
.project-page .nav__logo {
  mix-blend-mode: normal;
  filter: drop-shadow(0 1px 3px rgba(32, 32, 29, 0.32));
}
.project-intro {
  min-height: clamp(360px, 42vh, 520px);
  padding: calc(var(--nav-h) + 38px) var(--pad) 24px;
  background: #f2efe9;
  color: #20201d;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(34px, 6vh, 72px);
}
.project-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: rgba(32, 32, 29, 0.58);
}
.project-back {
  color: #20201d;
  border-bottom: 1px solid rgba(32, 32, 29, 0.48);
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}
.project-back:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.project-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px var(--pad);
  max-width: 1060px;
}
.project-meta__item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.project-meta__label { color: rgba(32, 32, 29, 0.45); }
.project-meta__value {
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.25;
}
.project-title-row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.4fr);
  align-items: end;
  gap: var(--pad);
}
.project-number {
  color: rgba(32, 32, 29, 0.32);
  justify-self: end;
  padding-bottom: clamp(5px, 1vw, 12px);
}
.project-title {
  max-width: 14ch;
  justify-self: end;
  font-size: clamp(44px, 7.2vw, 132px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-align: right;
  /* mask for the char reveal — padding keeps descenders visible,
     negative margin cancels the layout shift */
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.project-title .char,
.project-next__title .char { display: inline-block; will-change: transform; }
.project-hero {
  height: 560px;
  width: 100%;
  overflow: hidden;
  background: var(--bg-2);
}
.project-hero__img,
.project-media__img,
.project-split__img,
.project-duo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-copy {
  padding: clamp(42px, 8vh, 92px) var(--pad);
  background: #211f1f;
}
.project-copy--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.project-copy__title,
.project-panel .project-copy__title {
  margin-bottom: 16px;
  font-size: clamp(24px, 2.4vw, 42px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}
.project-copy__body,
.project-panel .project-copy__body {
  max-width: 1160px;
  color: rgba(242, 239, 233, 0.82);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.55;
}
.project-copy--center .project-copy__body {
  text-align: justify;
  text-align-last: center;
}
.project-media,
.project-split__media,
.project-duo__item {
  height: 750px;
  overflow: hidden;
  background: var(--bg-2);
}
.project-media { width: 100%; }
.project-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 28vw);
  min-height: 750px;
  background: #211f1f;
}
.project-split--reverse {
  grid-template-columns: minmax(320px, 28vw) minmax(0, 1fr);
}
.project-panel {
  min-height: 750px;
  padding: clamp(34px, 4vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #211f1f;
}
.project-panel .project-copy__body {
  max-width: 36ch;
  text-align: justify;
}
.project-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.project-next {
  border-top: 1px solid rgba(32, 32, 29, 0.14);
  background: #f2efe9;
  color: #20201d;
}
.project-next__link {
  display: grid;
  grid-template-columns: minmax(100px, 0.4fr) 1fr minmax(140px, 0.4fr);
  align-items: center;
  gap: var(--pad);
  padding: clamp(28px, 5vh, 70px) var(--pad);
}
.project-next__label,
.project-next__meta { color: rgba(32, 32, 29, 0.5); }
.project-next__title {
  font-size: clamp(34px, 5vw, 88px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.project-next__link:hover .project-next__title { color: var(--accent); }
@media (max-width: 767px) {
  .project-intro {
    min-height: 470px;
    gap: 32px;
  }
  .project-meta {
    grid-template-columns: 1fr 1fr;
  }
  .project-title-row {
    grid-template-columns: 1fr;
  }
  .project-number,
  .project-title {
    justify-self: start;
    text-align: left;
  }
  .project-hero { height: 560px; }
  .project-media,
  .project-split__media,
  .project-duo__item,
  .project-panel {
    height: auto;
    min-height: 750px;
  }
  .project-split,
  .project-split--reverse,
  .project-duo,
  .project-next__link {
    grid-template-columns: 1fr;
  }
  .project-panel { min-height: auto; }
}

/* ---------- archive ---------- */
.archive { position: relative; padding-bottom: clamp(60px, 10vh, 140px); }
.archive--page { padding-top: var(--nav-h); }
.page-title {
  padding: clamp(20px, 4vh, 50px) var(--pad);
  font-size: clamp(52px, 11vw, 180px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.archive__table { border-top: 1px solid var(--line); }
.archive__row {
  display: grid;
  /* mobile shows 3 cells: no. / project / year */
  grid-template-columns: 3.2rem 1fr 5.4rem;
  gap: 14px;
  align-items: baseline;
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.archive__row > span:nth-child(3) { display: none; }
.archive__row > span:nth-child(4) { display: none; }
@media (min-width: 768px) {
  .archive__row { grid-template-columns: 3.2rem 1fr 12rem 11rem 5.4rem; }
  .archive__row > span:nth-child(3) { display: block; }
  .archive__row > span:nth-child(4) { display: block; }
}
.archive__row--head { color: var(--faint); padding-top: 12px; padding-bottom: 12px; }
.archive__row--item { cursor: pointer; transition: background 0.3s, padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.archive__row--item:hover { background: rgba(242, 239, 233, 0.045); padding-left: calc(var(--pad) + 10px); }
.archive__num { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.archive__name {
  font-size: clamp(17px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archive__row--item:hover .archive__name { color: var(--accent); }
.archive__origin, .archive__cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive__year { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: right; }

.archive__float {
  position: fixed;
  top: 0; left: 0;
  z-index: 80;
  width: clamp(220px, 24vw, 360px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  border: 1px solid var(--line);
  display: none;
}
@media (pointer: fine) { .archive__float { display: block; } }

/* ---------- about ---------- */
.about { padding-bottom: clamp(70px, 12vh, 160px); }
.about--page { padding-top: var(--nav-h); }
.about__statement {
  padding: clamp(36px, 7vh, 90px) var(--pad);
  max-width: 20ch;
  font-size: clamp(28px, 4.6vw, 72px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.02em;
}
.about__statement .word { opacity: 0.15; display: inline-block; }
.about__grid {
  display: grid;
  gap: 40px var(--pad);
  padding: 0 var(--pad);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .about__grid { grid-template-columns: 1fr 1fr 1.2fr; } }
.about__col-title { color: var(--faint); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.about__list { padding-top: 16px; }
.about__list li {
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.about__list--small li { font-size: clamp(16px, 1.5vw, 22px); color: var(--muted); }
.about__col--stats { display: flex; flex-direction: column; gap: 22px; }
.about__stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.about__stat-num { font-size: clamp(34px, 4vw, 60px); font-weight: 700; color: var(--accent); }
.about__stat-label { color: var(--muted); }

/* ---------- contact / footer ---------- */
.contact { position: relative; overflow: hidden; }
.contact__cta {
  display: block;
  padding: clamp(40px, 9vh, 110px) var(--pad) clamp(30px, 6vh, 80px);
  font-size: clamp(44px, 10.5vw, 170px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.contact__line { display: block; }
.contact__line--accent { color: transparent; -webkit-text-stroke: 2px var(--ink); transition: color 0.5s; }
.contact__cta:hover .contact__line--accent { color: var(--accent); -webkit-text-stroke-color: transparent; }

.contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  justify-content: space-between;
  padding: 0 var(--pad) clamp(40px, 7vh, 90px);
}
.contact__email { color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.contact__email:hover { color: var(--accent); }
.contact__socials { display: flex; gap: clamp(16px, 3vw, 40px); color: var(--muted); }
.contact__socials a:hover { color: var(--ink); }

.contact__marquee { border-bottom: 0; }
.contact__marquee-text {
  font-family: var(--font-sans);
  font-size: clamp(60px, 11vw, 190px);
  font-weight: 700;
  line-height: 1;
  padding: 18px 0 26px;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 239, 233, 0.3);
  text-transform: uppercase;
}

.contact__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  justify-content: space-between;
  padding: 22px var(--pad) 28px;
  border-top: 1px solid var(--line);
  color: var(--faint);
}
.contact__bottom a:hover { color: var(--ink); }

/* ---------- fallbacks ---------- */
/* browsers without text-stroke would otherwise show invisible text */
@supports not (-webkit-text-stroke: 1px black) {
  .contact__line--accent,
  .contact__marquee-text { color: var(--ink); }
}

/* ---------- short landscape screens ---------- */
@media (max-height: 540px) and (orientation: landscape) {
  :root { --wheel-item-h: 36px; }
  .work__row-name { font-size: clamp(16px, 5.4vh, 24px); }
}

/* ============================================================
   SERVICES (about page) — hero + wall-fall cards
   ============================================================ */

/* ---------- hero ---------- */
.svc-hero {
  position: relative;
  height: 100svh;
  min-height: 50rem;
}

.svc-hero__floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.svc-float {
  position: absolute;
  border-radius: 4px;
  overflow: clip;
  will-change: transform;
}
.svc-float img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.svc-hero > *:not(.svc-hero__floats) { z-index: 1; }

.svc-hero__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}
.svc-title {
  text-align: center;
  font-size: 8vw;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.svc-title .svc-word { display: inline-block; }
.svc-word {
  line-height: 0.85;
  position: relative;
  text-transform: uppercase;
  clip-path: polygon(0 2%, 0 98%, 100% 98%, 100% 2%);
}
.svc-word__scroll { display: block; will-change: transform; }
.svc-word__visible { display: block; }
.svc-word__hidden { position: absolute; left: 0; top: -100%; }

.svc-desc {
  position: absolute;
  bottom: 10svh;
  left: 50%;
  transform: translateX(-50%);
  width: 34vw;
  text-align: center;
  color: var(--muted);
}
.svc-desc__mask {
  display: block;
  clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0);
}
.svc-desc__scroll,
.svc-desc__visible { display: block; will-change: transform; }

/* ---------- cards ---------- */
.svc-cards {
  padding: 0 0 100vh;
  position: relative;
  overflow: hidden;
}
.svc-card { height: 100dvh; min-height: 35rem; }
.svc-card:not(:last-child) { margin-bottom: 100dvh; }

.svc-card__wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  perspective: 250vw;
}
.svc-card__content {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 10%;
  padding: calc(var(--nav-h) + 2rem) var(--pad) 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.svc-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.svc-card__top p {
  font-size: 8vw;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-weight: 700;
  text-transform: uppercase;
}
.svc-card__icon {
  width: 6vw;
  height: auto;
  display: block;
  transform: rotate(-45deg);
  opacity: 0.9;
}

.svc-card__bottom {
  display: flex;
  align-items: flex-end;
  gap: 25px;
}
.svc-card__bottom > div:first-child {
  width: 32vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-right: auto;
}
.svc-card__tag {
  letter-spacing: 0.06em;
  margin-bottom: 0.9em;
  opacity: 0.6;
}
.svc-card__text {
  font-size: 1.6vw;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
}
.svc-card__bottom > div:last-child {
  display: flex;
  align-items: flex-end;
  margin-right: 25%;
  margin-bottom: 0.5rem;
}
.svc-card__num {
  font-size: 8vw;
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.svc-card__showcase {
  position: absolute;
  top: calc(50% + 1rem);
  left: var(--pad);
  right: var(--pad);
  transform: translateY(-50%);
  display: flex;
  gap: 1rem;
  pointer-events: none;
  z-index: 1;
}
.svc-card__showcase-item {
  flex: 1;
  aspect-ratio: 4 / 5;
  max-height: min(42vh, calc(100dvh - 14rem - 16vw));
  border-radius: 4px;
  overflow: hidden;
  will-change: opacity;
}
.svc-card__showcase-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* colour schemes — light / dark / accent */
.svc-card--scheme-1 .svc-card__content { background: var(--ink); color: var(--bg); }
.svc-card--scheme-2 .svc-card__content { background: var(--bg-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.svc-card--scheme-3 .svc-card__content { background: var(--accent); color: var(--bg); }
.svc-card--scheme-3 .svc-card__tag { opacity: 0.75; }

/* footer must slide over the last falling card */
.svc-after {
  position: relative;
  z-index: 10;
  background: var(--bg);
}

/* ---------- short screens ---------- */
@media (max-height: 700px) and (min-width: 768px) {
  .svc-hero { min-height: 30rem; }
}

/* short-but-wide viewports (landscape phones, snapped windows):
   pinning is disabled in JS — collapse pin spacing and stack statically */
@media (min-width: 768px) and (max-height: 600px) {
  .svc-cards { padding: 0 !important; overflow: visible; }
  .svc-card { height: auto; min-height: 100dvh; }
  .svc-card:not(:last-child) { margin-bottom: 0; }
  .svc-card__content {
    position: static;
    padding: 10dvh var(--pad) 2rem;
  }
  .svc-card__top { order: 1; }
  .svc-card__showcase {
    order: 2;
    position: static;
    transform: none;
    margin: 1.25rem 0;
  }
  .svc-card__showcase-item { max-height: 32vh; }
  .svc-card__bottom { order: 3; }
}

/* ---------- tablet ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .svc-card__bottom > div:first-child { width: 50vw; }
  .svc-card__text { font-size: 2.6vw; }
}

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  .svc-hero { min-height: 30rem; }

  /* reposition floats for small screens */
  .svc-float:nth-child(1) { top: 1%  !important; left: -6%  !important; width: 22vw !important; }
  .svc-float:nth-child(2) { top: 22% !important; left: 22%  !important; width: 15vw !important; }
  .svc-float:nth-child(3) { top: 6%  !important; left: 52%  !important; width: 16vw !important; }
  .svc-float:nth-child(4) { top: 26% !important; left: 70%  !important; width: 18vw !important; }
  .svc-float:nth-child(5) { top: 3%  !important; left: 82%  !important; width: 20vw !important; }
  .svc-float:nth-child(6) { top: 28% !important; left: -4%  !important; width: 17vw !important; }
  .svc-float:nth-child(7) { top: 64% !important; left: -10% !important; width: 22vw !important; }
  .svc-float:nth-child(8) { top: 66% !important; left: 86%  !important; width: 20vw !important; }

  .svc-title { font-size: 13vw; }
  .svc-desc {
    width: calc(100vw - 2rem);
    bottom: 2rem;
  }

  /* static stacked cards — no pin / fall on mobile */
  .svc-cards { padding: 0; overflow: visible; }
  .svc-card { height: 100dvh; min-height: 0; }
  .svc-card:not(:last-child) { margin-bottom: 0; }

  .svc-card__content {
    padding: 12dvh 1rem 2.5rem;
  }
  .svc-card__top { order: 1; }
  .svc-card__top p { font-size: 11vw; }
  .svc-card__icon { width: 11vw; }
  .svc-card__showcase {
    order: 2;
    position: static;
    transform: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin: 1.5rem 0;
  }
  .svc-card__showcase-item {
    flex: 1;
    width: 100%;
    aspect-ratio: unset;
    max-height: none;
    min-height: 0;
  }
  .svc-card__showcase-item:nth-child(n + 2) { display: none; }
  .svc-card__bottom { order: 3; display: block; }
  .svc-card__bottom > div:first-child { width: 100%; }
  .svc-card__text { font-size: 4.5vw; }
  .svc-card__num,
  .svc-card__bottom > div:last-child { display: none; }
}

/* ============================================================
   PAGE TRANSITION — double-slide curtain + logo stinger
   accent slide leads, black slide (with the logo) follows;
   on the next page both exit upward once it has loaded
   ============================================================ */

/* pre-paint cover: a tiny inline <head> script stamps .pt-cover on <html>
   when the page is entered through an internal transition, so the incoming
   page is black (with the logo) before the JS overlay takes over — no flash */
html.pt-cover body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 190;
  background: var(--bg) url("../assets/logo.svg") center / clamp(74px, 9vw, 118px) no-repeat;
  /* failsafe: if main.js never runs, uncover the page instead of trapping it */
  animation: pt-failsafe 0.5s ease 6s forwards;
}
@keyframes pt-failsafe {
  to { opacity: 0; visibility: hidden; }
}

.pt {
  position: fixed;
  inset: 0;
  /* over nav (160) + menu (150), under grain (200) + cursor (300)
     so the site texture stays on top of the loader */
  z-index: 190;
  visibility: hidden;
  pointer-events: none;
}
.pt.is-active { visibility: visible; pointer-events: all; }
.pt__slide {
  position: absolute;
  /* 1px overscan hides sub-pixel seams at the edges while sliding */
  inset: -1px 0;
  /* no CSS transform here — GSAP owns it via yPercent; a CSS translateY
     would land in GSAP's separate px channel and permanently offset the
     slides. Off-screen idle state comes from gsap.set(yPercent: 100)
     at overlay creation (the .pt root is also visibility: hidden) */
  will-change: transform;
}
.pt__slide--accent { background: var(--accent); }
.pt__slide--black {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt__logo {
  width: clamp(74px, 9vw, 118px);
  height: auto;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* note: the OS reduced-motion signal is intentionally not honored —
   see the RM flag in js/main.js. ?rm=1 simulates the reduced experience
   and stamps .is-rm on <html> so CSS can join in. */
html.is-rm .noise { animation: none; }
html.is-rm .marquee__track { transform: none !important; }
html.is-rm *, html.is-rm *::before, html.is-rm *::after { transition-duration: 0.01ms !important; }
