/* Visually-hidden utility — hides content visually but keeps it in the
   accessibility tree (screen readers, aria-describedby). Do NOT use
   display:none or visibility:hidden for elements referenced by aria attributes. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

/* user-select: none only on interactive chrome — not on readable content.
   Applying it globally prevents copy-paste from project descriptions,
   contact info, and studio text, and fails accessibility audits. */
button, [role="button"], .logo-mark, .nav-item, .bar,
.hero-scroll, .cta-btn, .cta-btn-ghost, canvas,
#grain, #emboss-canvas, #ink-bloom {
  user-select: none;
  -webkit-user-select: none;
}

:root {
  /* Colour palette */
  --plaster:   #F7F5F2;
  --ink:       #0d0c0a;
  --ink-mid:   rgba(13, 12, 10, 0.57);
  --ink-faint: rgba(13, 12, 10, 0.57);

  /* Safe area insets — notched / Dynamic Island iPhones */
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-right:  env(safe-area-inset-right,  0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left,   0px);

  /* Shared animation timing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ── 2. Base / Body ────────────────────────────────────────── */
html {
  width: 100%;
  height: 100%;
}

/* Reset heading defaults — h1 is used semantically in the hero
   but is styled entirely via .hero-name; browser defaults must not intrude */
h1, h2 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}
body {
  width: 100%;
  height: 100dvh; /* iOS Safari address-bar-aware height */
  overflow: hidden;
  background: var(--plaster);
}


/* ── 3. Canvas Layers ──────────────────────────────────────── */

/* Emboss — lowest layer, full-screen 2D canvas */
#emboss-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  display: block; /* no inline gap */
}

/* Film grain overlay */
#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 170;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.76' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 192px 192px;
  mix-blend-mode: overlay;
  filter: contrast(1.06) brightness(1.06);
}

/* Ink bloom — WebGL canvas that animates the menu reveal */
#ink-bloom {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  pointer-events: none;
  display: block;
}




/* ── 4. Chrome (Logo, Menu Button) ─────────────────────────── */

.logo-mark {
  position: fixed;
  top:  calc(36px + var(--safe-top));
  left: calc(48px + var(--safe-left));
  z-index: 200;
  width: 28px;
  height: 28px;
  filter: grayscale(1) brightness(0.22);
  opacity: 0;
  animation: a-fade 1s ease 0.3s forwards;
  cursor: pointer;
  transform-origin: center center;
  transition:
    filter    0.5s ease,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo-mark:hover  { filter: grayscale(1) brightness(0.08); transform: scale(1.18) rotate(8deg); }
.logo-mark:active { filter: grayscale(1) brightness(0.04); transform: scale(0.92) rotate(4deg); transition-duration: 0.12s; }

/* Logo inverts when the dark menu overlay is open */
.logo-mark.menu-open       { filter: grayscale(1) brightness(2.8); }
.logo-mark.menu-open:hover { filter: grayscale(1) brightness(3.5); }

/* Three-bar hamburger icon */
#menu-btn {
  position: fixed;
  top:   calc(36px + var(--safe-top));
  right: calc(48px + var(--safe-right));
  z-index: 200;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  opacity: 0;
  animation: a-fade 1s ease 0.3s forwards;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.bar {
  display: block;
  height: 1px;
  background: var(--ink);
  transform-origin: right center;
  transition:
    width     0.5s var(--ease-out-expo),
    opacity   0.4s ease,
    transform 0.5s var(--ease-out-expo);
}
.bar-1 { width: 22px; }
.bar-2 { width: 14px; }
.bar-3 { width: 22px; }

/* Hover — middle bar extends to match outer bars */
#menu-btn:hover .bar-2 { width: 22px; }

/* Open state — bars rotate into an ✕ */
#menu-btn.open .bar-1 { width: 22px; transform-origin: center center; transform: translateY(6px) rotate(45deg); }
#menu-btn.open .bar-2 { width: 22px; opacity: 0; transform: scaleX(0); }
#menu-btn.open .bar-3 { width: 22px; transform-origin: center center; transform: translateY(-6px) rotate(-45deg); }

/* Bars invert over the dark ink overlay */
#menu-btn.open .bar { background: rgba(247, 245, 242, 0.75); }


/* ── 5. Menu Overlay (Nav) ─────────────────────────────────── */

#menu-nav {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nav-item {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(247, 245, 242, 0.92);
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;

  /* Entry state: invisible, shifted down, blurred */
  opacity: 0;
  transform: translateY(20px);
  filter: blur(12px);
  transition:
    opacity   0.9s var(--ease-out-expo),
    transform 0.9s var(--ease-out-expo),
    filter    0.9s var(--ease-out-expo),
    color     0.3s ease;
  /* Per-item stagger delay is set inline by JS */
}

