/* ============================================================
   Atelier Maria — "Luxe" redesign
   Sleek modern luxury, all-light. Palette unchanged (bone / ink /
   burgundy). The hero 3D blueprint and all scroll choreography hooks
   are preserved; everything else is new styling: floating glass,
   warm depth, rounded geometry, refined motion.
   ============================================================ */

:root {
  /* ---- original palette (unchanged) ---- */
  --bone: #F5F2ED;
  --bone-2: #E8DEC9;
  --bone-3: #E4DDCE;
  --ink: #1A1815;
  --ink-2: #2A2724;
  --mute: #7A766F;
  --line: #CFC8B9;
  --accent: #8C1D33; /* burgundy — rich garnet/Bordeaux */

  /* ---- new luxe tokens (derived from the palette) ---- */
  --surface: #FBF9F5;                          /* elevated warm near-white */
  --surface-2: #FEFDFB;
  --glass: rgba(247, 244, 238, 0.62);          /* frosted bone */
  --glass-strong: rgba(249, 246, 240, 0.82);
  --glass-hi: rgba(255, 255, 255, 0.65);       /* the polished glint line */
  --hairline: rgba(26, 24, 21, 0.10);
  --accent-soft: rgba(140, 29, 51, 0.10);
  --accent-glow: rgba(140, 29, 51, 0.16);

  /* warm, layered shadows — never cold grey */
  --shadow-soft: 0 2px 8px -4px rgba(26,24,21,0.14), 0 10px 30px -12px rgba(26,24,21,0.16);
  --shadow-lift: 0 8px 18px -8px rgba(26,24,21,0.22), 0 34px 70px -24px rgba(26,24,21,0.36);
  --shadow-pill: 0 1px 1px rgba(255,255,255,0.5) inset, 0 8px 26px -14px rgba(26,24,21,0.30);

  /* rounded-geometry scale */
  --r-sm: 14px;
  --r: 22px;
  --r-lg: 34px;
  --r-xl: 46px;
  --r-full: 999px;

  --gutter: clamp(24px, 4.5vw, 80px);
  --bay: clamp(120px, 14vw, 230px);
  --on-image: #F8F5EF;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html, body {
  background: var(--bone);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* warm depth on the page itself (hero keeps flat bone for the 3D fill) */
body {
  overflow-x: hidden;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(140,29,51,0.05), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(232,222,201,0.55), transparent 55%),
    var(--bone);
  cursor: none;
}
@media (hover: none) { body { cursor: auto; } }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bone); }

/* kill the browser's blue tap/press highlight + selection box on UI controls */
* { -webkit-tap-highlight-color: transparent; }
a, button, .nav, .cta, .service-row, .contact-row, [data-magnetic] {
  -webkit-user-select: none; -moz-user-select: none; user-select: none;
}
a:focus, button:focus, .service-row:focus, .contact-row:focus { outline: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

.serif {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 300;
  letter-spacing: -0.025em;
  font-feature-settings: "ss01", "ss02";
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

/* smooth scroll (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

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

/* ---------- custom cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none;
  width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 1px solid rgba(26,24,21,0.55);
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease),
              background .35s var(--ease), border-color .35s var(--ease), opacity .3s;
  will-change: transform;
}
/* hover keeps the same ring — no enlarging, no solid fill */
.cursor.is-hover { background: transparent; }
/* over photos give the ring a light outline so it stays visible */
.cursor.on-media { border-color: rgba(255,255,255,0.9); }
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 301; pointer-events: none;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: var(--accent); will-change: transform;
}
@media (hover: none) { .cursor, .cursor-dot { display: none; } }

/* The custom cursor is OPT-IN: atelier.js adds `.has-custom-cursor` to <html> only
   when it actually initialises (fine pointer, motion allowed, script ran). Until then
   the ring/dot stay hidden and the native system cursor is shown — so they can never
   freeze at the top-left corner on hybrid / coarse-pointer / JS-disabled setups. */
.cursor, .cursor-dot { display: none; }
html.has-custom-cursor .cursor,
html.has-custom-cursor .cursor-dot { display: block; }
html:not(.has-custom-cursor) body,
html:not(.has-custom-cursor) a,
html:not(.has-custom-cursor) button,
html:not(.has-custom-cursor) .service-row,
html:not(.has-custom-cursor) .proj-arrow { cursor: auto; }

/* ============================================================
   CHROME
   ============================================================ */
.nav {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 80;
  display: flex; align-items: center; gap: clamp(20px, 3vw, 44px);
  padding: 12px 14px 12px 26px;
  border-radius: var(--r-full);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-hi);
  box-shadow: var(--shadow-pill);
  transition: transform .5s var(--ease), opacity .4s var(--ease);
}
/* hidden when scrolling down — slides up out of view, returns on scroll up */
.nav.is-hidden { transform: translate(-50%, calc(-100% - 28px)); opacity: 0; pointer-events: none; }
.nav .mark {
  font-family: 'Fraunces', serif; font-weight: 400; font-size: 17px;
  letter-spacing: -0.01em; white-space: nowrap;
  display: flex; align-items: center;
}
/* "Maria" wordmark logo. multiply blends its cream background into the glass nav,
   leaving only the burgundy letterforms visible. */
