/* =========================================================
   Tarik El Moudden — Portfolio
   "Midnight Studio" theme
   ========================================================= */

:root {
  --ink: #0b0a10;
  --ink-2: #13121a;
  --ink-3: #1c1a25;
  --line: rgba(241, 236, 228, 0.1);
  --line-strong: rgba(241, 236, 228, 0.22);
  --cream: #f1ece4;
  --muted: #9b96a6;
  --violet: #9d6bff;
  --sky: #3fb8ff;
  --grad: linear-gradient(120deg, var(--violet) 0%, var(--sky) 100%);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: clamp(16px, 5vw, 80px);
  --max: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--violet); color: #fff; }

em, .serif-accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

.serif-accent {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  transition: transform 1s var(--ease-in-out);
}
.preloader__name {
  font-family: var(--serif);
  font-size: clamp(64px, 14vw, 160px);
  line-height: 1;
  display: flex;
  overflow: hidden;
}
.preloader__name span,
.preloader__name em {
  display: inline-block;
  transform: translateY(110%);
  animation: letterUp 0.9s var(--ease) forwards;
}
.preloader__name em { color: var(--sky); }
.preloader__name > :nth-child(1) { animation-delay: 0.05s; }
.preloader__name > :nth-child(2) { animation-delay: 0.1s; }
.preloader__name > :nth-child(3) { animation-delay: 0.15s; }
.preloader__name > :nth-child(4) { animation-delay: 0.2s; }
.preloader__name > :nth-child(5) { animation-delay: 0.25s; }
.preloader__name > :nth-child(6) { animation-delay: 0.3s; }
.preloader__count {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
body.is-loaded .preloader { transform: translateY(-100%); }

@keyframes letterUp { to { transform: translateY(0); } }

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}
.orb--1 {
  width: 46vw; height: 46vw;
  background: var(--violet);
  top: -12vw; right: -10vw;
  animation: float1 22s ease-in-out infinite;
}
.orb--2 {
  width: 38vw; height: 38vw;
  background: var(--sky);
  bottom: -14vw; left: -12vw;
  opacity: 0.22;
  animation: float2 26s ease-in-out infinite;
}
.orb--3 {
  width: 24vw; height: 24vw;
  background: #ff6fb5;
  top: 40%; left: 45%;
  opacity: 0.1;
  animation: float1 30s ease-in-out infinite reverse;
}
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8vw, 10vh) scale(1.15); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10vw, -8vh) scale(0.9); }
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 4%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 7%); }
  80% { transform: translate(6%, -2%); }
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor, .cursor-dot { display: none; }