.nav-item.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Animated underline on hover */
.nav-item::after {
  content: '';
  display: block;
  height: 1px;
  background: rgba(247, 245, 242, 0.3);
  width: 0;
  transition: width 0.6s var(--ease-out-expo);
  margin-top: 2px;
}
.nav-item:hover             { color: rgba(247, 245, 242, 1); }
.nav-item:hover::after      { width: 100%; }
.nav-item:focus-visible     { outline: 2px solid rgba(247, 245, 242, 0.7); outline-offset: 4px; color: rgba(247, 245, 242, 1); }

/* Small ordinal index beside each nav item */
.nav-index {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 200;
  font-style: normal;
  letter-spacing: 0.2em;
  color: rgba(247, 245, 242, 0.48);
  vertical-align: super;
  margin-right: 0.6em;
  transition: color 0.3s ease;
}
.nav-item:hover .nav-index { color: rgba(247, 245, 242, 0.6); }


/* ── 6. Hero Section ───────────────────────────────────────── */

#hero {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.hero-centre {
  display: flex;
  align-items: baseline;
  gap: clamp(40px, 5vw, 88px);
  white-space: nowrap;
}

/* Thin vertical rule between studio name and tagline */
.hero-divider {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--ink-faint);
  vertical-align: middle;
  margin-bottom: 0.08em;
  opacity: 0;
  animation: a-fade 0.6s ease 2.2s forwards;
}

.hero-name {
  font-family: 'Jost', sans-serif;
  font-size: clamp(1.05rem, 1.6vw, 1.5rem);
  font-weight: 200;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mid);
  line-height: 1;
}

.hero-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1;
}

.hero-scroll {
  font-family: 'Jost', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: a-fade 0.8s ease 2.8s forwards;
}
/* Pulsing vertical line after "Scroll" */
.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 22px;
  background: var(--ink-faint);
  animation: a-pulse 2.4s ease-in-out 2.8s infinite;
}

/* Per-character entrance animation (spans injected by JS) */
.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
}
.char.animate {
  animation: char-in 0.55s var(--ease-out-expo) forwards;
  animation-delay: calc(var(--i) * 38ms);
}
.hero-name    .char.animate { animation-delay: calc(0.10s + var(--i) * 38ms); }
.hero-tagline .char.animate { animation-delay: calc(0.65s + var(--i) * 38ms); }

/* Non-breaking space between words */
.char-space { display: inline-block; width: 0.28em; }

/* Word wrapper — allows line breaks only between words, never mid-word */
.word { display: inline; white-space: nowrap; }


/* ── 7. Statement Section ──────────────────────────────────── */

#statement {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(48px, 8vw, 120px);
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.statement-inner { max-width: 900px; }

.line-body {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;

  /* Entry state */
  opacity: 0;
  filter: blur(22px);
  transform: translateY(28px);
  /* will-change is set/removed by JS around the transition —
     avoids keeping GPU layers alive indefinitely, and excludes
     'filter' which causes expensive compositing on low-end devices. */
  transition:
    opacity   1.8s var(--ease-out-expo),
    filter    1.8s var(--ease-out-expo),
    transform 1.8s var(--ease-out-expo);
}
.line-body.visible { opacity: 1; filter: blur(0); transform: translateY(0); }


/* ── 8. CTA Section ─────────────────────────────────────────── */

#cta {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 3vh, 32px);
  pointer-events: none;
}

.cta-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.6rem, 0.9vw, 0.72rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);

  /* Entry state */
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity   1.2s var(--ease-out-expo),
    transform 1.2s var(--ease-out-expo);
}
.cta-eyebrow.visible { opacity: 1; transform: translateY(0); }

