/* ============================================
   STUDIO/CC — Portfolio Stylesheet
   ============================================ */

:root {
  --bg: #0a0908;
  --bg-elev: #141210;
  --bg-card: #17140f;
  --ink: #f5efe6;
  --ink-dim: #8a847b;
  --ink-faint: #4a463f;
  --accent: #ff4d1c;
  --accent-soft: #ff6a3d;
  --accent-deep: #c4360f;
  --line: rgba(245, 239, 230, 0.08);
  --line-strong: rgba(245, 239, 230, 0.18);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}

@media (max-width: 900px) {
  body { cursor: auto; }
  .cursor, .cursor-dot { display: none; }
}

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

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

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
              background 0.3s var(--ease), border-color 0.3s var(--ease);
  mix-blend-mode: difference;
}

.cursor-dot {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s linear;
}

.cursor.hovering {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}

/* ============================================
   GRAIN OVERLAY
   ============================================ */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 24px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(10, 9, 8, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: padding 0.4s var(--ease);
  animation: navDrop 0.9s var(--ease) 0.05s both;
}

@keyframes navDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.nav.scrolled {
  padding: 16px 40px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.logo-mark {
  font-size: 18px;
  color: var(--accent);
  animation: rotate 8s linear infinite;
  display: inline-block;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.nav-links {
  display: flex;
  gap: 4px;
  justify-self: center;
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  transition: color 0.3s var(--ease);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: fit-content;
}

.nav-link span {
  position: relative;
  display: inline-block;
  transition: transform 0.4s var(--ease);
}

.nav-link::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  color: var(--ink);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
}

.nav-link:hover span {
  transform: translateY(-100%);
}

.nav-link:hover::after {
  transform: translateY(0);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-cta {
  background: var(--accent);
  color: var(--bg) !important;
  border-radius: 100px;
  padding: 8px 20px;
}

.nav-cta::after {
  color: var(--bg);
}

.nav-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .nav {
    padding: 16px 20px;
    grid-template-columns: 1fr auto;
  }
  .nav-links { display: none; }
  .nav-time { display: none; }
  .nav-right .nav-time { display: none; }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px 40px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 75%);
  opacity: 0.5;
}

.hero-glow {
  position: absolute;
  width: 800px;
  height: 800px;
  left: 60%;
  top: -200px;
  background: radial-gradient(circle, rgba(255, 77, 28, 0.25) 0%, transparent 60%);
  filter: blur(40px);
  animation: float 12s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 30px); }
}

.hero-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 0.2s forwards;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero-eyebrow .line {
  width: 48px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(60px, 13vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-bottom: 48px;
  font-variation-settings: 'opsz' 96;
}

.title-line {
  display: block;
  overflow: hidden;
}

.title-line .word {
  display: inline-block;
  transform: translateY(120%);
  animation: rise 1.1s var(--ease) forwards;
}

.title-line:nth-child(1) .word { animation-delay: 0.1s; }
.title-line:nth-child(2) .word:nth-child(1) { animation-delay: 0.2s; }
.title-line:nth-child(2) .word:nth-child(2) { animation-delay: 0.3s; }
.title-line:nth-child(3) .word { animation-delay: 0.4s; }

@keyframes rise {
  to { transform: translateY(0); }
}

.italic {
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--ink-dim);
  max-width: 540px;
  margin-bottom: 48px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(20px);
  animation: rise-soft 1s var(--ease) 0.8s forwards;
}

@keyframes rise-soft {
  to { opacity: 1; transform: translateY(0); }
}

.reveal-delay-2 {
  opacity: 0;
  transform: translateY(20px);
  animation: rise-soft 1s var(--ease) 1s forwards;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 100px;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.4s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px rgba(255, 77, 28, 0.6);
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Hero stats */
.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 60px;
}

.stat {
  background: var(--bg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.4s var(--ease);
  opacity: 0;
  transform: translateY(30px);
  animation: statRise 0.8s var(--ease) forwards;
}

.stat:nth-child(1) { animation-delay: 0.7s; }
.stat:nth-child(2) { animation-delay: 0.85s; }
.stat:nth-child(3) { animation-delay: 1.0s; }
.stat:nth-child(4) { animation-delay: 1.15s; }

@keyframes statRise {
  to { opacity: 1; transform: translateY(0); }
}

.stat:hover {
  background: var(--bg-elev);
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 5vw, 84px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
  font-variation-settings: 'opsz' 96;
}

.stat-num .pct {
  font-size: 0.6em;
  margin-left: 4px;
}

.stat-zero .stat-num {
  color: var(--ink);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 720px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 0.3em;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.4s forwards;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--ink-dim), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { top: -100%; }
  100% { top: 100%; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ============================================
   MARQUEE
   ============================================ */
.marquee-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 28px 0;
  overflow: hidden;
}

.marquee {
  width: 100%;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 32px;
  white-space: nowrap;
  animation: scroll-marquee 60s linear infinite;
  font-family: var(--font-display);
  font-weight: 400;
}

.marquee-item {
  font-size: clamp(28px, 4vw, 56px);
  color: var(--ink);
  letter-spacing: -0.02em;
  transition: color 0.3s var(--ease);
}

.marquee-item:hover {
  color: var(--accent);
}

.marquee-dot {
  font-size: 14px;
  color: var(--accent);
}

@keyframes scroll-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================
   SECTION HEADS (shared)
   ============================================ */
.section-head {
  max-width: 1400px;
  margin: 0 auto 80px;
  padding: 0 40px;
}

.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 128px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  font-variation-settings: 'opsz' 96;
}

