/* ============================================================
   REMÉ MARSHALL — Cinematic Experience
   Dark coral/pink system · scroll-scrubbed stage
   
   Adapted from TD. design by Toriq — used with permission.
   ============================================================ */

/* ── Fonts ───────────────────────────────────────────────── */
/* Anton (hero/display) + IBM Plex Sans (everything else) load via
   the <link> tags in index.html — Google Fonts. */

/* ── Design System ────────────────────────────────────────── */
:root {
  --bg: #050505;
  --bg-hi: #0d0d0d;
  --ink: #f5f5f5;
  --muted: #b0b0b0;
  --faint: #666;
  --pink: #ff2f92;
  --coral: #ff5f6f;
  --pink2: #ff77c8;
  --pink-glow: rgba(255, 47, 146, 0.28);
  --coral-dim: rgba(255, 95, 111, 0.15);
  --sh-dark: rgba(0, 0, 0, 0.55);
  --sh-darker: rgba(0, 0, 0, 0.7);
  --sh-light: rgba(255, 255, 255, 0.06);
  --raise: 8px 8px 20px var(--sh-dark), -4px -4px 12px var(--sh-light);
  --raise-sm: 4px 4px 12px var(--sh-dark), -2px -2px 8px var(--sh-light);
  --press: inset 3px 3px 8px rgba(0, 0, 0, 0.5), inset -2px -2px 6px rgba(255, 255, 255, 0.04);
  --display: 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --orb: clamp(140px, 32vmin, 22rem);
  --sceneY: 44%;
  --live: #ff2f92;
}

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

html { scroll-behavior: auto; font-size: clamp(15px, 0.62vw + 8px, 26px); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--pink); color: var(--bg); }

/* ============ stage & layers ============ */

.stage {
  position: fixed; inset: 0;
  overflow: hidden;
  display: none;
  background: var(--bg);
}
body.experience .stage { display: block; }
body.experience .fallback { display: none; }
body.experience .scroll-track { pointer-events: none; }

.layer { position: absolute; inset: 0; }

/* ============ environment ============ */

.env { opacity: 0; will-change: opacity; }

.env-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 47, 146, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(255, 95, 111, 0.06), transparent 50%);
  pointer-events: none;
  will-change: opacity;
}

.portal-wrap {
  position: absolute; left: 50%; top: var(--sceneY);
  width: min(102vmin, 1500px); height: min(102vmin, 1500px);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.portal {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 47, 146, 0.06), rgba(255, 95, 111, 0.04), transparent);
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(circle, #000 40%, transparent 68%);
  mask-image: radial-gradient(circle, #000 40%, transparent 68%);
  pointer-events: none;
}

.grid-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 47, 146, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 47, 146, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  will-change: transform, opacity;
}

/* ============ 3D world & orbs ============ */

.world3d { perspective: 1100px; perspective-origin: 50% var(--sceneY); }
.world { position: absolute; inset: 0; transform-style: preserve-3d; }

.orb {
  position: absolute;
  left: 50%; top: var(--sceneY);
  width: var(--orb); height: var(--orb);
  margin: calc(var(--orb) / -2) 0 0 calc(var(--orb) / -2);
  will-change: transform, opacity;
  opacity: 0;
  pointer-events: none;
}
.orb-sphere {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255, 47, 146, 0.22), #0d0d0d 60%, #050505 100%);
  border: 1px solid rgba(255, 47, 146, 0.09);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    inset 0 -12px 24px rgba(0, 0, 0, 0.45),
    inset 0 10px 20px rgba(255, 255, 255, 0.05);
  display: grid; place-items: center;
}
.orb-disc {
  width: 68%; height: 68%;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: grid; place-items: center;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.5);
}
.orb-disc img {
  width: 64%; height: 64%;
  border-radius: 50%;
  user-select: none;
}
.orb-disc img.fit-cover { object-fit: cover; }
.orb-disc img.fit-contain { width: 72%; height: 72%; object-fit: contain; padding: 8%; border-radius: 0; }

/* Orb color variants */
.orb:nth-child(1) .orb-sphere { border-color: rgba(255, 95, 111, 0.12); }
.orb:nth-child(2) .orb-sphere { border-color: rgba(255, 47, 146, 0.12); }
.orb:nth-child(3) .orb-sphere { border-color: rgba(255, 119, 200, 0.12); }
.orb:nth-child(4) .orb-sphere { border-color: rgba(255, 95, 111, 0.10); }