.cta-buttons {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);

  /* Entry state */
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity   1.4s var(--ease-out-expo) 0.15s,
    transform 1.4s var(--ease-out-expo) 0.15s;
}
.cta-buttons.visible { opacity: 1; transform: translateY(0); }

/* Shared button base */
.cta-btn,
.cta-btn-ghost {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.55rem, 0.8vw, 0.65rem);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 11px clamp(22px, 2.5vw, 32px) 10px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

/* Embedded WebGL canvas fills the button — text floats above it */
.cta-btn canvas,
.cta-btn-ghost canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Text always on top of the ink canvas */
.cta-btn span,
.cta-btn-ghost span {
  position: relative;
  z-index: 2;
  transition: color 0.45s ease;
}

/* Primary — dark bg, cream ink rises on hover, text flips to ink */
.cta-btn {
  color: var(--plaster);
  background: var(--ink);
  border-color: var(--ink);
}
.cta-btn.btn-hovered span { color: var(--ink); }
.cta-btn:focus-visible     { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Ghost — transparent bg, dark ink rises on hover, text flips to plaster */
.cta-btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: rgba(13, 12, 10, 0.44);
  transition: border-color 0.5s ease;
}
.cta-btn-ghost.btn-hovered     { border-color: var(--ink); }
.cta-btn-ghost.btn-hovered span { color: var(--plaster); }
.cta-btn-ghost:focus-visible    { outline: 2px solid var(--ink); outline-offset: 3px; }


/* ── 9. Work Page ───────────────────────────────────────────── */

#work-page {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  /* Scroll on the outer fixed div — same pattern as #studio-page.
     iOS Safari reliably scrolls position:fixed elements but consistently
     fails when the scroll container is a flex child inside one. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
#work-page::-webkit-scrollbar { display: none; }
#work-page.page-visible {
  pointer-events: auto;
  opacity: 1;
}

.work-header {
  /* Intentionally hidden — the title/count row is reserved for a future
     design iteration. The HTML is kept so JS can still populate #work-count
     without errors. Remove both this rule and the HTML if the feature is
     formally dropped. */
  display: none;
}
.work-title {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.55rem, 0.8vw, 0.65rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.work-count {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.55rem, 0.8vw, 0.65rem);
  font-weight: 200;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
}

/* Project grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 48px);
  padding: calc(80px + var(--safe-top)) clamp(48px, 8vw, 160px) clamp(32px, 4vh, 60px);
  align-content: start;
  /* Scroll removed — #work-page itself is the scroll container now */
}

.project-card {
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity   0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}
.project-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #908d88;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Real cover photo fills the card thumbnail */
.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  transition: transform 0.5s var(--ease-out-expo);
}
.project-card:hover .card-thumb img { transform: scale(1.03); }

/* Subtle cross-hatch pattern on placeholder */
.card-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(13,12,10,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,12,10,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.card-thumb-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.6rem;
  font-weight: 200;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(13,12,10,0.25);
  position: relative;
  z-index: 1;
}

/* Hover lift on card */
.card-thumb {
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo);
}
.project-card:hover .card-thumb {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(13,12,10,0.10);
}

.card-meta {
  padding: 14px 0 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card-tags {
  font-family: 'Jost', sans-serif;
  font-size: 0.55rem;
  font-weight: 200;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
}

/* ── Project Detail Panel ── */
#project-detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--plaster);
  display: flex;
  height: 100dvh; /* explicit height so flex children can overflow-y: auto */
  pointer-events: none;
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity   0.6s var(--ease-out-expo),
    transform 0.6s var(--ease-out-expo);
}
#project-detail.detail-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
  z-index: 210; /* above logo + hamburger (z-index 200) */
}

.detail-close {
  position: absolute;
  top: calc(36px + var(--safe-top));
  right: clamp(28px, 4vw, 60px);
  background: none;
  border: 1px solid rgba(13,12,10,0.18);
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 9px 16px 8px;
  z-index: 2;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.detail-close:hover { color: var(--ink); border-color: var(--ink); background: rgba(13,12,10,0.04); }
.detail-close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  color: var(--ink);
  border-color: var(--ink);
}

