/* ============================================
   PORTFOLIO — Global Styles
   ============================================ */

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

/* === VARIABLES === */
:root {
  --black:    rgb(51, 53, 58);
  --white:    #FFFFFF;
  --grey-100: #F5F5F5;
  --grey-200: #EBEBEB;
  --grey-300: #D4D4D4;
  --grey-500: #909090;
  --grey-700: #555555;

  /* UI / body font */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  /* Display / heading font — editorial serif */
  --font-display: 'Figtree', sans-serif;

  --nav-h:    68px;
  --pad:      clamp(20px, 5vw, 80px);
  --gap:      10px;
  --section:  clamp(80px, 10vw, 160px);

  /* Custom easing */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-swipe:  cubic-bezier(0.76, 0, 0.24, 1);
}

/* === BASE === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: #F5F5F5;
  color: var(--black);
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none) {
  body { cursor: auto; }
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === CUSTOM CURSOR === */
.cursor,
.cursor-follower {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  top: -100px;
  left: -100px;
}

.cursor {
  width: 8px;
  height: 8px;
  background: var(--black);
  transition: width 0.3s var(--ease-out),
              height 0.3s var(--ease-out),
              opacity 0.3s;
}

.cursor-follower {
  width: 36px;
  height: 36px;
  overflow: visible;
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}

.cursor-ring__track {
  fill: none;
  stroke: rgba(10, 10, 10, 0.18);
  stroke-width: 1.5;
}

.cursor-ring__progress {
  fill: none;
  stroke: var(--black);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 100.53;
  transform-origin: 18px 18px;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.12s linear;
}

.cursor.is-hovering {
  width: 0;
  height: 0;
  opacity: 0;
}

.cursor-follower.is-hovering {
  transform: translate(-50%, -50%) scale(1.56);
  opacity: 0.5;
}

/* === PAGE TRANSITION OVERLAY === */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 8000;
  pointer-events: none;
  transform: translateY(100%);
}

.page-transition.entering {
  pointer-events: all;
  transform: translateY(0);
  transition: transform 0.55s var(--ease-swipe);
}

.page-transition.exiting {
  transform: translateY(-100%);
  transition: transform 0.55s var(--ease-swipe);
}

/* === TYPOGRAPHY UTILITIES === */
.label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--grey-500);
}

/* === REVEAL / MASK ANIMATIONS === */

/* Wrap clips the motion.
   padding-bottom gives descenders (g, y, p…) room inside the clip.
   Negative margin-bottom cancels layout shift. */
.reveal-wrap {
  display: block;
  overflow: hidden;
  padding-bottom: 0.3em;
  margin-bottom: -0.3em;
}

/* Inner slides up from beneath the mask */
.reveal-text {
  display: block;
  transform: translateY(105%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform;
}

/* Triggered on load (hero) — class removed by JS after fonts load */
body:not(.is-loading) .hero .reveal-text {
  transform: translateY(0);
}

/* Triggered by IntersectionObserver for scroll reveals */
.reveal-on-scroll.is-visible .reveal-text {
  transform: translateY(0);
}

/* Fade-up for supporting elements */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 500;
}

.nav__bg {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--grey-200);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.nav.is-scrolled .nav__bg {
  opacity: 0;
}

.nav__left {
  display: flex;
  align-items: center;
  gap: 62px;
  position: relative;
  z-index: 1;
}

.nav__logo {
  font-size: 15px;
  font-weight: 400;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 15px;
  font-weight: 400;
  position: relative;
  padding-bottom: 1px;
}

.nav__clock {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--black);
  transition: width 0.35s var(--ease-out);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  width: 100%;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + clamp(48px, 7vw, 100px));
  padding-left: var(--pad);
  padding-right: var(--pad);
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Stagger hero lines */
.hero__heading .reveal-wrap:nth-child(1) .reveal-text { --reveal-delay: 80ms; }
.hero__heading .reveal-wrap:nth-child(2) .reveal-text { --reveal-delay: 160ms; }
.hero__heading .reveal-wrap:nth-child(3) .reveal-text { --reveal-delay: 240ms; }

.hero__heading .reveal-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* Serif italic accent — the Design Joy "for everyone" trick */
.hero__heading em,
.project-title-block em,
.about__heading em,
.next-project__title em {
  font-family: 'Playfair Display', serif;
  font-style: normal;
  font-weight: 400;
}