.section-sub {
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--ink-dim);
  max-width: 560px;
}

/* ============================================
   PILLARS
   ============================================ */
.pillars {
  padding: 160px 0 120px;
  position: relative;
}

.pillars-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pillar {
  background: var(--bg);
  padding: 56px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: background 0.5s var(--ease);
  position: relative;
  overflow: hidden;
}

.pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.pillar:hover {
  background: var(--bg-elev);
}

.pillar:hover::before {
  transform: scaleX(1);
}

.pillar-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.15em;
  transition: color 0.3s var(--ease), letter-spacing 0.4s var(--ease);
}

.pillar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  transition: letter-spacing 0.4s var(--ease);
}

.pillar-desc {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
  flex: 1;
  transition: color 0.4s var(--ease);
}

.pillar-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

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

/* ============================================
   WORK
   ============================================ */
.work {
  padding: 120px 0 120px;
  background: var(--bg);
}

.work-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
}

.work-item {
  display: grid;
  grid-template-columns: 80px 1fr 200px;
  gap: 40px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  position: relative;
  align-items: center;
  transition: padding 0.5s var(--ease);
}

.work-item:last-of-type {
  border-bottom: 1px solid var(--line);
}

.work-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
  z-index: 0;
}

.work-item:hover::before {
  transform: scaleX(1);
}

.work-item:hover {
  padding: 48px 32px;
}

.work-item:hover * {
  color: var(--bg) !important;
}

.work-item:hover .work-cta svg {
  transform: translate(8px, -8px);
}

.work-index,
.work-body,
.work-cta {
  position: relative;
  z-index: 1;
  transition: color 0.4s var(--ease);
}

.work-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  align-self: start;
  padding-top: 8px;
}

.work-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
}

.work-tag {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
}

.work-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.work-desc {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.55;
  max-width: 640px;
}

.work-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  justify-self: end;
}

.work-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s var(--ease);
}

@media (max-width: 720px) {
  .work-item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 36px 0;
  }
  .work-item:hover {
    padding: 36px 20px;
  }
  .work-cta {
    justify-self: start;
  }
}

.work-footer {
  max-width: 1400px;
  margin: 60px auto 0;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.work-footer-line {
  width: 60px;
  height: 1px;
  background: var(--ink-faint);
  flex-shrink: 0;
}

.work-footer p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* ============================================
   PROCESS
   ============================================ */
.process {
  padding: 160px 0 120px;
  background: var(--bg);
}

.process-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

.process-row {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.process-row:last-child {
  border-bottom: 1px solid var(--line);
}

.process-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 96;
}

.process-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.process-content p {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
  max-width: 640px;
}

.process-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  justify-self: end;
  padding-top: 12px;
}

@media (max-width: 720px) {
  .process-row {
    grid-template-columns: 60px 1fr;
    gap: 20px;
  }
  .process-num {
    font-size: 40px;
  }
  .process-time {
    grid-column: 2;
    justify-self: start;
    padding-top: 0;
  }
}

/* ============================================
   NUMBERS
   ============================================ */
.numbers {
  padding: 120px 40px;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.numbers-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.number-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.n-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.n-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 5.5vw, 88px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.04em;
  font-variation-settings: 'opsz' 96;
  margin: 8px 0;
}

.n-suf {
  color: var(--accent);
  font-size: 0.5em;
  margin-left: 4px;
}

.n-sub {
  font-size: 14px;
  color: var(--ink-dim);
}

@media (max-width: 900px) {
  .numbers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
  padding: 160px 40px 120px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(255, 77, 28, 0.12) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  filter: blur(60px);
  pointer-events: none;
}

.contact-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 10vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 24px 0 32px;
  font-variation-settings: 'opsz' 96;
}

.contact-sub {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--ink-dim);
  max-width: 540px;
  margin: 0 auto 60px;
  line-height: 1.55;
}

/* contact-cta, contact-cta:hover, contact-meta base layout defined
   in extended motion block below — keeping structural props here */
.contact-cta {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  gap: 24px;
  align-items: center;
  padding: 24px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  margin-bottom: 80px;
  background: var(--bg-elev);
}

.contact-cta:hover * {
  color: var(--bg) !important;
}

.contact-cta:hover svg {
  transform: translate(4px, -4px);
}

