/* ===== Mallory Haluko — Portfolio ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Warm deep charcoal palette */
  --bg: oklch(0.17 0.006 60);
  --bg-2: oklch(0.20 0.008 60);
  --bg-3: oklch(0.23 0.010 60);
  --fg: oklch(0.96 0.008 80);
  --fg-dim: oklch(0.72 0.012 80);
  --fg-mute: oklch(0.48 0.010 80);
  --line: oklch(0.28 0.010 60);
  --line-2: oklch(0.34 0.012 60);

  /* Signature accent — acidic warm chartreuse/yellow */
  --accent: oklch(0.88 0.18 100);
  --accent-ink: oklch(0.20 0.015 100);

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

  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: none; }
img { max-width: 100%; display: block; }

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

/* ===== Custom cursor ===== */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--fg);
  transition: width 0.2s var(--ease), height 0.2s var(--ease), background 0.2s var(--ease);
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid var(--fg);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.cursor-ring.hover {
  width: 80px; height: 80px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}
.cursor-ring.hover-label::after {
  content: attr(data-label);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  mix-blend-mode: normal;
}
@media (max-width: 900px) { .cursor-dot, .cursor-ring { display: none; } }

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1680px;
  padding: 0 40px;
  margin: 0 auto;
}
@media (max-width: 768px) { .container { padding: 0 20px; } }

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 40px;
  display: flex; justify-content: space-between; align-items: center;
  mix-blend-mode: difference;
  color: var(--fg);
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px;
}
.nav-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}
.nav-links {
  display: flex; gap: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--accent); }
.nav-links .num {
  font-size: 10px;
  color: var(--fg-mute);
  margin-right: 4px;
}
@media (max-width: 768px) { .nav-links { display: none; } }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  padding: 140px 0 80px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.hero-meta-top {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 60px;
}
.hero-meta-top .chip {
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-meta-top .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s var(--ease) infinite;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight, 800);
  font-size: clamp(64px, 14.5vw, 240px);
  line-height: 0.82;
  letter-spacing: var(--display-tracking, -0.055em);
  margin: 0;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .line-inner {
  display: block;
  transform: translateY(110%);
  animation: rise 1s var(--ease) 0.1s forwards;
}
.hero-title .line:nth-child(2) .line-inner { animation-delay: 0.25s; }
@keyframes rise {
  0% { transform: translateY(110%); }
  100% { transform: translateY(0); }
}
.hero-title .accent-word {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}
.hero-tagline {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  margin-top: 80px;
}
.hero-tagline p {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.25;
  max-width: 540px;
  letter-spacing: -0.01em;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.hero-tagline p strong { color: var(--fg); font-weight: 500; }
.hero-tagline .scroll-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.hero-tagline .scroll-hint .arrow {
  width: 24px; height: 1px; background: var(--fg-mute);
  position: relative; animation: slide 2s var(--ease) infinite;
}
@keyframes slide {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(6px); opacity: 0.5; }
}

/* ===== Section scaffolding ===== */
.section {
  padding: 140px 0;
  position: relative;
}
.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: baseline;
  margin-bottom: 60px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.5vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.section-title em {
  font-style: italic; font-weight: 400; color: var(--accent);
}

/* ===== Work grid ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--tile-gap, 24px) var(--tile-gap, 24px);
}
.work-tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: var(--radius);
  cursor: none;
  transition: transform 0.6s var(--ease);
}
.work-tile .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.work-tile .thumb-inner {
  position: absolute; inset: 0;
  transition: transform 0.8s var(--ease), filter 0.4s var(--ease);
  filter: saturate(var(--img-saturation, 0.85));
}
.work-tile .thumb-inner .project-img {
  transform: scale(1.5);
  transition: transform 0.8s var(--ease);
}
.work-tile:hover .thumb-inner {
  filter: saturate(1.1);
}
.work-tile:hover .thumb-inner .project-img {
  transform: scale(1.6);
}
.work-tile .meta {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 4px 0;
  gap: 12px;
}
.work-tile .title-row {
  display: flex; gap: 10px; align-items: baseline;
  font-family: var(--font-display);
}
.work-tile .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.work-tile .title {
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 0.2s var(--ease);
}
.work-tile:hover .title { color: var(--accent); }
.work-tile .cat {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  flex-shrink: 0;
}

/* Uniform sizing — every tile equal */
.work-tile.span-7,
.work-tile.span-5,
.work-tile.span-6,
.work-tile.span-8,
.work-tile.span-4,
.work-tile.span-12 { grid-column: span 4; }
.work-tile.ar-wide .thumb,
.work-tile.ar-tall .thumb,
.work-tile.ar-square .thumb,
.work-tile.ar-cinema .thumb { aspect-ratio: 4 / 3; }

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  .work-tile.span-7, .work-tile.span-5, .work-tile.span-6,
  .work-tile.span-8, .work-tile.span-4, .work-tile.span-12 {
    grid-column: span 6;
  }
}