.hero__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-top: clamp(40px, 6vw, 80px);
  max-width: 920px;
}

.hero__meta-left .label {
  display: block;
  margin-bottom: 14px;
}

.hero__meta-left p {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--black);
}

.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-700);
}

.available-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
}

.available-dot::after {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.35);
  transform: scale(0);
  animation: sonar 2.5s infinite 1s;
}

@keyframes sonar {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

.hero__bio {
  font-size: 15px;
  line-height: 1.8;
  color: var(--grey-700);
}

.hero__scroll {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: clamp(32px, 4vw, 60px);
}

.hero__scroll-line {
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: var(--grey-300);
  display: block;
}

/* ============================================
   HERO — SEARCH VARIANT
   ============================================ */
.hero--search {
  position: relative;
  justify-content: flex-start; /* override space-between */
  align-items: stretch;
  padding-bottom: 50px;
}

/* Heading + search centered vertically in remaining space */
.hero__center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(36px, 5vw, 56px);
  width: 100%;
  padding-bottom: 60px;
}

/* 2-line centered heading — slightly larger since we have fewer lines */
.hero--search .hero__heading .reveal-text {
  font-size: 72px;
  font-family: 'Figtree', sans-serif;
  font-weight: 400;
}

/* Scroll indicator pushed to bottom */
.hero--search .hero__scroll {
  margin-top: auto;
  align-self: flex-start;
  padding-top: 0;
}

/* ---- Search bar ---- */
.hero__search {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.search-form {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1.5px solid var(--black);
  border-radius: 100px;
  background: var(--black);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.search-form:focus-within {
  border-color: var(--black);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  padding: 14px 20px;
  color: var(--white);
  cursor: text;
}

.search-input::placeholder {
  color: var(--grey-500);
}

.search-submit {
  border: none;
  background: var(--white);
  color: var(--black);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.search-submit:hover {
  background: var(--grey-200);
  transform: scale(1.06);
}

/* AI response text — typewritten below the search bar */
.search-response {
  font-size: 13px;
  line-height: 1.8;
  color: var(--grey-700);
  width: 100%;
  max-width: 700px;
  text-align: left;
  padding-left: 20px;
  min-height: 3.6em;
  opacity: 0;
  transition: opacity 0.2s;
}

.search-response.is-visible {
  opacity: 1;
}

.search-link {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.search-response.is-thinking::after,
.search-response.is-typing::after {
  content: '|';
  color: var(--black);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ---- Recent searches sidebar ---- */
.search-panel {
  position: absolute;
  top: calc(var(--nav-h) + 48px);
  right: calc(var(--pad) + 120px);
  width: 190px;
  text-align: left;
  mix-blend-mode: difference;
  z-index: 1;
}

.search-panel__label {
  display: block;
  margin-bottom: 8px;
  padding-left: 16px;
  color: rgba(255, 255, 255, 0.55);
}

.search-panel__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-panel__item {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  padding: 0;
  padding-left: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.search-panel__item-text {
  position: relative;
  padding-bottom: 1px;
}

.search-panel__item-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease-out);
}

.search-panel__item:hover {
  opacity: 0.5;
}

.search-panel__item:hover .search-panel__item-text::after {
  width: 100%;
}

@media (max-width: 900px) {
  .search-panel { display: none; }
}

/* ============================================
   WORKS GRID
   ============================================ */
.works {
  padding: 0 var(--pad) var(--section);
  max-width: calc(1120px + 2 * var(--pad));
  margin-inline: auto;
}

/* ---- Full-width card ---- */
.project-card--full {
  margin-bottom: calc(var(--gap) + 15px);
}

.project-card--full .project-card__image {
  aspect-ratio: 16 / 7;
}

/* ---- Rows ---- */
.project-row {
  display: grid;
  gap: var(--gap);
  margin-bottom: calc(var(--gap) + 15px);
}

.project-row--4 { grid-template-columns: repeat(4, 1fr); }
.project-row--3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.project-row--2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Stagger in rows */
.project-row .project-card:nth-child(1) { --reveal-delay: 0ms; }
.project-row .project-card:nth-child(2) { --reveal-delay: 80ms; }
.project-row .project-card:nth-child(3) { --reveal-delay: 160ms; }
.project-row .project-card:nth-child(4) { --reveal-delay: 240ms; }

/* ---- Card ---- */
.project-card {
  cursor: none;
}

.project-card__link {
  display: block;
}

.project-card__image {
  overflow: hidden;
  position: relative;
  background: var(--grey-200);
  border-radius: 12px;
}

.project-row--4 .project-card__image {
  aspect-ratio: 4 / 3;
}

.project-row--3 .project-card__image {
  aspect-ratio: 4 / 3;
}

.project-row--2 .project-card__image {
  aspect-ratio: 16 / 10;
}

/* Placeholder fill */
.project-card__placeholder {
  position: absolute;
  inset: 0;
  background: hsl(var(--ph-hue, 0deg), 6%, var(--ph-l, 88%));
  transition: transform 0.75s var(--ease-out);
  will-change: transform;
}

/* Add a subtle diagonal pattern to distinguish placeholder from blank */
.project-card__placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.3) 40px,
      rgba(255,255,255,0.3) 41px
    );
  opacity: 0.4;
}

.project-card__link:hover .project-card__placeholder {
  transform: scale(1.05);
}

.project-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.75s var(--ease-out);
  will-change: transform;
}