.detail-gallery {
  flex: 0 0 55%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.detail-gallery::-webkit-scrollbar { display: none; }

.gallery-img {
  width: 100%;
  background: #918e88;
  position: relative;
  line-height: 0; /* collapse whitespace gap below img */
}
/* Real photo — full width, natural height, never clipped */
.gallery-img img {
  width: 100%;
  height: auto;
  display: block;
}
/* Placeholder slot (no image) gets a fixed ratio so it doesn't collapse */
.gallery-img:not(:has(img)) {
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(13,12,10,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,12,10,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}
.gallery-img-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.55rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(13,12,10,0.2);
  position: relative;
  z-index: 1;
}

.detail-info {
  flex: 1;
  min-height: 0; /* required: lets flex child shrink below content size so overflow-y: auto fires */
  display: flex;
  flex-direction: column;
  padding: calc(80px + var(--safe-top)) clamp(32px, 4vw, 60px) clamp(40px, 5vh, 80px);
  overflow-y: auto;
  scrollbar-width: none;
  border-left: 1px solid rgba(13,12,10,0.08);
}
.detail-info::-webkit-scrollbar { display: none; }

.detail-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 0.58rem;
  font-weight: 200;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}
.detail-project-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 28px;
}
.detail-tags-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 36px;
}
.detail-tag {
  font-family: 'Jost', sans-serif;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid rgba(13,12,10,0.15);
  padding: 5px 10px 4px;
}

.detail-rule {
  width: 100%;
  height: 1px;
  background: rgba(13,12,10,0.1);
  margin-bottom: 32px;
}

/* Expandable read-more */
.detail-summary {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-mid);
  margin-bottom: 24px;
}

.read-more-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0;
  margin-bottom: 24px;
  transition: color 0.3s ease;
}
.read-more-toggle:hover { color: var(--ink); }
.read-more-toggle::after {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease-out-expo);
}
.read-more-toggle:hover::after { width: 38px; }
.read-more-toggle.expanded::before { content: '— '; }

.read-more-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-mid);
}

/* Case study blocks inside read-more-body */
.case-study {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-block {
  padding: 24px 0;
  border-top: 1px solid rgba(13,12,10,0.08);
}

.cs-block:first-child {
  border-top: none;
  padding-top: 0;
}

.cs-block--lead {
  padding-bottom: 28px;
}

.cs-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px 0;
}

.cs-lead {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 14px 0;
}

.cs-lead:last-child { margin-bottom: 0; }

.cs-block p:not(.cs-label):not(.cs-lead) {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.95rem, 1.25vw, 1.08rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-mid);
  margin: 0 0 12px 0;
}

.cs-block p:not(.cs-label):not(.cs-lead):last-child {
  margin-bottom: 0;
}

.cs-block code {
  font-family: 'Courier New', monospace;
  font-size: 0.82em;
  background: rgba(13,12,10,0.05);
  padding: 1px 5px;
  letter-spacing: 0;
}

/* Visit site link in tags row */
.detail-url {
  display: inline-block;
  margin-left: auto;
  font-family: 'Jost', sans-serif;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.3s ease;
}

.detail-url:hover { color: var(--ink); }


/* ── 10. Studio Page ─────────────────────────────────────────── */

#studio-page {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  overflow-y: auto;
  scrollbar-width: none;
}
#studio-page::-webkit-scrollbar { display: none; }
#studio-page.page-visible {
  pointer-events: auto;
  opacity: 1;
}

.studio-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(88px + var(--safe-top)) clamp(60px, 7vw, 120px) clamp(60px, 8vh, 100px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(60px, 8vw, 120px);
  align-items: start;
}

.studio-kicker {
  font-family: 'Jost', sans-serif;
  font-size: 0.58rem;
  font-weight: 200;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.studio-kicker.s-visible { opacity: 1; transform: translateY(0); }

.studio-statement {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.7rem, 2.8vw, 2.9rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.015em;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
  transition:
    opacity   1.2s var(--ease-out-expo) 0.1s,
    transform 1.2s var(--ease-out-expo) 0.1s,
    filter    1.2s var(--ease-out-expo) 0.1s;
}
.studio-statement.s-visible { opacity: 1; transform: translateY(0); filter: blur(0); }

.studio-aside {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.95rem, 1.35vw, 1.2rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-mid);
  padding-top: clamp(52px, 6vw, 76px); /* visually align with statement body, below kicker */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease-out-expo) 0.35s, transform 1s var(--ease-out-expo) 0.35s;
}
.studio-aside.s-visible { opacity: 1; transform: translateY(0); }