.nav .mark-img { height: 24px; width: auto; display: block; mix-blend-mode: multiply; }
.nav .links { display: flex; gap: clamp(14px, 1.6vw, 26px); align-items: center; }
.nav .links a {
  position: relative; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); padding: 9px 14px; border-radius: var(--r-full);
  transition: color .3s var(--ease), background .3s var(--ease);
  will-change: transform;
}
.nav .links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav .links a:hover { color: var(--accent); background: var(--accent-soft); }
.nav .links a:hover::after { transform: scaleX(0); }

/* progress — a slim glass capsule rail, right edge */
.progress-rail {
  position: fixed; top: 50%; right: 22px; transform: translateY(-50%);
  height: 180px; width: 4px; border-radius: var(--r-full);
  background: rgba(26,24,21,0.10);
  z-index: 70; overflow: hidden;
}
.progress-fill {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(var(--accent), var(--ink));
  transform-origin: top; transform: scaleY(0);
  transition: transform .12s linear;
}
.progress-num {
  position: fixed; bottom: 26px; right: 18px; z-index: 70;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.2em; color: var(--mute); white-space: nowrap;
}

/* ============================================================
   HERO  (3D blueprint preserved — flat bone canvas)
   ============================================================ */
.hero {
  position: relative; height: 100vh; width: 100%; overflow: hidden;
  background: var(--bone);
}
.hero::before { /* soft burgundy glow behind the wordmark */
  content: ""; position: absolute; left: -10%; bottom: 6%;
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  z-index: 2; pointer-events: none; filter: blur(10px);
}
.hero-3d {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  will-change: opacity, transform;
}
.hero-3d canvas { width: 100% !important; height: 100% !important; display: block; }
.hero-canvas {
  position: absolute; inset: 0; z-index: 4;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 118px var(--gutter) 56px;
}
.hero-meta-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.hero-meta-top > div {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
  padding: 9px 16px; border-radius: var(--r-full);
  background: var(--glass); border: 1px solid var(--glass-hi);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}
.hero-meta-top .right { text-align: right; }
.hero-headline-wrap {
  align-self: end; position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: flex-start; width: 100%;
}
.hero-headline {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(58px, 9.5vw, 184px);
  line-height: 0.86; letter-spacing: -0.045em;
  white-space: nowrap; transform-origin: left center;
}
.hero-headline em { font-style: italic; font-weight: 300; color: var(--accent); }
.hero-subtitle {
  margin-top: 28px;
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 300;
  font-size: clamp(22px, 2.6vw, 38px); letter-spacing: -0.01em; color: var(--accent);
}
.hero-tag {
  margin-top: 16px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute); max-width: 46ch;
}

/* floating glass "spec card" — luxe CTA, bottom right of hero */
.hero-spec {
  position: absolute; right: var(--gutter); bottom: 96px; z-index: 5;
  width: min(300px, 78vw);
  padding: 22px 24px;
  border-radius: var(--r);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-hi);
  box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; gap: 16px;
}
.hero-spec .row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.hero-spec .row .k {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--mute);
}
.hero-spec .row .v { font-family: 'Fraunces', serif; font-size: 15px; }
.hero-spec .cta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
  padding: 13px 18px; border-radius: var(--r-full);
  background: var(--ink); color: var(--bone);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background .35s var(--ease); will-change: transform;
}
.hero-spec .cta:hover { background: var(--accent); }
.hero-spec .cta span:last-child { transition: transform .35s var(--ease); }
.hero-spec .cta:hover span:last-child { transform: translateX(5px); }