/* ============ hero layer ============ */

.heroLayer { will-change: opacity; }

.hero-video {
  position: absolute; left: 50%; top: 50%;
  width: 100.5%; height: 100.5%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  pointer-events: none; user-select: none;
  will-change: transform;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 5, 5, 0.7) 0%,
    rgba(5, 5, 5, 0.2) 40%,
    rgba(5, 5, 5, 0.4) 70%,
    rgba(5, 5, 5, 0.85) 100%
  );
  pointer-events: none;
}

.hero-letters {
  position: absolute; inset: 0;
  pointer-events: none;
}
.letter {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-weight: 950;
  font-size: clamp(5rem, 20vmin, 14rem);
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  will-change: transform, opacity;
}
.letter-r { left: 50%; margin-left: -0.72em; }
.letter-m { left: 50%; margin-left: 0.02em; }

.hero-intro {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(9vh + env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  will-change: transform, opacity;
}
.hero-tagline {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(0.72rem, 0.9vw, 0.9rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.7;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: calc(3.4vh + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display);
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  will-change: opacity;
}
.scroll-cue svg { animation: cue-bob 1.8s ease-in-out infinite; }
@keyframes cue-bob {
  0%, 100% { transform: translateY(-2px); opacity: 0.55; }
  50% { transform: translateY(3px); opacity: 1; }
}

/* ============ fixed UI ============ */

.ui { pointer-events: none; z-index: 6; }
.ui > * { pointer-events: auto; }

#brand {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  left: clamp(20px, 4vw, 44px);
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border: none; cursor: pointer;
  padding: 10px 16px;
  border-radius: 16px;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.3s ease;
}
#brand:hover { opacity: 1 !important; }

.section-label {
  position: absolute;
  top: calc(30px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--body);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
  white-space: nowrap;
}

/* --- project card dock --- */

.card-dock {
  position: absolute;
  left: 50%;
  bottom: calc(2.6rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 52rem);
  height: auto;
  pointer-events: none;
}

.card-dock .card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.85rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  padding: 1.15rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo head actions"
    "logo desc actions";
  column-gap: 1.15rem;
  row-gap: 0.15rem;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
  pointer-events: auto;
}
.card-head, .card-desc, .card-actions { will-change: transform, opacity; }

.card-logo {
  grid-area: logo;
  width: 4.4rem; height: 4.4rem;
  border-radius: 0.6rem;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: grid; place-items: center;
  align-self: center;
}
.card-logo img { width: 100%; height: 100%; border-radius: 0.6rem; object-fit: contain; padding: 10%; }

.card-head {
  grid-area: head;
  display: flex; align-items: baseline; gap: 0.75rem;
  min-width: 0;
}
.card-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.card-index {
  font-family: var(--display);
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.18em;
  color: #9a9a9a;
  white-space: nowrap;
}

.card-desc {
  grid-area: desc;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #c6c6c6;
  max-width: 46ch;
}

.card-actions {
  grid-area: actions;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 0.65rem;
}

.chip {
  display: inline-flex; align-items: center;
  font-family: var(--display);
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #9a9a9a;
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.75rem;
  border-radius: 0.55rem;
  white-space: nowrap;
}

.visit {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: #071820;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  text-decoration: none;
  padding: 0.55rem 1.05rem;
  border-radius: 0.6rem;
  box-shadow: 0 6px 18px rgba(255, 47, 146, 0.12);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  white-space: nowrap;
}
.visit:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(255, 47, 146, 0.22); }
.visit:active { transform: translateY(0); }
.visit svg { display: block; }

/* --- ending --- */

