/* Korneel.dev. Warm cream editorial portfolio. */

:root {
  --bg: #F6F3EB;
  --bg-2: #ECE4D7;
  --bg-3: #E8E6E1;
  --warm-white: #FFFDF5;
  --ink: #1A1512;
  --ink-soft: #2B2620;
  --body: #3E3A34;
  --muted: #6B6660;
  --rule: #DCD4C4;
  --gold: #C9A34A;
  --gold-bright: #FCCF4D;
  --amber: #F5B832;
  --soft-gold: #F4E4BC;
  --blush: #E8D5B5;
  --peach: #F2E6D6;

  --serif: "Playfair Display", "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
}

body { overflow-x: hidden; }

/* Subtle paper-grain + dot texture across the whole site */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .55;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(rgba(26,21,18,.05) 1px, transparent 1.4px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 26px 26px, 220px 220px;
}
body.mood-nocturnal::before { mix-blend-mode: screen; opacity: .22; }
body.mood-gallery::before { opacity: .4; }

#root { position: relative; z-index: 2; }

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

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

img { max-width: 100%; display: block; }

/* ---------- Loading screen — editorial brand moment ---------- */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .7s ease, visibility .7s;
}
.loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 160px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
  text-align: center;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25em;
}
.loader-name-1, .loader-name-2 {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: loader-enter 800ms cubic-bezier(.2,.8,.2,1) forwards;
}
.loader-name-1 { animation-delay: 100ms; }
.loader-name-2 { animation-delay: 380ms; }
.loader-name-2 em { font-style: italic; color: var(--gold); }

.loader-role {
  font-family: var(--mono);
  font-size: clamp(10px, 0.78vw, 12px);
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
  margin: clamp(20px, 2.5vh, 36px) 0 0;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  animation: loader-enter 700ms cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: 720ms;
}

.loader-cred {
  position: absolute;
  bottom: clamp(24px, 3vh, 36px);
  right: clamp(24px, 3vw, 36px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: loader-enter 700ms ease forwards;
  animation-delay: 900ms;
}

@keyframes loader-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(18px, 1.6vw, 28px) clamp(20px, 3vw, 56px);
  pointer-events: none;
  gap: 24px;
}

.nav .brand {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  color: var(--ink);
}
.nav .brand-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(16px, 1.15vw, 22px);
  letter-spacing: -0.005em;
}
.nav .brand-name em {
  font-style: italic;
  color: var(--gold);
}
.nav .brand-role {
  font-family: var(--mono);
  font-size: clamp(8.5px, 0.62vw, 11px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: clamp(4px, 0.4vw, 7px);
}

.nav .links {
  display: flex;
  gap: clamp(18px, 1.8vw, 36px);
  pointer-events: auto;
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12.5px);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  padding-top: clamp(6px, 0.5vw, 10px);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav .links a { position: relative; }
.nav .links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  height: 1px; width: 0; background: var(--gold);
  transition: width .35s ease;
}
.nav .links a:hover::after { width: 100%; }

/* ---------- Hero (fan-of-cards as the centerpiece) ----------
   Sized fluidly with clamp(min, vw-relative, max) so it scales on
   1024 → 1440 → 1920 → 2560 → 3440 without per-breakpoint tweaks.
*/
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(96px, 8vh, 160px) clamp(20px, 3vw, 64px) clamp(24px, 3vh, 48px);
  position: relative;
  overflow: hidden;
}

.hero-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(72px, 9vh, 140px);
  position: relative;
  padding: clamp(16px, 2vh, 32px) 0;
  min-height: 0;
}

/* Fan + hover-title share a frame. The title is absolutely positioned
   so its appearance never affects layout. Cards stay perfectly still. */
.fan-frame {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(140px, 14vh, 220px);
}

.hover-title {
  position: absolute;
  top: clamp(8px, 1vh, 24px);
  left: 50%;
  transform: translate(-50%, 12px);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(36px, 5.5vw, 140px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.8,.2,1);
  max-width: calc(100vw - clamp(40px, 6vw, 128px));
}
.hover-title em { color: var(--gold); }
.hover-title.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fan {
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
  perspective: 1800px;
  margin: 0;
  width: 100%;
  flex-shrink: 0;
}
.fan-track {
  display: flex;
  flex-direction: row;
  position: relative;
  justify-content: center;
  align-items: flex-end;
}
/* Card width scales with viewport; overlap stays a fraction of width */
.fan .fcard {
  --fcard-w: clamp(160px, 21vw, 540px);
  flex: 0 0 var(--fcard-w);
  width: var(--fcard-w);
  height: calc(var(--fcard-w) * 1.4);
  margin-left: calc(var(--fcard-w) * -0.36);
  position: relative;
  cursor: pointer;
  transform-origin: bottom center;
  transition:
    transform .7s cubic-bezier(.2,.8,.2,1),
    margin .7s cubic-bezier(.2,.8,.2,1),
    z-index 0s;
  border-radius: 8px;
  box-shadow: 0 30px 60px -30px rgba(26,21,18,.4);
  background: var(--warm-white);
}
.fan .fcard:first-child { margin-left: 0; }
.fan .fcard:nth-child(1) { transform: rotate(-8deg) translateY(8px); z-index: 1; }
.fan .fcard:nth-child(2) { transform: rotate(-3deg); z-index: 2; }
.fan .fcard:nth-child(3) { transform: rotate(3deg); z-index: 3; }
.fan .fcard:nth-child(4) { transform: rotate(8deg) translateY(8px); z-index: 4; }
.fan .fcard:hover {
  transform: rotate(0deg) translateY(-36px) scale(1.06) !important;
  z-index: 20 !important;
  box-shadow: 0 60px 120px -40px rgba(26,21,18,.55);
}

