/* ============================================================
   MNRL — site world (v1 "Loop" direction)
   Shared dark monochrome frame for case studies + contact.
   Client work supplies all color.
   ============================================================ */
:root {
  --paper: #0a0a0a; --ink: #f5f4f0; --quiet: #8a8a86;
  --rule: rgba(245,244,240,0.16); --print: #141412;
}
body { background: var(--paper); color: var(--ink); }
::selection { background: var(--ink); color: var(--paper); }

/* NAV */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 30; display:flex; justify-content: space-between;
  align-items:center; padding: 20px var(--gutter); mix-blend-mode: difference; color:#fff;
  transition: transform .5s var(--ease); }
.nav.nav--hidden { transform: translateY(-120%); }
.nav .mark { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.44em; text-indent:0.44em; font-size: 15px; }
.nav .r { display:flex; gap: 22px; align-items:center; font-family: var(--font-mono); font-size: 11px; letter-spacing:0.14em; text-transform:uppercase; }
.nav .r a { position: relative; }
.nav .r a::after { content:""; position:absolute; left:0; right:100%; bottom:-4px; height:1px; background: currentColor; transition: right .3s var(--ease); }
.nav .r a:hover::after { right:0; }
/* v4 · persistent navigation carries six destinations — it wraps rather than
   dropping any of them, so nothing becomes footer-only on small screens. */
@media (max-width: 1000px) {
  .nav { flex-wrap: wrap; row-gap: 8px; padding-block: 12px; }
  .nav .r { flex-wrap: wrap; gap: 8px 14px; font-size: 10px; letter-spacing: 0.1em; }
}
@media (max-width: 620px) { .nav .r { width: 100%; } }

/* Section frame */
.sec { position: relative; padding: clamp(70px,11vh,150px) 0; }
.idx { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--quiet); margin-bottom: 26px; display:flex; gap: 14px; align-items:center; }
.idx::before { content:""; width: 40px; height:1px; background: var(--rule); }

h1,h2,h3 { font-family: var(--font-display); }
.display { font-weight: 900; text-transform: uppercase; line-height: 0.86; letter-spacing: -0.035em; }

/* Buttons / links */
.btn { display:inline-flex; gap: 12px; align-items:center; font-family: var(--font-mono); font-size: 13px;
  letter-spacing: 0.16em; text-transform: uppercase; border: 1px solid var(--ink); padding: 16px 30px;
  transition: background .2s var(--ease), color .2s var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper); }
.tlink { text-decoration: underline; text-underline-offset: 4px; }

/* MARQUEE */
/* .marq is an <a>, i.e. inline by default — and `overflow` does nothing on a
   non-replaced inline box, so the 3500px scrolling row was escaping and giving
   the page a real horizontal scrollbar. Making it a block lets the clip apply. */
.marq { display: block; border-block: 1px solid var(--rule); overflow: hidden; padding-block: 20px; }
.marq__row { display:flex; gap: 44px; width: max-content; animation: marq 34s linear infinite; }
.marq__row span { font-family: var(--font-impact); text-transform: uppercase; font-size: clamp(30px,5vw,72px);
  line-height: 1; white-space: nowrap; }
.marq__row span:nth-child(even){ color: transparent; -webkit-text-stroke: 1px var(--ink); }
@keyframes marq { to { transform: translateX(-50%); } }
.marq:hover .marq__row { animation-play-state: paused; }

/* FOOTER */
.foot { border-top: 1px solid var(--rule); padding: 40px 0; }
.foot .wrap { display:flex; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); }
.foot a { color: var(--ink); }

/* ---------- CASE STUDY ---------- */
.cs-hero { min-height: 92svh; display:flex; flex-direction: column; justify-content: flex-end; padding: 120px 0 0; position: relative; overflow: hidden; }
.cs-hero .meta-top { font-family: var(--font-mono); font-size: 12px; letter-spacing:0.16em; text-transform:uppercase; color: var(--quiet); margin-bottom: 24px; }
.cs-hero h1 { font-weight: 900; text-transform: uppercase; font-size: clamp(56px,14vw,220px); line-height: 0.82; letter-spacing: -0.04em; }
.cs-hero h1 .o { color: transparent; -webkit-text-stroke: 1.4px var(--ink); }
.cs-sub { display:grid; grid-template-columns: repeat(12,1fr); column-gap: clamp(14px,1.6vw,28px); row-gap: 20px; margin: 44px 0 0; align-items: end; }
.cs-sub .lead { grid-column: 1 / 8; font-size: clamp(18px,2.2vw,26px); line-height: 1.32; }
.cs-sub .facts { grid-column: 9 / 13; display:grid; gap: 14px; align-self: start; }
.cs-sub .facts div { border-top: 1px solid var(--rule); padding-top: 10px; }
.cs-sub .facts .k { font-family: var(--font-mono); font-size: 10px; letter-spacing:0.14em; text-transform:uppercase; color: var(--quiet); }
.cs-sub .facts .v { font-size: 15px; margin-top: 3px; }