/* ===== Real project image ===== */
.project-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Placeholder imagery ===== */
.ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 24px,
      rgba(255,255,255,0.015) 24px 25px
    ),
    linear-gradient(135deg, var(--ph-a, oklch(0.26 0.02 60)), var(--ph-b, oklch(0.22 0.015 40)));
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px;
}
.ph-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.ph-label .swatch { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.ph-big {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--fg);
  mix-blend-mode: overlay;
  opacity: 0.85;
  text-wrap: balance;
}
.ph-corner {
  display: flex; justify-content: space-between; align-items: flex-end;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Placeholder color variants */
.ph.v-1 { --ph-a: oklch(0.28 0.04 80); --ph-b: oklch(0.20 0.025 60); }
.ph.v-2 { --ph-a: oklch(0.24 0.03 30); --ph-b: oklch(0.18 0.02 20); }
.ph.v-3 { --ph-a: oklch(0.26 0.04 240); --ph-b: oklch(0.20 0.025 260); }
.ph.v-4 { --ph-a: oklch(0.28 0.05 140); --ph-b: oklch(0.22 0.03 130); }
.ph.v-5 { --ph-a: oklch(0.26 0.04 330); --ph-b: oklch(0.20 0.03 310); }
.ph.v-6 { --ph-a: oklch(0.28 0.04 50); --ph-b: oklch(0.22 0.03 40); }

/* ===== Marquee ===== */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  margin: 100px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 56px);
  letter-spacing: -0.03em;
}
.marquee-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: scroll 40s linear infinite;
  width: max-content;
}
.marquee-item { display: inline-flex; align-items: center; gap: 48px; }
.marquee-item::after {
  content: '✦';
  color: var(--accent);
  font-size: 0.6em;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 80px;
  align-items: start;
}
.about-portrait {
  position: sticky; top: 120px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
.about-portrait-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: saturate(var(--img-saturation, 0.85));
  transition: filter 0.4s var(--ease), transform 0.8s var(--ease);
}
.about-portrait:hover .about-portrait-img {
  filter: saturate(1.05);
  transform: scale(1.02);
}
.about-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.about-text p { margin-bottom: 28px; }
.about-text p:first-child::first-letter {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--fg);
}
.about-text strong { color: var(--fg); font-weight: 500; }
.about-text em { color: var(--accent); font-style: italic; font-weight: 400; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.about-stat .num {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--fg);
}
.about-stat .num em { color: var(--accent); font-style: normal; }

/* === Live ticker — "someone erasing & rewriting" ===
   Layered: a digit + an eraser block that sweeps across it.
   Erase phase: digit fades right→left as eraser sweeps left→right.
   Write phase: digit reveals left→right (clip-path) as if hand-drawn.
*/
.live-ticker {
  position: relative;
  display: inline-block;
  line-height: 1;
}
.live-ticker .lt-value {
  display: inline-block;
  /* Use clip-path to mask reveal during write phase */
  clip-path: inset(0 0 0 0);
  transition: clip-path 600ms cubic-bezier(0.65, 0, 0.35, 1);
  will-change: clip-path;
}
.live-ticker .lt-eraser {
  position: absolute;
  top: -0.06em;
  bottom: -0.06em;
  left: 0;
  width: 0.6em;
  background: var(--accent);
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
  border-radius: 2px;
  /* Subtle texture: a soft inner shadow makes it feel less digital */
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 70%, black 30%);
  will-change: transform, opacity;
}