.project-card__link:hover .project-card__img {
  transform: scale(1.05);
}

/* Image overlay on hover */
.project-card__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0);
  transition: background 0.4s;
  z-index: 1;
  pointer-events: none;
}

.project-card__link:hover .project-card__image::before {
  background: rgba(10, 10, 10, 0.05);
}

/* Info row */
.project-card__info {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 12px;
}

.project-card__category {
  display: block;
  width: fit-content;
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 1px;
  position: relative;
  padding-bottom: 1px;
}

.project-card__category::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--black);
  transition: width 0.3s var(--ease-out);
}

.project-card__link:hover .project-card__category::after {
  width: 100%;
}

.project-card__year {
  font-size: 12px;
  color: var(--grey-500);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  padding: clamp(40px, 5vw, 80px) var(--pad) var(--section);
  border-top: 1px solid var(--grey-200);
}

.about__inner {
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  gap: 120px;
  align-items: start;
}

/* Bio heading + body */
.about__bio-heading {
  flex: 0 0 42%;
  max-width: 42%;
}

.about__bio-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--black);
}

.about__bio-body {
  margin-top: 30px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--grey-700);
}

.about__strike {
  color: var(--grey-300);
  text-decoration: line-through;
  text-decoration-color: var(--grey-300);
}

/* 2-column grid */
.about__columns {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 120px;
  align-items: start;
  justify-content: start;
}

.about__col-label--spaced {
  margin-top: 40px;
}

.about__col-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 28px;
}

.about__col-entry {
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.55;
}

.about__col-entry strong {
  display: block;
  font-weight: 600;
  color: var(--black);
}

.about__col-entry span {
  color: var(--grey-700);
}

.about__col-list {
  list-style: none;
  font-size: 14px;
  line-height: 1.75;
  color: var(--grey-700);
}

.about__col-group {
  margin-bottom: 24px;
}

.about__col-group strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 2px;
}

.about__col-link {
  text-decoration: underline;
  color: var(--black);
  font-size: 14px;
  transition: opacity 0.2s;
}

.about__col-link:hover {
  opacity: 0.5;
}

.about__col-plain {
  font-size: 14px;
  color: var(--grey-700);
}

/* Keep em italic accent working */
.about__heading em {
  font-family: 'Playfair Display', serif;
  font-style: normal;
  font-weight: 400;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: clamp(40px, 5vw, 80px) var(--pad) 40px;
  border-top: 1px solid var(--grey-200);
}

.footer__cta {
  max-width: 1120px;
  margin-inline: auto;
  margin-bottom: 24px;
}

.footer__cta .label {
  display: block;
  margin-bottom: 20px;
}

.footer__label--large {
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--black);
}

@media (max-width: 768px) {
  .footer__label--large {
    font-size: 28px;
  }
}

.footer__email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
}

.footer__email::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--black);
  transition: width 0.45s var(--ease-out);
}

.footer__email:hover::after {
  width: 100%;
}

.footer__bottom {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-top: 16px;
}

/* Socials now live under the email */
.footer__socials {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

/* Live clock — bottom right */
.footer__clock {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #000;
  font-variant-numeric: tabular-nums;
}

.footer__social {
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-500);
  position: relative;
  padding-bottom: 1px;
  transition: color 0.25s;
}

.footer__social::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--black);
  transition: width 0.3s var(--ease-out);
}