.fan .fcard-img {
  width: 100%; height: 100%;
  border-radius: 8px;
  overflow: hidden;
  filter: grayscale(40%);
  transition: filter .5s ease;
}
.fan .fcard:hover .fcard-img { filter: grayscale(0%); }

.fan .fcard-num {
  position: absolute;
  bottom: -28px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: clamp(9px, 0.62vw, 11px);
  letter-spacing: .22em;
  color: var(--muted);
  opacity: 0;
  transition: opacity .4s ease;
  white-space: nowrap;
}
.fan .fcard:hover .fcard-num { opacity: 1; }

.hero-tagline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 1.9vw, 48px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  text-align: center;
  max-width: clamp(560px, 60vw, 1400px);
  color: var(--body);
}
.hero-tagline em { font-style: italic; color: var(--gold); }

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: clamp(10px, 1vh, 24px);
}
.hero-foot .left {
  display: flex; gap: clamp(18px, 1.8vw, 36px); flex-wrap: wrap; align-items: center;
}
.hero-foot .left a {
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12.5px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
  padding-bottom: 4px;
}
.hero-foot .left a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--gold);
  transition: width .35s ease;
}
.hero-foot .left a:hover::after { width: 100%; }
.hero-foot .left .ic {
  width: clamp(13px, 0.85vw, 16px);
  height: clamp(13px, 0.85vw, 16px);
  display: inline-block;
}
.hero-foot .right {
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12.5px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.hero-foot .right b { color: var(--ink); font-weight: 500; }

/* Mobile per-card label — hidden on desktop, visible on mobile */
.fcard-mobile-label { display: none; }

/* Carousel dots indicator — hidden on desktop, visible on mobile.
   Signals there are more cards and shows the current position. */
.fan-dots { display: none; }

/* ---------- Mobile (≤900px): swap fan layout for a horizontal carousel.
   One phone visible at a time with peek of next; user scrolls/swipes. ---------- */
@media (max-width: 900px) {
  .nav {
    gap: 12px;
    padding-top: clamp(28px, 4vh, 44px);
  }
  .nav .links { gap: 14px; }
  .hero {
    padding-top: clamp(120px, 14vh, 180px);
    padding-bottom: clamp(48px, 7vh, 80px);
  }

  /* Reclaim the vertical space the hover-title was reserving. */
  .fan-frame {
    padding-top: clamp(40px, 6vh, 80px);
  }
  .hover-title { display: none; }

  /* Carousel: horizontal scroll-snap, one card centered with peek. */
  .fan {
    height: auto;
    flex-direction: column;
    perspective: none;
    overflow: visible;
  }
  .fan-track {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: flex-end;
    gap: 16px;
    padding: 24px 12vw 60px;
    width: 100%;
  }
  .fan-track::-webkit-scrollbar { display: none; }

  .fan .fcard,
  .fan .fcard:nth-child(1),
  .fan .fcard:nth-child(2),
  .fan .fcard:nth-child(3),
  .fan .fcard:nth-child(4) {
    --fcard-w: 76vw;
    margin-left: 0 !important;
    transform: none !important;
    scroll-snap-align: center;
    flex-shrink: 0;
    z-index: auto !important;
  }
  .fan .fcard:hover {
    transform: none !important;
  }

  /* Hide the mono kicker (01 · NEXT.JS) on mobile, show project title. */
  .fan .fcard-num { display: none; }
  .fcard-mobile-label {
    display: block;
    position: absolute;
    bottom: -44px; left: 0; right: 0;
    text-align: center;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(18px, 4.5vw, 26px);
    line-height: 1.2;
    color: var(--ink);
    letter-spacing: -0.01em;
    pointer-events: none;
  }
  .fcard-mobile-label em { color: var(--gold); }

  /* Dots indicator — sits under the carousel, signals "swipe for more". */
  .fan-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
  }
  .fan-dots span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--rule);
    transition: background .35s ease, transform .35s ease;
  }
  .fan-dots span.active {
    background: var(--gold);
    transform: scale(1.25);
  }
  .fan-dots-counter {
    width: auto !important; height: auto !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin-left: 12px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--muted);
    transform: none !important;
  }

  /* Center-align the hero foot (social row + location) and give it
     a bit of breathing room from the carousel dots above. */
  .hero-foot {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    padding-top: clamp(18px, 3vh, 32px);
  }
  .hero-foot .left {
    justify-content: center;
    gap: 22px;
  }
  .hero-foot .right {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav .brand-role { display: none; }
  .fan .fcard,
  .fan .fcard:nth-child(1),
  .fan .fcard:nth-child(2),
  .fan .fcard:nth-child(3),
  .fan .fcard:nth-child(4) {
    --fcard-w: 80vw;
  }
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
  display: inline-flex; align-items: center; gap: 12px;
}
.label::before {
  content: ""; width: 18px; height: 1px; background: var(--gold);
}