@media (hover: hover) and (pointer: fine) {
  .cursor, .cursor-dot {
    display: block;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 95;
    border-radius: 50%;
  }
  .cursor {
    width: 38px; height: 38px;
    margin: -19px 0 0 -19px;
    border: 1px solid var(--line-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s var(--ease), height 0.4s var(--ease), margin 0.4s var(--ease),
      background 0.3s, border-color 0.3s;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--cream);
  }
  .cursor__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0;
    transform: scale(0.5);
    transition: 0.3s var(--ease);
  }
  .cursor.is-hover {
    width: 64px; height: 64px;
    margin: -32px 0 0 -32px;
    border-color: transparent;
    background: rgba(241, 236, 228, 0.12);
  }
  .cursor.is-view {
    width: 92px; height: 92px;
    margin: -46px 0 0 -46px;
    background: var(--cream);
    border-color: transparent;
  }
  .cursor.is-view .cursor__label { opacity: 1; transform: scale(1); }
  body.cursor-hidden .cursor, body.cursor-hidden .cursor-dot { opacity: 0; }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--pad);
  transition: transform 0.5s var(--ease), background 0.4s, padding 0.4s;
}
.header.is-scrolled {
  background: rgba(11, 10, 16, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.header.is-hidden { transform: translateY(-110%); }

.logo { display: flex; align-items: flex-end; gap: 3px; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo__mark { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; }
.logo__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-bottom: 5px; }

.nav { display: flex; gap: 34px; }
.nav__link { font-size: 15px; font-weight: 500; overflow: hidden; display: inline-block; height: 1.6em; }
.nav__link span { display: inline-block; position: relative; transition: transform 0.5s var(--ease); }
.nav__link span::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 100%;
  font-family: var(--serif); font-style: italic; font-size: 1.12em;
  color: var(--sky);
}
.nav__link:hover span { transform: translateY(-100%); }

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  transition: background 0.3s, border-color 0.3s;
}
.status-pill:hover { background: rgba(241, 236, 228, 0.06); border-color: var(--cream); }
.status-pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.menu-btn { display: none; width: 44px; height: 44px; position: relative; z-index: 60; }
.menu-btn span {
  position: absolute; left: 10px; right: 10px; height: 2px;
  background: var(--cream); border-radius: 2px;
  transition: transform 0.45s var(--ease), top 0.45s var(--ease);
}
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-open .menu-btn span:first-child { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Shared ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(90px, 14vw, 180px) var(--pad) 0;
}
.section-tag {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 28px;
}
.section-tag span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 11px; letter-spacing: 0;
  color: var(--cream);
}
.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.section-title {
  font-size: clamp(34px, 4.6vw, 68px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
}
.section-title em { color: var(--muted); }

/* Reveal animations (activated by JS) */
.js .reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal-up.is-in { opacity: 1; transform: none; }

.js .reveal-scale {
  opacity: 0;
  transform: scale(0.85) rotate(-4deg);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
  transition-delay: 0.3s;
}
.js .reveal-scale.is-in { opacity: 1; transform: none; }

.line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.line__in { display: inline-block; }
.js .line__in { transform: translateY(105%); transition: transform 1.2s var(--ease); }
.js .is-in .line__in, .js .line.is-in .line__in { transform: none; }
.line:nth-child(2) .line__in { transition-delay: 0.08s; }
.line:nth-child(3) .line__in { transition-delay: 0.16s; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 14px;
  height: 58px;
  padding: 0 28px;
  border-radius: 100px;
  font-weight: 600; font-size: 15px;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.4s var(--ease);
}
.btn--primary { background: var(--cream); color: var(--ink); padding-right: 8px; }
.btn--primary::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad);
  z-index: -1;
  transform: translateY(101%);
  border-radius: inherit;
  transition: transform 0.5s var(--ease);
}
.btn--primary:hover { color: #fff; }
.btn--primary:hover::before { transform: none; }
.btn__icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.5s var(--ease);
}
.btn__icon svg, .service__arrow svg, .mail-btn__icon svg {
  width: 18px; height: 18px;
  fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn--primary:hover .btn__icon { transform: rotate(45deg); }
.btn--ghost { border: 1px solid var(--line-strong); }
.btn--ghost:hover { border-color: var(--cream); background: rgba(241, 236, 228, 0.05); }
.magnetic { will-change: transform; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--max);
  margin: 0 auto;
  padding: 130px var(--pad) 90px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  margin: 0 0 28px;
}
.eyebrow__line { width: 40px; height: 1px; background: var(--grad); }

.hero__title {
  font-size: clamp(36px, 4.1vw, 66px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
}
.hero__title .serif-accent { font-size: 1.08em; letter-spacing: -0.02em; }

.rotator {
  display: inline-grid;
  vertical-align: bottom;
  overflow: hidden;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: 1.08em;
}
.rotator__word {
  grid-area: 1 / 1;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease);
  color: var(--cream);
}
.rotator__word.is-active { transform: none; opacity: 1; }
.rotator__word.is-leaving { transform: translateY(-100%); opacity: 0; }