.footer__social:hover {
  color: var(--black);
}

.footer__social:hover::after {
  width: 100%;
}

/* ============================================
   PROJECT PAGE
   ============================================ */
.project-intro {
  padding: calc(var(--nav-h) + clamp(24px, 3vw, 40px)) var(--pad) 0;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--grey-500);
  margin-bottom: clamp(40px, 5vw, 72px);
  position: relative;
  padding-bottom: 1px;
  transition: color 0.25s;
}

.project-back::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--grey-500);
  transition: width 0.3s var(--ease-out);
}

.project-back:hover {
  color: var(--black);
}

.project-back:hover::after {
  width: 100%;
}

.project-back .arrow {
  font-size: 14px;
  transition: transform 0.25s var(--ease-out);
}

.project-back:hover .arrow {
  transform: translateX(-4px);
}

/* Project title */
.project-title-block {
  margin-bottom: clamp(40px, 5vw, 64px);
}

/* Stagger project title lines */
.project-title-block .reveal-wrap:nth-child(1) .reveal-text { --reveal-delay: 60ms; }
.project-title-block .reveal-wrap:nth-child(2) .reveal-text { --reveal-delay: 140ms; }

.project-title-block .reveal-text {
  font-family: var(--font-display);
  font-size: clamp(42px, 6.5vw, 100px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* 3-column project overview */
.project-overview {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: clamp(40px, 5vw, 72px);
}

.project-overview--no-stats {
  grid-template-columns: 1fr 2fr;
}

.project-overview--no-stats .project-overview__col:last-child {
  padding-right: 100px;
}

.project-overview__col {
  padding: clamp(36px, 4vw, 60px) clamp(28px, 3vw, 48px);
  border-right: 1px solid var(--grey-200);
}

.project-overview__col:first-child {
  padding-left: 0;
}

.project-overview__col:last-child {
  border-right: none;
  padding-right: 0;
}

.project-overview__label {
  display: block;
  margin-bottom: 14px;
}

.project-overview__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

.project-overview__summary {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--black);
  margin-bottom: 28px;
}

.project-overview__section {
  margin-bottom: 20px;
}

.project-overview__section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
}

.project-overview__section-body {
  font-size: 14px;
  line-height: 1.45;
  color: var(--grey-700);
}

.project-overview__section-body + .project-overview__section-body {
  margin-top: 12px;
}

/* Stats list */
.project-stats {
  list-style: none;
}

.project-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--grey-200);
  font-size: 16px;
}

.project-stat:first-child {
  padding-top: 0;
}

.project-stat__number {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--grey-700);
  flex-shrink: 0;
}

.project-stat__desc {
  font-size: 14px;
  line-height: 1.45;
  color: var(--grey-700);
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid var(--grey-300);
  border-radius: 2px;
  color: var(--grey-700);
}

/* Project hero image */
.project-hero-img {
  padding: 0 var(--pad);
  margin-bottom: 25px;
}

.project-hero-img > img,
.project-hero-img > video {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.project-hero-img .project-placeholder {
  aspect-ratio: 16 / 8;
}

/* Hero image slide cycle */
.hero-cycle {
  position: relative;
  overflow: hidden;
  display: block;
  line-height: 0;
  border-radius: 12px;
}

.hero-cycle__img {
  display: block;
  width: 100%;
}

.hero-cycle__img--b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-slide-b 7s linear infinite;
}

@keyframes hero-slide-b {
  0%          { transform: translateX(100%);  animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  8%          { transform: translateX(0); }
  50%         { transform: translateX(0);     animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  58%         { transform: translateX(-100%); animation-timing-function: step-start; }
  58.1%, 100% { transform: translateX(100%); }
}

/* Archive card image cycle */
.archive-cycle {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.archive-cycle__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.archive-cycle__img--nxt {
  transform: translateX(100%);
}

/* Project gallery */
.project-gallery {
  padding: 0 var(--pad) var(--section);
}

.project-gallery .project-row {
  gap: 25px;
  margin-bottom: 25px;
}

/* Gallery placeholders */
.project-placeholder {
  background: hsl(var(--ph-hue, 0deg), 6%, var(--ph-l, 88%));
  width: 100%;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.project-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.25) 40px,
      rgba(255,255,255,0.25) 41px
    );
  opacity: 0.4;
}

/* Full-width gallery image */
.project-gallery__full {
  margin-bottom: 25px;
}

.project-gallery img,
.project-gallery video {
  border-radius: 12px;
  display: block;
  width: 100%;
}

.project-gallery__video-frame {
  position: relative;
  aspect-ratio: 1256 / 942;
  overflow: hidden;
  border-radius: 12px;
  background: #272526;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-gallery .project-gallery__video-frame video {
  position: relative;
  width: 60%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
}

/* Full-bleed 2-col: photo left, video right — no side padding, outer radius only */
.project-fullbleed-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 25px;
}