.hero-scroll-hint {
  position: absolute; bottom: 30px; left: var(--gutter); z-index: 5;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.3em;
  color: var(--mute); display: flex; align-items: center; gap: 12px;
}
.hero-scroll-hint .line {
  width: 46px; height: 1px; background: var(--line); position: relative; overflow: hidden;
}
.hero-scroll-hint .line::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  animation: rail 2.4s ease-in-out infinite;
}
@keyframes rail {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
.hero-mark-pinned { display: none; }

/* ============================================================
   SECTION PRIMITIVES
   ============================================================ */
section { position: relative; }
section[id] { scroll-margin-top: 110px; }

.section-label {
  display: flex; align-items: center; gap: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute);
}
.section-label .num {
  font-family: 'Fraunces', serif; font-size: 16px; font-weight: 400; font-style: italic;
  color: var(--accent); letter-spacing: 0; text-transform: none;
}
.section-label .rule { flex: 1; height: 1px; background: var(--line); max-width: 80px; }

/* ============================================================
   INTRO
   ============================================================ */
.intro {
  padding: var(--bay) var(--gutter);
  display: grid; grid-template-columns: 1fr 1.05fr;
  gap: clamp(48px, 8vw, 130px); align-items: start;
}
.intro-left { position: sticky; top: 130px; z-index: 1; }
.intro-eyebrow { margin-bottom: 56px; }
.intro-heading {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(42px, 6vw, 96px); line-height: 1.0; letter-spacing: -0.035em;
  max-width: 12ch;
}
.intro-heading em { font-style: italic; color: var(--accent); }
.intro-right { padding-top: 30px; display: flex; flex-direction: column; gap: 56px; z-index: 1; }

/* portrait as a floating glass card with sheen */
.portrait {
  position: relative; width: 100%; max-width: 380px; aspect-ratio: 4 / 5;
  background: var(--surface); overflow: hidden;
  border-radius: var(--r-lg); padding: 12px;
  box-shadow: var(--shadow-lift); border: 1px solid var(--glass-hi);
}
.portrait > img {
  width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--r-lg) - 12px);
}
.portrait::after { /* sheen sweep */
  content: ""; position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-18deg); z-index: 2; pointer-events: none;
  animation: sheen 6s var(--ease) 1.2s infinite;
}
@keyframes sheen { 0%,72% { left: -60%; } 90%,100% { left: 130%; } }
.portrait-cap {
  position: absolute; bottom: 22px; left: 22px; z-index: 3;
  color: var(--on-image); font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 8px 14px; border-radius: var(--r-full);
  background: rgba(26,24,21,0.34); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.intro-body p { font-size: 17px; line-height: 1.62; color: var(--ink-2); max-width: 50ch; }
.intro-body p + p { margin-top: 20px; }
.intro-body .lede::first-letter {
  font-family: 'Fraunces', serif; font-size: 76px; float: left; line-height: 0.78;
  padding: 8px 12px 0 0; font-weight: 300; color: var(--accent);
}

/* ============================================================
   PROJECTS — horizontal coverflow (choreography preserved)
   ============================================================ */
.projects-wrap { position: relative; background: transparent; }
.projects-header {
  padding: var(--bay) var(--gutter) clamp(48px, 6vw, 80px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end;
}
.projects-header h2 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(50px, 8vw, 132px); line-height: 0.92; letter-spacing: -0.04em;
}
.projects-header h2 em { font-style: italic; color: var(--accent); }
.projects-header .meta {
  font-size: 14px; color: var(--mute); max-width: 38ch;
  border-top: 1px solid var(--line); padding-top: 16px;
}
/* free horizontal scroll carousel — the visitor swipes / drags / arrows through
   the work at their own pace (no scroll-jacking pin). Snaps each card to centre. */
.projects-pin {
  position: relative;
  overflow-x: auto; overflow-y: hidden;
  /* proximity (not mandatory): lets the visitor rest on the first AND last cards.
     mandatory snap can push the edge cards out of reach when their centre snap point
     sits a hair beyond the scroll extent. */
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.projects-pin::-webkit-scrollbar { display: none; }
.projects-pin.is-dragging { scroll-snap-type: none; user-select: none; } /* glide freely + no text selection; snap re-engages on release */
.projects-pin.is-dragging img { pointer-events: none; }
.projects-track {
  display: flex; align-items: center;
  padding: 10px var(--gutter) clamp(28px, 4vw, 48px); gap: 56px;
}
.projects-track-end { flex: 0 0 0px; align-self: stretch; }
.proj-card {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 0;
  scroll-snap-align: center;
}
.proj-img {
  width: min(52vw, 640px); aspect-ratio: 4 / 5;
  max-height: 74vh;   /* leaves room for header + arrows without forcing a giant section */
  background: var(--bone-3); overflow: hidden; position: relative;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lift);
}
/* <picture> wrappers carry no box of their own — the <img> lays out as a direct
   child (keeps the absolute/percentage sizing + parallax intact) */
.proj-img picture, .portrait picture, .mask-frame picture { display: contents; }
.proj-img img { width: 100%; height: 116%; object-fit: cover; position: relative; top: -8%; will-change: transform; }
/* glass meta bar — flush full-width caption, no floating edges (extends to the image sides) */
.proj-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 18px 22px; border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border: 0; border-top: 1px solid var(--glass-hi);
}
.proj-meta .left { display: flex; flex-direction: column; gap: 3px; }
.proj-meta .num {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: 0.2em; color: var(--accent);
}
.proj-meta .name {
  font-family: 'Fraunces', serif; font-weight: 300; font-size: 24px;
  letter-spacing: -0.01em; line-height: 1.05;
}
.proj-meta .place { font-size: 12px; color: var(--mute); }
.proj-meta .year { font-family: 'Fraunces', serif; font-style: italic; font-size: 17px; color: var(--ink-2); }

