/* ============================================================
   Prefontaine.design — Scroll Animation Stage + Device Frames
   ============================================================ */

.stage {
  position: relative;
  height: 460vh;          /* scroll runway */
  background: var(--near-black);
}
.stage__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Act 1 intro copy --- */
.act-intro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 6;
  padding: 0 32px;
}
.act-intro h2 {
  font-size: clamp(40px, 6vw, 88px);
  max-width: 900px;
}
.act-intro p {
  margin-top: 22px;
  font-size: 16px;
  color: var(--silver);
}

/* --- The gold line (SVG) that morphs into frame --- */
.gold-line {
  position: absolute;
  top: 50%; left: 0;
  width: 70%;
  margin-left: 15%;
  height: 1.5px;
  z-index: 5;
  transform: translateY(-50%);
  overflow: hidden;
}
.gold-line i {
  display: block;
  width: 100%; height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  box-shadow: 0 0 12px rgba(201,168,76,0.6);
}

/* --- Device cluster --- */
.devices {
  position: relative;
  z-index: 4;
  width: min(1040px, 88vw);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  will-change: transform;
}

/* Browser frame */
.browser {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0f12;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 40px 90px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  will-change: transform, opacity;
}
.browser__chrome {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.browser__dots { display: flex; gap: 7px; }
.browser__dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
}
.browser__url {
  flex: 1;
  max-width: 280px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--silver);
  letter-spacing: 0.02em;
}
.browser__screen {
  position: relative;
  height: calc(100% - 42px);
  overflow: hidden;
  background: #000;
  container-type: inline-size;
}

/* Phone frame */
.phone {
  position: absolute;
  right: -3%;
  bottom: 0;
  width: 17%;
  aspect-ratio: 9 / 19;
  border-radius: 26px;
  background: #0b0f12;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  z-index: 5;
  will-change: transform, opacity;
}
.phone__notch {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  z-index: 3;
}
.phone__screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: inline-size;
}

/* --- Mini-site stack (cross-faded) --- */
.minisite {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}
/* Force every mini-site inside an animated/static device frame to OVERLAP
   (absolute, inset 0). Some mini-site recreations set position:relative to
   contain their decorative children; that would drop them into normal flow
   and stack them vertically instead of cross-fading. This guarantees overlap
   while absolute positioning still contains their absolute children. */
.browser__screen .minisite,
.phone__screen .minisite {
  position: absolute;
  inset: 0;
}
.minisite.phone-view { font-size: 0.52em; }

/* Real-screenshot mini-site (replaces a hand-coded mock). The image fills the
   frame and cover-crops; --shot-pos lets each placement frame the hero. */
.minisite--shot picture { position: absolute; inset: 0; display: block; }
.minisite--shot img {
  width: 100%; height: 100%; display: block;
  object-fit: cover;
  object-position: var(--shot-pos, top center);
}

/* Act 4 caption */
.act-caption {
  position: absolute;
  top: 16%;
  left: 0; right: 0;
  text-align: center;
  z-index: 7;
  opacity: 0;
  padding: 0 32px;
}
.act-caption h2 { font-size: clamp(28px, 3.6vw, 48px); }

/* Act 5 final CTA */
.act-final {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  padding: 0 32px;
}
.act-final.live { pointer-events: auto; }
.act-final__card {
  text-align: center;
  max-width: 600px;
  padding: 64px 48px;
  border-radius: 24px;
}
.act-final__card h2 { font-size: clamp(32px, 4.4vw, 52px); margin-bottom: 32px; }

/* progress hint */
.stage__progress {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  width: 180px; height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.stage__progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
}

/* MINI-SITE 1 — Kiefy: now a real screenshot (see .minisite--shot above).
   The hand-coded dashboard mock was removed; only the .ms-kiefy wrapper class
   remains in the markup so scroll-anim.js can still cross-fade this layer. */


/* ============================================================
   MINI-SITE 3 — Prefontaine.dev (retro RPG / terminal portfolio)
   Faithful-but-calm recreation of the real prefontaine.dev hero.
   ============================================================ */
.ms-prefontaine {
  --pf-bg: #080b1e;
  --pf-cyan: #6cd6f5;
  --pf-white: #e8edf5;
  --pf-muted: #6b7a99;
  --pf-line: rgba(108,214,245,0.18);
  background:
    radial-gradient(130% 80% at 78% -10%, rgba(37,99,235,0.16), transparent 60%),
    var(--pf-bg);
  color: var(--pf-white);
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* scale everything to the frame width so it fits any size frame */
  font-size: 1.8cqw;
  overflow: hidden;
}
/* top bar */
.ms-prefontaine__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--pf-line);
  font-size: 0.62em;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.ms-prefontaine__brand { color: var(--pf-white); letter-spacing: 0.02em; white-space: nowrap; }