.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s ease, transform .9s ease;
}
.word.in { opacity: 1; transform: translateY(0); }

@keyframes underlineSweep {
  to { transform: scaleX(1); }
}

/* ---------- Section header ---------- */
section { position: relative; }

.sec-head {
  padding: 18vh 40px 6vh;
  max-width: 1400px;
  margin: 0 auto;
}
.sec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 24px 0 0;
  max-width: 1100px;
}
.sec-head h2 em { font-style: italic; color: var(--gold); }

/* ---------- Highlights horizontal scroll ---------- */
.highlights-track {
  display: flex;
  gap: 32px;
  padding: 40px 40px 18vh;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.highlights-track::-webkit-scrollbar { display: none; }

.hcard {
  flex: 0 0 380px;
  height: 500px;
  position: relative;
  scroll-snap-align: start;
  perspective: 1400px;
  cursor: pointer;
}
.hcard-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
  border-radius: 4px;
}
.hcard:hover .hcard-inner {
  transform: rotateY(-14deg) rotateX(6deg) translateZ(20px);
}
.hcard-image {
  position: absolute; inset: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-3);
  filter: grayscale(60%) contrast(1.02);
  transition: filter .8s ease, transform .8s ease;
  box-shadow: 0 30px 60px -30px rgba(26,21,18,.18);
}
.hcard:hover .hcard-image {
  filter: grayscale(0%);
  transform: scale(1.02);
  box-shadow: 0 50px 100px -40px rgba(26,21,18,.35);
}
.hcard-num {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--warm-white);
  z-index: 2;
  mix-blend-mode: difference;
}
.hcard-title {
  position: absolute;
  bottom: -56px; left: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .6s ease, transform .6s ease;
}
.hcard:hover + .hcard-meta .hcard-title,
.hcard:hover ~ * .hcard-title { /* unused */ }

.hcard-meta {
  position: absolute;
  bottom: -56px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--muted);
}
.hcard:hover .hcard-meta .reveal { color: var(--ink); }

.hcard .behind {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3vw, 48px);
  color: var(--ink);
  opacity: 0;
  transform: translateZ(-1px);
  z-index: -1;
  pointer-events: none;
  transition: opacity .6s ease;
  white-space: nowrap;
}
.hcard:hover .behind { opacity: 1; }

.highlights-hint {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  padding: 0 0 8vh;
}

/* ---------- Project deep-dive ---------- */
.proj {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 12vh 40px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  border-top: 1px solid var(--rule);
}
.proj-sticky {
  position: sticky;
  top: 12vh;
  align-self: start;
  height: 70vh;
  display: flex; flex-direction: column;
  justify-content: center;
}
.proj-card3d {
  width: 100%;
  height: 60vh;
  perspective: 1400px;
}
.proj-card3d-inner {
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: cardFloat 9s ease-in-out infinite;
  position: relative;
}
@keyframes cardFloat {
  0%, 100% { transform: rotateY(-6deg) rotateX(4deg) translateY(0); }
  50% { transform: rotateY(8deg) rotateX(-3deg) translateY(-10px); }
}
.proj-card-face {
  position: absolute; inset: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 50px 100px -40px rgba(26,21,18,.35);
  background: var(--bg-3);
}
.proj-card-glare {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.4), transparent 60%);
  mix-blend-mode: overlay;
  pointer-events: none;
}
.proj-info {
  display: flex; gap: 24px;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}

.proj-content { padding-top: 4vh; }
.proj-content h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}
.proj-content h3 em { font-style: italic; color: var(--gold); }
.proj-content .lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  color: var(--body);
  margin: 0 0 40px;
  max-width: 560px;
}
.proj-content .built-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.proj-content ul {
  list-style: none; padding: 0; margin: 0 0 32px;
  font-size: 16px;
  color: var(--body);
}
.proj-content ul li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  display: flex; gap: 16px;
}
.proj-content ul li::before {
  content: "+"; color: var(--gold); flex-shrink: 0;
}
.proj-meta-row {
  display: flex; gap: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 32px;
  flex-wrap: wrap;
}
.proj-meta-row b { color: var(--ink); font-weight: 500; }

.proj-cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 16px 0;
  border-bottom: 1px solid var(--ink);
  cursor: pointer;
  transition: gap .3s ease;
}
.proj-cta:hover { gap: 18px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(26,21,18,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility .5s;
}
.modal-bg.open { opacity: 1; visibility: visible; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -45%) scale(.96);
  background: var(--bg);
  width: min(1100px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  z-index: 101;
  opacity: 0; visibility: hidden;
  transition: opacity .55s cubic-bezier(.2,.8,.2,1), transform .55s cubic-bezier(.2,.8,.2,1), visibility .55s;
  border-radius: 6px;
  box-shadow: 0 80px 160px -40px rgba(26,21,18,.55);
}
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-close {
  position: sticky; top: 16px; float: right;
  margin: 16px 16px 0 0;
  z-index: 5;
  background: var(--ink);
  color: var(--bg);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-family: var(--sans);
}
.modal-hero {
  height: 50vh;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
}
.modal-hero .placeholder { width: 100%; height: 100%; }
.modal-body { padding: 60px 64px 80px; }
.modal-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4vw, 64px);
  margin: 0 0 24px;
  line-height: 1.05;
}
.modal-body h3 em { font-style: italic; color: var(--gold); }
.modal-body .lead {
  font-family: var(--serif); font-style: italic;
  font-size: 22px; line-height: 1.5; color: var(--body);
  margin: 0 0 40px; max-width: 720px;
}
.modal-body p { color: var(--body); margin: 0 0 20px; max-width: 700px; }
.modal-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin: 32px 0;
}
.modal-stat {
  padding: 24px; border: 1px solid var(--rule);
  border-radius: 4px; background: var(--warm-white);
}
.modal-stat .k {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}
.modal-stat .v {
  font-family: var(--serif); font-size: 28px; line-height: 1.2;
}
.modal-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 18px 28px;
  background: var(--gold-bright);
  border-radius: 999px;
  margin-top: 16px;
  transition: background .3s ease, gap .3s ease;
}
.modal-link:hover { background: var(--amber); gap: 20px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 18vh;
  align-items: start;
}
.about-photo {
  aspect-ratio: 4/5;
  background: var(--bg-3);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.about-photo .placeholder { width: 100%; height: 100%; }
.about-text p {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.6;
  color: var(--body);
  margin: 0 0 24px;
}
.about-text p:first-of-type { font-style: italic; }
.stack-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 40px;
}
.stack-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--warm-white);
}