/* Erase phase: eraser sweeps L→R across digit, digit clips away L→R */
.live-ticker.phase-erase .lt-value {
  clip-path: inset(0 0 0 100%);
  transition: clip-path 600ms cubic-bezier(0.65, 0, 0.35, 1);
}
.live-ticker.phase-erase .lt-eraser {
  animation: tickerEraseSweep 650ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes tickerEraseSweep {
  0%   { transform: translateX(-60%); opacity: 0; }
  15%  { opacity: 0.85; }
  85%  { opacity: 0.85; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* Write phase: digit re-draws L→R (no eraser) */
.live-ticker.phase-write .lt-value {
  clip-path: inset(0 100% 0 0);
  animation: tickerWriteReveal 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes tickerWriteReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.about-stat .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-portrait { position: static; max-width: 400px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Process essay ===== */
.process {
  background: var(--bg-2);
  padding: 120px 0;
  margin: 80px 0;
}
.process-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}
.process-pull {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 40px 0 80px;
  text-wrap: balance;
  max-width: 18ch;
}
.process-pull em { font-style: italic; color: var(--accent); font-weight: 400; }
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 60px;
}
.process-step {
  border-top: 1px solid var(--line-2);
  padding-top: 20px;
}
.process-step .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.process-step h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.process-step p {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.5;
}
@media (max-width: 900px) {
  .process-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Clients ===== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.client {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 32px 24px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 140px;
  position: relative;
  transition: background 0.3s var(--ease);
}
.client:nth-child(4n) { border-right: none; }
.client:hover { background: var(--bg-2); }
.client:hover .client-name { color: var(--accent); }
.client-name {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 0.2s var(--ease);
}
.client-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
  .client:nth-child(4n) { border-right: 1px solid var(--line); }
  .client:nth-child(2n) { border-right: none; }
}

/* ===== Contact ===== */
.contact {
  padding: 160px 0 80px;
}
.contact-head {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.contact-huge {
  font-family: var(--font-display);
  font-size: clamp(64px, 11vw, 180px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  margin-bottom: 60px;
}
.contact-huge a {
  display: inline-block;
  position: relative;
  transition: color 0.3s var(--ease);
}
.contact-huge a:hover { color: var(--accent); font-style: italic; font-weight: 500; }
.contact-huge .wave {
  display: inline-block;
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.contact-col h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}
.contact-col a, .contact-col p {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 6px;
  transition: color 0.2s var(--ease);
}
.contact-col a:hover { color: var(--accent); }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer .left, .footer .right { display: flex; gap: 24px; }

/* ===== Project detail overlay ===== */
.overlay {
  position: fixed; inset: 0;
  z-index: 500;
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay-close {
  position: fixed; top: 24px; right: 40px;
  z-index: 510;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  transition: all 0.2s var(--ease);
}
.overlay-close:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.overlay-close .x {
  display: inline-block; transition: transform 0.3s var(--ease);
}
.overlay-close:hover .x { transform: rotate(90deg); }

.project-detail {
  padding: 100px 40px 80px;
  max-width: 1680px;
  margin: 0 auto;
}
.project-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  padding-bottom: 32px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.project-header .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.project-header .kicker .num { color: var(--accent); margin-right: 10px; }
.project-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 140px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.88;
  text-wrap: balance;
}
.project-title em { font-style: italic; color: var(--accent); font-weight: 500; }
.project-meta-stack {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  text-align: right;
  line-height: 1.8;
  text-transform: uppercase;
}
.project-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 48px;
  overflow: hidden;
  border-radius: var(--radius);
  position: relative;
}
.project-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.project-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.project-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  margin-bottom: 80px;
}
.project-body .lead {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-wrap: pretty;
}
.project-body .body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.project-body .body p { margin-bottom: 16px; }

.project-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  margin-bottom: 80px;
}
.gallery-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--bg-2, #111);
  filter: saturate(var(--img-saturation, 0.85));
}
.gallery-item figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  text-wrap: pretty;
  max-width: 70ch;
}

.project-credits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  margin-bottom: 80px;
}
.project-credit h6 {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 10px;
}
.project-credit p {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--fg);
  line-height: 1.5;
}

