/* ==========================================================================
   Rojina — Portfolio
   ========================================================================== */

:root {
  --paper: #EDEAE4;
  --ink: #0E0E0E;
  --accent: #FF4F1F;

  /* --bg / --fg are tweened by GSAP when entering dark sections */
  --bg: #EDEAE4;
  --fg: #0E0E0E;
  --line: color-mix(in srgb, var(--fg) 16%, transparent);
  --muted: color-mix(in srgb, var(--fg) 55%, transparent);

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;

  --pad: clamp(16px, 2.2vw, 36px);
  --section: clamp(110px, 14vw, 220px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
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(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
sup { font-size: .5em; vertical-align: super; line-height: 0; }

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}

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

.has-cursor, .has-cursor a, .has-cursor button, .has-cursor label { cursor: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Layers ---------- */

.webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main { position: relative; z-index: 2; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------- Loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  clip-path: inset(0 0 0 0);
}
.loader__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad);
}
.loader__top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: .02em;
}
.loader__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.loader__note {
  font-size: 13px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}
.loader__count {
  display: flex;
  align-items: flex-start;
  font-size: clamp(96px, 22vw, 380px);
  font-weight: 500;
  letter-spacing: -.07em;
  line-height: .78;
  font-variant-numeric: tabular-nums;
}
.loader__pct {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: .3em;
  letter-spacing: 0;
  margin-left: .15em;
  color: var(--accent);
}
.loader__bar {
  height: 1px;
  margin-top: 18px;
  background: color-mix(in srgb, var(--paper) 18%, transparent);
}
.loader__bar span {
  display: block;
  height: 100%;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Cursor ---------- */

.cursor { display: none; }

.has-cursor .cursor {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  pointer-events: none;
}
.cursor__dot,
.cursor__ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
}
.cursor__dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.cursor__ring {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}
.cursor__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--fg);
  opacity: .35;
  transform: scale(.42);
  transition: transform .5s var(--ease), background-color .4s, opacity .4s, border-color .4s;
}
.cursor__label {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s, transform .5s var(--ease);
}
.cursor.is-hover .cursor__ring::before { transform: scale(.7); opacity: .6; }
.cursor.is-view .cursor__ring::before {
  transform: scale(1);
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
}
.cursor.is-view .cursor__label { opacity: 1; transform: scale(1); }
.cursor.is-view .cursor__dot { opacity: 0; }
.cursor.is-hidden { opacity: 0; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: var(--pad);
  font-size: 13px;
  letter-spacing: .01em;
  color: #fff;
  mix-blend-mode: difference;
}
.nav__logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.nav__links { display: flex; gap: 1.6rem; }
.nav__links a,
.footer a {
  position: relative;
}
.nav__links a::after,
.footer a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .6s var(--ease);
}
.nav__links a:hover::after,
.footer a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__links sup { margin-left: 2px; opacity: .6; }

.nav__status { display: flex; align-items: center; gap: 8px; }
.nav__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3DDC84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}
.nav__time { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Shared ---------- */

.section { padding: var(--section) var(--pad); }

.label {
  display: flex;
  gap: 12px;
  margin-bottom: clamp(32px, 4vw, 64px);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  font-size: clamp(52px, 8.4vw, 150px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.055em;
}
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line > span { display: inline-block; }
.section-title em { letter-spacing: -.03em; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--pad) + 90px) var(--pad) var(--pad);
}
.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}
.hero__intro {
  max-width: 15em;
  font-size: clamp(22px, 2.5vw, 42px);
  line-height: 1.06;
  letter-spacing: -.03em;
}
.hero__intro em { font-size: 1.08em; }
.hero__index {
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
  color: var(--muted);
}
.hero__title {
  margin-top: auto;
  font-size: 34.5vw;
  font-weight: 600;
  line-height: .8;
  letter-spacing: -.07em;
  white-space: nowrap;
}
.hero__line {
  display: block;
  overflow: hidden;
  padding: .02em 0 .16em;
  margin: 0 0 -.14em -.045em;
}
.char { display: inline-block; will-change: transform; }

.hero__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.hero__disc { text-align: right; }
.hero__scroll { display: flex; align-items: center; gap: 10px; }
.hero__scroll i {
  position: relative;
  width: 1px;
  height: 26px;
  overflow: hidden;
  background: var(--line);
}
.hero__scroll i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  animation: scrollLine 1.8s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ---------- About ---------- */