/* ---------- How I Work 2x2 ---------- */
.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 18vh;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.principle {
  background: var(--bg);
  padding: 60px 48px;
}
.principle .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--gold);
  margin-bottom: 24px;
}
.principle h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 20px;
}
.principle p { color: var(--body); max-width: 460px; margin: 0; }

/* ---------- Experience ---------- */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 18vh;
}
.exp-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 32px;
  font-weight: 500;
}
.exp-row {
  display: grid;
  grid-template-columns: 1fr;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.exp-row .role {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 6px;
}
.exp-row .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; gap: 16px; flex-wrap: wrap;
}
.exp-row .meta b { color: var(--ink); font-weight: 500; }

/* ---------- Contact ---------- */
.contact {
  padding: 0 40px 18vh;
  max-width: 1400px;
  margin: 0 auto;
}
.contact-rows {
  border-top: 1px solid var(--rule);
}
.contact-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding .4s ease;
  position: relative;
}
.contact-row:hover { padding-left: 24px; }
.contact-row .k {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
}
.contact-row .v {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 48px);
  font-style: italic;
}
.contact-row .arrow {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink);
  transition: transform .3s ease;
}
.contact-row:hover .arrow { transform: translateX(8px); }

.contact-bottom {
  margin-top: 40px;
  font-family: var(--serif); font-style: italic;
  color: var(--muted);
}