.hero__lead {
  max-width: 520px;
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--muted);
  margin: 0 0 40px;
}
.hero__lead strong { color: var(--cream); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__visual { display: flex; justify-content: center; }
/* Portrait: glowing "sun" with orbit rings; shoulders dissolve into the page */
.portrait {
  position: relative;
  width: min(100%, 500px);
  aspect-ratio: 1;
}
.portrait__stage {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(black 47%, transparent 71%);
  mask-image: radial-gradient(black 47%, transparent 71%);
}
.portrait__halo {
  position: absolute;
  left: 50%; top: 58%;
  width: 130%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 107, 255, 0.45) 0%, rgba(63, 184, 255, 0.18) 38%, transparent 65%);
  pointer-events: none;
  animation: breathe 6s ease-in-out infinite;
}
.portrait__sun {
  position: absolute;
  left: 50%; top: 55%;
  width: 90%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(140deg, var(--violet) 10%, #6f7dff 50%, var(--sky) 95%);
  box-shadow: inset 0 -30px 60px rgba(11, 10, 16, 0.35);
}
.portrait__sun::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 0deg, transparent 0 68%, rgba(255, 255, 255, 0.3) 78%, transparent 88%);
  animation: spin 10s linear infinite;
}
.orbit {
  position: absolute;
  left: 50%; top: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  translate: -50% -50%;
  animation: spin 24s linear infinite;
}
.orbit--1 { width: 84%; }
.orbit--2 { width: 99%; border-style: dashed; border-color: rgba(241, 236, 228, 0.14); animation-duration: 40s; animation-direction: reverse; }
.orbit__dot {
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 14px 3px rgba(63, 184, 255, 0.7);
}
.orbit--2 .orbit__dot { background: var(--violet); box-shadow: 0 0 14px 3px rgba(157, 107, 255, 0.7); }
.orbit__dot--b { top: auto; bottom: -4px; width: 7px; height: 7px; margin-left: -3px; background: #ff6fb5 !important; box-shadow: 0 0 12px 2px rgba(255, 111, 181, 0.6) !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.6; }
}
.portrait__img {
  position: absolute;
  bottom: 0;
  left: 53%;
  width: 105%;
  max-width: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 20px 31px rgba(0, 0, 0, 0.4));
}
.portrait__badge {
  position: absolute;
  z-index: 2;
  width: 27%;
  left: -4%; bottom: 16%;
  animation: spin 18s linear infinite;
  background: var(--ink);
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.portrait__badge text {
  fill: var(--cream);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 3.2px;
}

.chip {
  position: absolute;
  padding: 10px 18px;
  border-radius: 100px;
  background: rgba(19, 18, 26, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  animation: bob 6s ease-in-out infinite;
}
.chip::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--sky);
}
.chip { z-index: 2; }
.chip--1 { top: 22%; right: -2%; }
.chip--1::before { background: var(--violet); }
.chip--2 { top: 56%; right: -6%; animation-delay: -2s; }
.chip--3 { top: 30%; left: -6%; animation-delay: -4s; }
.chip--3::before { background: #ff6fb5; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.scroll-cue {
  position: absolute;
  left: var(--pad);
  bottom: 28px;
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue__line {
  position: relative;
  width: 1px; height: 46px;
  background: var(--line-strong);
  overflow: hidden;
}
.scroll-cue__line::after {
  content: "";
  position: absolute; left: 0; top: -50%;
  width: 100%; height: 50%;
  background: var(--cream);
  animation: drip 2s var(--ease-in-out) infinite;
}
@keyframes drip { to { top: 100%; } }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 26px 0;
  transform: rotate(-1.5deg) scale(1.03);
  background: rgba(19, 18, 26, 0.6);
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 36px;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span {
  font-size: clamp(24px, 3vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.marquee span:nth-of-type(even) {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px var(--cream);
}
.marquee i { font-style: normal; color: var(--violet); font-size: 22px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- About ---------- */
.about__statement {
  font-size: clamp(22px, 2.7vw, 40px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 clamp(60px, 8vw, 110px);
  max-width: 1150px;
}
.about__statement .w {
  color: rgba(241, 236, 228, 0.16);
  transition: color 0.4s;
}
.about__statement .w.is-lit { color: var(--cream); }
.about__statement .w.is-accent.is-lit {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.stat {
  padding: 36px 24px 0 0;
  display: flex; flex-direction: column; gap: 6px;
}
.stat + .stat { padding-left: 28px; border-left: 1px solid var(--line); }
.stat__num {
  font-family: var(--serif);
  font-size: clamp(52px, 5.6vw, 88px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label { color: var(--muted); font-size: 15px; }

/* ---------- Services ---------- */
.service-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.service {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1.1fr 1fr 60px;
  align-items: center;
  gap: 24px;
  padding: clamp(28px, 3.4vw, 44px) 0;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
  cursor: default;
}
.service::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--pad) * -0.5);
  background: var(--grad);
  z-index: -1;
  border-radius: 20px;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.6s var(--ease);
}
.service__num { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 0.4s; }
.service__title {
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  transition: transform 0.6s var(--ease);
}
.service__desc { margin: 0; color: var(--muted); max-width: 440px; transition: color 0.4s; }
.service__arrow {
  justify-self: end;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.6s var(--ease), background 0.4s, border-color 0.4s;
}
@media (hover: hover) {
  .service:hover::before { transform: scaleY(1); }
  .service:hover .service__title { transform: translateX(14px); }
  .service:hover .service__num,
  .service:hover .service__desc { color: rgba(255, 255, 255, 0.92); }
  .service:hover .service__arrow { background: var(--ink); border-color: var(--ink); transform: rotate(45deg); }
}

/* ---------- Work ---------- */
.filters {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
}
.filters__pill {
  position: absolute;
  top: 5px; left: 0;
  height: calc(100% - 10px);
  border-radius: 100px;
  background: var(--cream);
  transition: transform 0.55s var(--ease), width 0.55s var(--ease);
  z-index: 0;
}
.filter {
  position: relative;
  z-index: 1;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  transition: color 0.4s;
}
.filter:hover { color: var(--cream); }
.filter.is-active { color: var(--ink); }
.filter sup { font-size: 10px; margin-left: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease), opacity 0.5s var(--ease), border-color 0.4s, box-shadow 0.6s var(--ease);
}
/* Invitation cards that fill empty grid cells (same size as projects) */
.cta-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 100%;
  padding: 28px;
  border-radius: 22px;
  border: 1px dashed rgba(241, 236, 228, 0.25);
  background:
    radial-gradient(circle at 20% 15%, rgba(157, 107, 255, 0.28), transparent 55%),
    radial-gradient(circle at 90% 95%, rgba(63, 184, 255, 0.22), transparent 50%),
    var(--ink-2);
  overflow: hidden;
  transition: border-color 0.4s, transform 0.6s var(--ease);
}
.cta-card[hidden] { display: none; }
.cta-card:hover { border-color: var(--cream); transform: translateY(-4px); }
.cta-card__icon {
  position: absolute;
  top: 26px; left: 28px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 300; color: #fff;
  transition: transform 0.6s var(--ease);
}
.cta-card:hover .cta-card__icon { transform: rotate(90deg) scale(1.06); }
.cta-card--alt .cta-card__icon { background: transparent; border: 1px solid var(--line-strong); font-size: 22px; }
.cta-card h3 { margin: 0; font-size: clamp(24px, 2.2vw, 32px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }
.cta-card h3 em { color: var(--sky); }
.cta-card p { margin: 0; color: var(--muted); }
.cta-card__link { margin-top: 8px; font-weight: 600; font-size: 15px; }
.card.is-hiding { opacity: 0; transform: scale(0.94); }
.card.is-hidden { display: none; }
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 30px 70px -30px rgba(157, 107, 255, 0.45);
}

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  flex: 1 0 auto;
  overflow: hidden;
  background: var(--ink-3);
}
.card__info { flex: 0 0 auto; }

.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.1s var(--ease), filter 0.6s;
}
.card:hover .card__media img { transform: scale(1.12); }
.card__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(11, 10, 16, 0.55));
  pointer-events: none;
}
.card__media--type {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(157, 107, 255, 0.55), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(63, 184, 255, 0.45), transparent 50%),
    var(--ink-3);
  text-align: center;
}
.card__media--type span {
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  transition: transform 1.1s var(--ease);
}
.card__media--type em { font-size: 1.5em; }
.card:hover .card__media--type span { transform: scale(1.08); }