.cs-media { position: relative; overflow: hidden; margin: clamp(40px,6vw,80px) 0; }
.cs-media--bleed { margin-inline: calc(-1 * var(--gutter)); }
.cs-media img, .cs-media video { width: 100%; display:block; object-fit: cover; }
.cs-media figcaption { font-family: var(--font-mono); font-size: 11px; letter-spacing:0.08em; text-transform:uppercase; color: var(--quiet); margin-top: 12px; }

.cs-chapter h2 { font-weight: 900; text-transform: uppercase; font-size: clamp(34px,6vw,96px); line-height: 0.88; letter-spacing:-0.03em; max-width: 15ch; }
.cs-body { display:grid; grid-template-columns: repeat(12,1fr); column-gap: clamp(14px,1.6vw,28px); margin-top: clamp(24px,3vw,44px); }
.cs-body p { grid-column: 2 / 9; font-size: clamp(16px,1.5vw,19px); line-height: 1.6; color: var(--ink); }
.cs-body p + p { margin-top: 20px; }
.cs-body .q { color: var(--quiet); }
@media (max-width: 820px){ .cs-body p { grid-column: 1 / 13; } .cs-sub .lead,.cs-sub .facts{ grid-column: 1/13; } }

.cs-quote { padding: clamp(50px,9vh,130px) 0; }
.cs-quote blockquote { font-family: var(--font-display); font-weight: 800; text-transform: none;
  font-size: clamp(28px,5vw,68px); line-height: 0.98; letter-spacing:-0.03em; max-width: 20ch; }
.cs-quote cite { display:block; margin-top: 24px; font-family: var(--font-mono); font-style: normal;
  font-size: 12px; letter-spacing:0.12em; text-transform:uppercase; color: var(--quiet); }

.cs-grid { display:grid; gap: clamp(12px,1.6vw,22px); }
.cs-grid--2 { grid-template-columns: 1fr 1fr; }
.cs-grid--3 { grid-template-columns: repeat(3,1fr); }
.cs-grid img { width:100%; height:100%; object-fit: cover; aspect-ratio: 4/5; }
@media (max-width: 720px){ .cs-grid--2,.cs-grid--3 { grid-template-columns: 1fr; } }

.cs-outcome { display:grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 40px; }
.cs-outcome div { background: var(--paper); padding: 24px 22px; }
.cs-outcome .k { font-family: var(--font-mono); font-size: 11px; letter-spacing:0.1em; text-transform:uppercase; color: var(--quiet); }
.cs-outcome .v { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px,2.6vw,30px); letter-spacing:-0.01em; margin-top: 8px; }

