:root {
  --bg: #000;
  --panel: #0c0c0c;
  --line: rgba(255, 255, 255, .16);
  --text: #f4f4f2;
  --muted: rgba(244, 244, 242, .58);
  --pad: clamp(16px, 3.5vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden;
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 125%; font-variation-settings: "wdth" 125;
  font-weight: 400; text-transform: uppercase; letter-spacing: -.035em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
.small { font-size: 11px; line-height: 1.3; letter-spacing: -.02em; }

/* film grain + light */
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .09;
  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 1s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }
.glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 78% 8%, rgba(255,255,255,.11), transparent 70%),
    radial-gradient(35% 40% at 90% 92%, rgba(255,255,255,.07), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-6%, 4%) scale(1.08); } }

/* letter swap hover: text slides up, copy slides in */
.swap { display: inline-block; overflow: hidden; vertical-align: top; }
.swap > span { display: inline-block; position: relative; transition: transform .45s var(--ease); }
.swap > span::after { content: attr(data-t); position: absolute; left: 0; top: 100%; }
.swap:hover > span, .swap:focus-visible > span { transform: translateY(-100%); }

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--pad); mix-blend-mode: difference;
}
.logo { font-size: 22px; letter-spacing: -.05em; }
.nav-mid { display: flex; gap: 28px; font-size: 11px; }
.pill {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 7px 12px; font-size: 10.5px;
}
.pill:hover .swap > span { transform: translateY(-100%); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

main { position: relative; }

/* hero */
.hero {
  min-height: 100svh; position: relative; display: grid; place-items: center;
  padding: 120px var(--pad) 80px;
}
.hero-index { position: absolute; left: var(--pad); top: 26%; }
.hero-title {
  margin: 0; font-weight: 500; line-height: .9; letter-spacing: -.055em;
  font-size: clamp(44px, 9.4vw, 148px);
  display: grid; justify-items: start;
}
.line { display: block; overflow: hidden; padding-bottom: .04em; }
.line > span:first-child { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.l1 { margin-left: 1.05em; } .l1 > span:first-child { animation-delay: .15s; }
.l2 { margin-left: 0; }      .l2 > span:first-child { animation-delay: .27s; }
.l3 { margin-left: .7em; display: flex; align-items: flex-end; gap: 22px; } .l3 > span:first-child { animation-delay: .39s; }
@keyframes rise { to { transform: none; } }
.hero-note {
  max-width: 250px; margin-bottom: .55em; text-indent: 3em; opacity: 0;
  animation: fade 1s .9s forwards; font-weight: 400; letter-spacing: -.02em; line-height: 1.3;
}
@keyframes fade { to { opacity: 1; } }

.circle {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.7); transition: background .3s, color .3s;
}
.circle:hover { background: var(--text); color: var(--bg); }
.circle.sm { width: 48px; height: 48px; flex: none; }
.hero-down { margin-top: 48px; opacity: 0; animation: fade 1s 1.2s forwards; }
.hero-down svg { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* sections */
.section { padding: 0 var(--pad) clamp(80px, 12vw, 160px); }
.label {
  display: flex; justify-content: space-between; padding-top: 12px; margin-bottom: clamp(36px, 6vw, 72px);
  border-top: 1px solid var(--line);
}

/* about */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.socials { display: flex; gap: 10px; align-items: start; }
.about-lead {
  margin: 0 0 32px; font-size: clamp(22px, 3.1vw, 42px); line-height: 1.02; letter-spacing: -.045em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); }

/* marquee */
.marquee { overflow: hidden; margin: 0 0 clamp(80px, 10vw, 140px); }
.marquee-track { display: flex; width: max-content; animation: slide 28s linear infinite; }
.marquee-track span {
  font-size: clamp(64px, 14vw, 220px); font-weight: 400; letter-spacing: -.06em; line-height: 1; padding-right: .3em; white-space: nowrap;
}
@keyframes slide { to { transform: translateX(-50%); } }

/* work */
.work-intro { display: flex; gap: 24px; align-items: start; justify-content: space-between; margin-bottom: clamp(36px, 6vw, 64px); }
.work-intro p {
  margin: 0; max-width: 820px; text-indent: 3em; text-transform: none;
  font-size: clamp(20px, 2.4vw, 32px); line-height: 1.1; letter-spacing: -.04em;
}
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 24px); }
.project { display: block; }
.project-media {
  position: relative; aspect-ratio: 5 / 4; border-radius: 22px; overflow: hidden;
  background: var(--bg); border: 1px solid rgba(255,255,255,.08);
  container-type: inline-size; isolation: isolate;
}
/* subtle grain on the custom backgrounds */
.project-media::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: .18; mix-blend-mode: overlay; pointer-events: none;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-word {
  position: absolute; z-index: 0; left: 50%; top: 36%; transform: translate(-50%, -50%);
  font-size: 19cqw; font-weight: 600; letter-spacing: -.06em; line-height: 1; white-space: nowrap;
  color: var(--mark); transition: transform 1.2s var(--ease);
}
.project:hover .bg-word { transform: translate(-50%, -50%) scale(1.06); }
.phone {
  position: absolute; z-index: 1; left: 50%; top: 11cqw; width: 34cqw; aspect-ratio: 390 / 844;
  transform: translateX(-50%); padding: 1.1cqw; border-radius: 5.6cqw;
  background: linear-gradient(160deg, #2b2b2b, #0a0a0a 40%, #161616);
  box-shadow:
    0 0 0 .25cqw #3a3a3a inset,
    0 2.5cqw 5cqw rgba(0,0,0,.35),
    0 6cqw 12cqw rgba(0,0,0,.28);
  transition: transform 1s var(--ease);
}
.project:hover .phone { transform: translateX(-50%) translateY(-3cqw) rotate(-1.5deg); }
.screen { width: 100%; height: 100%; border-radius: 4.6cqw; overflow: hidden; background: #fff; }
.screen img { width: 100%; height: auto; display: block; }
.island {
  position: absolute; top: 2.2cqw; left: 50%; transform: translateX(-50%);
  width: 10cqw; height: 2.9cqw; border-radius: 99px; background: #000;
}
.project-media .tag, .project-media .go { z-index: 2; }
.project-media .tag {
  position: absolute; left: 14px; top: 14px; padding: 7px 11px; border-radius: 999px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px); color: #fff;
}
.project-media .go {
  position: absolute; right: 14px; bottom: 14px; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #000; font-size: 20px;
  transform: scale(.6) rotate(-45deg); opacity: 0; transition: transform .5s var(--ease), opacity .3s;
}
.project:hover .go, .project:focus-visible .go { transform: none; opacity: 1; }
.project-info { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; padding: 16px 4px 0; }
.project-info h3 { margin: 0; font-size: clamp(22px, 2.6vw, 34px); font-weight: 500; letter-spacing: -.05em; line-height: 1; }
.project-info .meta { text-align: right; color: var(--muted); }
.project-info .type { color: var(--muted); }
.project-info p {
  grid-column: 1 / -1; margin: 8px 0 0; max-width: 560px; color: var(--muted);
  text-transform: none; font-size: 15px; line-height: 1.45; letter-spacing: -.01em; font-stretch: 100%; font-variation-settings: "wdth" 100;
}
.project-info .stack { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.project-info .stack li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }

/* capabilities */
.cap-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 32px; gap: 20px; }
.cap-head h2 { margin: 0; text-align: right; font-weight: 500; font-size: clamp(40px, 7vw, 110px); line-height: .9; letter-spacing: -.055em; }
.caps {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  cursor: grab; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding-inline: var(--pad);
}
.caps::-webkit-scrollbar { display: none; }
.caps.dragging { cursor: grabbing; scroll-snap-type: none; }
.cap {
  flex: 0 0 clamp(250px, 26vw, 340px); aspect-ratio: 3 / 4; scroll-snap-align: start; user-select: none;
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px;
  border-radius: 22px; border: 1px solid rgba(255,255,255,.1);
  background: radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.08), transparent 60%), var(--panel);
  transition: background .4s, color .4s;
}
.cap:hover { background: var(--text); color: var(--bg); }
.cap:hover p { color: rgba(0,0,0,.65); }
.cap .n { display: flex; justify-content: space-between; }
.cap h3 { margin: 0 0 12px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; letter-spacing: -.05em; line-height: .95; }
.cap p {
  margin: 0; color: var(--muted); text-transform: none; font-size: 14px; line-height: 1.45; letter-spacing: -.01em;
  font-stretch: 100%; font-variation-settings: "wdth" 100;
}