.card__info { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; min-height: 2.6em; }
.card__meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #b3aebe;
  min-height: 4.5em;           /* room for 3 lines keeps every card the same height */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0 0; }
.card__tags li {
  font-size: 12px; font-weight: 600;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid rgba(241, 236, 228, 0.26);
  background: rgba(241, 236, 228, 0.07);
  color: rgba(241, 236, 228, 0.88);
  letter-spacing: 0.01em;
}

/* ---------- Process ---------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 40px;
}
.steps__line {
  position: absolute;
  top: 7px; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.steps__line span {
  position: absolute; inset: 0;
  background: var(--grad);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.step { position: relative; }
.step__dot {
  position: absolute;
  top: -40px; left: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}
.step.is-in .step__dot {
  background: var(--sky);
  border-color: var(--sky);
  box-shadow: 0 0 0 6px rgba(63, 184, 255, 0.15);
}
.step__num { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
.step h3 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; letter-spacing: -0.03em; margin: 8px 0 12px; }
.step p { margin: 0; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.contact__title {
  font-size: clamp(40px, 6.6vw, 104px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin: 0 0 clamp(44px, 6vw, 72px);
}
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: clamp(60px, 8vw, 100px); }
.mail-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 18px;
  padding: 12px 12px 12px 34px;
  border-radius: 100px;
  background: var(--grad);
  color: #fff;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: 0 20px 60px -20px rgba(157, 107, 255, 0.7);
  max-width: 100%;
}
.mail-btn__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-btn__icon {
  flex: none;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.5s var(--ease);
}
.mail-btn:hover .mail-btn__icon { transform: rotate(45deg); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 58px;
  padding: 0 24px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  font-size: 15px; font-weight: 600;
  transition: border-color 0.3s, background 0.3s;
}
.copy-btn:hover { border-color: var(--cream); background: rgba(241, 236, 228, 0.05); }
.copy-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.copy-btn.is-copied { border-color: #4ade80; color: #4ade80; }

.contact__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}
.meta-label { display: block; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.meta-value { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--pad) 36px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 14px; color: var(--muted);
}
.footer p { margin: 0; }
.to-top { display: inline-flex; align-items: center; gap: 8px; color: var(--cream); font-weight: 600; }
.to-top svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 0.4s var(--ease); }
.to-top:hover svg { transform: translateY(-4px); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .status-pill { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .service { grid-template-columns: 60px 1fr 54px; }
  .service__desc { grid-column: 2 / 3; grid-row: 2; }
  .service__arrow { grid-row: 1 / 3; grid-column: 3; }
}

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--pad);
    background: var(--ink);
    clip-path: circle(0% at calc(100% - 44px) 44px);
    transition: clip-path 0.8s var(--ease-in-out);
  }
  .menu-open .nav { clip-path: circle(150% at calc(100% - 44px) 44px); }
  /* backdrop-filter would trap the fixed menu inside the header */
  .menu-open .header { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; border-color: transparent; }
  .nav__link { font-size: clamp(44px, 12vw, 72px); font-weight: 500; letter-spacing: -0.04em; height: 1.2em; line-height: 1.2; }
  .menu-open { overflow: hidden; }

  .hero { grid-template-columns: 1fr; padding-top: 110px; text-align: left; }
  .hero__visual { order: -1; }
  .portrait { width: min(80vw, 360px); }
  .chip { padding: 8px 14px; font-size: 13px; }
  .chip--1 { right: -8%; }
  .chip--2 { right: -8%; }
  .chip--3 { left: -8%; }
  .scroll-cue { display: none; }

  .steps { grid-template-columns: 1fr 1fr; row-gap: 72px; }
  .steps__line { display: none; }
  .step.is-in .step__dot { box-shadow: 0 0 0 5px rgba(63, 184, 255, 0.15); }
  .step__dot { top: -30px; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }

  .stats { grid-template-columns: 1fr; }
  .stat { padding: 26px 0; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .service { grid-template-columns: 1fr 48px; gap: 12px 16px; }
  .service__num { grid-column: 1 / -1; }
  .service__title { grid-column: 1; }
  .service__desc { grid-column: 1 / -1; grid-row: auto; }
  .service__arrow { grid-row: 2; grid-column: 2; width: 46px; height: 46px; }
  .steps { grid-template-columns: 1fr; }
  .contact__meta { grid-template-columns: 1fr; }
  .filters { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; padding: 9px 12px; font-size: 13px; }
  .mail-btn { padding-left: 20px; gap: 12px; font-size: 15px; }
  .mail-btn__icon { width: 48px; height: 48px; }
  .btn { height: 54px; }
  .marquee { padding: 18px 0; }
}