.about__statement {
  max-width: 20ch;
  font-size: clamp(32px, 5vw, 92px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.045em;
  text-indent: 1.6em;
}
.about__statement em { letter-spacing: -.02em; }
.word { display: inline-block; }

.about__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--pad);
  margin-top: clamp(80px, 10vw, 180px);
  align-items: end;
}
.about__portrait { grid-column: 1 / span 4; }
.about__text {
  grid-column: 6 / span 4;
  display: grid;
  gap: 1.2em;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}
.about__text p:first-child { color: var(--fg); }

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: #FFF;
}
/* Taller than the frame so the scroll parallax never shows an edge */
.portrait__img {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: scale 1.2s var(--ease);
}
@media (hover: hover) {
  .portrait:hover .portrait__img { scale: 1.04; }
}
.portrait__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  color: var(--ink);
}

.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(60px, 7vw, 120px);
  border-top: 1px solid var(--line);
}
.stats li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px var(--pad) 0 0;
}
.stats li + li { padding-left: var(--pad); border-left: 1px solid var(--line); }
.stats__num {
  font-size: clamp(56px, 7vw, 120px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.stats__label { font-size: 13px; color: var(--muted); }

/* ---------- Services ---------- */

.services .section-title { margin-bottom: clamp(48px, 6vw, 100px); }

.services__list { border-bottom: 1px solid var(--line); }
.service {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1.3fr 1fr 40px;
  align-items: center;
  gap: var(--pad);
  padding: clamp(22px, 2.6vw, 40px) 0;
  border-top: 1px solid var(--line);
  isolation: isolate;
  transition: color .5s var(--ease), padding .6s var(--ease);
}
.service::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--pad) * -1);
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .6s var(--ease);
}
.service__num { font-size: 13px; color: var(--muted); transition: color .5s; }
.service__title {
  font-size: clamp(34px, 5.2vw, 92px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.05em;
  transition: transform .6s var(--ease);
}
.service__tags { font-size: 14px; color: var(--muted); max-width: 26em; transition: color .5s; }
.service__arrow {
  font-size: 28px;
  justify-self: end;
  transition: transform .6s var(--ease);
}

@media (hover: hover) {
  .service:hover { color: var(--ink); }
  .service:hover::before { transform: scaleY(1); }
  .service:hover .service__num,
  .service:hover .service__tags { color: var(--ink); }
  .service:hover .service__title { transform: translateX(24px); }
  .service:hover .service__arrow { transform: rotate(45deg); }
}

/* ---------- Work (horizontal) ---------- */

.work { position: relative; }
.work__pin {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 5vh, 64px);
  overflow: hidden;
  padding: calc(var(--pad) + 60px) 0 var(--pad);
}
.work__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding: 0 var(--pad);
}
.work__head .label { margin-bottom: 20px; }
.work__head .section-title { font-size: clamp(52px, 7vw, 124px); }
.work__meta {
  max-width: 300px;
  font-size: 14px;
  color: var(--muted);
}
.work__progress {
  height: 1px;
  margin-top: 18px;
  background: var(--line);
}
.work__progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.work__track {
  display: flex;
  gap: clamp(16px, 2vw, 36px);
  width: max-content;
  padding: 0 var(--pad);
  will-change: transform;
}