/* prev / next controls — glass circles overlapping the left & right of the strip */
.projects-stage { position: relative; }
.proj-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 6;
  width: clamp(48px, 4vw, 62px); height: clamp(48px, 4vw, 62px); border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--glass-hi); color: var(--ink);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: var(--shadow-soft);
  font-family: 'Fraunces', serif; font-size: 24px; line-height: 1;
  cursor: none;
  transition: background .4s var(--ease), color .4s var(--ease),
              border-color .4s var(--ease), transform .4s var(--ease), opacity .4s var(--ease);
}
.proj-arrow--prev { left: clamp(12px, 3vw, 48px); }
.proj-arrow--next { right: clamp(12px, 3vw, 48px); }
.proj-arrow:hover {
  background: var(--accent); color: var(--bone); border-color: var(--accent);
  transform: translateY(-50%) scale(1.06);
}
.proj-arrow:disabled { opacity: 0; pointer-events: none; }

/* ============================================================
   PHILOSOPHY — elevated pull-quotes
   ============================================================ */
.philosophy {
  padding: var(--bay) var(--gutter);
  display: flex; flex-direction: column; gap: clamp(110px, 15vw, 200px);
  position: relative;
}
.philosophy::before, .philosophy::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); height: 1px;
  background: var(--line);
}
.philosophy::before { top: 0; }
.philosophy::after { bottom: 0; }
.pull { display: grid; grid-template-columns: minmax(0,1fr); gap: 28px; align-items: start; position: relative; }
.pull.left { padding-right: 28vw; }
.pull.right { padding-left: 28vw; text-align: right; justify-items: end; }
.pull.center { padding: 0 12vw; text-align: center; justify-items: center; }
.pull blockquote {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(38px, 6vw, 104px); line-height: 1.0; letter-spacing: -0.035em;
  max-width: 18ch;
}
.pull blockquote em { font-style: italic; color: var(--accent); }
.pull blockquote .quote-mark {
  display: block; font-size: 1.6em; line-height: 0.4; font-style: italic;
  color: var(--accent); opacity: 0.5; margin-bottom: 0.1em;
}
.pull cite {
  font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute);
}

/* ============================================================
   MASK REVEAL
   ============================================================ */