.ending {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  padding: 20px;
}
.ending-mark {
  font-family: var(--display);
  font-weight: 950;
  font-size: clamp(4rem, 14vmin, 10rem);
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ending-line {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.ending-mail {
  color: var(--ink);
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.ending-mail:hover {
  border-color: rgba(255, 47, 146, 0.3);
  box-shadow: 0 0 20px rgba(255, 47, 146, 0.08);
}

/* --- progress rail --- */

.rail {
  position: absolute;
  right: clamp(12px, 2.6vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
  gap: 11px;
  padding: 10px 8px;
  border-radius: 999px;
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.rail button {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
  padding: 0;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.rail button.active {
  background: var(--pink);
  box-shadow: 0 0 5px rgba(255, 47, 146, 0.28);
  transform: scale(1.15);
}

/* ============ loading gate ============ */

#gate {
  position: fixed; inset: 0;
  z-index: 50;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.55s ease;
}
#gate.done { opacity: 0; pointer-events: none; }
.gate-mark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vmin, 5rem);
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gate-pulse 1.6s ease-in-out infinite;
}
@keyframes gate-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
body.simple #gate { display: none; }

/* ============ focus ============ */

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── Closing motion poster ─────────────────────────────── */
.closing-layer {
  position: fixed;
  left: 50%; top: 50%;
  width: 100.5%; height: 100.5%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  pointer-events: none; user-select: none;
  will-change: opacity;
  opacity: 0;
  z-index: 5;
  overflow: hidden;
}

.closing-layer video {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  animation: closingLoop 4s linear infinite;
}

@keyframes closingLoop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ============ fallback / static page ============ */

.scroll-track { position: relative; }

.fallback {
  display: block;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) clamp(18px, 5vw, 40px) 80px;
}

.fb-hero { text-align: center; margin-bottom: 56px; }
.fb-mark {
  font-family: var(--display); font-weight: 900;
  font-size: 2rem; 
  background: linear-gradient(135deg, var(--coral), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 28px;
}
.fb-portrait {
  width: 100%; height: auto;
  max-width: 400px;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  margin-bottom: 30px;
}
.fb-hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: -0.02em;
}
.fb-sub { color: var(--muted); margin-top: 8px; }
.fb-lead { color: var(--muted); margin-top: 12px; max-width: 600px; margin-left: auto; margin-right: auto; }
.fb-cta {
  display: inline-block;
  margin-top: 20px;
  padding: 0.85rem 1.8rem;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  color: #071820;
  font-weight: 800;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(255, 95, 111, 0.2);
}

.fb-heading {
  font-family: var(--display); font-weight: 500;
  font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  margin-bottom: 34px;
  margin-top: 60px;
}

.project-list { list-style: none; display: grid; gap: 26px; }
.project-list li {
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 26px;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-areas: "logo title" "logo desc" "logo link";
  column-gap: 20px; row-gap: 6px;
  align-items: start;
}
.project-list .fb-logo-placeholder {
  grid-area: logo;
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid rgba(255, 47, 146, 0.1);
  display: grid; place-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--faint);
  padding: 6px;
}
.project-list h3 {
  grid-area: title;
  font-family: var(--display); font-weight: 700;
  font-size: 1.3rem;
}
.project-list p { grid-area: desc; color: var(--muted); font-size: 0.95rem; }
.project-list a {
  grid-area: link;
  justify-self: start;
  margin-top: 10px;
  display: inline-block;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  color: #071820;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 47, 146, 0.2);
}

.fb-footer {
  margin-top: 70px;
  text-align: center;
  color: var(--muted);
  display: grid; gap: 10px; justify-items: center;
}
.fb-mark-sm { font-family: var(--display); font-weight: 900; font-size: 1.4rem; background: linear-gradient(135deg, var(--coral), var(--pink)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fb-footer a { color: var(--white); }
.fb-footer a:hover { color: var(--pink); }

/* WhatsApp FAB (only on fallback pages) */
.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  box-shadow: 0 8px 24px rgba(255, 47, 146, 0.3);
  transition: transform 0.2s ease;
}
.whatsapp-fab:hover { transform: scale(1.1); }
.whatsapp-fab img { width: 28px; height: 28px; }

/* ============ responsive ============ */

@media (max-width: 640px) {
  .card-dock .card {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo head"
      "desc desc"
      "actions actions";
    row-gap: 12px;
    padding: 18px;
    border-radius: 14px;
  }
  .card-logo { width: 3.4rem; height: 3.4rem; border-radius: 0.7rem; }
  .card-title { font-size: 1.15rem; white-space: normal; }
  .card-desc { max-width: none; font-size: 0.88rem; }
  .card-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .rail { display: none; }
  .letter { top: 50%; font-size: clamp(3.5rem, 14vmin, 8rem); }
  .hero-tagline { font-size: 0.7rem; letter-spacing: 0.1em; padding: 0 14px; }
  .project-list li {
    grid-template-columns: 1fr;
    grid-template-areas: "logo" "title" "desc" "link";
    justify-items: start;
  }
  .whatsapp-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }
  .whatsapp-fab img { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue svg, .gate-mark { animation: none; }
}

/* ── Simple mode (no-JS fallback header) ────────────────── */
.simple-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.simple-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w, 1180px);
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
}
.simple-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}
.simple-nav a:hover { color: var(--pink); }
.simple-nav .nav-cta {
  background: linear-gradient(135deg, var(--coral), var(--pink));
  color: #071820;
  font-weight: 800;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}