/* ---------- Gravity / Footer playful ---------- */
.gravity-section {
  background: var(--ink);
  color: var(--bg);
  position: relative;
  min-height: 90vh;
  overflow: hidden;
}
.gravity-section .sec-head h2 { color: var(--bg); }
.gravity-section .label { color: var(--gold-bright); }
.gravity-canvas {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  cursor: grab;
}
.gravity-canvas:active { cursor: grabbing; }
.gword {
  position: absolute;
  font-family: var(--serif);
  font-style: italic;
  white-space: nowrap;
  user-select: none;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid rgba(246,243,235,.2);
  background: rgba(246,243,235,.03);
  color: var(--bg);
  transition: background .2s ease;
}
.gword.gold { background: var(--gold-bright); color: var(--ink); border-color: var(--gold-bright); }
.gword.outline { background: transparent; }
.gword.solid { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.gword:hover { background: var(--gold-bright); color: var(--ink); border-color: var(--gold-bright); }

.gravity-foot {
  display: flex; justify-content: space-between;
  padding: 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(246,243,235,.6);
  border-top: 1px solid rgba(246,243,235,.1);
  flex-wrap: wrap;
  gap: 24px;
}

/* ---------- Cursor ---------- */
.cursor {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, background .25s ease, border .25s ease;
  mix-blend-mode: difference;
}
.cursor.large {
  width: 48px; height: 48px;
  background: transparent;
  border: 1px solid var(--bg);
}
@media (hover: none) { .cursor { display: none; } }

/* ---------- Mood variants ---------- */
body.mood-nocturnal {
  --bg: #1A1816;
  --bg-2: #221F1B;
  --bg-3: #2B2620;
  --warm-white: #2F2A24;
  --ink: #F4E4BC;
  --ink-soft: #F6F3EB;
  --body: #DCD4C4;
  --muted: #8A8276;
  --rule: #3A332C;
  --gold: #FCCF4D;
  --gold-bright: #FCCF4D;
}
body.mood-nocturnal .nav { color: #1A1816; }
body.mood-nocturnal .ph.cream,
body.mood-nocturnal .ph.sand,
body.mood-nocturnal .ph.gold,
body.mood-nocturnal .ph.blush { background: #2B2620; color: rgba(246,243,235,.55); }
body.mood-nocturnal .ph::before {
  background-image: repeating-linear-gradient(45deg,
    rgba(246,243,235,.05) 0 8px, transparent 8px 18px);
}
body.mood-nocturnal .gravity-section { background: #0C0B0A; }
body.mood-nocturnal .modal-stat { background: #221F1B; }
body.mood-nocturnal .stack-chip { background: #221F1B; }
body.mood-nocturnal .modal-link { color: #1A1816; }

body.mood-gallery {
  --bg: #FAFAF7;
  --bg-2: #F0EFEB;
  --bg-3: #E8E7E2;
  --warm-white: #FFFFFF;
  --ink: #0A0908;
  --ink-soft: #161413;
  --body: #2A2825;
  --muted: #7A7873;
  --rule: #D8D6D0;
  --gold: #0A0908;
  --gold-bright: #0A0908;
  --amber: #1A1816;
  --soft-gold: #E8E7E2;
}
body.mood-gallery .modal-link { color: #FAFAF7; }
body.mood-gallery .gravity-section { background: #0A0908; }

/* ---------- Voice variants (typography personalities) ---------- */
body.voice-terminal {
  --serif: "JetBrains Mono", ui-monospace, monospace;
  font-family: var(--mono);
}
body.voice-terminal h1,
body.voice-terminal h2,
body.voice-terminal h3,
body.voice-terminal h4,
body.voice-terminal .hero-sub,
body.voice-terminal .lead,
body.voice-terminal .v,
body.voice-terminal .gword,
body.voice-terminal .loader-text,
body.voice-terminal .role,
body.voice-terminal .principle h4 {
  font-family: var(--mono) !important;
  font-style: normal !important;
  letter-spacing: -0.02em;
  font-weight: 500;
}
body.voice-terminal h1 { font-size: clamp(36px, 5.5vw, 88px) !important; line-height: 1.1; }
body.voice-terminal h2 { font-size: clamp(32px, 4vw, 64px) !important; }
body.voice-terminal h1 em,
body.voice-terminal h2 em,
body.voice-terminal h3 em { font-style: normal !important; color: var(--gold); }
body.voice-terminal h1 em::before,
body.voice-terminal h2 em::before { content: "/* "; opacity: .5; }
body.voice-terminal h1 em::after,
body.voice-terminal h2 em::after { content: " */"; opacity: .5; }

body.voice-studio {
  --serif: "Inter", -apple-system, sans-serif;
}
body.voice-studio h1,
body.voice-studio h2,
body.voice-studio h3,
body.voice-studio h4,
body.voice-studio .hero-sub,
body.voice-studio .lead,
body.voice-studio .v,
body.voice-studio .gword,
body.voice-studio .loader-text,
body.voice-studio .role,
body.voice-studio .principle h4 {
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-weight: 600;
  letter-spacing: -0.04em;
}
body.voice-studio h1 em,
body.voice-studio h2 em,
body.voice-studio h3 em { font-style: normal !important; font-weight: 300; color: var(--muted); }

/* ---------- Motion variants ---------- */
body.motion-still .hcard:hover .hcard-inner { transform: rotateY(-4deg) translateZ(8px); }
body.motion-still .proj-card3d-inner { animation-duration: 18s; animation-name: cardFloatStill; }
@keyframes cardFloatStill {
  0%, 100% { transform: rotateY(-2deg) rotateX(1deg); }
  50% { transform: rotateY(2deg) rotateX(-1deg); }
}

body.motion-unhinged .hcard:hover .hcard-inner {
  transform: rotateY(-22deg) rotateX(12deg) translateZ(40px) rotateZ(-3deg);
}
body.motion-unhinged .proj-card3d-inner { animation-duration: 5s; animation-name: cardFloatHard; }
@keyframes cardFloatHard {
  0%, 100% { transform: rotateY(-12deg) rotateX(8deg) translateY(0) rotateZ(-2deg); }
  25% { transform: rotateY(15deg) rotateX(-6deg) translateY(-20px) rotateZ(3deg); }
  50% { transform: rotateY(-8deg) rotateX(10deg) translateY(-30px) rotateZ(-4deg); }
  75% { transform: rotateY(18deg) rotateX(-4deg) translateY(-15px) rotateZ(2deg); }
}
body.motion-unhinged .hcard:hover .hcard-image {
  transform: scale(1.08) rotate(-1deg);
}
body.motion-unhinged .word { transition-duration: .6s !important; }

/* ---------- Reveal helper ---------- */
.reveal-up { opacity: 0; transform: translateY(40px); transition: opacity 1s ease, transform 1s ease; }
.reveal-up.in { opacity: 1; transform: translateY(0); }

/* ---------- Placeholder graphics for project images ---------- */
.ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(26,21,18,.55);
  position: relative;
  overflow: hidden;
}
/* Real-image variant — phone mockup fills the card area, no chrome */
.ph.ph-img {
  background: transparent;
  padding: 0;
}
.ph.ph-img::before { display: none; }
.ph.ph-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}


/* Fan cards that contain a real phone-mockup image: drop the card chrome,
   so the phone IS the card. Keep cards with placeholder gradients framed. */
.fan .fcard:has(.ph.ph-img) {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.fan .fcard:has(.ph.ph-img) .fcard-img {
  border-radius: 0;
  overflow: visible;
  filter: none;
}
.fan .fcard:has(.ph.ph-img):hover {
  box-shadow: none;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg,
    rgba(26,21,18,.04) 0 8px, transparent 8px 18px);
}
.ph.cream { background: var(--peach); }
.ph.sand { background: var(--bg-3); }
.ph.gold { background: var(--soft-gold); }
.ph.blush { background: var(--blush); }
.ph.dark { background: var(--ink-soft); color: rgba(246,243,235,.65); }
.ph.dark::before {
  background-image: repeating-linear-gradient(45deg,
    rgba(246,243,235,.05) 0 8px, transparent 8px 18px);
}

/* graphic shapes for placeholders */
.ph .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .8;
  mix-blend-mode: multiply;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { padding: 18px 20px; font-size: 10px; }
  .nav .links { gap: 16px; }
  .clock { display: none; }
  .hero { padding: 0 20px; }
  .sec-head, .about-grid, .principles, .exp-grid, .contact { padding-left: 20px; padding-right: 20px; }
  .highlights-track { padding: 40px 20px 18vh; }
  .proj {
    grid-template-columns: 1fr; padding: 8vh 20px; gap: 40px;
  }
  .proj-sticky { position: relative; top: 0; height: auto; }
  .proj-card3d { height: 50vh; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .principles { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-row { grid-template-columns: 1fr; gap: 8px; }
  .modal-body { padding: 32px 24px 60px; }
  .modal-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────
   Multi-page additions
   ───────────────────────────────────────────────────────────────── */

/* Active state in nav */
.nav .links a.active { color: var(--gold); }
.nav .links a.active::after { width: 100%; }

/* ---------- Page header (about / contact / 404) ---------- */
.page-hero {
  min-height: 60vh;
  padding: clamp(120px, 14vh, 200px) clamp(20px, 4vw, 80px) clamp(48px, 8vh, 120px);
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
}
.page-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.page-hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 140px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: clamp(20px, 2vh, 36px) 0 0;
}
.page-hero-title em { font-style: italic; color: var(--gold); }
.page-hero-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 30px);
  line-height: 1.4;
  color: var(--body);
  margin: clamp(20px, 2vh, 36px) 0 0;
  max-width: 720px;
}

/* About / Approach / Experience get tighter top padding when on a page */
body[data-page="about"] .sec-head { padding-top: clamp(80px, 10vh, 140px); }
body[data-page="contact"] #contact { padding-top: clamp(60px, 8vh, 100px); }

/* ---------- Case page (left text / right visual w/ gravity) ---------- */
.case-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.case-text {
  padding: clamp(120px, 14vh, 180px) clamp(40px, 4vw, 88px) clamp(80px, 10vh, 140px);
  width: 100%;
  max-width: 880px;
  min-width: 0;
  margin-left: auto; /* on big screens, push text content closer to the visual */
}
.case-back {
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  width: fit-content;
  margin-bottom: clamp(60px, 8vh, 120px);
  padding: 6px 0;
  position: relative;
}
.case-back::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 1px; width: 0; background: var(--gold);
  transition: width .35s ease;
}
.case-back:hover::after { width: 100%; }
.case-back:hover { color: var(--ink); }

.case-num {
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: clamp(18px, 2vh, 28px);
  display: flex; align-items: center; gap: 12px;
  width: fit-content;
}
.case-num::before {
  content: ""; width: 18px; height: 1px; background: var(--gold);
}
.case-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 0 0 clamp(20px, 2vh, 32px);
  word-break: break-word;
  hyphens: auto;
}
.case-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.5vw, 26px);
  line-height: 1.45;
  color: var(--body);
  margin: 0 0 clamp(36px, 5vh, 56px);
}
.case-prose p {
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.7;
  color: var(--body);
  margin: 0 0 20px;
}
.case-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: clamp(36px, 5vh, 56px) 0;
}
.case-stat {
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--warm-white);
}
.case-stat .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.case-stat .v {
  font-family: var(--serif);
  font-size: clamp(18px, 1.4vw, 24px);
  line-height: 1.2;
}
.case-built-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: clamp(28px, 4vh, 48px) 0 14px;
}
.case-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 clamp(28px, 4vh, 40px);
}
.case-bullets li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 16px;
  font-size: clamp(15px, 1.05vw, 17px);
  color: var(--body);
}
.case-bullets li span { color: var(--gold); flex-shrink: 0; }
.case-meta-row {
  display: flex; gap: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 clamp(24px, 3vh, 36px);
  flex-wrap: wrap;
}
.case-meta-row b { color: var(--ink); font-weight: 500; }
.case-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: clamp(11px, 0.78vw, 13px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 18px 28px;
  background: var(--gold-bright);
  border-radius: 999px;
  margin-bottom: clamp(40px, 6vh, 72px);
  transition: gap .3s ease, background .3s ease;
}
.case-link:hover { gap: 18px; background: var(--amber); }
.case-link.disabled {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
  pointer-events: none;
}

