:root {
  --ink: #16161a;
  --paper: #ffffff;
  --muted: #6b6c72;
  --circle-bg: #ececea;
  --line: #e6e6e3;
  --accent: #dcf24d;
  --header-h: 96px;
  --gutter: clamp(48px, 11vw, 180px);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  width: 100%;
}

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

ul {
  list-style: none;
}

section {
  width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  width: 100%;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--ink);
  transition: opacity 0.2s ease;
}

.main-nav a:hover {
  opacity: 0.6;
}

.nav-email-mobile {
  display: none;
}

.email-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease;
  flex: 0 0 auto;
}

.email-pill:hover {
  transform: translateY(-1px);
  background: #2a2a30;
}

.email-pill svg {
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Language switch */

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  flex: 0 0 auto;
}

.lang-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.active {
  background: var(--ink);
  color: #ffffff;
}

.lang-btn.active:hover {
  color: #ffffff;
}

/* Featured intro */

.featured-intro {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.featured-intro h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 9vw, 200px);
  letter-spacing: -2px;
  line-height: 1;
}

.featured-intro .scroll-hint {
  margin-top: 40px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--muted);
}

/* Hero */

.hero {
  padding-top: clamp(64px, 12vw, 128px);
  padding-bottom: clamp(60px, 10vw, 140px);
  display: grid;
  grid-template-columns: minmax(180px, 340px) minmax(0, 760px);
  justify-content: center;
  gap: clamp(60px, 9vw, 120px);
  align-items: center;
}

.photo-circle {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--circle-bg);
}

.avatar-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.hero-copy h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1.02;
  letter-spacing: -2px;
  margin-bottom: clamp(20px, 3vw, 36px);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.hero-text p {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.5;
  color: var(--ink);
}

/* Load-in animation (hero + header) */

@media (prefers-reduced-motion: no-preference) {
  .site-header {
    opacity: 0;
    animation: fade-in 0.6s ease 0.05s forwards;
  }

  .hero-photo {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
  }

  .hero-copy h1 {
    opacity: 0;
    transform: translateY(28px);
    animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  }

  .hero-text {
    opacity: 0;
    transform: translateY(28px);
    animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
  }
}

@keyframes hero-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* Scroll-reveal (About / Services / Skills / Highlights / Contact / Footer) */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.in-view {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-stagger > * {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal-stagger.in-view > * {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-stagger.in-view > *:nth-child(1) { transition-delay: 0.03s; }
  .reveal-stagger.in-view > *:nth-child(2) { transition-delay: 0.08s; }
  .reveal-stagger.in-view > *:nth-child(3) { transition-delay: 0.13s; }
  .reveal-stagger.in-view > *:nth-child(4) { transition-delay: 0.18s; }
  .reveal-stagger.in-view > *:nth-child(5) { transition-delay: 0.23s; }
  .reveal-stagger.in-view > *:nth-child(6) { transition-delay: 0.28s; }
  .reveal-stagger.in-view > *:nth-child(7) { transition-delay: 0.33s; }
  .reveal-stagger.in-view > *:nth-child(8) { transition-delay: 0.38s; }
  .reveal-stagger.in-view > *:nth-child(9) { transition-delay: 0.43s; }
  .reveal-stagger.in-view > *:nth-child(10) { transition-delay: 0.48s; }
  .reveal-stagger.in-view > *:nth-child(11) { transition-delay: 0.53s; }
  .reveal-stagger.in-view > *:nth-child(12) { transition-delay: 0.58s; }
}

/* Section heads */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.section-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.5px;
}

.section-index {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1px;
}

/* Work stack (one small rounded card at a time, scrolls up and over the sticky "Featured work" heading) */

.work-stack {
  position: relative;
  z-index: 2;
  padding: 0;
}

.stack-card {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 calc(var(--gutter) * 2);
  pointer-events: none;
}

.stack-card:nth-child(odd) { justify-content: flex-start; }
.stack-card:nth-child(even) { justify-content: flex-end; }

.stack-card:nth-child(1) { z-index: 1; }
.stack-card:nth-child(2) { z-index: 2; }
.stack-card:nth-child(3) { z-index: 3; }
.stack-card:nth-child(4) { z-index: 4; }

.stack-inner {
  position: relative;
  width: min(550px, 86vw);
  aspect-ratio: 550 / 450;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.25);
  will-change: transform, opacity;
  pointer-events: auto;
}