.mask-section { position: relative; padding: var(--bay) var(--gutter); }
.mask-stage { display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; align-items: center; }
.mask-stage .copy { display: flex; flex-direction: column; gap: 30px; }
.mask-stage h3 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(38px, 4.8vw, 78px); line-height: 1.04; letter-spacing: -0.03em; max-width: 14ch;
}
.mask-stage p { font-size: 16px; color: var(--ink-2); max-width: 42ch; line-height: 1.62; }
.mask-frame {
  position: relative; aspect-ratio: 4 / 5; width: 100%;
  background: var(--surface); overflow: hidden;
  border-radius: var(--r-lg); padding: 12px;
  box-shadow: var(--shadow-lift); border: 1px solid var(--glass-hi);
}
.mask-frame img {
  width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--r-lg) - 12px);
  clip-path: inset(0% 100% 0% 0%); will-change: clip-path;
}
.mask-frame .mask-cap {
  position: absolute; bottom: 24px; left: 24px; z-index: 2;
  color: var(--on-image); font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 8px 14px; border-radius: var(--r-full);
  background: rgba(26,24,21,0.34); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ============================================================
   SERVICES — rows that lift into glass cards
   ============================================================ */
.services { padding: var(--bay) var(--gutter) clamp(48px, 6vw, 80px); position: relative; }
.services-grid { display: grid; grid-template-columns: 1fr 2.4fr; gap: 80px; align-items: start; }
.services-grid h2 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(42px, 5.4vw, 86px); line-height: 1.0; letter-spacing: -0.035em;
}
.services-grid h2 em { font-style: italic; color: var(--accent); }
.services-list { display: flex; flex-direction: column; gap: 10px; }
.service-row {
  display: grid; grid-template-columns: 60px 1fr 1.4fr 70px;
  align-items: center; gap: 32px;
  padding: 30px 26px; border-radius: var(--r);
  border: 1px solid transparent;
  cursor: none;
  transition: background .45s var(--ease), box-shadow .45s var(--ease),
              border-color .45s var(--ease), transform .45s var(--ease);
}
.service-row:hover {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-color: var(--glass-hi); box-shadow: var(--shadow-lift); transform: translateY(-3px);
}
.service-row:hover .svc-name { color: var(--accent); }
.service-row:hover .svc-num { color: var(--accent); }
.svc-num {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em;
  color: var(--mute); transition: color .4s var(--ease);
}
.svc-name {
  font-family: 'Fraunces', serif; font-weight: 300; font-size: clamp(28px, 3.2vw, 48px);
  letter-spacing: -0.025em; transition: color .4s var(--ease);
}
.svc-desc { color: var(--ink-2); font-size: 14px; line-height: 1.58; max-width: 44ch; }
.svc-arrow {
  justify-self: end; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--mute);
  font-family: 'Fraunces', serif; font-size: 22px;
  transition: transform .4s var(--ease), color .4s var(--ease),
              background .4s var(--ease), border-color .4s var(--ease);
}
.service-row:hover .svc-arrow {
  background: var(--accent); color: var(--bone); border-color: var(--accent); transform: translateX(4px);
}

/* ============================================================
   CONTACT — glass pills
   ============================================================ */
.contact {
  padding: var(--bay) var(--gutter) 70px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end;
  position: relative;
}
.contact::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px;
  background: var(--line);
}
.contact-headline {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(64px, 10vw, 200px); line-height: 0.9; letter-spacing: -0.045em;
}
.contact-headline em { font-style: italic; color: var(--accent); }
.contact-meta { display: flex; flex-direction: column; gap: 14px; }
.contact-row {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 20px 26px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--glass-hi);
  box-shadow: var(--shadow-soft);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease), background .4s var(--ease);
}
.contact-row .ck { display: flex; align-items: center; gap: 11px; color: var(--mute); }
.contact-row .k {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.2em; color: var(--mute); text-transform: uppercase;
}
.contact-icon { width: 19px; height: 19px; flex: 0 0 auto; display: block; transition: color .35s var(--ease); }
a.contact-row:hover .ck { color: var(--accent); }
.contact-row .v {
  font-family: 'Fraunces', serif; font-weight: 300; font-size: 23px; letter-spacing: -0.01em;
  transition: color .35s var(--ease), transform .35s var(--ease);
}
a.contact-row:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lift); background: var(--surface-2);
}
a.contact-row:hover .v { color: var(--accent); transform: translateX(5px); }
a.contact-row:hover .k { color: var(--accent); }

/* non-clickable rows (no href) read as plain info, not interactive cards */
div.contact-row {
  background: transparent; border-color: transparent; box-shadow: none;
  padding-left: 4px; padding-right: 4px;
}