/* Gentle reduced-motion mode (class set by JS from the device setting or the
   footer switch). Large movement pauses; fades, colour, cursor and glow stay. */
.reduce-motion { scroll-behavior: auto; }
.reduce-motion .orb,
.reduce-motion .grain,
.reduce-motion .marquee__track,
.reduce-motion .portrait__badge,
.reduce-motion .portrait__sun::before,
.reduce-motion .orbit,
.reduce-motion .chip,
.reduce-motion .scroll-cue__line::after,
.reduce-motion .portrait__halo { animation: none !important; }
.reduce-motion .marquee { transform: none; }
/* reveals become soft fades instead of slides */
.js.reduce-motion .reveal-up,
.js.reduce-motion .reveal-scale,
.js.reduce-motion .line__in,
.js.reduce-motion [data-split] .st-word > span { transform: none !important; }
.js.reduce-motion .reveal-up,
.js.reduce-motion .reveal-scale { transition: opacity 0.7s ease; }
.js.reduce-motion .line__in,
.js.reduce-motion [data-split] .st-word > span { opacity: 0; transition: opacity 0.8s ease; }
.js.reduce-motion .is-in .line__in,
.js.reduce-motion .line.is-in .line__in,
.js.reduce-motion [data-split].is-in .st-word > span { opacity: 1; }
/* rotating word crossfades */
.reduce-motion .rotator__word,
.reduce-motion .rotator__word.is-leaving { transform: none; }
.reduce-motion .card:hover .card__media img { transform: translate3d(0, 0, 0) scale(1.12); }
/* no curtain intro in reduced mode */
.reduce-motion .preloader { display: none; }