.case-next {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
  padding-top: clamp(28px, 4vh, 40px);
}
.case-next span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.case-next em {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3vw, 44px);
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color .3s ease;
}
.case-next:hover em { color: var(--gold); }

/* ---------- Case visual (right side) ---------- */
.case-visual {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: hidden;
  /* live above texture & nav-difference */
}
.case-visual-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.case-visual-image .ph {
  width: 100%; height: 100%;
  font-size: 0; /* hide placeholder label */
}
/* Fade from page bg → revealed image as you go right */
.case-visual-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right,
      var(--bg) 0%,
      var(--bg) 6%,
      rgba(246,243,235,0) 45%,
      rgba(246,243,235,0) 100%),
    linear-gradient(to bottom,
      rgba(246,243,235,.4) 0%,
      rgba(246,243,235,0) 25%,
      rgba(246,243,235,0) 75%,
      rgba(246,243,235,.3) 100%);
  pointer-events: none;
}
.case-visual-play {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.case-visual-play .gravity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.case-visual-play .gword {
  /* smaller, more case-like pills */
  border-color: rgba(26,21,18,.18);
  background: rgba(255,253,245,.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink);
  box-shadow: 0 6px 20px -10px rgba(26,21,18,.25);
}
.case-visual-play .gword.gold { background: var(--gold-bright); border-color: var(--gold-bright); }
.case-visual-play .gword.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.case-visual-hint {
  position: absolute;
  top: clamp(110px, 12vh, 160px);
  right: clamp(20px, 3vw, 48px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(26,21,18,.55);
  z-index: 3;
  pointer-events: none;
}

/* On mobile / touch devices the gravity words are decorative only — they
   stay locked in place. Hide the "Drag the words" hint so it doesn't lie. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .case-visual-hint { display: none; }
  .gravity-canvas { cursor: default; }
}

/* Nocturnal mood adjustments for case visual */
body.mood-nocturnal .case-visual-fade {
  background:
    linear-gradient(to right,
      var(--bg) 0%, var(--bg) 6%,
      rgba(26,24,22,0) 45%, rgba(26,24,22,0) 100%);
}
body.mood-nocturnal .case-visual-play .gword {
  background: rgba(34,31,27,.72);
  color: var(--ink);
  border-color: rgba(244,228,188,.15);
}

/* ---------- About letter design ---------- */
.letter-page {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(120px, 14vh, 200px) clamp(28px, 5vw, 64px) clamp(80px, 10vh, 140px);
  font-family: var(--serif);
  color: var(--ink);
}

/* The big "Hi." */
.letter-hi {
  position: relative;
  margin: 0 0 clamp(32px, 4vh, 56px);
}
.letter-hi h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(140px, 22vw, 320px);
  line-height: .85;
  letter-spacing: -0.05em;
  margin: 0;
  color: var(--ink);
}
.letter-hi h1 .dot { color: var(--gold); }
.letter-hi .meta {
  position: absolute;
  top: clamp(16px, 2vh, 32px);
  right: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  max-width: 200px;
  line-height: 1.6;
}
.letter-hi .meta em { color: var(--ink); font-style: normal; }

.letter-intro {
  font-family: var(--serif);
  font-size: clamp(20px, 1.6vw, 28px);
  line-height: 1.5;
  color: var(--body);
  margin: 0 0 clamp(48px, 6vh, 80px);
  max-width: 28ch;
}
.letter-intro em { font-style: italic; color: var(--gold); }

/* Polaroid photo */
.letter-polaroid {
  width: clamp(200px, 26vw, 320px);
  padding: 14px 14px 56px;
  background: var(--warm-white);
  box-shadow: 0 30px 60px -20px rgba(26,21,18,.3);
  transform: rotate(-2.4deg);
  margin: 0 auto clamp(56px, 7vh, 100px);
  position: relative;
}
.letter-polaroid .photo {
  aspect-ratio: 4/5;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
}
.letter-polaroid .photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.letter-polaroid .caption {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  text-align: center;
  font-family: "Caveat", "Playfair Display", cursive;
  font-size: 22px;
  color: var(--body);
}

/* Letter body */
.letter-body {
  font-family: var(--serif);
  font-size: clamp(19px, 1.3vw, 22px);
  line-height: 1.65;
  color: var(--ink);
}
.letter-body p { margin: 0 0 1.4em; position: relative; }
.letter-body em { font-style: italic; color: var(--ink); }
.letter-body .underline {
  background: linear-gradient(transparent 70%, rgba(252,207,77,.5) 70%, rgba(252,207,77,.5) 95%, transparent 95%);
  padding: 0 2px;
}
.letter-body strong { font-weight: 500; color: var(--gold); font-style: italic; }

/* Approach block — big italic numerals as visual anchor */
.letter-approach {
  margin: clamp(48px, 6vh, 80px) 0;
  padding: clamp(40px, 6vh, 64px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.letter-approach .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  display: inline-flex; align-items: center; gap: 12px;
}
.letter-approach .label::before {
  content: ""; width: 18px; height: 1px; background: var(--gold);
}
.letter-approach h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(40px, 5vh, 64px);
}
.letter-approach h2 em { font-style: italic; color: var(--gold); }

.letter-approach .principle {
  display: grid;
  grid-template-columns: clamp(96px, 14vw, 140px) 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  padding: clamp(24px, 3vh, 36px) 0;
}
.letter-approach .principle:not(:last-child) {
  border-bottom: 1px dotted var(--rule);
}
.letter-approach .principle .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(64px, 7vw, 110px);
  line-height: .85;
  letter-spacing: -0.03em;
  color: var(--gold);
}
.letter-approach .principle h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 12px 0 8px;
}
.letter-approach .principle h4 em { font-style: italic; color: var(--gold); }
.letter-approach .principle p {
  font-family: var(--serif);
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  color: var(--body);
  margin: 0;
  max-width: 50ch;
}
.letter-approach .principle p em { font-style: italic; color: var(--ink); }