.foot {
  padding: 30px var(--gutter) 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute);
  border-top: 1px solid var(--hairline);
}

/* ============================================================
   UTILITY + MOTION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(40px); }
.reveal.is-in { opacity: 1; transform: translateY(0); transition: opacity .8s ease-out, transform .8s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .portrait::after, .hero-scroll-hint .line::after { animation: none !important; }
}

/* ============================================================
   RESPONSIVE + PERFORMANCE
   ============================================================ */

/* touch devices: drop the costly always-on compositing */
@media (hover: none) {
  .grain { display: none; }            /* mix-blend-mode repaint every frame */
  .portrait::after { display: none; }  /* infinite sheen sweep */
  .cursor, .cursor-dot { display: none; }
}

/* ---- tablet / mobile ---- */
@media (max-width: 900px) {
  /* lighter glass — large blur radii are expensive on mobile GPUs */
  .nav, .hero-meta-top > div, .hero-spec, .proj-meta,
  .contact-row, .service-row:hover, .portrait-cap, .mask-cap {
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }

  .nav { left: 12px; right: 12px; transform: none; width: auto; justify-content: space-between; padding: 9px 10px 9px 18px; gap: 10px; }
  .nav.is-hidden { transform: translateY(calc(-100% - 20px)); }
  .nav .mark { font-size: 14px; }
  .nav .mark-img { height: 19px; }
  .nav .links { gap: 1px; }
  .nav .links a { padding: 9px 7px; font-size: 9px; letter-spacing: 0.04em; }

  /* mobile hero = a clean vertical stack, no overlap:
     wordmark → 3D drawing → paragraph. The text and the 3D live in different
     containers, so `display: contents` flattens them into one flex column on
     .hero and `order` arranges the pieces. */
  .hero {
    height: auto; min-height: 100svh;
    display: flex; flex-direction: column;
    padding: 100px 24px 48px; gap: 22px;
  }
  .hero-canvas { display: contents; }                  /* expose meta/headline/paragraph as flex items */
  .hero-headline-wrap { display: contents; }           /* expose headline + paragraph separately */
  .hero-canvas > div:empty { display: none; }          /* drop the desktop grid spacer */

  .hero-meta-top { order: 0; }
  .hero-headline { order: 1; white-space: normal; }     /* Atelier Maria — up top */
  .hero-3d {                                            /* the drawing — its own panel in the flow */
    order: 2; position: static; inset: auto;
    width: calc(100% + 48px); height: 52vh; opacity: 0.95;
    margin: -56px -24px 0;                              /* pull up tight + full-bleed past the hero's 24px side padding */
  }
  .hero-subtitle { order: 3; margin-top: 0; }           /* paragraph — below the drawing */
  .hero-tag { order: 4; margin-top: 0; }
  .hero-scroll-hint { order: 5; position: static; left: auto; }

  .hero-spec { display: none; }

  .intro { grid-template-columns: 1fr; gap: 48px; padding: 130px 24px; }
  .intro-left { position: static; }
  .intro-body p { font-size: 16px; }

  /* projects → native swipe carousel (no scroll-jacking pin) */
  .projects-header { grid-template-columns: 1fr; padding: 110px 24px 48px; gap: 28px; }
  .projects-pin {
    height: auto; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scroll-padding-left: 24px; perspective: none; scrollbar-width: none;
    overscroll-behavior-x: contain; touch-action: pan-x pan-y;
  }
  .projects-pin::-webkit-scrollbar { display: none; }
  .projects-track { height: auto; padding: 8px 24px 28px; gap: 16px; transform: none !important; transform-style: flat; }
  .proj-card { scroll-snap-align: start; scroll-snap-stop: always; transform: none !important; opacity: 1 !important; filter: none !important; }
  /* taller cards, but tied to height so they never exceed the screen */
  .proj-img { width: min(90vw, 68vh); max-width: 560px; aspect-ratio: 4 / 5; max-height: 78vh; box-shadow: var(--shadow-soft); clip-path: none !important; }
  .proj-img img { height: 100%; top: 0; transform: none !important; }   /* JS parallax is skipped on mobile — keep the image flush */
  .proj-meta { padding: 13px 16px; }
  .proj-meta .name { font-size: 21px; }

  .mask-stage { grid-template-columns: 1fr; gap: 36px; }
  .mask-section, .services, .contact, .philosophy { padding-left: 24px; padding-right: 24px; }

  .philosophy { gap: clamp(72px, 18vw, 130px); }
  .pull.left, .pull.right, .pull.center { padding: 0; text-align: left; justify-items: start; }
  .pull blockquote { max-width: none; }

  .services-grid { grid-template-columns: 1fr; gap: 40px; }
  .service-row { grid-template-columns: 36px 1fr 46px; gap: 16px; padding: 22px 18px; }
  .svc-desc { display: none; }

  .contact { grid-template-columns: 1fr; gap: 44px; }
  .contact-row { padding: 18px 20px; }

  .progress-rail { display: none; }
  .progress-num { display: none; }
}

