/* The chosen tech portrait owns the opening scene, alongside Ali's name. */
.scene-intro .scene-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: 36px;
  row-gap: 24px;
}
html[data-scenes="on"] .scene-intro .scene-inner {
  height: 100%;
  min-height: 500px;
}
.intro-topline { grid-column: 1; grid-row: 1; }
.intro-topline > span { display: none; }
.intro-composition { display: contents; }
.intro-identity { grid-column: 1; grid-row: 2; align-self: center; }
.name-title { font-size: clamp(100px, 12vw, 190px); }
.intro-bottom {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-top: 24px;
}
.intro-context { display: none; }
.intro-statement { max-width: 380px; }
.portrait-module {
  grid-column: 2;
  grid-row: 1 / 4;
  width: min(100%, max(299px, calc((100dvh - 281px) * 0.75)));
  justify-self: center;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.portrait-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  isolation: isolate;
  perspective: 1000px;
}
.portrait-depth { position: absolute; inset: 0; }
.portrait-image {
  position: absolute;
  inset: 0;
  mask-image: linear-gradient(to bottom, #000 65%, #0009 83%, transparent 100%);
  mask-composite: intersect;
}
.portrait-segment {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc((3 - var(--slice)) * 25% - 1px) 0 calc(var(--slice) * 25% - 1px));
}
.portrait-segment img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  user-select: none;
  -webkit-user-drag: none;
}
.portrait-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.corner-tl { top: 3%; left: 3%; border-top: 1px solid #72ccdd; border-left: 1px solid #72ccdd; }
.corner-br { bottom: 3%; right: 3%; border-right: 1px solid #ff997b; border-bottom: 1px solid #ff997b; }
.portrait-caption {
  margin: 0 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 0;
  padding-top: 4px;
  min-height: 45px;
}
.portrait-caption > span { color: #aebba2; font: 9px var(--mono); letter-spacing: 1px; }
.portrait-replay {
  font: 10px var(--mono);
  color: #d3e0c6;
  background: transparent;
  border: 0;
  padding: 8px 0 8px 10px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.portrait-replay > span { color: #ff997b; font-size: 19px; }
.portrait-replay:disabled { opacity: 0.45; cursor: default; }
.portrait-particles { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; }
.portrait-stage[data-particles="ready"] { cursor: crosshair; }
.portrait-stage[data-particles="ready"] .portrait-particles { visibility: visible; opacity: var(--portrait-dots, 0); }
.portrait-stage[data-particles="ready"] .portrait-segment { opacity: var(--portrait-photo, 1); }
html[data-motion="off"] .portrait-stage .portrait-particles { visibility: hidden; }
html[data-motion="off"] .portrait-stage .portrait-segment { opacity: 1; }
html[data-motion="off"] .portrait-stage { cursor: auto; }
@media (max-width: 1100px) {
  .scene-intro .scene-inner { column-gap: 24px; }
  .name-title { font-size: clamp(88px, 11.7vw, 140px); }
  .intro-statement { font-size: 16px; }
  .portrait-caption > span { font-size: 8px; letter-spacing: 0; }
  .portrait-caption { gap: 8px; }
}
@media (max-width: 760px) {
  .scene-intro .scene-inner { display: flex; gap: 0; justify-content: center; }
  html[data-scenes="on"] .scene-intro .scene-inner { height: auto; min-height: 100%; padding-block: 16px; }
  .intro-topline { margin-bottom: 8px; }
  .intro-composition {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 0;
    min-height: 0;
    padding: 0;
  }
  .portrait-module {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: clamp(330px, calc(100svh - 380px), 620px);
    margin: 0;
    position: relative;
    z-index: 1;
  }
  .intro-identity {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    margin-bottom: 64px;
    padding: 0 12px;
    position: relative;
    z-index: 2;
    pointer-events: none;
  }
  .name-title { font-size: clamp(66px, 20vw, 116px); text-shadow: 0 2px 20px #0009; }
  .name-line:first-child { color: #d8dfd3; }
  .name-line:last-child { padding-top: 0; }
  .name-line + .name-line { margin-top: 5px; }
  .portrait-caption { margin-inline: 0; }
  .portrait-caption > span { font-size: 8px; }
  .portrait-replay { min-height: 44px; font-size: 9px; gap: 9px; }
  .portrait-corner { width: 15px; height: 15px; }
  .intro-bottom { border-top: 0; padding-top: 16px; gap: 8px; }
  .intro-statement { font-size: 15px; line-height: 1.5; max-width: 420px; }
  .intro-bottom .scene-cta { min-height: 44px; }
}
@media (max-width: 760px) and (max-height: 740px) {
  .portrait-module { height: 330px; }
  .intro-statement { font-size: 14px; }
  .intro-bottom { padding-top: 12px; }
}

/* Atmosphere belongs to the scene; the subject has no enclosing photo frame. */
.portrait-corner { display: none; }
.portrait-atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  mask-image: radial-gradient(ellipse, #000 48%, transparent 74%);
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at 27% 47%, #45c5dd19, transparent 48%), radial-gradient(ellipse at 79% 62%, #f87e6519, transparent 47%);
}
.portrait-atmosphere::before {
  content: "";
  position: absolute;
  inset: 14% 3% 18%;
  border: 1px solid #69c6d329;
  border-right-color: #f8977238;
  border-radius: 50%;
  transform: rotate(-24deg) skewY(12deg);
}
.portrait-atmosphere::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #7bd8e4;
  border-radius: 50%;
  left: 18%;
  top: 30%;
  box-shadow: 0 0 16px #7bd8e480, 260px 220px 0 -1px #ef9678;
}
@media (max-width: 760px) {
 .portrait-atmosphere { inset-inline: 0; }
 .portrait-atmosphere::after { box-shadow: 0 0 16px #7bd8e480; }
}
