/* ==========================================================================
   NeoGenesis Capital — mobile / narrow-viewport layout (≤ 900px)
   The desktop page is authored on a fixed 1440px stage that is scaled to fit. Below 900px that scale makes
   the type unreadable, so the stage (Hero → Platform) is swapped for the normal-flow `.m-stage` markup in
   index.html, and the flow sections (Momentum, Press, Portfolio, Leadership, footer) get tighter rules.
   ========================================================================== */

.m-only { display: none; }

@media (max-width: 900px) {
  :root {
    --fs-display: clamp(38px, 10.5vw, 56px);
    --fs-h1: clamp(30px, 8vw, 40px);
    --fs-h2: clamp(22px, 5.8vw, 28px);
    --fs-lead: clamp(18px, 4.8vw, 22px);
    --fs-stat: clamp(44px, 12vw, 60px);
  }
  .m-only { display: block; }
  .flow, .m-stage, .hero-fixed { overflow-x: clip; }

  /* ---- hide the scaled stage; keep the fixed hero video and make it cover the screen ---- */
  .viewport { display: none; }
  .hero-stage { transform: none !important; left: 0 !important; width: 100%; height: 100% !important; }
  .hero-stage section.layer { width: 100%; }
  .hero-stage section.layer > header, .hero-stage section.layer > .tagline, .hero-stage section.layer > .hero-blurb, .hero-stage section.layer > .abs.reveal { display: none; }
  /* video fits the screen width (no side crop) and sits in the gap between the nav and the headline block;
     script.js measures that gap and sets top/bottom here so it never runs under the text */
  .hero-bg { inset: 0; }
  .hero-bg video { left: 0; top: 0; width: 100%; height: 100%; transform: none; object-fit: contain; object-position: center; }
  .hero-spacer { height: 100svh; }

  /* ---- mobile hero chrome (inside .hero-fixed, above the video) ---- */
  .m-hero { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; padding: calc(30px + 22px) 20px 28px; color: var(--c-white); }   /* 30px = announcement band */
  .hero-band { height: 30px; gap: 10px; font-size: var(--fs-caption); }
  .hero-band .hb-tag, .hero-band .hb-long { display: none; }   /* keep the strip to one short line on phones */
  .m-nav { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
  .m-logo { display: block; width: 168px; }
  .m-logo img { display: block; width: 100%; height: auto; }
  .m-logo img + img { width: 56%; margin-top: 6px; }
  .m-menu-btn { appearance: none; -webkit-appearance: none; margin: 0; padding: 7px 12px; border: 1px solid rgba(255,255,255,.5); border-radius: 0; background: rgba(0,0,0,.35); color: var(--c-white);
    font-family: var(--f-mono); font-size: var(--fs-micro); line-height: 1.4; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
  .m-menu-btn[aria-expanded="true"] { background: var(--c-green); border-color: var(--c-green); color: var(--c-black); }
  .m-menu { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 24px; background: rgba(0,0,0,.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .m-menu[hidden] { display: none; }
  .m-menu a { color: var(--c-white); text-decoration: none; font-weight: 300; font-size: clamp(30px, 8vw, 40px); line-height: 1.3; }
  .m-menu a.m-menu-contact { margin-top: 18px; display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; padding: 12px 18px; background: var(--c-green); color: var(--c-black); font-weight: 500; font-size: var(--fs-body); }
  .m-menu-close { position: absolute; right: 20px; top: 22px; }
  .m-menu .ocr10 { color: var(--c-gray-600); margin: 0 0 14px; }
  .m-hero-foot { display: grid; gap: 18px; }
  .m-tagline { margin: 0; font-size: calc(var(--fs-display) * .8); line-height: 1.05; font-weight: 200; }
  .m-tagline b { display: block; font-weight: 700; }
  .m-blurb { margin: 0; max-width: 34ch; font-family: var(--f-mono); font-size: var(--fs-micro); line-height: 1.6; color: var(--c-gray-100); }
  .m-scroll { position: relative; display: block; width: 33px; height: 33px; justify-self: end; transform: rotate(90deg) scaleY(-1); }

  /* ---- generic mobile section chrome ---- */
  .m-stage { position: relative; z-index: 2; background: var(--c-black); }
  .m-sec { position: relative; padding: 64px 20px 72px; overflow: hidden; }
  .m-sec > * { position: relative; z-index: 1; }
  .m-sec.noise::after { z-index: 0; }
  .m-light { background: var(--c-gray-100); color: var(--c-black); }
  .m-dark { background: var(--c-black); color: var(--c-white); }
  .m-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; }
  .m-eyebrow::before { content: ""; width: 5px; height: 5px; background: currentColor; }
  .m-eyebrow.t-green::before { background: var(--c-green); }
  .m-display { margin: 0; font-weight: 700; font-size: var(--fs-display); line-height: 1.05; }
  .m-h1 { margin: 0; font-weight: 700; font-size: var(--fs-h1); line-height: 1.12; }
  .m-h2 { margin: 0; font-weight: 700; font-size: var(--fs-h2); line-height: 1.15; }
  .m-lead { margin: 0; font-size: var(--fs-lead); line-height: 1.3; }
  .m-p { margin: 0; font-size: var(--fs-body); line-height: 1.5; }
  .m-rule { height: 1px; background: currentColor; opacity: .18; margin: 36px 0; }
  .m-fig { margin: 0; }
  .m-fig img { display: block; width: 100%; height: auto; }
  .m-slashes { margin: 0; font-family: var(--f-mono); font-size: var(--fs-micro); line-height: 1.4; letter-spacing: .02em; opacity: .7; }
  .m-stack > * + * { margin-top: 18px; }

  /* thesis */
  .m-thesis .m-display { text-transform: capitalize; }
  .m-mammoth { margin: 28px -20px 0; }
  .m-mammoth img { width: 100%; height: auto; display: block; }
  .m-band .m-eyebrow { margin-bottom: 22px; }
  .m-band { margin: 40px 0 0; padding: 0; background: transparent; color: var(--c-black); }
  .m-band .a { margin: 0; font-weight: 700; font-size: var(--fs-h2); line-height: 1.2; color: var(--c-black); }
  .m-band .b { margin: 14px 0 0; font-weight: 400; font-size: var(--fs-h2); line-height: 1.2; color: #4a4a4a; }
  .m-band .m-p { margin-top: 26px; color: var(--c-ink); }
  .m-band .link { color: var(--c-black); text-decoration: underline; text-underline-offset: 3px; }
  .m-cce { padding-top: 56px; }
  .m-cce .m-lead { margin-top: 22px; font-weight: 700; }
  .m-cce .m-p { margin-top: 18px; color: var(--c-ink); }
  .m-cell { position: relative; margin: 40px -20px 0; aspect-ratio: 4 / 3; background: var(--c-black); overflow: hidden; }
  .m-cell .m-cell-photo { position: absolute; left: 50%; top: 50%; width: 150%; height: auto; transform: translate(-50%, -50%) rotate(180deg); }
  .m-cell .m-cell-tl { position: absolute; left: 20px; top: 18px; margin: 0; }
  .m-cell .m-cell-bl { position: absolute; left: 20px; bottom: 18px; margin: 0; }
  .m-cell .m-cell-br { position: absolute; right: 20px; bottom: 14px; width: 120px; }
  .m-cell .ocr10 p { margin: 0; }

  /* snapshot */
  .m-snapshot .m-clogo { display: block; width: 62%; max-width: 300px; height: auto; margin: 18px 0 0; }
  .m-snapshot .m-hazard { display: block; width: 74%; max-width: 375px; height: auto; margin: 26px 0 0; }
  .m-snapshot .m-p { margin-top: 28px; }
  .m-snapshot .m-p .muted { color: var(--c-gray-600); }
  .m-stats { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .m-stats li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.18); }
  .m-stats b { font-weight: 200; font-size: var(--fs-stat); line-height: 1; color: var(--c-green); white-space: nowrap; }
  .m-stats span { font-weight: 200; font-size: var(--fs-lead); line-height: 1.2; text-align: right; }
  .m-stats small { display: block; margin-top: 6px; }
  .m-lab { margin: 36px -20px 0; height: 220px; overflow: hidden; }
  .m-lab img { width: 100%; height: 100%; object-fit: cover; display: block; }

  /* platform */
  .m-platform .m-lead { margin-top: 26px; }
  .m-platform .m-lead .muted { color: var(--c-gray-600); }
  .m-pipeline { margin: 40px -20px 0; padding: 26px 20px 28px; background: var(--c-black); color: var(--c-white); }
  .m-pipeline .m-fig { margin: 18px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .m-pipeline .m-fig img { width: 200%; min-width: 640px; }
  .m-steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
  .m-steps li { position: relative; padding: 8px 0 8px 12px; border-left: 1px solid var(--c-green); font-family: var(--f-mono); font-size: var(--fs-micro); line-height: 1.5; text-transform: uppercase; color: var(--c-gray-100); }
  .m-steps li i { display: block; font-style: normal; color: var(--c-gray-600); }
  .m-pipeline .m-key { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; }
  .m-pipeline .m-key::before { content: ""; width: 10px; height: 10px; background: var(--c-green); }
  .m-fullstack { position: relative; margin: 40px -20px 0; padding: 36px 20px 40px; background: var(--c-black); color: var(--c-white); overflow: hidden; }
  .m-fullstack .m-dna { position: absolute; right: -30%; top: -10%; width: 120%; opacity: .55; pointer-events: none; }
  .m-fullstack > * { position: relative; }
  .m-fullstack .m-p { margin-top: 16px; color: var(--c-gray-100); }
  .m-cards { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
  .m-card { position: relative; padding: 18px 18px 20px; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; background: rgba(255,255,255,.04); display: grid; grid-template-columns: 52px 1fr auto; column-gap: 16px; align-items: start; }
  .m-card img { width: 44px; height: 44px; object-fit: contain; display: block; }
  .m-card h4 { margin: 0; font-weight: 900; font-size: var(--fs-lead); line-height: 1.1; }
  .m-card p { margin: 8px 0 0; font-size: var(--fs-small); line-height: 1.45; color: var(--c-gray-100); }
  .m-card .m-num { font-family: var(--f-mono); font-size: var(--fs-micro); color: var(--c-gray-600); line-height: 1.4; }
  .m-card .m-slashes { grid-column: 2; margin-top: 12px; color: var(--c-green); opacity: 1; }
  .m-mom-tab { padding: 26px 20px 0; background: var(--c-black); text-align: center; }
  .m-mom-tab p { margin: 0; }

  /* ---- flow sections ---- */

  .pf-frame { padding-top: 88px; padding-bottom: 72px; }
  .pf-canvas, .pf-port { display: none; }
  .pf-src { padding-bottom: 0; }
  .pf-src-grid { grid-template-columns: 1fr; gap: 20px; }
  .pf-src-logo { width: 200px; }
  .pf-cards { grid-template-columns: 1fr; margin-top: 28px; gap: 14px; }
  .pf-card { transform: none !important; }
  .js .pf-cards .reveal { opacity: 1; translate: 0 0; }     /* no strands to wait for on mobile */
  .pf-marks { display: none; }

  .ld-frame { padding: 96px 20px 80px; }
  .ld-cluster-tr, .ld-rule { display: none; }
  .ld-head { gap: 22px; }
  .ld-eyebrow { margin-bottom: 0; }
  .ld-sq { left: -14px; }
  .pf-sq { left: -14px; }
  .ld-dots { display: none; }
  .ld-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .ld-tile { min-width: 0; }
  .ld-meta, .ld-cap .ocr10 { white-space: normal; }
  .ld-tab { height: 96px; }
  .ld-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .ld-grid-row2 { grid-template-columns: minmax(0, 1fr); width: calc(50% - 7px); margin: 14px auto 0; }
  .ld-side-label { position: static; width: 150px; margin: 22px auto 0; }
  .ld-links { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ld-logo { aspect-ratio: auto; padding: 20px 0 6px; align-items: flex-start; }
  .ld-logo img { width: 56%; max-width: 260px; }
  .ld-logo img + img { width: 32%; max-width: 146px; }
  .ld-note-col { grid-column: 1 / -1; aspect-ratio: auto; }
  .ld-note { min-height: 0; }
  .ld-note-under { margin-top: 18px; }
  .ld-cmark { width: 56px; }
  .ld-eye { width: 72px; }
  .ld-name { font-size: var(--fs-lead); }
  .ld-bio { display: none; }                 /* touch: tap a portrait to open its bio (leadership.js toggles .is-open) */
  .ld-tile.is-open { grid-column: 1 / -1; }  /* open tile spans the row so the bio has room */
  .ld-tile.is-open .ld-bio { display: block; transform: none; }
  .m-snapshot .m-p .snap-p2 { display: block; margin-top: 1em; }
  .m-band .m-p + .m-p { margin-top: 14px; }
  .ld-cluster { display: none; }
  .ld-group-head { gap: 12px; }
  .ld-group-head .ocr12 { white-space: nowrap; flex: none; }
  .ld-marks { flex: 1 1 0; min-width: 0; overflow: hidden; }
  .ld-hazard { width: 96px; flex: none; }
  .ld-marks img { display: none; }
  .ld-marks img:first-child { display: block; }

  .foot-wrap { padding-left: 20px; padding-right: 20px; }
  .foot-marks { height: 104px; margin-top: 28px; }     /* room for the absolutely-placed tagline + badge before the column rule */
  .foot-cols { margin-top: 48px; }
}

@media (max-width: 420px) {
  .m-steps { grid-template-columns: 1fr; }
}

/* ---- Press strip on phones: one row of logos that flows continuously (was a cramped 4-column grid) ---- */
@media (max-width: 900px) {
  .seen-frame { padding-left: 0; padding-right: 0; }
  .seen-label { padding: 0 20px; }
  .seen-flow { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%); }
  .seen-grid { display: flex; flex-wrap: nowrap; width: max-content; gap: 0; animation: seen-flow var(--seen-dur, 30s) linear infinite; will-change: transform; }
  .seen-grid li, .seen-grid li.seen-clone { display: flex; flex: 0 0 auto; height: 64px; padding: 0 26px; opacity: 1 !important; translate: none !important; }
  .seen-grid img { max-width: 132px; max-height: 30px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .seen-grid { animation: none; }
  .seen-flow { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .seen-grid li.seen-clone { display: none; }
}
@media (max-width: 900px) { .hero-band[hidden] ~ .hero-stage .m-hero { padding-top: 22px; } }   /* no band: drop its 30px from the top padding */
@media (max-width: 900px) { .hero-bg .hero-anim { left: 0; top: 0; width: 100%; height: 100%; transform: none; object-fit: contain; object-position: center; } }   /* same box as the phone video */