.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.project-nav a {
  padding: 32px 0;
  display: flex; flex-direction: column;
  gap: 10px;
  transition: color 0.3s var(--ease);
}
.project-nav a:hover { color: var(--accent); }
.project-nav .dir {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.project-nav .nm {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.project-nav .next { text-align: right; align-items: flex-end; }

@media (max-width: 900px) {
  .project-header { grid-template-columns: 1fr; }
  .project-meta-stack { text-align: left; }
  .project-body { grid-template-columns: 1fr; gap: 32px; }
  .project-credits { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* Lock scroll when overlay open */
body.overlay-open { overflow: hidden; }


/* ===== MadLibs section ===== */
.madlibs {
  padding: 140px 0 80px;
  position: relative;
}
.madlibs::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 80px;
  height: 1px; background: var(--line);
}
.madlibs-head {
  margin-bottom: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px 60px;
  align-items: end;
}
.madlibs-head .section-num {
  grid-column: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--fg-mute);
  align-self: start;
}
.madlibs-head .section-title {
  grid-column: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5vw, 72px);
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.madlibs-head .section-title em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}
.madlibs-sub {
  grid-column: 2;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.5;
  color: var(--fg-dim);
  max-width: 38ch;
}
@media (max-width: 900px) {
  .madlibs-head { grid-template-columns: 1fr; gap: 24px; }
  .madlibs-head .section-title, .madlibs-sub { grid-column: 1; }
}

/* The composition surface */
.madlibs-board {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}
.madlibs-board::before {
  /* faint dotted notebook texture */
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--line-2) 1px, transparent 1.4px);
  background-size: 28px 28px;
  background-position: -2px -2px;
  opacity: 0.35;
  pointer-events: none;
}

.madlibs-sentence {
  position: relative;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.018em;
  color: var(--fg);
  text-wrap: pretty;
  margin: 0 0 48px;
  max-width: 28ch;
}
.madlibs-sentence .punct {
  color: var(--fg-dim);
}

/* The cyclable chip */
.madlibs-slot {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 0.05em 0.42em 0.05em 0.42em;
  margin: 0 0.06em;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--accent);
  position: relative;
  border-radius: 6px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
  border-bottom: 2px dashed currentColor;
  line-height: 1.05;
}
.madlibs-slot:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-color: transparent;
  transform: translateY(-1px);
}
.madlibs-slot:active { transform: translateY(0); }
.madlibs-slot-arrow {
  font-size: 0.5em;
  font-family: var(--font-mono);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.madlibs-slot:hover .madlibs-slot-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* From line + actions */
.madlibs-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.madlibs-from {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--fg-dim);
  flex: 1 1 280px;
}
.madlibs-from-lbl {
  white-space: nowrap;
}
.madlibs-from input {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 6px 4px;
  font: inherit;
  font-size: 18px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s var(--ease);
  min-width: 180px;
}
.madlibs-from input::placeholder { color: var(--fg-mute); }
.madlibs-from input:focus { border-bottom-color: var(--accent); }

.madlibs-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.madlibs-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.madlibs-shuffle:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.madlibs-shuffle .dice {
  font-size: 14px;
  display: inline-block;
}
.madlibs-shuffle:hover .dice {
  animation: madlibs-spin 0.6s var(--ease);
}
@keyframes madlibs-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.madlibs-send {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  box-shadow: 0 0 0 0 var(--accent);
}
.madlibs-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px var(--accent);
}
.madlibs-send.is-sent {
  background: var(--fg);
  color: var(--bg);
}

.madlibs-hint {
  position: relative;
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.madlibs-hint .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s var(--ease) infinite;
}