.contact-cta-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.15em;
  padding-right: 24px;
  border-right: 1px solid var(--line-strong);
}

.contact-cta-value {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.contact-cta svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  transition: transform 0.4s var(--ease);
}

.contact-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.cm-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.15em;
}

.cm-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

@media (max-width: 720px) {
  .contact-cta {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
    border-radius: 24px;
  }
  .contact-cta-label {
    padding-right: 0;
    border-right: none;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-strong);
  }
  .contact-meta {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 32px 40px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-row {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-mid {
  flex: 1;
  text-align: center;
}

/* ============================================
   REVEAL ANIMATIONS (scroll-triggered)
   ============================================ */
.reveal,
.reveal-delay {
  opacity: 0;
  transform: translateY(20px);
  animation: rise-soft 1s var(--ease) 0.6s forwards;
}

.reveal-delay {
  animation-delay: 0.7s;
}

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

/* For sections that fade in on scroll.
   IMPORTANT: content is visible by default. The .pending-reveal class
   is added by JS only after page is loaded AND only to elements
   below the fold, so users without JS still see everything. */
.fade-up {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.fade-up.pending-reveal {
  opacity: 0;
  transform: translateY(40px);
}

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

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 720px) {
  .hero {
    padding: 110px 20px 40px;
  }
  .section-head {
    padding: 0 20px;
    margin-bottom: 60px;
  }
  .pillars { padding: 100px 0 80px; }
  .work { padding: 100px 0; }
  .work-list { padding: 0 20px; }
  .work-footer { padding: 0 20px; }
  .process { padding: 100px 0 80px; }
  .process-list { padding: 0 20px; }
  .numbers { padding: 80px 20px; }
  .contact { padding: 100px 20px 80px; }
  .footer { padding: 24px 20px; }
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(to right, var(--accent), var(--accent-soft));
  z-index: 10000;
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.1s linear;
}

/* ============================================
   PAGE TRANSITION CURTAIN
   ============================================ */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--accent);
  transform: translateY(100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Curtain slides UP from bottom to cover screen.
   Expo-out: very fast at first (urgency), then settles with weight. */
.curtain.entering {
  animation: curtainEnter 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: all;
}

/* On page arrival: curtain sits covering → sweeps UP off screen.
   Slight delay so the eye can register the accent colour, then
   expo-in: gentle start, accelerates away — feels like it's being pulled. */
.curtain.exiting {
  transform: translateY(0);
  animation: curtainExit 1.1s cubic-bezier(0.76, 0, 0.24, 1) 0.3s forwards;
  pointer-events: none;
}

/* On page-load exit: text rises in briefly then rides the curtain away */
.curtain.exiting .curtain-text:not(.letters-active) {
  animation: curtainTextExit 1.4s var(--ease) forwards;
}

/* On exit after navigation: letters should fade upward with the curtain,
   not just snap away. Remove individual transitions so the parent drives. */
.curtain.exiting .curtain-text.letters-active .cl {
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  opacity: 0;
  transform: translateY(-24px);
}

@keyframes curtainTextExit {
  0%   { opacity: 0;   transform: translateY(20px); }
  25%  { opacity: 1;   transform: translateY(0);    }
  80%  { opacity: 1;   transform: translateY(0);    }
  100% { opacity: 0;   transform: translateY(-20px);}
}

.curtain-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 88px);
  color: var(--bg);
  letter-spacing: -0.03em;
  text-align: center;
  padding: 0 40px;
  max-width: 90%;
  opacity: 0;
  transform: translateY(30px);
}

/* When letters take over, suppress the default fade */
.curtain-text.letters-active {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

@keyframes curtainEnter {
  0%   { transform: translateY(100%); }
  100% { transform: translateY(0%); }
}

@keyframes curtainExit {
  0%   { transform: translateY(0%); }
  100% { transform: translateY(-100%); }
}

/* ── Per-letter spans injected by JS ── */
.curtain-text .cl {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px) rotate(6deg);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.curtain-text .cl.in {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}
.curtain-text .cl-space {
  display: inline-block;
  width: 0.28em;
}

/* ── Status + bar sit at the bottom ── */
.curtain-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  opacity: 0;
  transform: translateY(16px);
  position: absolute;
  bottom: 80px;
  left: 0; right: 0;
  /* animated in by JS after letters settle */
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.curtain-sub.in {
  opacity: 1;
  transform: translateY(0);
}
/* On exit: sub fades out fast */
.curtain.exiting .curtain-sub {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.curtain-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(10, 9, 8, 0.5);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.curtain-bar-wrap {
  width: clamp(140px, 18vw, 260px);
  height: 2px;
  background: rgba(10, 9, 8, 0.18);
  border-radius: 2px;
  overflow: hidden;
}
.curtain-bar {
  height: 100%;
  background: var(--bg);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.22,1,0.36,1);
}

/* ── Pulsing dots ── */
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
  40%           { opacity: 1;    transform: scale(1); }
}
.curtain-dots { display: inline-flex; gap: 5px; }
.curtain-dots span {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(10,9,8,0.5);
  display: inline-block;
  animation: dotPulse 1.1s ease-in-out infinite;
}
.curtain-dots span:nth-child(2) { animation-delay: 0.18s; }
.curtain-dots span:nth-child(3) { animation-delay: 0.36s; }