.project-fullbleed-2__left,
.project-fullbleed-2__right {
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.fb2-photo {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.fb2-photo--active {
  transform: translateX(0);
}

.fb2-photo--exit {
  transform: translateX(-100%);
}

.fb2-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-gallery .project-fullbleed-2 img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.fb2-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  transition: opacity 0.4s ease;
}

.fb2-video ~ .fb2-video {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
}

.fb2-video--active {
  opacity: 1;
}

.fb2-video:not(.fb2-video--active) {
  opacity: 0;
}

.fb2-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.fb2-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.fb2-dot--active {
  background: #fff;
  border-color: #fff;
}

/* --- 3-panel swipe cycler --- */
.fb3-cell {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

/* Set A: in normal flow — sizes the cell */
.fb3-img--a {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Set B: absolute overlay, hidden until wipe reveals it */
.fb3-img--b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: none;
}

.fb3-cell.showing-b .fb3-img--b {
  opacity: 1;
}

/* Trainswipe curtain — slides in, holds, slides out */
.fb3-wipe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateX(-101%);
  z-index: 10;
  pointer-events: none;
  will-change: transform;
}

.fb3-cell.is-wipe-in .fb3-wipe {
  animation: fb3WipeIn 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fb3-cell.is-held .fb3-wipe {
  transform: translateX(0);
}

.fb3-cell.is-wipe-out .fb3-wipe {
  animation: fb3WipeOut 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fb3WipeIn {
  from { transform: translateX(-101%); }
  to   { transform: translateX(0); }
}

@keyframes fb3WipeOut {
  from { transform: translateX(0); }
  to   { transform: translateX(101%); }
}

@media (max-width: 768px) {
  .project-fullbleed-2 {
    grid-template-columns: 1fr;
  }

  .project-fullbleed-2__left {
    aspect-ratio: 1440 / 722;
  }
}

/* Centered image — renders at natural width, no scale-up */
.project-gallery__centered {
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
}

.project-gallery__centered img {
  width: auto;
  max-width: 100%;
}

.project-split__image {
  border-radius: 12px;
  overflow: hidden;
}

.project-split__image img {
  display: block;
  width: 100%;
}

/* Split block — image + copy side by side */
.project-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  align-items: start;
  margin-top: clamp(48px, 6vw, 80px);
  margin-bottom: 25px;
}

.project-split__copy {
  padding-top: 40px;
  padding-right: 35px;
}

.project-split--reverse {
  grid-template-columns: 1fr 1fr;
}

.project-split--reverse .project-split__image {
  order: 2;
}

.project-split--reverse .project-split__copy {
  order: 1;
  padding-left: 20px;
  padding-right: 40px;
}

.project-split__heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--black);
  margin-bottom: 16px;
}

.project-split__body {
  font-size: 14px;
  line-height: 1.45;
  color: var(--grey-700);
}

/* Dark panel split variant */
.project-split--stretch {
  align-items: stretch;
}

.project-split__copy--dark {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-split__copy--dark .project-split__heading {
  color: #fff;
}

.project-split__copy--dark .project-split__body {
  color: rgba(255, 255, 255, 0.65);
}

.project-split__image--dark {
  border-radius: 12px;
  overflow: hidden;
  background: #1e1e1e;
}

.project-split__image--dark img {
  display: block;
  width: 100%;
}

/* Unified dark split — no gap, shared background */
.project-split--unified-dark {
  background: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  gap: 0;
}

.project-split--unified-dark .project-split__image,
.project-split--unified-dark .project-split__image--dark {
  border-radius: 0;
}

.project-split--unified-dark .project-split__copy--dark {
  background: transparent;
  border-radius: 0;
}

@media (max-width: 768px) {
  .project-split,
  .project-split--reverse {
    grid-template-columns: 1fr;
  }

  .project-split--reverse .project-split__image,
  .project-split--reverse .project-split__copy {
    order: unset;
  }
}

/* Copy block between images */
.project-copy-block {
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Tighter spacing below non-centered copy blocks, so they read as attached
   to the image that follows rather than floating evenly between two images.
   Centered pull-quotes/stats keep the default symmetric spacing. */
.project-copy-block--tight {
  padding-bottom: calc(clamp(48px, 6vw, 80px) - 35px);
}

.project-copy-block__heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--black);
  margin-bottom: 16px;
}