/* contact */
.contact-card {
  position: relative; min-height: min(78vh, 640px); border-radius: 28px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 20px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(60% 60% at 85% 10%, rgba(255,255,255,.12), transparent 70%),
    radial-gradient(50% 50% at 10% 100%, rgba(255,255,255,.06), transparent 70%),
    #0a0a0a;
}
.connect { margin: 0; font-weight: 500; font-size: clamp(40px, 7.4vw, 110px); line-height: 1; letter-spacing: -.055em; }
.connect .big { line-height: 1.02; }
.ring { position: relative; display: grid; place-items: center; width: 116px; height: 116px; margin-top: 18px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 14s linear infinite; }
.ring text { fill: var(--text); font-size: 8px; letter-spacing: 0; font-stretch: 100%; font-variation-settings: "wdth" 100; }
.ring-arrow {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 18px;
  border: 1px solid rgba(255,255,255,.7); transition: background .3s, color .3s, transform .4s var(--ease);
}
.ring:hover .ring-arrow { background: var(--text); color: var(--bg); transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.mail-line {
  margin-top: 6px; font-size: clamp(14px, 1.6vw, 20px); letter-spacing: -.03em;
  text-transform: none; border-bottom: 1px solid var(--line); padding-bottom: 2px;
}
.muted-links { color: var(--muted); margin: 0; }
.muted-links a { color: var(--text); }

/* footer */
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px var(--pad) 32px; color: var(--muted); }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* responsive */
@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-mid { display: none; }
  .logo { font-size: 18px; }
  .hero { place-items: center start; }
  .hero-index { top: 96px; }
  .l1 { margin-left: .5em; } .l3 { margin-left: .3em; flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero-note { margin-bottom: 0; text-indent: 0; font-size: 11px; max-width: 280px; }
  .hero-down { margin-top: 32px; }
  .hero { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .projects { grid-template-columns: 1fr; }
  .work-intro .circle { display: none; }
  .work-intro p { text-indent: 1.5em; }
  .contact-card { min-height: 60vh; }
}
@media (max-width: 560px) {
  .project-media { aspect-ratio: 4 / 4.4; }
  .phone { width: 46cqw; top: 13cqw; border-radius: 7.4cqw; padding: 1.5cqw; }
  .screen { border-radius: 6.1cqw; }
  .island { top: 3cqw; width: 13cqw; height: 3.8cqw; }
  .bg-word { font-size: 24cqw; top: 30%; }
  .tag-host { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .grain { animation: none; }
  .marquee-track { animation: none; }
}