/* ===== MadLibs animated pen sign-off ===== */
.madlibs-signoff {
  margin-top: 56px;
  position: relative;
  text-align: center;
}
.madlibs-pen-stage {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.madlibs-signature {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
}
.madlibs-signoff.in .madlibs-signature {
  animation: madlibs-draw 5s cubic-bezier(0.7, 0.05, 0.3, 1) forwards;
}

.madlibs-pen {
  /* the pen rides the same path the ink draws */
  offset-path: path("M 60 150 C 80 80, 130 70, 150 130 S 200 200, 220 120 C 235 70, 280 70, 290 130 S 330 200, 350 130 C 365 80, 410 80, 420 140 S 460 200, 480 130 C 495 80, 540 80, 550 140 C 555 170, 545 195, 525 195 C 505 195, 500 175, 510 155 C 525 125, 580 110, 620 130 C 650 145, 660 175, 640 190 C 620 200, 595 185, 600 160 C 605 130, 660 110, 700 130 L 740 150 C 770 165, 800 145, 800 120 C 800 95, 770 90, 760 115 C 750 145, 780 175, 820 165 C 860 155, 880 125, 900 130 C 925 135, 935 165, 920 185 L 950 165 C 980 145, 1010 150, 1030 170 L 1060 130 C 1080 110, 1110 115, 1120 140");
  offset-rotate: auto;
  offset-distance: 0%;
  opacity: 0;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
}
.madlibs-signoff.in .madlibs-pen {
  animation: madlibs-pen-ride 5s cubic-bezier(0.7, 0.05, 0.3, 1) forwards;
}

@keyframes madlibs-draw {
  0%   { stroke-dashoffset: 2400; }
  100% { stroke-dashoffset: 0; }
}
@keyframes madlibs-pen-ride {
  0%   { offset-distance: 0%;    opacity: 0; }
  4%   { opacity: 1; }
  98%  { opacity: 1; }
  100% { offset-distance: 100%;  opacity: 0; }
}

.madlibs-signoff-caption {
  margin-top: 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(14px, 1.1vw, 17px);
  color: var(--fg-mute);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease) 4.6s, transform 0.6s var(--ease) 4.6s;
}
.madlibs-signoff.in .madlibs-signoff-caption {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .madlibs-signoff.in .madlibs-signature { animation-duration: 0.01s; }
  .madlibs-signoff.in .madlibs-pen { animation: none; opacity: 0; }
}


/* ===== Password Gate ===== */
.mh-gate {
  position: fixed; inset: 0;
  z-index: 99999;
  background:
    radial-gradient(120% 80% at 0% 0%, oklch(0.55 0.13 290 / 0.85) 0%, transparent 60%),
    radial-gradient(120% 80% at 100% 100%, oklch(0.55 0.10 195 / 0.8) 0%, transparent 60%),
    radial-gradient(60% 50% at 50% 55%, oklch(0.10 0.02 275 / 0.55) 0%, transparent 70%),
    oklch(0.28 0.04 275);
  color: oklch(0.96 0.008 80);
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: mhGateIn 0.5s var(--ease) both;
  font-family: var(--font-display);
}
@keyframes mhGateIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mh-gate-leaving {
  animation: mhGateOut 0.6s var(--ease) forwards;
}
@keyframes mhGateOut {
  to { opacity: 0; transform: scale(1.02); filter: blur(6px); }
}

/* Subtle hairline grid (disabled) */
.mh-gate-bg {
  display: none;
}
/* hide leftover orb/noise nodes from older markup */
.mh-gate-orb, .mh-gate-noise { display: none; }

/* Frame with corner labels */
.mh-gate-frame {
  position: relative;
  width: min(94vw, 1200px);
  height: min(88vh, 760px);
  display: grid;
  place-items: center;
}
.mh-gate-corner {
  position: absolute;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.96 0.008 80 / 0.5);
  pointer-events: none;
}
.mh-gate-corner.tl { top: 0; left: 0; pointer-events: auto; }
.mh-gate-corner.tr { top: 0; right: 0; }
.mh-gate-corner.bl { bottom: 0; left: 0; }
.mh-gate-corner.br { bottom: 0; right: 0; }

.mh-gate-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.96 0.008 80 / 0.7);
}
.mh-gate-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: oklch(0.85 0.13 290);
  box-shadow: 0 0 0 3px oklch(0.85 0.13 290 / 0.18);
  animation: mhDotPulse 2.4s ease-in-out infinite;
}
@keyframes mhDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px oklch(0.85 0.13 290 / 0.18); }
  50% { box-shadow: 0 0 0 7px oklch(0.85 0.13 290 / 0); }
}
.mh-gate-meta { color: oklch(0.96 0.008 80 / 0.45); }