.cs-services { display:flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.cs-services span { font-family: var(--font-mono); font-size: 12px; letter-spacing:0.04em; border: 1px solid var(--rule); padding: 9px 16px; color: var(--quiet); }

/* NEXT project */
.cs-next { border-top: 1px solid var(--rule); }
.cs-next a { display:grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items:center; padding: clamp(40px,7vh,90px) 0; }
.cs-next .k { font-family: var(--font-mono); font-size: 11px; letter-spacing:0.14em; text-transform:uppercase; color: var(--quiet); }
.cs-next .t { font-family: var(--font-display); font-weight: 900; text-transform:uppercase; font-size: clamp(30px,6vw,84px); line-height:0.9; letter-spacing:-0.03em; transition: transform .4s var(--ease); }
.cs-next a:hover .t { transform: translateX(14px); }

/* ---- Interactive headings (liquid hover + hold-to-magnify) ----
   Owner: every page except /racership/ gets the H1 ripple. The behaviour is
   wired by interactions.js ("h1, .h-int"); these are the only styles it needs,
   lifted from namma.css so /contact/ and /media-lab/ don't have to pull in the
   whole homepage stylesheet. */
.h-int { cursor: default; }
.h-int .wd { display: inline-block; white-space: nowrap; }
.h-int .ltr { display: inline-block; will-change: transform;
  transition: transform .5s var(--ease, cubic-bezier(.22,1,.36,1)); transform-origin: center 80%; }
.h-int:active { cursor: grabbing; }
@media (hover:hover) and (pointer:fine){ .h-int { cursor: grab; } }
.h-int-lens { color: inherit; transform-origin: 50% 50%;
  transition: transform .45s var(--ease, cubic-bezier(.22,1,.36,1)); }
.h-int-lens .ltr { transform: none !important; }
@media (prefers-reduced-motion: reduce){
  .h-int .ltr { transform: none !important; }
  .h-int-lens { transition: none; }
}

/* ---- The floating reader ----
   Long copy folds out of the scroll and opens as a magazine spread. The source
   markup stays in the page; .has-fold is set by reader.js only once it can
   give the copy back, so with JavaScript off nothing is hidden. */
.rs-fold-btn { display:inline-flex; align-items:center; gap:12px;
  font-family:var(--font-mono); font-size:11px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink); border:1px solid var(--rule); background:transparent;
  padding:14px 22px; border-radius:100px; cursor:pointer; margin-top:6px;
  transition:background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.rs-fold-btn:hover { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.rs-fold-btn:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.rs-fold-arrow { transition:transform .3s var(--ease); }
.rs-fold-btn:hover .rs-fold-arrow { transform:translate(3px,-3px); }
/* only hide the prose once the reader is live */
.has-fold [data-fold] > *:not([data-fold-ui]) { display:none; }

.rd { border:0; padding:0; background:transparent; max-width:none; max-height:none;
  width:100%; height:100%; overflow:visible; color:var(--ink); }
.rd::backdrop { background:rgba(6,6,8,.72);
  -webkit-backdrop-filter:blur(12px) saturate(1.1); backdrop-filter:blur(12px) saturate(1.1); }
.rd-sheet { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:min(1040px, calc(100vw - 2 * var(--gutter))); max-height:min(86svh, 900px);
  overflow:auto; overscroll-behavior:contain;
  background:var(--print); border:1px solid rgba(255,255,255,.16); border-radius:6px;
  padding:clamp(26px,4vw,64px);
  box-shadow:0 70px 140px -46px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.05),
    inset 0 1px 0 rgba(255,255,255,.14);
  animation:rd-in .5s var(--ease) both; }
.rd.is-still .rd-sheet { animation:none; }
@keyframes rd-in { from { opacity:0; transform:translate(-50%,-46%) scale(.97); }
                   to   { opacity:1; transform:translate(-50%,-50%) scale(1); } }
.rd-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px;
  padding-bottom:16px; border-bottom:1px solid var(--rule); }
.rd-eyebrow { font-family:var(--font-mono); font-size:10px; letter-spacing:.2em;
  text-transform:uppercase; color:var(--quiet); margin:0; }
.rd-close { font-family:var(--font-mono); font-size:10px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--quiet); background:none; border:0; cursor:pointer;
  padding:2px 0; transition:color .25s var(--ease); }
.rd-close:hover { color:var(--ink); }
.rd-close:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.rd-title { font-family:var(--font-display); font-weight:900; text-transform:uppercase;
  font-size:clamp(26px,4vw,64px); line-height:.9; letter-spacing:-.035em;
  margin:clamp(18px,2.4vw,32px) 0 clamp(16px,2vw,28px); max-width:20ch; }
/* the spread — two columns on a wide sheet, one on a narrow one */
.rd-body { columns:2; column-gap:clamp(26px,3.4vw,56px); }
@media (max-width:760px){ .rd-body { columns:1; } }
.rd-body > * { break-inside:avoid; }
.rd-body p { font-size:clamp(15px,1.35vw,17px); line-height:1.68; margin:0 0 1.05em;
  color:rgba(255,255,255,.82); }
.rd-body p:first-of-type::first-letter { float:left; font-family:var(--font-display);
  font-weight:900; font-size:3.4em; line-height:.78; padding:.06em .12em 0 0; color:var(--ink); }
.rd-body ul, .rd-body ol { margin:0 0 1.05em; padding-left:1.1em; }
.rd-body li { font-size:clamp(14px,1.25vw,16px); line-height:1.6; margin-bottom:.5em;
  color:rgba(255,255,255,.78); }
.rd-body li b { color:var(--ink); display:block; font-family:var(--font-display);
  font-weight:700; margin-bottom:3px; }
.rd-body .grid { display:block; background:none; border:0; }
.rd-body .grid li { background:none; padding:0 0 .6em; border:0; }
.rd-foot { display:flex; justify-content:space-between; gap:16px; margin:clamp(20px,2.6vw,34px) 0 0;
  padding-top:14px; border-top:1px solid var(--rule);
  font-family:var(--font-mono); font-size:9px; letter-spacing:.16em;
  text-transform:uppercase; color:var(--quiet); }

/* ---- Live card inside the reader ----
   The pop-out that explains the card now shows one. Hover lifts the helmet
   (pure CSS, so it survives reader.js cloning the node); activating turns it
   over. Same backface-culling contract as the full card on the page: flat
   faces, hidden backfaces, symmetric easing so 90° lands at the midpoint. */