.ms-prefontaine__brand .prompt { color: var(--pf-cyan); }
.ms-prefontaine__brand .at { color: var(--pf-muted); }
.ms-prefontaine__menu { display: flex; gap: 13px; color: var(--pf-muted); letter-spacing: 0.04em; }
.ms-prefontaine__menu .n { color: rgba(201,168,76,0.7); }
.ms-prefontaine__explore {
  border: 1px solid var(--pf-cyan); color: var(--pf-cyan);
  padding: 4px 10px; letter-spacing: 0.1em;
  display: flex; align-items: center; gap: 6px;
}
.ms-prefontaine__explore::before { content: '■'; font-size: 0.7em; }

/* HUD frame */
.ms-prefontaine__stage {
  flex: 1; min-height: 0;
  margin: 1em;
  position: relative;
  padding: 1.4em 1.6em;
  display: flex; flex-direction: column; justify-content: center;
}
.ms-prefontaine__stage::before,
.ms-prefontaine__stage::after {
  content: ''; position: absolute; width: 1em; height: 1em;
  border: 1.5px solid rgba(108,214,245,0.5);
}
.ms-prefontaine__stage::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.ms-prefontaine__stage::after { bottom: 0; right: 0; border-left: none; border-top: none; }
.ms-prefontaine__corner-tr, .ms-prefontaine__corner-bl {
  position: absolute; width: 1em; height: 1em;
  border: 1.5px solid rgba(108,214,245,0.5);
}
.ms-prefontaine__corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.ms-prefontaine__corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }

.ms-prefontaine__save {
  font-size: 0.6em; letter-spacing: 0.18em; color: var(--pf-cyan);
  margin-bottom: 1.3em;
}
.ms-prefontaine__save .sep { color: rgba(201,168,76,0.8); margin: 0 6px; }
.ms-prefontaine__hero h3 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.9em; line-height: 1.02; letter-spacing: -0.02em;
  color: var(--pf-white);
}
.ms-prefontaine__hero h3 .cy { color: var(--pf-cyan); }
.ms-prefontaine__hero p {
  font-size: 0.66em; line-height: 1.7; color: var(--pf-muted);
  margin-top: 1.1em; max-width: 60ch;
}
.ms-prefontaine__btns { display: flex; gap: 0.56em; margin-top: 1em; }
.ms-prefontaine__btns .start {
  background: var(--pf-cyan); color: #04121b; font-weight: 700;
  padding: 0.7em 1.2em; font-size: 0.6em; letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 0.7em; white-space: nowrap;
}
.ms-prefontaine__btns .start .key {
  border: 1px solid rgba(4,18,27,0.5); padding: 0 4px; font-size: 0.85em;
}
.ms-prefontaine__btns .read {
  border: 1px solid var(--pf-line); color: var(--pf-cyan);
  padding: 0.7em 1.2em; font-size: 0.6em; letter-spacing: 0.08em; white-space: nowrap;
}
.ms-prefontaine__div {
  margin-top: 1.4em;
  border-top: 1px dashed rgba(108,214,245,0.22);
}
.ms-prefontaine__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9em;
  margin-top: 1em; font-size: 0.56em;
}
.ms-prefontaine__stats .k { color: var(--pf-muted); letter-spacing: 0.06em; margin-bottom: 0.5em; }
.ms-prefontaine__stats .v { color: var(--pf-white); line-height: 1.5; }
.ms-prefontaine__stats .v.open { color: #4ade80; display: flex; align-items: center; gap: 6px; }
.ms-prefontaine__stats .v.open::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.ms-prefontaine__stats .v .accent { color: var(--pf-cyan); }

/* phone breakpoint adjustments for mini-sites
   (Kiefy is a screenshot now, so it needs no phone-specific layout rules) */
.phone-view.ms-prefontaine .ms-prefontaine__menu { display: none; }
.phone-view.ms-prefontaine .ms-prefontaine__stage { margin: 12px; padding: 18px 16px; }
.phone-view.ms-prefontaine .ms-prefontaine__hero h3 { font-size: 1.35em; }
.phone-view.ms-prefontaine .ms-prefontaine__hero p { display: none; }
.phone-view.ms-prefontaine .ms-prefontaine__stats { grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 768px) {
  .stage { height: 420vh; }
  .phone { display: none; }
  .devices { width: 94vw; }
}
