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

/* ── Fonts ───────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 950;
  font-display: swap;
  src: url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900;950&display=swap');
}

/* ── 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: 'Inter', system-ui, -apple-system, sans-serif;
  --body: 'Inter', 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: 900;
  font-size: 1.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;
  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(--display);
  font-size: 0.72rem; font-weight: 500;
  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 {
  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: 950;
  font-size: clamp(2.6rem, 8vmin, 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;
  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 {
    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: Inter, 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);
}

/* Invisible full-screen link: click anywhere on the white Edutech screen → elucidateagent.online.
   The link is inside .folio-screen; when the screen is off-stage it is visibility:hidden,
   so the link is naturally hidden there. When the screen is visible, the whole area is the click target.
   pointer-events:auto overrides the screen's pointer-events:none so clicks register. */
.folio-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
}
.folio-link:hover,
.folio-link:focus-visible { outline: none; }

.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%, 540px);
  justify-self: center;
  text-align: left;
  text-transform: none;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  font-size: clamp(3.1rem, 5vw, 5.9rem);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -.02em;
}

.service::before {
  content: "Click to learn more";
  display: block;
  margin: 0 0 18px 4px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .20em;
  color: var(--folio-coral);
  opacity: .76;
  text-transform: uppercase;
}

.service span { display: block; }
.service span b { font-weight: inherit; }

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

@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(3.6rem, 17vw, 6rem);
    justify-self: start;
  }
  .identity-group { grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
  .side-note { font-size: 7px; }
}

/* ============ About screen (added before the ending) ============ */

.about-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(255, 47, 146, 0.10), transparent 55%),
    radial-gradient(100% 80% at 10% 85%, rgba(255, 95, 111, 0.07), transparent 55%),
    var(--bg);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity;
  display: grid;
  place-items: center;
  overflow-y: auto;
  font-family: var(--body);
  -webkit-overflow-scrolling: touch;
}
.about-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 47, 146, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 47, 146, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}

.about-inner {
  position: relative;
  width: min(92vw, 1080px);
  padding: clamp(40px, 7vh, 84px) clamp(6px, 2vw, 20px);
}

.about-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: clamp(26px, 4vw, 54px);
  margin-bottom: clamp(24px, 4vh, 40px);
}
.about-photo {
  margin: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 47, 146, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 28px rgba(255, 47, 146, 0.12);
  flex-shrink: 0;
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.about-eyebrow {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--pink);
  margin: 0 0 12px;
}
.about-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.about-lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.about-body {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(22px, 3.4vh, 34px);
  max-width: 72ch;
}
.about-body p {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.about-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(26px, 4vh, 40px);
}
.about-topics span {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--bg-hi);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.95rem;
  border-radius: 0.6rem;
}

.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: #071820;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(255, 47, 146, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.about-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(255, 47, 146, 0.32); }

@media (max-width: 780px) {
  .about-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 22px;
  }
  .about-head-copy { text-align: center; }
  .about-photo { width: 168px; height: 168px; }
  .about-lead { max-width: none; }
  .about-topics { justify-content: center; }
  .about-cta { align-self: center; }
}

/* ============ global mobile refinement (all screens) ============ */

@media (max-width: 640px) {
  /* top UI: keep brand + section label from colliding */
  .brand {
    font-size: 1.1rem;
    padding: 8px 12px;
    left: 14px;
    top: calc(12px + env(safe-area-inset-top));
  }
  .section-label {
    top: calc(18px + env(safe-area-inset-top));
    font-size: 0.56rem;
    letter-spacing: 0.22em;
    max-width: 62vw;
    white-space: normal;
    line-height: 1.5;
    text-align: center;
  }

  /* products stage: raise the orb above the docked card, shrink both */
  :root { --sceneY: 36%; --orb: min(58vmin, 15rem); }
  .card {
    padding: 14px 14px;
    row-gap: 9px;
    border-radius: 12px;
  }
  .card-title { font-size: 1.02rem; }
  .card-index { font-size: 0.62rem; letter-spacing: 0.12em; }
  .card-desc { font-size: 0.82rem; line-height: 1.38; }
  .chip { font-size: 0.6rem; padding: 0.32rem 0.55rem; }
  .visit { font-size: 0.8rem; padding: 0.5rem 0.85rem; }
  .card-dock { width: 94vw; }

  /* white elucidateagent screen */
  .service::before { margin-bottom: 10px; }
  .video-wrap { box-shadow: 0 14px 34px rgba(16, 42, 47, 0.16); }

  /* ending: keep the big mark + email pill inside the viewport */
  .ending { gap: 10px; padding: 16px; width: min(92vw, 420px); }
  .ending-mark { font-size: clamp(3rem, 18vmin, 6rem); }
  .ending-line { font-size: 0.72rem; letter-spacing: 0.16em; }
  .ending-mail {
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    max-width: 88vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* hero intro sits clear of the scroll cue */
  .hero-intro { bottom: calc(12vh + env(safe-area-inset-bottom)); }
}