.simple-nav .nav-cta:hover { color: #071820; }

/* ============ white Education Technology screen (portfolio-final-4 layout) ============ */

.folio-screen {
  --folio-paper: #dbdbdb;
  --folio-ink: #171717;
  --folio-coral: #ff5f6f;
  --folio-line: rgba(255, 95, 111, 0.25);
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--folio-paper);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity;
  color: var(--folio-ink);
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.folio-grid {
  width: min(94vw, 1680px);
  display: grid;
  grid-template-columns: minmax(250px, .88fr) minmax(250px, .76fr) minmax(300px, .98fr);
  align-items: center;
  gap: clamp(28px, 4vw, 78px);
}

.identity-group {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 1.4vw, 22px);
}

.side-note {
  justify-self: center;
  color: var(--folio-coral);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .20em;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: .76;
  white-space: nowrap;
}

.identity-art {
  min-width: 0;
  margin: 0;
  display: grid;
  place-items: center;
}

.identity-art img {
  display: block;
  width: min(88%, 430px);
  max-height: 64svh;
  object-fit: contain;
}

.video-wrap {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 3 / 4;
  justify-self: center;
  overflow: hidden;
  border-radius: clamp(24px, 2.1vw, 38px);
  background: #10292e;
  box-shadow: 0 22px 55px rgba(16, 42, 47, .16);
}

.video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: inherit;
}

.video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease;
}

.service {
  min-width: 0;
  color: var(--folio-coral);
  width: min(100%, 500px);
  justify-self: center;
  text-align: left;
  text-transform: uppercase;
  font-family: 'Anton', Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  font-size: clamp(3.55rem, 5.6vw, 6.85rem);
  font-weight: 400;
  line-height: .88;
  letter-spacing: .01em;
}

.service::before {
  content: none;   /* ESLA screens use a dedicated .eyebrow element instead */
}

.service span { display: block; }

@media (max-width: 1100px) {
  .folio-grid {
    grid-template-columns: minmax(220px, .95fr) minmax(220px, .7fr) minmax(250px, 1fr);
    gap: 28px;
  }
  .service { font-size: clamp(3.4rem, 6.4vw, 5.6rem); }
}