@media (max-width: 600px) {
  .letter-approach .principle {
    grid-template-columns: 72px 1fr;
    gap: 16px;
  }
  .letter-approach .principle .num { font-size: 48px; }
}

/* ---------- Stack chips (under polaroid) ---------- */
.letter-stack {
  margin: clamp(40px, 5vh, 64px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.letter-stack .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.letter-stack .label::before,
.letter-stack .label::after {
  content: ""; width: 18px; height: 1px; background: var(--rule);
}
.letter-stack .chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.letter-stack .chips span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--warm-white);
  white-space: nowrap;
}

/* Faded variant: the older / background stack — visually quieter so the
   current stack reads first, but still on the page so the arc is honest. */
.letter-stack .label-faded {
  margin-top: 6px;
  color: var(--muted);
}
.letter-stack .label-faded::before,
.letter-stack .label-faded::after {
  background: var(--rule);
}
.letter-stack .chips-faded span {
  color: var(--muted);
  background: transparent;
  border-color: var(--rule);
}

/* ---------- Inline case-link in letter body ---------- */
.letter-body a.case-inline {
  text-decoration: none;
  position: relative;
  border-bottom: 1px dotted var(--gold);
  padding-bottom: 1px;
  transition: border-color .3s ease, color .3s ease;
}
.letter-body a.case-inline:hover {
  border-bottom-style: solid;
}
.letter-body a.case-inline strong { color: var(--gold); }