/* Process steps */
.studio-process {
  grid-column: 1 / -1;
  margin-top: clamp(52px, 7vh, 88px);
  border-top: 1px solid rgba(13,12,10,0.1);
}

.process-step {
  display: grid;
  grid-template-columns: 3.5rem 1fr 1fr;
  gap: 0 clamp(24px, 4vw, 60px);
  padding: clamp(18px, 2.2vh, 26px) 0;
  border-bottom: 1px solid rgba(13,12,10,0.08);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity   0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}
.process-step.s-visible { opacity: 1; transform: translateY(0); }

.step-num {
  font-family: 'Jost', sans-serif;
  font-size: 0.6rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  padding-top: 0.3em;
}
.step-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 1.8vw, 1.7rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.step-desc {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.72rem, 0.95vw, 0.85rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-faint);
}


/* ── 11. Contact Page ────────────────────────────────────────── */

#contact-page {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
#contact-page.page-visible {
  pointer-events: auto;
  opacity: 1;
}

.contact-inner {
  width: 100%;
  max-width: 560px;
  padding: 0 clamp(28px, 5vw, 60px);
}

.contact-kicker {
  font-family: 'Jost', sans-serif;
  font-size: 0.58rem;
  font-weight: 200;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.contact-kicker.c-visible { opacity: 1; transform: translateY(0); }

.contact-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: clamp(32px, 4vh, 48px);
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px);
  transition:
    opacity   1.1s var(--ease-out-expo) 0.1s,
    filter    1.1s var(--ease-out-expo) 0.1s,
    transform 1.1s var(--ease-out-expo) 0.1s;
}
.contact-headline.c-visible { opacity: 1; filter: blur(0); transform: translateY(0); }

/* Netlify form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1s var(--ease-out-expo) 0.25s, transform 1s var(--ease-out-expo) 0.25s;
}
.contact-form.c-visible { opacity: 1; transform: translateY(0); }

.form-field {
  position: relative;
  border-bottom: 1px solid rgba(13,12,10,0.15);
  margin-bottom: 32px;
}
.form-field:focus-within {
  border-bottom-color: var(--ink);
}
.form-label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 0.55rem;
  font-weight: 200;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  transition: color 0.3s ease;
}
.form-field:focus-within .form-label { color: var(--ink-mid); }

.form-input,
.form-textarea {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 300;
  color: var(--ink);
  padding: 0 0 14px;
  letter-spacing: 0.01em;
  caret-color: var(--ink);
}
.form-textarea {
  resize: none;
  min-height: 80px;
  line-height: 1.6;
}

.form-select {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 300;
  color: var(--ink);
  padding: 0 0 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(13,12,10,0.4)' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.form-select option { background: var(--plaster); color: var(--ink); }

.form-submit {
  align-self: flex-start;
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.55rem, 0.8vw, 0.65rem);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--plaster);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 11px clamp(22px, 2.5vw, 32px) 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.35s ease, background 0.35s ease;
}
.form-submit:hover {
  color: var(--ink);
  background: var(--plaster);
}
.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Inline validation error messages */
.form-error {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #c0392b;
  padding: 4px 0 8px;
  min-height: 1.4em;
}

.form-success {
  display: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-mid);
  line-height: 1.6;
  padding-top: 8px;
}

/* ── 13. Microinteraction styles ────────────────────────────── */

/* Desktop: card thumbnail parallax
   The inner layer shifts slightly opposite to cursor;
   overflow:hidden on .card-thumb keeps it clipped cleanly. */
.card-thumb-inner {
  position: absolute;
  inset: -6px; /* slight oversize so edges don't expose gaps during shift */
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transition: transform 0.08s linear; /* tightened — JS drives it each mousemove */
}

/* Desktop: scroll-hint dismiss
   Class added by JS on first scroll gesture. */
.hero-scroll.scroll-fired {
  animation: scroll-hint-out 0.5s var(--ease-out-expo) forwards;
}
@keyframes scroll-hint-out {
  to { opacity: 0; transform: translateY(-8px); }
}
/* Suppress the ::after pulse once dismissed */
.hero-scroll.scroll-fired::after {
  animation: none;
}