@media (max-width: 780px) {
  .folio-screen { overflow-y: auto; }
  .folio-grid {
    width: min(100%, 560px);
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .identity-art img { width: min(82vw, 430px); max-height: none; }
  .video-wrap { width: min(68vw, 320px); }
  .service {
    text-align: left;
    font-size: clamp(4rem, 19vw, 7rem);
    justify-self: start;
  }
  .identity-group { grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
  .side-note { font-size: 7px; }
}

/* ============================================================================
   ESLA — five-screen folio extensions (elucidateagent.online)
   Screens 2–5 widen the media column; content column carries eyebrow + Impact
   headline + microtype copy. Desktop rules first, then tablet/mobile overrides.
   ============================================================================ */

/* --- wider media column for screens 2–5 (desktop only) --- */
@media (min-width: 1101px) {
  .grid-wide {
    grid-template-columns: minmax(180px, .55fr) minmax(400px, 1.45fr) minmax(280px, .95fr);
  }
  /* screens 3–5: no centre panel — identity left, copy + embedded content right */
  .grid-embed {
    grid-template-columns: minmax(200px, 340px) minmax(0, 720px);
    width: min(94vw, 1200px);
    gap: clamp(28px, 4vw, 64px);
  }
  /* screen 5: hero + text left, video alongside right, no identity column */
  .grid-split {
    grid-template-columns: minmax(0, 1.12fr) minmax(400px, .88fr);
    width: min(94vw, 1560px);
    gap: clamp(36px, 5vw, 84px);
  }
  /* screen 3: single column, large hero, native LOCATE activity below the copy */
  .grid-solo {
    grid-template-columns: minmax(0, 940px);
    width: min(94vw, 1000px);
    padding-top: 46px;   /* clears the fixed section label */
  }
  /* screen 4: wider column for the native ESCS app */
  .grid-solo-wide {
    grid-template-columns: minmax(0, 1400px);
    width: min(94vw, 1440px);
  }
}

/* centered hero (screen 4) with left-aligned body underneath */
.hero-center { text-align: center; }
.hero-center .tag-inline { margin-left: auto; margin-right: auto; }
.hero-eyebrow { text-align: center; }
.grid-solo-wide .content { width: 100%; }
.grid-solo-wide .escs-host { margin-top: 16px; }

/* embedded-content screens scroll vertically if the column outgrows the viewport */
.screen-embed { overflow-y: auto; }
.screen-embed .folio-grid { margin: auto; }
.grid-embed .content { width: 100%; justify-self: start; }

/* hidden scrollbars — each screen is a locked 16:9 canvas; the rail shows position */
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
.screen-embed { scrollbar-width: none; -ms-overflow-style: none; }
.screen-embed::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* --- generic media frames (screens 2–5) --- */
.media {
  position: relative;
  justify-self: center;
  overflow: hidden;
  border-radius: clamp(24px, 2.1vw, 38px);
  background: #10292e;
  box-shadow: 0 22px 55px rgba(16, 42, 47, .16);
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: inherit;
  z-index: 4;
}
.media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.media-wide  { width: min(100%, 720px); aspect-ratio: 16 / 9; }
.embed-wrap { margin-top: 26px; width: 100%; }
.embed-wrap iframe {
  width: 100%;
  height: 560px;
  border: 0;
  display: block;
  border-radius: clamp(18px, 1.6vw, 28px);
  background: #10292e;
  box-shadow: 0 22px 55px rgba(16, 42, 47, .16);
}
.embed-wrap.escs iframe { height: 520px; }

/* --- YouTube thumbnail link (screen 5) --- */
.media-link {
  position: relative;
  display: block;
  margin-top: 26px;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: clamp(18px, 1.6vw, 28px);
  background: #10292e;
  box-shadow: 0 22px 55px rgba(16, 42, 47, .16);
}
.media-link::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: inherit;
  z-index: 2;
}
.media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.media-link:hover .media-thumb { transform: scale(1.03); }
.media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--folio-coral);
  border: 2px solid rgba(255, 255, 255, .85);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  padding-left: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .2s ease;
}
.media-link:hover .media-play { transform: translate(-50%, -50%) scale(1.08); }

/* --- screen 5 right column: video + caption --- */
.grid-split .content { width: 100%; justify-self: start; }
.grid-split .service { width: min(100%, 660px); }
.media-col {
  min-width: 0;
  width: 100%;
  justify-self: end;
}
.media-col .media-link { margin-top: 0; width: 100%; }
.media-caption {
  margin: 14px 0 0;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--folio-ink);
  opacity: .72;
  text-align: center;
}