/* ---------- Testimonial pull-quote ---------- */
.letter-testimonial {
  margin: clamp(56px, 7vh, 88px) 0;
  padding: clamp(40px, 5vh, 64px) 0;
  text-align: center;
  position: relative;
}
.letter-testimonial::before {
  content: "“";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(80px, 9vw, 140px);
  line-height: 1;
  color: var(--gold);
  opacity: .55;
}
.letter-testimonial blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 26ch;
  margin: 0 auto clamp(20px, 3vh, 32px);
}
.letter-testimonial blockquote em {
  font-style: italic;
  color: var(--gold);
}
.letter-testimonial figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.letter-testimonial figcaption .name { color: var(--ink); font-weight: 500; }
.letter-testimonial figcaption .role { color: var(--muted); }

/* Experience */
.letter-experience {
  margin-top: clamp(48px, 6vh, 80px);
}
.letter-experience h3 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: clamp(28px, 4vh, 40px) 0 16px;
}
.letter-experience .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  gap: 18px;
  border-bottom: 1px dotted var(--rule);
}
.letter-experience .row .role {
  font-family: var(--serif);
  font-size: clamp(16px, 1.1vw, 18px);
  color: var(--ink);
}
.letter-experience .row .role em { font-style: italic; color: var(--gold); }
.letter-experience .row .yr {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--muted);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* Sign-off */
.letter-signoff {
  margin-top: clamp(64px, 8vh, 120px);
  text-align: left;
}
.letter-signoff p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 1.5vw, 26px);
  color: var(--ink);
  margin: 0 0 24px;
}
.letter-signoff .name {
  font-family: "Caveat", cursive;
  font-size: clamp(56px, 6vw, 96px);
  color: var(--gold);
  line-height: 1;
  margin: 0;
  transform: rotate(-1.5deg);
  display: inline-block;
}
.letter-signoff .ps {
  margin-top: 32px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 60ch;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.letter-signoff .ps b { color: var(--gold); font-style: normal; font-weight: 500; }
.letter-signoff .ps a {
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
}
.letter-signoff .ps a:hover { color: var(--gold); }

/* ---------- Site footer (about / contact / case) ---------- */
.site-foot {
  border-top: 1px solid var(--rule);
  padding: clamp(40px, 5vh, 72px) clamp(20px, 4vw, 80px);
  margin-top: clamp(40px, 6vh, 80px);
}
.site-foot-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
}
.site-foot-brand {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand-name-foot {
  font-family: var(--serif);
  font-size: clamp(18px, 1.2vw, 22px);
}
.brand-name-foot em { font-style: italic; color: var(--gold); }
.brand-role-foot {
  font-family: var(--mono);
  font-size: clamp(9px, 0.62vw, 11px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.site-foot-links {
  display: flex; gap: clamp(20px, 2vw, 36px);
  justify-content: center;
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12px);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.site-foot-links a { position: relative; padding-bottom: 4px; }
.site-foot-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 1px; width: 0; background: var(--gold);
  transition: width .35s ease;
}
.site-foot-links a:hover::after { width: 100%; }
.site-foot-meta {
  font-family: var(--mono);
  font-size: clamp(9px, 0.62vw, 11px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

/* ---------- Case page mobile ---------- */
@media (max-width: 1024px) {
  .case-page {
    grid-template-columns: 1fr;
  }
  .case-visual {
    position: relative;
    height: 70vh;
    order: -1;
  }
  /* Push the visual content (image, gradient, gravity canvas) below the
     fixed nav so the header stays readable on cream background. */
  .case-visual-image,
  .case-visual-fade,
  .case-visual-play .gravity-canvas {
    top: clamp(80px, 11vh, 120px);
  }
  .case-visual-fade {
    background:
      linear-gradient(to bottom,
        rgba(246,243,235,0) 0%, rgba(246,243,235,0) 70%,
        var(--bg) 100%);
  }
  .case-text { padding: clamp(40px, 5vh, 80px) clamp(20px, 4vw, 60px) clamp(60px, 8vh, 120px); }
  .case-meta-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-foot-inner { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .site-foot-links { justify-content: center; }
  .site-foot-meta { text-align: center; }
}