.project-copy-block__body {
  font-size: 14px;
  line-height: 1.45;
  color: var(--grey-700);
}

/* Caption under gallery image */
.gallery-caption {
  font-size: 11.5px;
  color: var(--grey-500);
  padding-top: 10px;
  line-height: 1.5;
}

/* ============================================
   PROJECT THUMBNAIL CAROUSEL (stacking)
   ============================================ */
.projects-carousel-section {
  display: flex;
  align-items: flex-start;
  gap: clamp(24px, 4vw, 56px);
  border-top: 1px solid var(--grey-200);
  padding: clamp(40px, 6vw, 72px) 0;
}

.projects-carousel__label {
  flex-shrink: 0;
  padding-left: var(--pad);
  line-height: 1.05;
}

.projects-carousel__label-line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--black);
}

.projects-carousel {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.projects-carousel::-webkit-scrollbar { display: none; }
.projects-carousel.is-dragging        { cursor: grabbing; }

.projects-carousel__track {
  display: flex;
  gap: 16px;
  width: max-content;
}

.project-thumb {
  display: block;
  flex-shrink: 0;
  width: clamp(240px, 26vw, 380px);
  text-decoration: none;
  color: inherit;
  position: sticky;
  left: 0;
  background: var(--white, #fff);
  border-radius: 12px;
}

.project-thumb__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 12px;
  background: var(--grey-100);
}

.project-thumb__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Next project link */
.next-project {
  padding: var(--section) var(--pad);
  border-top: 1px solid var(--grey-200);
}

.next-project__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.next-project .label {
  display: block;
  margin-bottom: 20px;
}

.next-project__link {
  display: block;
  width: 100%;
}

.next-project__title .reveal-text {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 80px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.next-project__arrow {
  display: block;
  font-size: 48px;
  font-weight: 300;
  margin-top: 20px;
  transition: transform 0.35s var(--ease-out);
}

.next-project__link:hover .next-project__arrow {
  transform: translateX(12px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .project-meta {
    grid-template-columns: 80px 1fr 1fr;
  }
  .project-meta__item:last-child {
    grid-column: 2 / -1;
    border-top: 1px solid var(--grey-200);
    padding-top: 24px;
  }
}

@media (max-width: 1024px) {
  .project-row--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .about__inner {
    flex-direction: column;
    gap: 40px;
  }

  .about__bio-heading {
    flex: none;
    max-width: 100%;
  }

  .about__columns {
    grid-template-columns: repeat(2, auto);
    gap: 60px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav__menu { gap: 20px; }

  .project-overview {
    grid-template-columns: 1fr;
  }

  .project-overview__col {
    border-right: none;
    border-bottom: 1px solid var(--grey-200);
    padding: clamp(28px, 4vw, 40px) 0;
  }

  .project-overview__col:last-child {
    border-bottom: none;
    padding-right: 0;
  }

  .hero__meta {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-row--4,
  .project-row--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .project-meta {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .project-meta__item:last-child {
    grid-column: auto;
    border-top: none;
    padding-top: 0;
  }
}

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

  .project-row--4,
  .project-row--2 {
    grid-template-columns: 1fr;
  }

  .project-card--full .project-card__image {
    aspect-ratio: 4 / 3;
  }

  .nav__menu { gap: 16px; }

  .project-meta {
    grid-template-columns: 1fr;
  }

  .project-meta__item:last-child {
    border-top: none;
    padding-top: 0;
  }

  /* Disable custom cursor on touch */
  body { cursor: auto; }
  .cursor,
  .cursor-follower { display: none; }

  /* Hero tagline — match the project title size (e.g. "Fireside") on mobile */
  .hero--search .hero__heading .reveal-text {
    font-size: 36px;
  }

  /* Homepage work grid: merge the two 3-up rows into one continuous 2-column
     flow so it reads as clean pairs (2/2/2) instead of each 3-item row
     wrapping on its own (2/1/2/1). The 2-up row (Fireside+Oxrow) is left
     as its own full-width row, untouched. */
  .works {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 20px;
  }

  .project-row--2 {
    grid-column: 1 / -1;
  }

  .project-row--3 {
    display: contents;
  }

  /* Tighten space above card title/category by 2px */
  .project-card__info {
    padding-top: 10px;
  }

  /* TL;DR/Problem/Research column was losing ~100px to a desktop-only
     right-padding rule that's more specific than the 768px reset —
     match its specificity so mobile actually gets full width. */
  .project-overview--no-stats .project-overview__col:last-child {
    padding-right: 0;
  }

  /* Right-align the nav clock so wrapped "TPE" / time lines share an edge */
  .nav__clock {
    text-align: right;
  }

  /* Nav: drop the clock and let the menu take its spot on the right,
     top-aligned with "Adam Chang". .nav__left is unwrapped via
     display:contents so the logo and menu become direct children of
     .nav, letting justify-content: space-between push the menu all the
     way to the far right instead of sitting next to the logo. */
  .nav {
    align-items: flex-start;
    padding-top: 20px;
  }

  .nav__left {
    display: contents;
  }

  .nav__clock {
    display: none;
  }
}

/* ============================================
   THEME TOGGLE — iOS-style pill, bottom-left
   Clean version = OFF state (grey track, knob left)
   ============================================ */
.theme-toggle {
  position: fixed;
  bottom: 26px;
  right: 32px;
  z-index: 700;
  /* pill dimensions */
  width: 44px;
  height: 26px;
  border-radius: 13px;
  /* OFF track — black to match page */
  background: var(--black);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: block;
  font-size: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  transition: background 0.16s var(--ease-out),
              box-shadow 0.16s var(--ease-out),
              transform 0.2s var(--ease-out);
}

.theme-toggle:hover {
  background: #222222;
  transform: scale(1.04);
}

/* Knob — LEFT = off */
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.22),
              0 0 0 0.5px rgba(0,0,0,0.06);
  transition: left 0.16s var(--ease-out);
}

/* Pre-navigation slide, added by JS on click so the toggle visibly
   animates before the page-transition wipe covers the screen — a full
   page load follows, so there's otherwise no continuous DOM to animate. */
.theme-toggle.is-switching {
  background: #FF1A4B;
}

.theme-toggle.is-switching::after {
  left: 25px;
}

/* Tooltip */
.theme-toggle[data-tooltip]::before {
  display: none;
}

/* ============================================
   ARCHIVE PAGE
   ============================================ */

.archive-gallery {
  padding: calc(var(--nav-h) + 64px) var(--pad) var(--section);
  max-width: calc(1120px + 2 * var(--pad));
  margin-inline: auto;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 56px;
  row-gap: 80px;
  align-items: start;
}

.archive-item {
  cursor: pointer;
}

.archive-item__img-wrap {
  overflow: hidden;
  background: var(--grey-200);
  border-radius: 12px;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.archive-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: unset;
  transition: opacity 0.3s ease;
}

.archive-item:hover img {
  opacity: 0.82;
}

.archive-item__caption {
  margin-top: 10px;
}

.archive-item__title {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-700);
  line-height: 1.5;
}

.archive-item__stat {
  display: block;
  font-size: 12px;
  color: var(--grey-500);
  line-height: 1.5;
}

.archive-item__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--grey-700);
  text-decoration: none;
  transition: color 0.18s;
}

.archive-item__link:hover {
  color: var(--black);
}

.archive-item__link svg {
  flex-shrink: 0;
}

/* Lightbox */
.archive-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 14, 13, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.archive-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.archive-lightbox__img {
  display: block;
  max-width: min(653px, 90vw);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translateY(6px);
  opacity: 0;
  transition: transform 0.32s var(--ease-out), opacity 0.28s ease;
}

.archive-lightbox.is-open .archive-lightbox__img {
  transform: translateY(0);
  opacity: 1;
}

.archive-lightbox__close {
  position: absolute;
  top: 28px;
  left: 28px;
  background: none;
  border: none;
  font-size: 16px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  font-family: var(--font);
  transition: color 0.18s;
}

.archive-lightbox__close:hover {
  color: rgba(255,255,255,0.9);
}

@media (max-width: 900px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 32px;
    row-gap: 56px;
  }
}

@media (max-width: 540px) {
  .archive-grid {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }
  .archive-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
  }
}