.stack-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.stack-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(20px, 3vw, 28px) clamp(22px, 3vw, 30px) clamp(24px, 3vw, 32px);
  background: linear-gradient(180deg, rgba(12, 12, 16, 0.1) 0%, rgba(12, 12, 16, 0.55) 45%, rgba(12, 12, 16, 0.9) 100%);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.stack-inner:hover .stack-info,
.stack-inner:focus-within .stack-info {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.stack-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 2.2vw, 24px);
  letter-spacing: -0.3px;
  color: #ffffff;
  margin-bottom: 6px;
}

.stack-meta {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 12px;
}

.stack-info p {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
}

.case-study-btn {
  display: inline-block;
  align-self: flex-start;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease;
}

.case-study-btn:hover {
  transform: translateY(-1px);
}

/* Case study page */

.case-banner-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2493 / 1022;
  overflow: hidden;
}

.case-banner-wrap[hidden] {
  display: none;
}

.case-banner {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.case-banner-logo {
  position: absolute;
  left: 23%;
  top: 34%;
  width: 25%;
  height: auto;
  object-fit: contain;
  object-position: left center;
  pointer-events: none;
}

.case-banner-logo[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .case-banner-logo {
    opacity: 0;
    transform: translateY(18px) scale(0.85);
    animation: logo-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
  }
}

@keyframes logo-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.case-study {
  max-width: 1800px;
  margin: 0 auto;
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(60px, 10vw, 120px);
}

.back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin-bottom: clamp(24px, 4vw, 40px);
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 0.6;
}

.case-hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
  border-radius: 20px;
  display: block;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.case-hero-img[hidden] {
  display: none;
}

.case-meta {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.case-hero-copy h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 16px;
}

.case-tagline {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 24px;
}

.case-live-btn {
  display: inline-block;
  background: var(--ink);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease;
}

.case-live-btn:hover {
  transform: translateY(-1px);
}

.case-live-btn[hidden] {
  display: none;
}

.case-body {
  margin-top: clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vw, 56px);
}

.case-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.3px;
  margin-bottom: 14px;
}

.case-section p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 680px;
}

.case-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-highlights li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.case-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.case-apps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

.case-app-card {
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.case-app-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.case-app-body {
  padding: clamp(20px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-app-platform {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.case-app-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: -0.2px;
}

.case-app-rating {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.case-app-body p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 4px 0 2px;
}

.case-app-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.case-app-features li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.case-app-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.case-app-body .case-live-btn {
  align-self: flex-start;
}

@media (max-width: 700px) {
  .case-apps {
    grid-template-columns: 1fr;
  }
}

.case-empty {
  padding: 40px 0;
}

.case-empty h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 12px;
}

.case-empty p {
  color: var(--muted);
}

/* About */

.about-bio {
  max-width: 760px;
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.5;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: -0.3px;
  padding-bottom: clamp(40px, 6vw, 80px);
}

/* Services */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px);
  padding-bottom: clamp(40px, 6vw, 80px);
}

.service-item {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.service-item h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(17px, 1.8vw, 20px);
  margin-bottom: 8px;
}

.service-item p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* Skills */

.skills-section {
  padding-bottom: clamp(40px, 6vw, 80px);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.skills span {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

/* Highlights */

.highlights {
  padding-bottom: clamp(40px, 6vw, 80px);
}

.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}

.highlight-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.highlight-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.highlight-row h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2vw, 22px);
  white-space: nowrap;
}

.highlight-row span {
  font-size: 14px;
  color: var(--muted);
}

/* Contact */

.contact {
  padding-top: clamp(60px, 8vw, 100px);
  padding-bottom: clamp(60px, 8vw, 120px);
  border-top: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 7vw, 84px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: clamp(20px, 2.5vw, 28px);
}

.contact-note {
  max-width: 480px;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: clamp(24px, 3vw, 36px);
}

.contact-email {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: clamp(32px, 4vw, 48px);
}

.socials {
  display: flex;
  gap: 24px;
}

.socials a,
.socials span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease;
}

.socials a:hover {
  color: var(--ink);
}

/* Footer */

.site-footer {
  padding: 24px var(--gutter) 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

/* Responsive */

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

  .photo-circle {
    width: 200px;
  }

  .stack-inner {
    width: min(340px, 82vw);
  }

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

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vw, 40px);
  }
}

@media (max-width: 700px) {
  :root {
    --header-h: 68px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .stack-inner {
    width: min(300px, 80vw);
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .nav-email-mobile {
    display: block;
  }

  .email-pill span {
    display: none;
  }

  .email-pill {
    padding: 12px;
  }

  .lang-btn {
    padding: 6px 9px;
    font-size: 10px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