/* Card — minimal, no fill, just hairline */
.mh-gate-card {
  position: relative;
  width: min(540px, 92vw);
  padding: 0;
  background: transparent;
  border: 0;
  animation: mhCardIn 0.7s var(--ease) 0.1s both;
}
@keyframes mhCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.mh-gate-shake {
  animation: mhShake 0.45s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes mhShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.mh-gate-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.03em;
  margin-bottom: 56px;
  line-height: 1;
  opacity: 0.92;
}
.mh-gate-mark-m { color: oklch(0.96 0.008 80); }
.mh-gate-mark-h { color: oklch(0.85 0.13 290); font-style: italic; font-weight: 400; }

.mh-gate-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 20px;
  color: oklch(0.96 0.008 80);
}
.mh-gate-title span { display: block; }
.mh-gate-title em {
  font-style: italic;
  font-weight: 300;
  color: oklch(0.85 0.13 290);
  letter-spacing: -0.04em;
}
.mh-gate-sub {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.55;
  color: oklch(0.96 0.008 80 / 0.6);
  margin: 0 0 40px;
  max-width: 38ch;
  font-weight: 400;
}

/* Form — single hairline row */
.mh-gate-form {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  position: relative;
  border-bottom: 1px solid oklch(0.96 0.008 80 / 0.18);
  transition: border-color 0.25s var(--ease);
  padding: 4px 0;
}
.mh-gate-form:focus-within {
  border-bottom-color: oklch(0.85 0.13 290);
}
.mh-gate-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.mh-gate-input {
  flex: 1;
  width: 100%;
  height: 52px;
  padding: 0 60px 0 0;
  background: transparent;
  border: 0;
  color: oklch(0.96 0.008 80);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  outline: none;
}
.mh-gate-input::placeholder { color: oklch(0.96 0.008 80 / 0.35); font-weight: 300; }

.mh-gate-eye {
  position: absolute;
  right: 64px;
  background: none;
  border: 0;
  color: oklch(0.96 0.008 80 / 0.5);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 4px 6px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.mh-gate-eye:hover { color: oklch(0.96 0.008 80); }

.mh-gate-submit {
  width: 52px; height: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.85 0.13 290);
  color: oklch(0.13 0.025 270);
  border: 0;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
  flex-shrink: 0;
}
.mh-gate-submit span { display: none; }
.mh-gate-submit:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  background: oklch(0.96 0.008 80 / 0.15);
  color: oklch(0.96 0.008 80 / 0.5);
}
.mh-gate-submit:not(:disabled):hover { transform: scale(1.06); }
.mh-gate-submit:not(:disabled):active { transform: scale(0.96); }
.mh-gate-submit svg { transition: transform 0.2s var(--ease); }
.mh-gate-submit:not(:disabled):hover svg { transform: translateX(2px); }