/* ============================================
   TITLE MASK REVEAL
   ============================================ */
.reveal-mask {
  display: inline-block;
  overflow: hidden;
  position: relative;
  padding-bottom: 0.15em;
  padding-right: 0.05em;
  margin-bottom: -0.1em;
}

.reveal-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 1s cubic-bezier(0.77, 0, 0.18, 1) 0.1s;
}

.in-view .reveal-mask::after,
.section-head.in-view .reveal-mask::after {
  transform-origin: right;
  transform: scaleX(0);
}

/* Section head: number, title, sub all stagger in */
.section-head {
  transition: opacity 0.6s var(--ease);
}

.section-head .section-num {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.section-head.in-view .section-num {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.section-head .section-sub {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.section-head.in-view .section-sub {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.45s;
}

/* ============================================
   KINETIC SCROLL STRIP
   ============================================ */
.kinetic-section {
  padding: 60px 0;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.kinetic-strip {
  display: flex;
  align-items: center;
  gap: 80px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(80px, 14vw, 220px);
  line-height: 1;
  letter-spacing: -0.04em;
  will-change: transform;
}

.kinetic-strip + .kinetic-strip {
  margin-top: 20px;
}

.kinetic-text {
  display: inline-block;
  color: var(--ink);
  transition: color 0.4s var(--ease);
}

.kinetic-text.outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink-faint);
  text-stroke: 2px var(--ink-faint);
}

.kinetic-text:hover {
  color: var(--accent);
}

.kinetic-text.outline:hover {
  -webkit-text-stroke-color: var(--accent);
  color: transparent;
}

/* ============================================
   MAGNETIC BUTTONS
   ============================================ */
[data-magnetic] {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* ============================================
   TILT CARDS (3D mouse-tilt)
   ============================================ */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.pillars-grid {
  perspective: 1000px;
}

/* ============================================
   HERO PARALLAX LAYERS
   ============================================ */
.hero-grid {
  will-change: transform;
}

.hero-title {
  will-change: transform;
}

/* ============================================
   MARQUEE SCROLL-VELOCITY REACTION
   ============================================ */
.marquee-track {
  will-change: transform;
  /* Animation overridden by JS, but kept as fallback */
}

/* ============================================
   FLOATING NUMBER STRIP (sticky scrub)
   ============================================ */
.scrub-strip {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.scrub-track {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 32px 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  will-change: transform;
}

.scrub-item {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.scrub-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* ============================================
   EXTENDED MOTION SYSTEM
   ============================================ */

/* --- Work items: staggered slide-in --- */
.work-item {
  --item-delay: 0ms;
}
.work-item.fade-up.pending-reveal {
  opacity: 0;
  transform: translateX(-20px);
}
.work-item.fade-up.in-view {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.7s var(--ease) var(--item-delay),
              transform 0.7s var(--ease) var(--item-delay),
              padding 0.5s var(--ease);
}

/* --- Process rows: number pops, row slides --- */
.process-row.fade-up.pending-reveal {
  opacity: 0;
  transform: translateX(-16px);
}
.process-row.fade-up.in-view {
  opacity: 1;
  transform: translateX(0);
}

.process-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 96;
  display: inline-block;
  transition: transform 0.5s var(--ease), color 0.3s var(--ease);
}

.process-row:hover .process-num {
  transform: scale(1.12) translateX(6px);
  color: var(--accent-soft);
}

.process-content h3 {
  position: relative;
  display: inline-block;
}

.process-content h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}

.process-row:hover .process-content h3::after {
  width: 100%;
}

/* --- Number cards: count-up feel via clip reveal --- */
.number-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.number-card.fade-up.pending-reveal {
  opacity: 0;
  transform: translateY(32px);
}
.number-card.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.number-card .n-value {
  display: inline-block;
  transition: transform 0.6s var(--ease), color 0.3s var(--ease);
}

.number-card:hover .n-value {
  transform: scale(1.04);
  color: var(--accent);
}

.number-card .n-label {
  transition: letter-spacing 0.4s var(--ease), color 0.3s var(--ease);
}

.number-card:hover .n-label {
  letter-spacing: 0.25em;
  color: var(--ink);
}

/* --- Contact section: title word-rise, CTA spring --- */
.contact-title {
  overflow: hidden;
}

.contact-title span {
  display: block;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.contact.in-view .contact-title span:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.contact.in-view .contact-title span:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

/* contact-sub animation */
.contact-sub {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease) 0.4s, transform 0.7s var(--ease) 0.4s;
}

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

/* contact-cta animation */
.contact-cta {
  transition: opacity 0.7s var(--ease) 0.55s,
              transform 0.7s var(--ease) 0.55s,
              background 0.5s var(--ease),
              border-color 0.5s var(--ease),
              box-shadow 0.5s var(--ease);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
}

.contact.in-view .contact-cta {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.contact-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.01) !important;
  box-shadow: 0 30px 60px -20px rgba(255, 77, 28, 0.5);
}

/* contact-meta animation */
.contact-meta {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease) 0.7s, transform 0.7s var(--ease) 0.7s;
}

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

/* --- Pillar cards: internal hover reactions --- */
.pillar:hover .pillar-num {
  color: var(--accent);
  letter-spacing: 0.25em;
}

.pillar:hover .pillar-title {
  letter-spacing: -0.03em;
}

.pillar:hover .pillar-desc {
  color: var(--ink);
}

/* --- Footer: slide up on scroll entry --- */
/* footer-row animation initial state */
.footer-row {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

/* --- Scroll progress bar pulse on milestone --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 9997;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* --- Kinetic text inner glow on hover --- */
.kinetic-text {
  transition: text-shadow 0.3s var(--ease);
}

.kinetic-text:hover {
  text-shadow: 0 0 40px var(--accent);
}

/* --- Work item hover: CTA arrow bounce --- */
@keyframes arrowBounce {
  0%, 100% { transform: translate(8px, -8px); }
  50%       { transform: translate(12px, -12px); }
}

.work-item:hover .work-cta svg {
  animation: arrowBounce 0.8s var(--ease) infinite;
}

/* --- Reduced motion: disable all the above --- */
@media (prefers-reduced-motion: reduce) {
  .stat,
  .contact-title span,
  .contact-sub,
  .contact-cta,
  .contact-meta,
  .footer-row {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .section-head .section-num,
  .section-head .section-sub {
    opacity: 1 !important;
    transform: none !important;
  }
  @keyframes navDrop { from { } to { } }
  @keyframes statRise { to { } }
}

/* ============================================
   LIGHT THEME — respects system preference
   ============================================ */

@media (prefers-color-scheme: light) {
  :root {
    --bg:          #f5f0e8;
    --bg-elev:     #ede8df;
    --bg-card:     #e8e2d8;
    --ink:         #1a1612;
    --ink-dim:     #6b6560;
    --ink-faint:   #b0aaa0;
    --accent:      #ff4d1c;
    --accent-soft: #ff6a3d;
    --accent-deep: #c4360f;
    --line:        rgba(26, 22, 18, 0.10);
    --line-strong: rgba(26, 22, 18, 0.22);
  }

  /* Nav gets a warm glass tint in light */
  .nav {
    background: rgba(245, 240, 232, 0.75);
  }

  /* Grain stays but lightens */
  .grain { opacity: 0.03; }

  /* Hero grid lines readjust */
  .hero-grid {
    background-image:
      linear-gradient(rgba(26,22,18,0.07) 1px, transparent 1px),
      linear-gradient(90deg, rgba(26,22,18,0.07) 1px, transparent 1px);
  }

  /* Curtain becomes warm cream */
  .curtain {
    background: var(--bg);
  }

  /* Cursor in light mode: dark outline */
  .cursor {
    border-color: var(--ink);
    mix-blend-mode: multiply;
  }

  /* Code / mono backgrounds */
  .case-stack .stack-tag {
    background: var(--bg-elev);
  }

  /* stat / info cells */
  .case-stat,
  .case-info-cell {
    background: var(--bg);
  }

  .case-stat:hover,
  .case-info-cell:hover {
    background: var(--bg-elev);
  }

  /* Kinetic outline text adjusts stroke */
  .kinetic-text.outline {
    -webkit-text-stroke: 2px var(--ink-faint);
  }

  /* Pillar & work items */
  .pillar, .stat {
    background: var(--bg);
  }
  .pillar:hover, .stat:hover {
    background: var(--bg-elev);
  }

  /* Work item hover — invert to dark fill */
  .work-item::before {
    background: var(--ink);
  }
  .work-item:hover * {
    color: var(--bg) !important;
  }

  /* Footer */
  .footer {
    background: var(--bg-elev);
  }

  /* Section heads */
  .section-num { color: var(--accent); }

  /* Contact section */
  .contact { background: var(--bg); }

  /* Hero glow: slightly warmer */
  .hero-glow {
    background: radial-gradient(circle, rgba(255, 77, 28, 0.18) 0%, transparent 60%);
  }
  .case-hero-bg::before {
    background: radial-gradient(circle, rgba(255, 77, 28, 0.12) 0%, transparent 60%);
  }

  /* Theme toggle icon */
  .theme-toggle .icon-moon  { display: none !important; }
  .theme-toggle .icon-sun   { display: block !important; }
}

/* Dark mode toggle icons default state */
.theme-toggle .icon-sun  { display: none !important; }
.theme-toggle .icon-moon { display: block; }

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform 0.5s var(--ease);
}
.theme-toggle:hover svg {
  transform: rotate(25deg);
}

/* Manual override classes */
html[data-theme="light"] {
  --bg:          #f5f0e8;
  --bg-elev:     #ede8df;
  --bg-card:     #e8e2d8;
  --ink:         #1a1612;
  --ink-dim:     #6b6560;
  --ink-faint:   #b0aaa0;
  --line:        rgba(26, 22, 18, 0.10);
  --line-strong: rgba(26, 22, 18, 0.22);
}
html[data-theme="dark"] {
  --bg:          #0a0908;
  --bg-elev:     #141210;
  --bg-card:     #17140f;
  --ink:         #f5efe6;
  --ink-dim:     #8a847b;
  --ink-faint:   #4a463f;
  --line:        rgba(245, 239, 230, 0.08);
  --line-strong: rgba(245, 239, 230, 0.18);
}

html[data-theme="light"] .nav   { background: rgba(245, 240, 232, 0.75); }
html[data-theme="dark"] .nav    { background: rgba(10, 9, 8, 0.6); }
html[data-theme="light"] .grain { opacity: 0.03; }
html[data-theme="light"] .curtain { background: var(--bg); }
html[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(26,22,18,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,22,18,0.07) 1px, transparent 1px);
}
html[data-theme="light"] .cursor { border-color: var(--ink); mix-blend-mode: multiply; }
html[data-theme="light"] .pillar,
html[data-theme="light"] .stat,
html[data-theme="light"] .case-stat,
html[data-theme="light"] .case-info-cell { background: var(--bg); }
html[data-theme="light"] .pillar:hover,
html[data-theme="light"] .stat:hover,
html[data-theme="light"] .case-stat:hover { background: var(--bg-elev); }
html[data-theme="light"] .work-item::before { background: var(--ink); }
html[data-theme="light"] .theme-toggle .icon-moon { display: none !important; }
html[data-theme="light"] .theme-toggle .icon-sun  { display: block !important; }
html[data-theme="dark"]  .theme-toggle .icon-sun  { display: none !important; }
html[data-theme="dark"]  .theme-toggle .icon-moon { display: block !important; }

.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================
   ENHANCED MOTION SYSTEM
   ============================================ */

/* --- Magnetic warp on cursor approach --- */
[data-magnetic] {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* --- Text scramble chars --- */
.scramble-char {
  display: inline-block;
  transition: transform 0.12s var(--ease);
}

/* --- Parallax sections --- */
.parallax-deep  { will-change: transform; }
.parallax-mid   { will-change: transform; }
.parallax-slow  { will-change: transform; }

/* --- Spotlight / follow-cursor on cards --- */
.spotlight-card {
  position: relative;
  overflow: hidden;
}
.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255,77,28,0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 2;
}
.spotlight-card:hover::after { opacity: 1; }

/* --- Stagger children via custom prop --- */
.stagger-children > * {
  --i: 0;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease) calc(var(--i) * 80ms),
    transform 0.6s var(--ease) calc(var(--i) * 80ms);
}
.stagger-children.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Letter reveal (used for big section titles) --- */
.letter-split .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(60%) rotate(4deg);
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease);
}
.letter-split.in-view .letter {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* --- Glitch hover on hero title --- */
@keyframes glitch-1 {
  0%, 95%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
  96%           { clip-path: inset(20% 0 60% 0); transform: translateX(-4px); }
  97%           { clip-path: inset(50% 0 30% 0); transform: translateX(4px); }
  98%           { clip-path: inset(70% 0 10% 0); transform: translateX(-2px); }
}
@keyframes glitch-2 {
  0%, 94%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
  95%           { clip-path: inset(10% 0 70% 0); transform: translateX(5px); }
  96%           { clip-path: inset(40% 0 40% 0); transform: translateX(-5px); }
  97%           { clip-path: inset(65% 0 15% 0); transform: translateX(3px); }
}

.glitch-wrap {
  position: relative;
  display: inline-block;
}
.glitch-wrap::before,
.glitch-wrap::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.glitch-wrap::before {
  color: #00ffcc;
  animation: glitch-1 5s infinite;
  mix-blend-mode: screen;
}
.glitch-wrap::after {
  color: #ff4d1c;
  animation: glitch-2 5s 0.15s infinite;
  mix-blend-mode: screen;
}

/* --- Floating orbit decoration --- */
@keyframes orbit {
  from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}
.orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: orbit 8s linear infinite;
  pointer-events: none;
}
.orbit-dot:nth-child(2) { animation-delay: -4s; background: var(--ink-faint); box-shadow: none; }