/* ---- phone ---- */
@media (max-width: 520px) {
  :root { --gutter: 18px; }
  .nav { justify-content: center; padding: 5px; gap: 0; max-width: calc(100vw - 16px); }
  .nav .mark { display: none; }                 /* reclaim width for the links */
  .nav .links { gap: 0; }
  /* five links sized to fill the pill on a phone without spilling out */
  .nav .links a { padding: 8px 6px; font-size: 9.5px; letter-spacing: 0.03em; }
  .hero-headline { font-size: clamp(44px, 15vw, 88px); line-height: 0.92; white-space: normal; }
  .intro-heading { font-size: clamp(34px, 10vw, 56px); }
  .intro-body .lede::first-letter { font-size: 60px; }
  .proj-img { width: min(92vw, 64vh); max-height: 74vh; }
  .pull blockquote { font-size: clamp(32px, 11vw, 60px); }
  .svc-name { font-size: clamp(26px, 8vw, 38px); }
  .contact-headline { font-size: clamp(50px, 17vw, 96px); }
  .contact-row { flex-wrap: wrap; gap: 6px; }
  .foot { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============================================================
   HOMEPAGE PROJECT CARDS → links to /projects/{slug}
   The card markup is unchanged; an anchor now wraps the image.
   atelier.js suppresses the click when the gesture was a drag.
   ============================================================ */
.proj-link { display: block; color: inherit; }
.proj-img { position: relative; }
/* a quiet "open" affordance that blooms in on hover (fine pointers only) */
.proj-open {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--glass-strong); border: 1px solid var(--glass-hi);
  box-shadow: var(--shadow-soft); color: var(--ink);
  font-size: 15px; opacity: 0; transform: translateY(-6px) scale(.9);
  transition: opacity .4s var(--ease), transform .4s var(--ease), background .35s var(--ease), color .35s var(--ease);
}
.proj-card:hover .proj-open { opacity: 1; transform: translateY(0) scale(1); }
.proj-link:hover .proj-open { background: var(--accent); color: var(--bone); }
@media (hover: none) { .proj-open { display: none; } }

/* ============================================================
   SUBPAGES — project detail + projects index
   Editorial, light, reusing the bone/ink/burgundy system.
   Static (no JS): content is visible by default, no .reveal.
   ============================================================ */
.subpage { min-height: 100vh; display: flex; flex-direction: column; }
.subpage .nav .mark { font-family: 'Fraunces', serif; }
.subpage-main { flex: 1 0 auto; padding: clamp(120px, 16vh, 188px) var(--gutter) 0; }

/* breadcrumb */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute);
}
.crumbs a { color: var(--mute); transition: color .3s var(--ease); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--line); }
.crumbs [aria-current] { color: var(--ink-2); }

/* ---------- project detail ---------- */
.pj-head { max-width: 1200px; margin: 28px 0 clamp(34px, 5vw, 64px); }
.pj-eyebrow { margin-bottom: 22px; }
.pj-title {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(46px, 8vw, 124px); line-height: 0.92; letter-spacing: -0.04em;
  max-width: 16ch;
}
.pj-title em { font-style: italic; color: var(--accent); }

/* image on the left, the info column (brief + spec) beside it on the right */
.pj-main {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: clamp(28px, 4vw, 64px); align-items: start;
  padding-bottom: clamp(60px, 9vw, 130px);
}
.pj-figure {
  position: sticky; top: clamp(92px, 12vh, 120px);
  border-radius: var(--r-lg); overflow: hidden; margin: 0;
  box-shadow: var(--shadow-lift); background: var(--bone-3);
}
.pj-figure img { width: 100%; height: auto; display: block; }
.pj-info { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 32px); }
.pj-cap {
  position: absolute; left: 0; bottom: 0; margin: 18px;
  padding: 9px 16px; border-radius: var(--r-full);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-hi); box-shadow: var(--shadow-soft);
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
}