.mh-gate-foot {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.96 0.008 80 / 0.45);
}
.mh-gate-foot a {
  color: oklch(0.85 0.13 290);
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
.mh-gate-foot a:hover { opacity: 0.7; }

@media (max-width: 640px) {
  .mh-gate-corner.tr, .mh-gate-corner.bl, .mh-gate-corner.br { display: none; }
  .mh-gate-input { font-size: 18px; }
}

/* ===== Project external link ===== */
.project-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 12px 20px;
  border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.project-link:hover { background: var(--accent); color: var(--accent-ink); }

/* ===== In market (tactics) ===== */
.inmarket { padding-top: 40px; }
.inmarket-intro {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45;
  color: var(--fg-dim); max-width: 46ch; margin-bottom: 72px;
}
.tactic-group { margin-bottom: 96px; }
.tactic-group:last-child { margin-bottom: 0; }
.tactic-group-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 16px 40px; margin-bottom: 28px;
}
.tactic-group-head > div { flex: 1 1 420px; }
.tactic-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-mute);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
}
.tactic-count { color: var(--accent); margin-right: 10px; }
.tactic-brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.4vw, 52px); letter-spacing: -0.035em; line-height: 1;
  margin-bottom: 14px;
}
.tactic-blurb { font-family: var(--font-display); font-size: 17px; line-height: 1.5; color: var(--fg-dim); max-width: 56ch; }
.tactic-campaign {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 12px 20px; border: 1px solid var(--line-2); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: all 0.2s var(--ease);
}
.tactic-campaign:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tactic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 28px 20px;
}
.tactic { display: flex; flex-direction: column; text-align: left; }
.tactic-thumb {
  width: 100%; aspect-ratio: 3 / 2; border-radius: var(--radius);
  overflow: hidden; background: #f4f2ee; margin-bottom: 14px;
}
.tactic-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.6s var(--ease); }
.tactic:hover .tactic-thumb img { transform: scale(1.04); }
.tactic-kind {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-mute);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px;
}
.tactic-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  letter-spacing: -0.015em; line-height: 1.25; transition: color 0.2s var(--ease);
}
.tactic:hover .tactic-title { color: var(--accent); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(12, 11, 10, 0.96);
  display: flex; flex-direction: column;
  padding: 20px clamp(16px, 3vw, 40px);
  animation: lbIn 0.35s var(--ease) both;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-top, .lightbox-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px;
}
.lightbox-top span {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-mute);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 0; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); background: #f4f2ee; }
.lightbox-btn {
  min-height: 44px; min-width: 44px; padding: 10px 18px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: all 0.2s var(--ease);
}
.lightbox-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lightbox-caption { flex: 1 1 300px; text-align: center; }
.lightbox-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

/* ===== Equal spacing between all sections (140px gap) ===== */
.hero { padding-bottom: 70px; }
.section, .section.inmarket { padding: 70px 0; }
.process { margin: 70px 0; padding: 100px 0; }
.madlibs { padding: 70px 0; }
.madlibs::before { display: none; }
.contact { padding: 70px 0 80px; }

/* Looping project animation */
.project-loop {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: #000;
}

/* Solid variant + spacing for project buttons */
.project-body .body .project-link { margin-right: 12px; }
.project-link-solid { background: var(--accent); color: var(--accent-ink); }
.project-link-solid:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tactic-group { scroll-margin-top: 100px; }

/* Lightbox: close X on the image corner */
.lightbox-top { min-height: 32px; justify-content: flex-start; }
.lightbox-frame { position: relative; display: inline-block; max-width: 100%; }
.lightbox-frame img {
  display: block; max-width: 100%; max-height: calc(100vh - 210px);
  object-fit: contain; border-radius: var(--radius); background: #f4f2ee;
}
.lightbox-x {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 18, 17, 0.88); color: var(--fg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.lightbox-x:hover { background: var(--accent); color: var(--accent-ink); transform: rotate(90deg); }

/* ===== Responsive page margins (side padding) =====
   Earlier section rules used `padding: Xpx 0`, which zeroed the side padding.
   This sets one gutter everywhere: 20px on phones, scaling up to 64px on wide screens. */
:root { --gutter: clamp(20px, 4.5vw, 64px); }
.container { padding-left: var(--gutter) !important; padding-right: var(--gutter) !important; }
.nav { padding-left: var(--gutter); padding-right: var(--gutter); }
.process-inner { padding-left: var(--gutter); padding-right: var(--gutter); }
.project-detail { padding-left: var(--gutter); padding-right: var(--gutter); }
.overlay-close { right: var(--gutter); }
.lightbox { padding-left: var(--gutter); padding-right: var(--gutter); }

/* Phones: tighten vertical rhythm a touch and keep wide rows from overflowing */
@media (max-width: 640px) {
  .section, .section.inmarket, .madlibs { padding-top: 56px; padding-bottom: 56px; }
  .process { margin: 56px 0; padding: 72px 0; }
  .hero { padding-top: 110px; }
  .hero-meta-top { flex-wrap: wrap; gap: 8px 16px; }
  .hero-tagline { grid-template-columns: 1fr; gap: 24px; }
  .project-header { gap: 20px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer .left, .footer .right { flex-wrap: wrap; gap: 8px 16px; }
  .work-tile .meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .work-tile .cat { text-align: left; }
  .project-credits { grid-template-columns: 1fr; }
  .lightbox-frame img { max-height: calc(100vh - 230px); }
}
html, body { overflow-x: hidden; }