/* --- Ink-reveal on scroll (clip from bottom) --- */
.ink-reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.ink-reveal.in-view {
  clip-path: inset(0 0 0% 0);
}

/* --- Section divider line draw --- */
.line-draw {
  width: 0;
  height: 1px;
  background: var(--line-strong);
  transition: width 1.2s var(--ease);
}
.line-draw.in-view { width: 100%; }

/* --- Hover underline slide --- */
.hover-underline {
  position: relative;
  display: inline-block;
}
.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}
.hover-underline:hover::after { width: 100%; }

/* --- Case section enhanced fade-up --- */
.case-section.fade-up.pending-reveal {
  opacity: 0;
  transform: translateY(48px) scale(0.985);
}
.case-section.fade-up.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

/* --- Stat value pop on in-view --- */
.case-stat.fade-up.pending-reveal .case-stat-value {
  transform: scale(0.7);
  opacity: 0;
}
.case-stat.fade-up.in-view .case-stat-value {
  transform: scale(1);
  opacity: 1;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s,
              opacity 0.6s var(--ease) 0.2s;
}

/* --- Stack tags stagger in --- */
.case-stack {
  --gap: 8px;
}
.case-stack .stack-tag {
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
              border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.in-view .case-stack .stack-tag {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.in-view .case-stack .stack-tag:nth-child(1) { transition-delay: 0.05s; }
.in-view .case-stack .stack-tag:nth-child(2) { transition-delay: 0.12s; }
.in-view .case-stack .stack-tag:nth-child(3) { transition-delay: 0.19s; }
.in-view .case-stack .stack-tag:nth-child(4) { transition-delay: 0.26s; }
.in-view .case-stack .stack-tag:nth-child(5) { transition-delay: 0.33s; }
.in-view .case-stack .stack-tag:nth-child(6) { transition-delay: 0.40s; }
.in-view .case-stack .stack-tag:nth-child(7) { transition-delay: 0.47s; }
.in-view .case-stack .stack-tag:nth-child(8) { transition-delay: 0.54s; }
.in-view .case-stack .stack-tag:nth-child(9) { transition-delay: 0.61s; }
.in-view .case-stack .stack-tag:nth-child(10) { transition-delay: 0.68s; }

/* --- Case list items stagger --- */
.case-list li {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease),
              border-color 0.3s var(--ease);
}
.in-view .case-list li {
  opacity: 1;
  transform: translateX(0);
}
.in-view .case-list li:nth-child(1) { transition-delay: 0.10s; }
.in-view .case-list li:nth-child(2) { transition-delay: 0.22s; }
.in-view .case-list li:nth-child(3) { transition-delay: 0.34s; }
.in-view .case-list li:nth-child(4) { transition-delay: 0.46s; }
.in-view .case-list li:nth-child(5) { transition-delay: 0.58s; }
.in-view .case-list li:nth-child(6) { transition-delay: 0.70s; }

/* --- Case body p, h2 subtle stagger --- */
.case-section-content > p {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.case-section-content > p:nth-child(2) { transition-delay: 0.12s; }
.case-section-content > p:nth-child(3) { transition-delay: 0.24s; }
.in-view .case-section-content > p {
  opacity: 1;
  transform: translateY(0);
}
.case-section-content > .case-h2 {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.in-view .case-section-content > .case-h2 {
  opacity: 1;
  transform: translateY(0);
}

/* --- Hero label wiggle on hover --- */
.case-section-label {
  cursor: default;
  transition: letter-spacing 0.4s var(--ease), color 0.3s var(--ease);
}
.case-section-label:hover {
  letter-spacing: 0.35em;
}

/* --- Next case section sweep --- */
.case-next {
  overflow: hidden;
}
.next-link {
  background-clip: text;
  -webkit-background-clip: text;
  transition: color 0.4s var(--ease), -webkit-text-fill-color 0.4s var(--ease);
}
.next-link-wrap:hover .next-link {
  color: var(--accent);
}

/* case-title-line animation removed */

/* --- Case hero: single smooth fade-in on load --- */
.case-meta,
.case-title,
.case-summary,
.case-info {
  opacity: 0;
  animation: rise-soft 0.9s var(--ease) forwards;
}
.case-meta    { animation-delay: 0.15s; }
.case-title   { animation-delay: 0.28s; }
.case-summary { animation-delay: 0.42s; }
.case-info    { animation-delay: 0.56s; }

/* case-tag: no individual animation, inherits from .case-meta */
.case-tag {
  opacity: 1;
  transform: none;
  animation: none;
}

/* --- Visual block for diagrams / images --- */
.case-visual {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
  margin: 24px 0;
  position: relative;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.case-visual:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.4);
}
html[data-theme="light"] .case-visual:hover {
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.12);
}

/* Diagram inner styles */
.case-diagram {
  width: 100%;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  position: relative;
}

.diag-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.in-view .diag-row { opacity: 1; transform: translateX(0); }
.in-view .diag-row:nth-child(1) { transition-delay: 0.05s; }
.in-view .diag-row:nth-child(2) { transition-delay: 0.15s; }
.in-view .diag-row:nth-child(3) { transition-delay: 0.25s; }
.in-view .diag-row:nth-child(4) { transition-delay: 0.35s; }
.in-view .diag-row:nth-child(5) { transition-delay: 0.45s; }
.in-view .diag-row:nth-child(6) { transition-delay: 0.55s; }
.diag-row:last-child { border-bottom: none; }

.diag-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  color: var(--ink-dim);
}
.diag-row:hover .diag-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.diag-label {
  flex: 1;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.diag-value {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.diag-connector {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--ink-faint);
  font-size: 16px;
  letter-spacing: -0.04em;
}

/* Flow diagram */
.case-flow {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 40px;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.in-view .flow-node { opacity: 1; transform: scale(1); }
.in-view .flow-node:nth-child(1) { transition-delay: 0.0s; }
.in-view .flow-node:nth-child(2) { transition-delay: 0.1s; }
.in-view .flow-node:nth-child(3) { transition-delay: 0.2s; }
.in-view .flow-node:nth-child(4) { transition-delay: 0.3s; }
.in-view .flow-node:nth-child(5) { transition-delay: 0.4s; }
.in-view .flow-node:nth-child(6) { transition-delay: 0.5s; }
.in-view .flow-node:nth-child(7) { transition-delay: 0.6s; }

.flow-box {
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
  cursor: default;
}
.flow-box:hover,
.flow-box.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.flow-box.success {
  border-color: #00c98b;
  color: #00c98b;
  background: rgba(0,201,139,0.08);
}
.flow-box.warn {
  border-color: #f5a623;
  color: #f5a623;
  background: rgba(245,166,35,0.08);
}
.flow-box.danger {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,77,28,0.08);
}
.flow-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-align: center;
}
.flow-arrow {
  color: var(--ink-faint);
  font-size: 18px;
  padding: 0 4px;
  flex-shrink: 0;
  align-self: center;
  margin-top: -20px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.in-view .flow-arrow { opacity: 1; transition-delay: 0.25s; }

/* Metric bar chart */
.metric-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px;
}
.metric-row {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  align-items: center;
  gap: 20px;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.in-view .metric-row { opacity: 1; }
.in-view .metric-row:nth-child(1) { transition-delay: 0.1s; }
.in-view .metric-row:nth-child(2) { transition-delay: 0.22s; }
.in-view .metric-row:nth-child(3) { transition-delay: 0.34s; }
.in-view .metric-row:nth-child(4) { transition-delay: 0.46s; }
.in-view .metric-row:nth-child(5) { transition-delay: 0.58s; }

.metric-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  text-align: right;
}
.metric-track {
  height: 6px;
  background: var(--line-strong);
  border-radius: 100px;
  overflow: hidden;
}
.metric-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.in-view .metric-fill { width: var(--pct); }
.metric-fill.muted { background: var(--ink-faint); }
.metric-fill.good  { background: #00c98b; }
.metric-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* ============================================
   CURTAIN LIGHT THEME
   In light mode the curtain bg flips to the page background,
   so the text/bar/dots (which default to var(--bg) for the dark
   accent curtain) must flip to var(--ink) or they vanish.
   ============================================ */
@media (prefers-color-scheme: light) {
  .curtain {
    background: #f5f0e8;
    color: var(--ink);
  }
  .curtain-text       { color: var(--ink); }
  .curtain-bar        { background: var(--ink); }
  .curtain-bar-wrap   { background: rgba(10, 9, 8, 0.12); }
  .curtain-status     { color: rgba(10, 9, 8, 0.55); }
  .curtain-dots span  { background: rgba(10, 9, 8, 0.5); }
}
html[data-theme="light"] .curtain {
  background: #f5f0e8;
  color: var(--ink);
}
html[data-theme="light"] .curtain-text      { color: var(--ink); }
html[data-theme="light"] .curtain-bar       { background: var(--ink); }
html[data-theme="light"] .curtain-bar-wrap  { background: rgba(10, 9, 8, 0.12); }
html[data-theme="light"] .curtain-status    { color: rgba(10, 9, 8, 0.55); }
html[data-theme="light"] .curtain-dots span { background: rgba(10, 9, 8, 0.5); }

/* ============================================
   SMOOTH THEME TRANSITION
   ============================================ */
html {
  transition:
    background-color 0.5s var(--ease),
    color 0.5s var(--ease);
}
/* Theme-switch color transitions — targeted, not global */
body, .nav, .footer, .pillar, .stat, .case-stat, .case-info-cell,
.case-hero, .case-body, .case-next, .work-item, .curtain,
.case-stack .stack-tag, .case-list li, .case-section-content > p,
.case-section-content > .case-h2, .diag-icon, .flow-box, .metric-fill {
  transition-property: background-color, border-color, color;
  transition-duration: 0.4s;
  transition-timing-function: var(--ease);
}