.project { width: clamp(280px, 30vw, 520px); flex-shrink: 0; }
.project__link { display: block; }
.project__media {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 56vh;
  overflow: hidden;
  border-radius: 6px;
  container-type: inline-size;
  transform: translateZ(0);
}
.project__media img,
.cover {
  position: absolute;
  inset: 0 -10%;
  width: 120%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.project__link:hover .cover,
.project__link:hover .project__media img { transform: scale(1.06); }

.project__info {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding-top: 16px;
  font-size: 13px;
}
.project__num, .project__cat { color: var(--muted); }
.project__title {
  font-size: clamp(18px, 1.5vw, 24px);
  font-weight: 500;
  letter-spacing: -.03em;
}

.work__end {
  display: grid;
  place-items: center;
  width: clamp(280px, 26vw, 460px);
  flex-shrink: 0;
}
.work__all {
  display: grid;
  place-items: center;
  align-content: center;
  width: clamp(200px, 17vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  transition: background-color .5s var(--ease), color .5s, border-color .5s;
}
.work__all em { font-size: 1.4em; }
.work__all:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* Generated cover art — replace with real project imagery */
.cover { overflow: hidden; }

.cover--aurora {
  background:
    radial-gradient(60% 50% at 30% 25%, #7D6BFF 0%, transparent 70%),
    radial-gradient(55% 45% at 75% 85%, #FF6FB5 0%, transparent 70%),
    radial-gradient(40% 40% at 85% 20%, #3FD0FF 0%, transparent 70%),
    #10103A;
}
.cover--aurora .cover__glyph {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  font-family: var(--serif);
  font-size: 100cqw;
  line-height: 1;
  color: #F4F0FF;
}
.cover__tag {
  position: absolute;
  left: calc(10% + 16px);
  bottom: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}

.cover--mira { background: #F4C7B1; }
.cover--mira .cover__pill {
  position: absolute;
  left: 34%;
  top: 14%;
  width: 26%;
  height: 58%;
  border-radius: 999px;
  background: #E8613F;
}
.cover--mira .cover__sun {
  position: absolute;
  left: 52%;
  top: 34%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #FBEFE4;
  mix-blend-mode: multiply;
}
.cover--mira .cover__word {
  position: absolute;
  left: calc(10% + 6cqw);
  bottom: 4cqw;
  font-family: var(--serif);
  font-style: italic;
  font-size: 30cqw;
  line-height: 1;
  color: var(--ink);
}

.cover--field {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #DDE6D3, #B7C9A8);
}
.phone {
  display: flex;
  flex-direction: column;
  gap: 4cqw;
  width: 50cqw;
  height: 100cqw;
  padding: 6cqw 5cqw;
  border-radius: 8cqw;
  background: #FAFAF7;
  box-shadow: 0 4cqw 10cqw rgba(30, 50, 20, .25);
  transform: rotate(-6deg);
}
.phone__head { height: 14cqw; border-radius: 3cqw; background: #2F4A2A; }
.phone__row { height: 3cqw; border-radius: 2cqw; background: #D6DED0; }
.phone__row--s { width: 60%; }
.phone__card { flex: 1; border-radius: 4cqw; background: #FF4F1F; }

.cover--kora { background: #FF4F1F; }
.cover--kora .cover__poster {
  position: absolute;
  left: calc(10% + 4cqw);
  top: 6cqw;
  font-size: 50cqw;
  font-weight: 600;
  line-height: .78;
  letter-spacing: -.08em;
  color: var(--ink);
}
.cover--kora .cover__small {
  position: absolute;
  right: calc(10% + 6cqw);
  bottom: 6cqw;
  font-size: 4cqw;
  line-height: 1.2;
  text-align: right;
  color: var(--ink);
}

.cover--still {
  background:
    repeating-radial-gradient(circle at 50% 55%, rgba(200, 245, 96, .7) 0 1px, transparent 1px 5cqw),
    radial-gradient(circle at 50% 55%, #26391F 0%, #0B120D 70%);
}
.cover--still .cover__word {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  font-family: var(--serif);
  font-style: italic;
  font-size: 26cqw;
  color: #E8FFC2;
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: clamp(24px, 3vw, 48px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
  font-size: clamp(56px, 9vw, 168px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.055em;
}
.marquee__track span { padding: 0 .3em; }
.marquee__track i {
  font-style: normal;
  font-size: .5em;
  color: var(--accent);
}

/* ---------- Contact ---------- */

.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.contact__main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.contact__title {
  font-size: clamp(60px, 11.5vw, 230px);
  font-weight: 500;
  line-height: .88;
  letter-spacing: -.06em;
}
.contact__btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: clamp(130px, 13vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 500;
  transition: background-color .4s;
}
.contact__btn:hover { background: var(--fg); color: var(--bg); }

.contact__mail {
  align-self: flex-start;
  position: relative;
  margin-top: clamp(40px, 6vw, 100px);
  font-size: clamp(26px, 4vw, 72px);
  font-weight: 400;
  letter-spacing: -.04em;
}
.contact__mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform-origin: left;
  transition: transform .7s var(--ease);
}
.contact__mail:hover::after { transform: scaleX(0); transform-origin: right; }

.footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pad);
  margin-top: auto;
  padding-top: clamp(60px, 8vw, 140px);
  font-size: 14px;
}
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.footer__col--end { align-items: flex-end; justify-content: flex-end; }
.footer__head {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer__top { display: inline-block; }

.social { display: inline-flex; align-items: center; gap: 8px; }
.social__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
  transition: fill .3s, transform .5s var(--ease);
}
.social:hover .social__icon { fill: var(--accent); transform: scale(1.15); }

/* ---------- Inner pages (work index + case study) ---------- */

.page-hero {
  padding: calc(var(--pad) + 140px) var(--pad) clamp(48px, 6vw, 96px);
}
.page-title {
  font-size: clamp(64px, 13vw, 240px);
  font-weight: 500;
  line-height: .86;
  letter-spacing: -.065em;
}
.page-title em { letter-spacing: -.03em; }
.page-hero__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-top: clamp(32px, 4vw, 64px);
}
.page-hero__lead {
  max-width: 24em;
  margin-top: clamp(24px, 3vw, 48px);
  font-size: clamp(18px, 1.6vw, 26px);
  line-height: 1.25;
  letter-spacing: -.02em;
}
.page-hero__row .page-hero__lead { margin-top: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  transition: background-color .4s var(--ease), color .4s, border-color .4s;
}
.filter sup { margin-left: 3px; opacity: .6; }
@media (hover: hover) {
  .filter:hover { border-color: var(--fg); }
}
.filter.is-active { background: var(--fg); border-color: var(--fg); color: var(--bg); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(48px, 6vw, 96px) var(--pad);
  padding: 0 var(--pad) var(--section);
}
.work-grid .project { width: auto; }
.work-grid .project:nth-child(even) { margin-top: clamp(0px, 10vw, 180px); }
.work-grid .project[hidden] { display: none; }
.work-grid .project__media { max-height: none; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pad);
  margin-top: clamp(48px, 6vw, 96px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.case-meta dt {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-media { padding: 0 var(--pad); }
.case-media .project__media {
  width: min(100%, 68vh);
  max-height: none;
  margin-inline: auto;
}

.case-body { display: grid; gap: clamp(48px, 6vw, 96px); }
.case-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--pad);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.case-row__head {
  grid-column: 1 / span 4;
  display: flex;
  gap: 16px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.case-row__head span { color: var(--muted); }
.case-row__text {
  grid-column: 6 / -1;
  font-size: clamp(22px, 2.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -.03em;
}

.case-next {
  position: relative;
  display: block;
  padding: clamp(48px, 6vw, 96px) var(--pad);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.case-next::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .7s var(--ease);
}
.case-next .label { justify-content: space-between; margin-bottom: 24px; }
.case-next__title {
  display: block;
  font-size: clamp(48px, 9vw, 168px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.06em;
}
.case-next__title i {
  display: inline-block;
  font-style: normal;
  transition: transform .7s var(--ease);
}
@media (hover: hover) {
  .case-next:hover { color: var(--ink); }
  .case-next:hover .label { color: var(--ink); }
  .case-next:hover::before { transform: scaleY(1); }
  .case-next:hover .case-next__title i { transform: translateX(.2em); }
}

.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Page transition curtain ---------- */

.transition {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad);
  background: var(--ink);
  color: var(--paper);
  clip-path: inset(100% 0% 0% 0%);
  pointer-events: none;
}
/* Set by an inline script before first paint when arriving from another page;
   the animation is a failsafe in case scripts never run */
.is-arriving .transition { clip-path: inset(0% 0% 0% 0%); animation: curtainFailsafe .01s 4s forwards; }
@keyframes curtainFailsafe { to { clip-path: inset(100% 0% 0% 0%); } }
.transition__brand { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.transition__mask { overflow: hidden; }
.transition__label {
  display: block;
  font-size: clamp(64px, 14vw, 260px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.065em;
}

/* ---------- Mobile menu ---------- */

.nav__menu {
  display: none;
  justify-self: end;
  padding: 12px;
  margin: -12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
}
.menu {
  position: fixed;
  inset: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--pad) + 80px) var(--pad) var(--pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink);
  color: var(--paper);
}
.menu[hidden] { display: none; }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
}
.menu__num { font-size: 12px; color: color-mix(in srgb, var(--paper) 50%, transparent); }
.menu__text {
  display: inline-block;
  font-size: clamp(36px, min(15vw, 10svh), 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.06em;
}
.menu__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-top: 24px;
  gap: 1rem;
  font-size: 13px;
  color: color-mix(in srgb, var(--paper) 60%, transparent);
}

/* ---------- Shared bits for new pages ---------- */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-size: 14px;
  transition: background-color .4s var(--ease), color .4s, border-color .4s;
}
.link-arrow span { transition: transform .5s var(--ease); }
@media (hover: hover) {
  .link-arrow:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
  .link-arrow:hover span { transform: rotate(45deg); }
}

.contact--short { min-height: 0; padding-top: 0; }
.contact--short .footer { padding-top: clamp(40px, 5vw, 80px); border-top: 1px solid var(--line); }

/* ---------- About page ---------- */

.about-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: var(--pad);
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--pad) + 100px) var(--pad) var(--pad);
}
.about-hero .page-title { font-size: clamp(64px, 10vw, 190px); }
.about-hero__next {
  display: inline-flex;
  gap: 10px;
  margin-top: clamp(32px, 4vw, 56px);
  font-size: 14px;
  border-bottom: 1px solid currentColor;
}
.about-hero__next span { display: inline-block; animation: nudge 1.8s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

.particle-portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: calc(100svh - 160px);
  width: 100%;
  justify-self: center;
  touch-action: pan-y;
}
.particle-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.particle-portrait canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.particle-portrait.is-live img { visibility: hidden; }
.particle-portrait__hint {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity .6s;
}
.particle-portrait.is-live .particle-portrait__hint { opacity: 1; }

.about-story__cols {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--pad);
  margin-top: clamp(60px, 8vw, 140px);
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}
.about-story__cols p:first-child { grid-column: 5 / span 4; color: var(--fg); }
.about-story__cols p:last-child { grid-column: 9 / span 4; }

.approach .section-title { margin-bottom: clamp(48px, 6vw, 100px); }
.steps { display: grid; gap: clamp(24px, 3vw, 40px); }
.step {
  position: sticky;
  top: calc(var(--pad) + 90px);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  grid-template-rows: auto 1fr;
  gap: var(--pad);
  min-height: min(62vh, 560px);
  padding: clamp(24px, 3vw, 48px);
  border-radius: 10px;
  color: var(--ink);
  transform-origin: 50% 0;
  will-change: transform;
}
.step--1 { background: var(--accent); }
.step--2 { background: #B9B2FF; }
.step--3 { background: #F6E7D2; }
.step--4 { background: #0E0E0E; color: var(--paper); }
.step__num { font-size: 13px; }
.step__title {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  font-size: clamp(64px, 10vw, 180px);
  font-weight: 500;
  line-height: .85;
  letter-spacing: -.065em;
}
.step__text {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  max-width: 22em;
  justify-self: end;
  font-size: clamp(18px, 1.7vw, 28px);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.tools {
  overflow: hidden;
  padding: var(--section) 0;
}
.tools__label { padding: 0 var(--pad); }
.tools__row {
  display: flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
  font-size: clamp(56px, 9vw, 168px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.055em;
}
.tools__row span { padding: 0 .25em; }
.tools__row i { font-style: normal; font-size: .4em; color: var(--accent); }
.tools__row--outline span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--fg);
}

/* ---------- Contact page ---------- */

.contact-hero { min-height: 70vh; min-height: 70svh; display: flex; flex-direction: column; justify-content: flex-end; }

.brief {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--pad);
  padding-top: 0;
}
.brief__form { grid-column: 1 / span 8; display: grid; gap: clamp(36px, 4vw, 56px); }
.brief__title {
  font-size: clamp(32px, 3.6vw, 60px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1;
}
.brief__group { border: 0; }
.brief__group legend {
  margin-bottom: 16px;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: clamp(15px, 1.2vw, 18px);
  transition: background-color .4s var(--ease), color .4s, border-color .4s, transform .4s var(--ease);
}
@media (hover: hover) {
  .chip:hover span { border-color: var(--fg); }
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.chip:active span { transform: scale(.96); }

.brief__fields { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 40px) var(--pad); }
.field { display: grid; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: 13px; color: var(--muted); }
.field input,
.field textarea {
  width: 100%;
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: clamp(20px, 1.8vw, 28px);
  letter-spacing: -.02em;
  resize: vertical;
  transition: border-color .4s;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--fg); }
.field.is-invalid input,
.field.is-invalid textarea { border-color: var(--accent); }

.brief__submit { display: flex; align-items: center; gap: var(--pad); }
.brief__btn { border: 0; font-family: inherit; }
.brief__note { max-width: 22em; font-size: 14px; color: var(--muted); }

.brief__aside {
  grid-column: 10 / -1;
  display: grid;
  align-content: start;
  gap: 32px;
  font-size: 15px;
}
.brief__info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.brief__info a { border-bottom: 1px solid transparent; transition: border-color .4s; }
.brief__info a:hover { border-color: currentColor; }
.brief__mail { font-size: clamp(18px, 1.5vw, 22px); }

.faq .section-title { margin-bottom: clamp(48px, 6vw, 100px); }
.faq__list { border-bottom: 1px solid var(--line); }
.faq__item { border-top: 1px solid var(--line); }
.faq__item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--pad);
  padding: clamp(20px, 2.4vw, 36px) 0;
  list-style: none;
  font-size: clamp(22px, 2.6vw, 44px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item i {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.faq__item i::before,
.faq__item i::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: currentColor;
  transition: transform .5s var(--ease);
}
.faq__item i::after { transform: rotate(90deg); }
.faq__item[open] i::after { transform: rotate(0deg); }
.faq__a { overflow: hidden; }
.faq__a p {
  max-width: 40em;
  padding-bottom: clamp(20px, 2.4vw, 36px);
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .nav { grid-template-columns: 1fr auto auto; }
  .nav .nav__status { display: none; }
  .about__portrait { grid-column: 1 / span 5; }
  .about__text { grid-column: 7 / -1; }
}

@media (max-width: 899px) {
  .about-hero { grid-template-columns: 1fr; min-height: 0; }
  .particle-portrait { max-width: 480px; max-height: none; }
  .about-story__cols p:first-child { grid-column: 1 / span 6; }
  .about-story__cols p:last-child { grid-column: 7 / span 6; }
  .brief { row-gap: clamp(64px, 10vw, 96px); }
  .brief__form, .brief__aside { grid-column: 1 / -1; }
  .brief__aside { grid-template-columns: 1fr 1fr; }
  .particle-portrait__hint { bottom: -28px; }
  /* Keep the form readable over the 3D blob */
  [data-page="contact"] .webgl { opacity: .35; }

  .work__pin { height: auto; padding: var(--section) 0; }
  .work__head { flex-direction: column; align-items: flex-start; }
  .work__progress { display: none; }
  .work__track {
    flex-direction: column;
    width: auto;
    gap: 48px;
  }
  .project { width: 100%; }
  .project__media { max-height: none; }
  .work__end { width: 100%; padding-top: 24px; }
}

@media (min-width: 600px) and (max-width: 899px) {
  .work__track { display: grid; grid-template-columns: 1fr 1fr; gap: 56px var(--pad); }
  .work__end { padding-top: 0; }
}

/* Landscape phones: size the hero by height so the intro and title don't collide */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding-top: calc(var(--pad) + 60px); }
  .hero__intro { font-size: 20px; }
  .hero__title { font-size: 44vh; font-size: 44svh; }
}

@media (max-width: 720px) {
  :root { --section: 88px; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__links a:not(:last-child) { display: none; }
  .nav__time { display: none; }
  /* With JS the links move into the full-screen menu */
  .nav:has(.nav__menu) .nav__links { display: none; }
  .nav__menu { display: block; }

  .about-story__cols { grid-template-columns: 1fr; }
  .about-story__cols p:first-child, .about-story__cols p:last-child { grid-column: 1 / -1; }
  .step { top: calc(var(--pad) + 64px); grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; min-height: 340px; }
  .step__title { grid-row: 2; }
  .step__text { grid-column: 1; grid-row: 3; justify-self: start; }
  .brief__fields { grid-template-columns: 1fr; }
  .brief__submit { flex-direction: column; align-items: flex-start; }
  .brief__aside { grid-template-columns: 1fr; }

  .hero__top { flex-direction: column; }
  .hero__index { text-align: left; }
  .hero__bottom { grid-template-columns: 1fr auto; row-gap: 6px; }
  .hero__bottom > span:first-child { grid-column: 1 / -1; }
  .hero__disc { display: none; }

  .about__statement { text-indent: 0; }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait, .about__text { grid-column: 1 / -1; }
  .about__portrait { max-width: 320px; }
  .stats { grid-template-columns: 1fr; }
  .stats li, .stats li + li { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }

  .service { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .service__num { grid-column: 1 / -1; }
  .service__tags { grid-column: 1 / -1; grid-row: 3; }
  .service__arrow { grid-row: 2; grid-column: 2; }

  .page-hero { padding-top: calc(var(--pad) + 100px); }
  .page-hero__row { flex-direction: column; align-items: flex-start; }
  .case-meta { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .case-row__head, .case-row__text { grid-column: 1 / -1; }

  .contact__main { flex-direction: column; align-items: flex-start; }
  .footer { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .footer__col--end { align-items: flex-start; }
}

@media (max-width: 599px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-grid .project:nth-child(even) { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .nav__status i, .hero__scroll i::after, .about-hero__next span { animation: none; }
}