/* Motion switch in the footer */
.motion-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted);
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  transition: border-color 0.3s, color 0.3s;
}
.motion-toggle:hover { border-color: var(--cream); color: var(--cream); }
.motion-toggle__track {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 100px;
  background: rgba(241, 236, 228, 0.15);
  transition: background 0.3s;
}
.motion-toggle__track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cream);
  transition: transform 0.3s var(--ease);
}
.motion-toggle[aria-pressed="true"] .motion-toggle__track { background: var(--grad); }
.motion-toggle[aria-pressed="true"] .motion-toggle__track::after { transform: translateX(16px); }
.footer__right { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* =========================================================
   Motion layer
   ========================================================= */

/* Scroll progress bar */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 70;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  box-shadow: 0 0 12px rgba(157, 107, 255, 0.8);
}

/* Section titles: words slide up one after another */
.st-word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.12em 0.08em 0; margin-right: -0.12em; }
.st-word > span { display: inline-block; }
.js [data-split] .st-word > span {
  transform: translateY(110%) rotate(4deg);
  transition: transform 1s var(--ease);
  transition-delay: calc(var(--i) * 0.07s);
}
.js [data-split].is-in .st-word > span { transform: none; }

/* Project cards: mouse-following light + scroll parallax */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
}
.card:hover::after { opacity: 1; }
.card__media img {
  transform: translate3d(0, var(--py, 0px), 0) scale(1.12);
}
.card:hover .card__media img { transform: translate3d(0, var(--py, 0px), 0) scale(1.18); }