.pj-lead {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(21px, 2.2vw, 30px); line-height: 1.42; letter-spacing: -0.02em;
  color: var(--ink);
}
.pj-todo {
  display: inline-block; margin-top: 22px; padding: 11px 16px;
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.6;
  letter-spacing: 0.04em; text-transform: none; color: var(--ink-2);
}

/* spec list — palette / materials / sectioning */
.pj-spec { display: flex; flex-direction: column; gap: 0; }
.pj-spec .row {
  display: grid; grid-template-columns: 1fr; gap: 7px;
  padding: 22px 0; border-top: 1px solid var(--hairline);
}
.pj-spec .row:last-child { border-bottom: 1px solid var(--hairline); }
.pj-spec dt {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute);
}
.pj-spec dd { font-size: 14.5px; line-height: 1.62; color: var(--ink-2); }
.pj-spec .inline { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.pj-spec .inline dd { font-family: 'Fraunces', serif; font-style: italic; font-size: 19px; color: var(--ink); }

/* adjacent project nav + CTA */
.pj-foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  padding: clamp(40px, 6vw, 70px) 0; border-top: 1px solid var(--line);
}
.pj-adj {
  display: flex; flex-direction: column; gap: 6px;
  padding: 24px 26px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--glass-hi); box-shadow: var(--shadow-soft);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .4s var(--ease);
}
.pj-adj:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); background: var(--surface-2); }
.pj-adj.next { text-align: right; }
.pj-adj .dir {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute);
}
.pj-adj .nm { font-family: 'Fraunces', serif; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.02em; }
.pj-adj:hover .nm { color: var(--accent); }
.pj-adj.empty { background: transparent; border-color: transparent; box-shadow: none; pointer-events: none; }

.pj-cta-wrap { display: flex; flex-wrap: wrap; gap: 14px; padding-bottom: clamp(50px, 8vw, 96px); }
.pj-cta {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 26px; border-radius: var(--r-full);
  background: var(--ink); color: var(--bone);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.pj-cta:hover { background: var(--accent); transform: translateY(-2px); }
.pj-cta.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.pj-cta.ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- projects index ---------- */
.index-head { max-width: 1100px; margin: 28px 0 clamp(40px, 6vw, 76px); }
.index-title {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(56px, 11vw, 184px); line-height: 0.9; letter-spacing: -0.045em;
  margin-top: 22px;
}
.index-title em { font-style: italic; color: var(--accent); }
.index-intro {
  margin-top: 28px; max-width: 60ch; font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65; color: var(--ink-2);
}
.index-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.4vw, 36px); padding-bottom: clamp(70px, 10vw, 140px);
}
.index-card { display: block; color: inherit; }
.index-img {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--r); box-shadow: var(--shadow-soft); background: var(--bone-3);
  transition: box-shadow .45s var(--ease), transform .45s var(--ease);
}
.index-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.index-card:hover .index-img { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.index-card:hover .index-img img { transform: scale(1.05); }
.index-num {
  position: absolute; top: 12px; left: 14px;
  font-family: 'Fraunces', serif; font-style: italic; font-size: 15px; color: var(--on-image);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.index-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin: 15px 4px 0; }
.index-meta .nm { font-family: 'Fraunces', serif; font-size: clamp(19px, 1.9vw, 24px); letter-spacing: -0.02em; }
.index-card:hover .index-meta .nm { color: var(--accent); }
.index-meta .pl { font-size: 12px; color: var(--mute); margin-top: 3px; }
.index-meta .yr { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--mute); letter-spacing: 0.1em; }

@media (max-width: 900px) {
  .pj-main { grid-template-columns: 1fr; gap: 28px; }
  .pj-figure { position: static; }          /* don't pin once the layout stacks */
  .pj-title { max-width: none; }
  .index-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pj-foot { grid-template-columns: 1fr; }
  .pj-adj.next { text-align: left; }
  .index-grid { grid-template-columns: 1fr; }
  .pj-cta { width: 100%; justify-content: center; }
  .pj-cap { display: none; }   /* drop the image caption on mobile, keep it on desktop */
}