/* --- screen 3: native LOCATE activity (SP stage 02 rebuilt in-page) --- */
.locate {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(260px, 400px) minmax(0, 1fr);
  gap: 22px;
  background: #fffdf8;
  border: 1px solid rgba(23, 23, 23, .14);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 18px 44px rgba(23, 23, 23, .08);
}
.locate-map { display: grid; gap: 10px; align-content: start; align-self: start; min-width: 0; }
.silhouette {
  position: relative;
  height: 340px;
  background: linear-gradient(180deg, #fffdf8, #f5f1e9);
  border: 1px solid rgba(23, 23, 23, .12);
  border-radius: 14px;
}
.person { position: absolute; left: 50%; transform: translateX(-50%) scale(.85); transform-origin: top center; top: 18px; width: 150px; height: 360px; }
.head { position: absolute; left: 42px; width: 66px; height: 66px; border: 3px solid var(--folio-ink); border-radius: 50%; }
.torso { position: absolute; top: 70px; left: 20px; width: 110px; height: 196px; border: 3px solid var(--folio-ink); border-radius: 42px 42px 26px 26px; }
.leg { position: absolute; top: 262px; width: 40px; height: 98px; border: 3px solid var(--folio-ink); border-top: 0; }
.leg.a { left: 30px; }
.leg.b { right: 30px; }
.dot {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--folio-coral);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--folio-coral);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform .18s ease;
}
.dot::after {
  content: attr(data-label);
  position: absolute;
  left: 24px;
  top: -6px;
  white-space: nowrap;
  background: #fff;
  border: 1px solid rgba(23, 23, 23, .14);
  padding: 4px 7px;
  border-radius: 5px;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .7rem;
  font-weight: 700;
  color: var(--folio-ink);
}
.dot:hover, .dot.active { transform: scale(1.3); }
.dot.brain { left: 66px; top: 18px; }
.dot.thyroid { left: 66px; top: 78px; }
.dot.adrenal { left: 34px; top: 156px; }
.dot.pancreas { left: 80px; top: 174px; }
.dot.ovary { left: 40px; top: 238px; }
.dot.testis { left: 82px; top: 254px; }
/* right-side markers cast their labels left so neighbouring tags never collide */
.dot.pancreas::after, .dot.testis::after { left: auto; right: 24px; }
.locate-fact {
  margin: 0;
  min-height: 2.6em;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--folio-ink);
  opacity: .75;
}
.locate-questions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
  min-width: 0;
}
.lq {
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(23, 23, 23, .12);
  border-left: 4px solid var(--folio-coral);
  padding: 10px 12px;
  border-radius: 10px;
}
.lq-q { margin: 0 0 6px; font-size: .86rem; font-weight: 700; line-height: 1.35; color: var(--folio-ink); }
.lq select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid rgba(23, 23, 23, .25);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: .84rem;
  color: var(--folio-ink);
}
.lq-actions { display: flex; gap: 8px; margin-top: 6px; }
.lq-check {
  background: var(--folio-coral);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.lq-hint {
  background: #fff;
  border: 1px solid rgba(23, 23, 23, .25);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--folio-ink);
}
.lq-feedback { display: none; margin: 8px 0 0; font-size: .78rem; font-weight: 700; padding: 8px 10px; border-radius: 8px; }
.lq-feedback.secure { display: block; background: #e1f0e7; border-left: 4px solid #26734f; color: #245e40; }
.lq-feedback.retry { display: block; background: #f6e0e5; border-left: 4px solid #a52d45; color: #85243a; }
.lq-hintbox { display: none; margin: 8px 0 0; font-size: .78rem; font-weight: 600; background: #fff4db; border-left: 4px solid #e98235; padding: 8px 10px; border-radius: 8px; color: #61430f; }
.lq-hintbox.show { display: block; }
.lq-memo { display: none; margin: 8px 0 0; font-size: .8rem; font-weight: 600; background: #edf4f1; border-left: 4px solid #0b6170; padding: 8px 10px; border-radius: 8px; color: #245e40; }
.lq-memo.show { display: block; }
.locate-score {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--folio-ink);
  opacity: .7;
}

/* --- SS carousel --- */
.carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #10292e;
}
.carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #10292e;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(5, 5, 5, .32);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s ease, transform .2s ease;
}
.carousel-arrow:hover { background: rgba(5, 5, 5, .58); }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }
.carousel-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 14px;
  background: linear-gradient(0deg, rgba(5, 5, 5, .58), rgba(5, 5, 5, 0));
}
.carousel-count {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
}
.carousel-dots { display: flex; gap: 7px; }
.carousel-dots button {
  width: 8px; height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.carousel-dots button:hover { background: rgba(255, 255, 255, .7); }
.carousel-dots button.active { background: var(--folio-coral, #ff5f6f); transform: scale(1.25); }

/* --- content column (right side) --- */
.content {
  min-width: 0;
  width: min(100%, 560px);
  justify-self: center;
}
.content .eyebrow {
  margin: 0 0 16px;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .20em;
  text-transform: uppercase;
  color: var(--folio-coral);
  opacity: .76;
}
.service-head {
  font-size: clamp(2.3rem, 4.4vw, 4.6rem);
  line-height: .9;
}
.service-sub {
  font-size: clamp(2.4rem, 4.2vw, 4.6rem);
  line-height: .9;
}
.service-hero-lg {
  font-size: clamp(3.8rem, 7.2vw, 7.8rem);
  line-height: .88;
}
.grid-solo .content { width: 100%; justify-self: start; }
.grid-solo .service { width: min(100%, 940px); }
.solo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 56px);
}
.solo-head-copy { min-width: 0; flex: 1 1 auto; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  background: var(--folio-coral);
  color: #fff;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 15px 24px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(255, 95, 111, .28);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(255, 95, 111, .38); }
.cta-arrow { font-size: 1em; line-height: 1; }
.cta-btn.cta-ghost {
  background: transparent;
  color: var(--folio-ink);
  border: 2px solid var(--folio-ink);
  box-shadow: none;
}
.cta-btn.cta-ghost:hover {
  background: var(--folio-coral);
  border-color: var(--folio-coral);
  color: #fff;
  box-shadow: 0 14px 32px rgba(255, 95, 111, .38);
}
.cta-btn.cta-sm { padding: 11px 18px; font-size: .66rem; }
.cta-btn + .cta-btn { margin-left: 14px; }
.cta-mt { margin-top: 26px; }
.cta-mt-sm { margin-top: 14px; }
.tag-inline {
  display: block;
  width: fit-content;
  margin: 12px 0 0;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  color: #fff;
  background: var(--folio-coral);
  border-radius: 999px;
  padding: 6px 11px;
}
.lead {
  margin: 20px 0 0;
  max-width: 56ch;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--folio-ink);
  opacity: .8;
}
.points {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--folio-ink);
}
.points li::before {
  content: "";
  width: 7px; height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--folio-coral);
}
.points li .tag {
  margin-left: auto;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--folio-coral);
  border: 1px solid var(--folio-line);
  border-radius: 999px;
  padding: 5px 9px;
  white-space: nowrap;
}
.points-small li { font-size: .96rem; }
.note {
  margin: 14px 0 0;
  max-width: 50ch;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .04em;
  color: var(--folio-ink);
  opacity: .72;
}
.folio-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-bottom: 4px;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--folio-coral);
  text-decoration: none;
  border-bottom: 1px solid var(--folio-line);
  transition: opacity .2s ease;
}
.folio-link::after { content: "→"; }
.folio-link:hover { opacity: .7; }