/* exactly two cells: the card, and one column holding everything else */
.rd-body--card { columns: auto; display: grid;
  grid-template-columns: minmax(0,270px) minmax(0,1fr);
  gap: clamp(22px,2.6vw,40px); align-items: start; }
@media (max-width: 760px) { .rd-body--card { grid-template-columns: 1fr; } }
.rd-col > *:last-child { margin-bottom: 0; }
.rdcard { align-self: start; perspective: 1200px;
  cursor: pointer; border: 0; background: none; padding: 0; }
.rdcard:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
/* preserve-3d on the ROTATING wrapper, flat faces inside it — that is what
   lets backface-visibility cull the front. With `flat` here the parent
   flattens first and the front renders mirrored instead of being hidden. */
.rdcard-in { position: relative; aspect-ratio: 5/7; transform-style: preserve-3d;
  transform: rotateY(var(--f,0deg));
  transition: transform .8s cubic-bezier(.65,0,.35,1); }
.rdcard[aria-pressed="true"] .rdcard-in { --f: 180deg; }
.rdcard-face { position: absolute; inset: 0; border-radius: 7px; overflow: hidden;
  isolation: isolate; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.14); }
.rdcard-front { transform: rotateY(0deg); background: #0c0c0e; }
.rdcard-back { transform: rotateY(180deg); background: #101014;
  display: flex; flex-direction: column; gap: 10px; padding: 16px 15px; }
.rdcard-lay { position: absolute; inset: 0; }
.rdcard-lay img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The helmet lifts exactly the way the real card does it: the off layer stays
   fully opaque and a travelling radial mask punches a hole through it that
   follows the cursor. An opacity crossfade is a different effect — the whole
   image dissolving rather than the helmet melting where you point. Driven by
   reader.js, which delegates pointermove because the node is cloned on open. */
.rdcard-off { will-change: mask-image;
  -webkit-mask-image: radial-gradient(circle var(--rr,0px) at var(--rx,-400px) var(--ry,-400px), #000 0%, transparent 100%);
  mask-image: radial-gradient(circle var(--rr,0px) at var(--rx,-400px) var(--ry,-400px), #000 0%, transparent 100%); }
/* the glow ring that rides the reveal edge, same as .holo .revealring */
.rdcard-ring { position: absolute; inset: 0; pointer-events: none; z-index: 3;
  opacity: 0; transition: opacity .35s var(--ease); mix-blend-mode: screen;
  background: radial-gradient(circle var(--rr,0px) at var(--rx,-400px) var(--ry,-400px),
    transparent 0%, transparent 62%, rgba(190,220,255,.30) 80%, transparent 92%); }
.rdcard.is-revealing .rdcard-ring { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  /* no cursor chase — the face is simply shown */
  .rdcard-off { -webkit-mask-image: none; mask-image: none; }
  .rdcard-ring { display: none; }
}
.rdcard-foil { position: absolute; inset: 0; mix-blend-mode: screen; opacity: .16;
  background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,.75) 50%, transparent 64%);
  transition: opacity .5s var(--ease); }
.rdcard:hover .rdcard-foil { opacity: .3; }
.rdcard-ui { position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: space-between; padding: 12px 13px;
  background: linear-gradient(to top, rgba(0,0,0,.86) 5%, rgba(0,0,0,.2) 44%, transparent 70%); }
.rdcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rdcard-mark { font-family: var(--font-mono); font-size: 7px; letter-spacing: .16em;
  color: rgba(255,255,255,.72); }
.rdcard-mark i { font-style: normal; opacity: .5; }
.rdcard-num { font-family: var(--font-display); font-weight: 900; font-size: 22px;
  line-height: 1; color: #fff; }
.rdcard-nm { display: block; font-family: var(--font-display); font-weight: 900;
  text-transform: uppercase; font-size: 17px; line-height: .94; letter-spacing: -.02em; color: #fff; }
.rdcard-disc { display: block; margin-top: 4px; font-family: var(--font-mono);
  font-size: 7.5px; letter-spacing: .13em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.rdcard-bnm { font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: 16px; line-height: 1; letter-spacing: -.02em; color: #fff; }
.rdcard-tbl { width: 100%; border-collapse: collapse; }
.rdcard-tbl td { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.55); }
.rdcard-tbl td + td { text-align: right; color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 12px; letter-spacing: 0; }
.rdcard-spon { display: flex; gap: 4px; margin-top: auto; }
.rdcard-spon i { flex: 1; height: 17px; border: 1px dashed rgba(255,255,255,.24); border-radius: 2px; }
.rdcard-hint { display: block; margin-top: 10px; font-family: var(--font-mono);
  font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--quiet); }
@media (prefers-reduced-motion: reduce) {
  .rdcard-in, .rdcard-off, .rdcard-foil { transition: none; }
}