/* Mobile: press-hold ripple on project cards */
.card-hold-ripple {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  border-radius: 0;
  overflow: hidden;
}
.card-hold-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 10, 0.06);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0s linear; /* duration set by JS */
}
.card-hold-ripple.holding::after {
  transform: scaleX(1);
}

/* Mobile: swipe-to-close — panel follows finger via JS inline transform.
   When released below threshold, a snap-back class is applied. */
#project-detail.swipe-dragging {
  transition: none !important; /* disable CSS transition while dragging */
}
#project-detail.swipe-snap-back {
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity   0.45s ease !important;
}

/* Mobile: rubber-band overscroll indicator on work grid.
   A faint gradient appears at the bottom edge when pulled past end. */
.work-grid-rubber-band {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(13,12,10,0.04), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.work-grid-rubber-band.visible { opacity: 1; }

/* Mobile: logo long-press bloom — no extra CSS needed, reuses existing InkBloom */


/* ── 9. Keyframes ───────────────────────────────────────────── */

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

@keyframes a-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 0.8; transform: scaleY(1.3); }
}

@keyframes char-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 12. Reduced Motion ─────────────────────────────────────── */
/*
  When the user has requested reduced motion (vestibular disorders,
  epilepsy, personal preference), we:
    • Cut all CSS transitions to zero duration
    • Cancel all keyframe animations (char entrances, logo fade, etc.)
    • Make opacity-hidden elements immediately visible so content
      isn't permanently invisible (JS animations won't fire either —
      see the JS reduced-motion guard below)
  The canvas-based effects (emboss, ink bloom, idle ghost cursors)
  are suppressed in JS — see window.__reducedMotion guard.
*/
@media (prefers-reduced-motion: reduce) {

  /* Target decorative entrance animations only.
     DO NOT use a blanket * override — the JS navigation system uses
     CSS opacity transitions (.page-visible, .card-visible etc.) to
     show and hide pages. Killing all transitions breaks navigation. */

  .char { animation-duration: 0.01ms !important; }

  .logo-mark, #menu-btn   { animation: none !important; opacity: 1 !important; }
  .hero-divider            { animation: none !important; opacity: 1 !important; }
  .hero-scroll             { animation: none !important; opacity: 1 !important; }
  .hero-scroll::after      { animation: none !important; }

  .line-body   { transition: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .cta-eyebrow { transition: none !important; opacity: 1 !important; transform: none !important; }
  .cta-buttons { transition: none !important; opacity: 1 !important; transform: none !important; }

  .studio-kicker, .studio-statement, .studio-aside, .process-step { transition: none !important; }
  .studio-kicker.s-visible, .studio-statement.s-visible,
  .studio-aside.s-visible,  .process-step.s-visible { opacity: 1 !important; transform: none !important; filter: none !important; }

  .contact-kicker, .contact-headline, .contact-form { transition: none !important; }
  .contact-kicker.c-visible, .contact-headline.c-visible,
  .contact-form.c-visible { opacity: 1 !important; transform: none !important; filter: none !important; }

  /* Suppress only the entrance transition on cards, not the card-visible state */
  .project-card { transition: none !important; }
  .project-card.card-visible { opacity: 1 !important; transform: none !important; }

  .nav-item { transition: color 0.3s ease !important; filter: none !important; }
  .nav-item.visible { opacity: 1 !important; transform: none !important; }

  #emboss-canvas, #ink-bloom { display: none !important; }
  #grain { opacity: 0.12 !important; }
}


/* ── 13. Mobile Overrides (≤767px) ─────────────────────────── */

@media (max-width: 767px) {

  /* Chrome */
  .logo-mark {
    top:  calc(22px + var(--safe-top));
    left: calc(22px + var(--safe-left));
    width: 22px;
    height: 22px;
  }
  #menu-btn {
    top:   calc(22px + var(--safe-top));
    right: calc(22px + var(--safe-right));
    padding: 10px;
  }

  /* Hero — vertically centred, text left-aligned */
  #hero {
    align-items: center;
    justify-content: flex-start;
    padding: calc(80px + var(--safe-top)) 28px 0;
  }
  .hero-centre {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    white-space: normal;
    width: 100%;
  }
  .hero-divider { display: none; }
  .hero-name    { font-size: clamp(0.7rem, 3.5vw, 0.95rem); letter-spacing: 0.18em; }
  .hero-tagline { font-size: clamp(1.45rem, 6vw, 1.9rem); line-height: 1.22; word-break: normal; overflow-wrap: break-word; white-space: normal; width: 100%; }
  .hero-tagline .word { display: inline; white-space: nowrap; }
  .hero-scroll  { margin-top: 10px; font-size: 0.55rem; }

  /* Nav items */
  .nav-item { font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1.18; white-space: nowrap; }

  /* Statement */
  #statement { padding: 0 28px; }
  .statement-inner { max-width: 100%; width: 100%; }
  .line-body { font-size: clamp(1.75rem, 7vw, 2.4rem); line-height: 1.22; overflow-wrap: break-word; word-break: normal; white-space: normal; }

  /* CTA */
  .cta-buttons { flex-direction: column; gap: 12px; width: 100%; padding: 0 28px; }
  .cta-btn, .cta-btn-ghost { width: 100%; text-align: center; padding: 12px 24px 11px; }

  /* Cheaper grain on low-power devices */
  #grain { background-size: 128px 128px; opacity: 0.28; }

  /* Work page mobile */
  .work-grid {
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vh, 36px);
    padding: calc(72px + var(--safe-top)) 20px calc(60px + var(--safe-bottom));
  }
  .work-header { padding: calc(22px + var(--safe-top)) 20px 0; padding-left: calc(22px + 22px + 20px + var(--safe-left)); }
  .card-name { font-size: 1rem; }
  /* 16:9 thumbnail is less dominating than 4:3 on narrow single-column layout */
  .card-thumb { aspect-ratio: 16/9; }

  /* Project detail mobile — single scrolling column */
  #project-detail {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  /* Gallery becomes a full-width vertical stack; the outer panel scrolls */
  .detail-gallery {
    flex: 0 0 auto;
    overflow: visible;
    padding-top: calc(56px + var(--safe-top));
    /* reset the desktop overflow-y: auto so images aren't clipped */
    overflow-y: visible;
  }
  /* Each image fills the full viewport width, natural height */
  .gallery-img {
    width: 100%;
    height: auto;
    aspect-ratio: unset;
    min-width: unset;
  }
  .gallery-img img {
    width: 100%;
    height: auto;
    display: block;
  }
  /* Placeholder slots (no image) keep a 4:3 ratio so they don't collapse */
  .gallery-img:not(:has(img)) {
    aspect-ratio: 4/3;
    height: auto;
  }
  .detail-info {
    flex: 0 0 auto;       /* don't stretch — content dictates height */
    min-height: unset;
    overflow-y: visible;  /* outer panel scrolls, not this child */
    padding: 28px 24px calc(60px + var(--safe-bottom));
    border-left: none;
    border-top: 1px solid rgba(13,12,10,0.08);
  }
  /* Close button stays fixed to viewport top */
  .detail-close {
    position: fixed;
    top: calc(16px + var(--safe-top));
    right: calc(16px + var(--safe-right));
  }

  /* Studio mobile — single column */
  .studio-inner { grid-template-columns: 1fr; gap: 24px; padding: calc(88px + var(--safe-top)) 28px clamp(60px, 8vh, 100px); }
  .studio-aside { padding-top: 0; }
  .studio-process { grid-column: 1; margin-top: clamp(36px, 5vh, 56px); }
  .process-step { grid-template-columns: 2.5rem 1fr; }
  .step-desc { grid-column: 2; }

  /* Contact mobile — the fixed container needs to scroll because the form
     is taller than many viewports, especially with the software keyboard open.
     align-items: flex-start + overflow-y: auto turns the fixed panel into a
     full-height scroll container without disrupting the desktop flex-centre layout. */
  #contact-page {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
  }
  #contact-page::-webkit-scrollbar { display: none; }
  .contact-inner {
    padding: calc(88px + var(--safe-top)) 24px calc(60px + var(--safe-bottom));
    width: 100%;
    max-width: 100%;
  }

}