/* section label legibility over white screens */
.stage .section-label { color: rgba(23, 23, 23, .42); }

/* --- fallback cards (no-JS) --- */
.fb-card {
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin-bottom: 16px;
}
.fb-card h3 { font-weight: 700; font-size: 1.3rem; margin-bottom: 6px; }
.fb-card p { color: var(--muted); font-size: 0.95rem; }
.fb-card a { color: var(--coral); font-weight: 700; text-decoration: none; font-size: 0.95rem; }

/* --- tablet: screens 2–5 stack, media centered --- */
@media (max-width: 1100px) and (min-width: 781px) {
  .grid-wide,
  .grid-embed,
  .grid-split,
  .grid-solo {
    grid-template-columns: 1fr;
    width: min(100%, 640px);
    gap: 32px;
  }
  .grid-wide .media { justify-self: center; width: min(100%, 580px); }
  .grid-wide .content { justify-self: start; }
  .grid-embed .content { justify-self: start; }
  .grid-split .content { justify-self: start; }
  .grid-solo { padding-top: 46px; }
  .grid-solo .content { justify-self: start; }
  .grid-solo-wide { width: min(94vw, 960px); }
  .solo-head { flex-direction: column; align-items: flex-start; gap: 22px; }
  .cta-btn { align-self: flex-start; }
  .media-col { justify-self: center; max-width: 580px; }
  .grid-wide .identity-art img,
  .grid-embed .identity-art img { width: min(70vw, 340px); max-height: none; }
  .locate { grid-template-columns: 1fr; }
  .locate-questions { grid-template-columns: 1fr; }
  .silhouette { height: 300px; }
  .grid-solo .person { transform: translateX(-50%) scale(.75); }
}

/* --- mobile: media frame sizing --- */
@media (max-width: 780px) {
  .media-wide { width: min(92vw, 560px); aspect-ratio: 16 / 9; }
  .embed-wrap iframe { height: 480px; }
  .embed-wrap.escs iframe { height: 440px; }
  .media-link { width: 100%; }
  .service-head { font-size: clamp(2.4rem, 10vw, 3.6rem); }
  .service-sub  { font-size: clamp(2.4rem, 10vw, 3.6rem); }
  .service-hero-lg { font-size: clamp(3rem, 12vw, 4.6rem); }
  .content { width: 100%; }
  .locate { grid-template-columns: 1fr; padding: 16px; }
  .locate-questions { grid-template-columns: 1fr; }
  .silhouette { height: 280px; }
  .grid-solo .person { transform: translateX(-50%) scale(.68); }
  .escs-host { height: 520px; }
  .carousel-arrow { width: 34px; height: 34px; font-size: 13px; }
  .carousel-arrow.prev { left: 10px; }
  .carousel-arrow.next { right: 10px; }
}
