:root {
  --bg: #f5f5f2;
  --ink: #101010;
  --muted: rgba(16, 16, 16, .58);
  --line: rgba(16, 16, 16, .12);
  --dark: #030303;
  --dark-ink: #f8f8f5;
  --dark-muted: rgba(248, 248, 245, .64);
  --accent: #7b7b72;
  --header-h: 56px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body.is-dark {
  background: var(--dark);
  color: var(--dark-ink);
}

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

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 56px);
  color: currentColor;
  mix-blend-mode: difference;
}

.brand, nav a, .eyebrow, .counter, .scroll-cue small {
  font-size: 11px;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand { font-weight: 650; }
nav { display: flex; gap: clamp(16px, 3vw, 32px); }
nav a { opacity: .72; transition: opacity .25s ease; }
nav a:hover, nav a:focus-visible { opacity: 1; }

.panel {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 48px) clamp(20px, 5vw, 72px) 72px;
}
.light { background: var(--bg); color: var(--ink); }
.dark { background: var(--dark); color: var(--dark-ink); }

.hero {
  position: relative;
  text-align: center;
}
.hero-copy { max-width: 980px; }
.eyebrow { margin: 0 0 22px; color: currentColor; opacity: .55; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 26px;
  font-size: clamp(56px, 10vw, 148px);
  line-height: .88;
  letter-spacing: -.075em;
  font-weight: 640;
}
h2 {
  margin-bottom: 20px;
  font-size: clamp(42px, 7vw, 104px);
  line-height: .9;
  letter-spacing: -.065em;
  font-weight: 620;
}
h3 {
  margin-bottom: 12px;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
  letter-spacing: -.035em;
}
p {
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}
.dark p, .dark .lede { color: var(--dark-muted); }
.lede {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(18px, 1.7vw, 25px);
  line-height: 1.35;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  place-items: center;
  opacity: .58;
}
.scroll-cue span {
  width: 1px;
  height: 54px;
  background: currentColor;
  transform-origin: top;
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.portfolio-stage {
  position: relative;
  min-height: 520svh;
  background: var(--dark);
  color: var(--dark-ink);
}
.sticky-frame {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.stage-meta {
  position: absolute;
  z-index: 20;
  top: calc(var(--header-h) + 22px);
  left: clamp(20px, 5vw, 72px);
  right: clamp(20px, 5vw, 72px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.counter { display: flex; gap: 8px; opacity: .7; }

.project-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(420px, 1.22fr);
  gap: clamp(28px, 5vw, 96px);
  align-items: center;
  padding: calc(var(--header-h) + 84px) clamp(20px, 5vw, 72px) 68px;
  opacity: 0;
  transform: translateY(34px) scale(.985);
  filter: blur(16px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  pointer-events: none;
}
.project-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}
.project-card[data-theme="light"] {
  background: var(--bg);
  color: var(--ink);
}
.project-card[data-theme="dark"] {
  background: var(--dark);
  color: var(--dark-ink);
}
.project-copy {
  max-width: 560px;
  transform: translateY(26px);
  opacity: 0;
  transition: transform 1s var(--ease), opacity 1s var(--ease);
}
.project-card.active .project-copy { transform: translateY(0); opacity: 1; }
.project-copy p:not(.eyebrow) { max-width: 420px; }

.image-shell {
  position: relative;
  height: min(72svh, 780px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 2px;
  transform: translateX(40px) scale(.96);
  transition: transform 1.05s var(--ease), clip-path 1.05s var(--ease);
  clip-path: inset(9% 7% round 1px);
}
.project-card.active .image-shell {
  transform: translateX(0) scale(1);
  clip-path: inset(0 0 round 1px);
}
.dark-shell { background: #000; }
.light-shell { background: #f8f8f5; }
.image-shell::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid currentColor;
  opacity: .08;
  pointer-events: none;
}
.image-shell img {
  width: min(84%, 860px);
  max-height: 84%;
  object-fit: contain;
  transform: scale(1.06);
  transition: transform 1.2s var(--ease);
}
.project-card.active .image-shell img { transform: scale(1); }
.scroll-track {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  pointer-events: none;
}
.step { min-height: 104svh; }

.section-inner { width: min(1120px, 100%); }
.process { align-items: center; }
.process .section-inner > h2 { max-width: 900px; }
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: clamp(42px, 7vw, 90px);
  background: var(--line);
}
.process-grid > div {
  background: var(--bg);
  padding: clamp(24px, 4vw, 44px);
  min-height: 260px;
}
.process-grid span {
  display: block;
  margin-bottom: 42px;
  font-size: 12px;
  letter-spacing: .15em;
  opacity: .45;
}
.contact { text-align: center; }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  margin-top: 18px;
  padding: 0 22px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .04em;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.button:hover { background: currentColor; color: var(--dark); transform: translateY(-2px); }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  nav { gap: 14px; }
  .project-card {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 30px;
  }
  .image-shell { height: 48svh; order: -1; }
  .project-copy { max-width: 92%; }
  .process-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