/* Marquee leans with scroll speed */
.marquee span { display: inline-block; transform: skewX(var(--skew, 0deg)); transition: transform 0.25s ease-out; }

/* Giant name above the footer fills with gradient when it comes into view */
.footer-name {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  font-size: clamp(40px, 9.4vw, 160px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.9;
  white-space: nowrap;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(241, 236, 228, 0.18);
  background: var(--grad) no-repeat 0 0 / 0% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-size 2.2s var(--ease);
  padding-bottom: 0.12em;
  user-select: none;
}
.footer-name.is-in { background-size: 100% 100%; }
.no-js .footer-name, .footer-name.no-anim { background-size: 100% 100%; }


/* Gradient light that trails the cursor (mouse/trackpad only) */
.cursor-glow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor-glow {
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 620px; height: 620px;
    margin: -310px 0 0 -310px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle,
      rgba(157, 107, 255, 0.34) 0%,
      rgba(111, 125, 255, 0.2) 28%,
      rgba(63, 184, 255, 0.1) 46%,
      transparent 68%);
    opacity: 0;
    transition: opacity 0.6s, width 0.6s var(--ease), height 0.6s var(--ease), margin 0.6s var(--ease);
    will-change: transform;
  }
  body.glow-on .cursor-glow { opacity: 1; }
  body.cursor-hidden .cursor-glow { opacity: 0; }
  /* light swells over interactive elements */
  body.glow-big .cursor-glow { width: 760px; height: 760px; margin: -380px 0 0 -380px; }
  /* the small dot becomes a tiny gradient gem */
  .cursor-dot { background: var(--grad); box-shadow: 0 0 10px rgba(157, 107, 255, 0.9); }
  .cursor { border-color: rgba(157, 107, 255, 0.5); }
}
/* card spotlight picks up the brand colours */
.card::after {
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(157, 107, 255, 0.22), rgba(63, 184, 255, 0.08) 40%, transparent 65%);
}

/* Email reveal: the text swaps in with a soft slide */
.mail-btn.is-revealed .mail-btn__text { animation: revealText 0.5s var(--ease); }
@keyframes revealText { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Work-in-progress notice: a floating glass pill at the bottom of the screen */
.notice {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px;
  border-radius: 100px;
  background: rgba(19, 18, 26, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(157, 107, 255, 0.12);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.5s;
}
.notice[hidden] { display: none; }
.notice.is-visible { transform: translate(-50%, 0); opacity: 1; }
.notice__dot {
  flex: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 0 rgba(157, 107, 255, 0.6);
  animation: noticePulse 2.2s infinite;
}
@keyframes noticePulse {
  0% { box-shadow: 0 0 0 0 rgba(157, 107, 255, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(157, 107, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(157, 107, 255, 0); }
}
.notice__text { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.notice__text strong { color: var(--cream); font-weight: 600; }
.notice__close {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background 0.3s, color 0.3s;
}
.notice__close:hover { background: rgba(241, 236, 228, 0.1); color: var(--cream); }
.notice__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 640px) {
  .notice { border-radius: 18px; bottom: 16px; align-items: flex-start; padding: 12px 8px 12px 16px; }
  .notice__dot { margin-top: 6px; }
  .notice__text { font-size: 13px; }
}
.reduce-motion .notice__dot { animation: none; }
.reduce-motion .notice { transform: translate(-50%, 0); transition: opacity 0.5s; }
