/* ==========================================================================
   COMPONENT: DEVICE MOCKUPS (MacBook + macOS window) for case studies
   Framework: Antigravity Modular Component Architecture
   Pure CSS frames, so screens stay crisp and swappable.
   ========================================================================== */

.mock-stage {
  position: relative;
  margin: 0;
  padding: clamp(24px, 5vw, 64px) clamp(12px, 4vw, 56px) clamp(20px, 4vw, 44px);
  border: var(--border-cyber);
  border-radius: 4px;
  background:
    radial-gradient(120% 80% at 15% 0%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(90% 70% at 90% 100%, rgba(244, 114, 182, 0.12), transparent 60%),
    var(--color-bg-surface);
  overflow: hidden;
}

.mock-stage::before { /* faint grid, echoes the site */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 80%);
  pointer-events: none;
}

.mock-stage > * { position: relative; }

.mock-stage__cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
  margin-top: clamp(18px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  letter-spacing: var(--letter-spacing-mono);
  color: var(--color-text-muted);
}

.mock-stage__hint { color: var(--color-accent-purple); }

/* ---------- MacBook ---------- */
.mac {
  --lid: #0E0E12;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.55));
}

.mac__lid {
  position: relative;
  padding: 2.1% 2.1% 2.6%;
  background: var(--lid);
  border-radius: clamp(10px, 1.8vw, 20px) clamp(10px, 1.8vw, 20px) 0 0;
  box-shadow: inset 0 0 0 1px #2C2D35, inset 0 0 0 2px #050507;
}

.mac__lid::before { /* camera */
  content: '';
  position: absolute;
  top: 0.8%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3A4660, #0B0C10 70%);
}

.mac__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 3px;
  background: #000;
}

.mac__screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
}

.mac__screen::after { /* glass sheen */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.06) 0%, transparent 38%);
  pointer-events: none;
}

.mac__base {
  position: relative;
  width: 114%;
  margin-left: -7%;
  height: clamp(8px, 1.4vw, 16px);
  background: linear-gradient(#4A4B53, #2A2B31 55%, #18191D);
  border-radius: 2px 2px 50% 50% / 2px 2px 100% 100%;
}

.mac__base::before { /* thumb notch */
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 15%;
  height: 45%;
  transform: translateX(-50%);
  background: #1C1D22;
  border-radius: 0 0 8px 8px;
}

/* Long screens: hover or focus scrolls the screen top to bottom */
.mac--scroll .mac__screen img { transition: object-position 7s cubic-bezier(.45, .05, .35, 1); }
.mac--scroll:hover .mac__screen img,
.mac--scroll:focus .mac__screen img { object-position: 50% 100%; }
.mac--scroll { cursor: ns-resize; }
.mac--scroll:focus-visible { outline: 2px solid var(--color-accent-purple); outline-offset: 8px; border-radius: 8px; }

/* Live prototype inside the laptop: rendered at desktop size, scaled to fit */
.mac--live .mac__screen { background: #F7F8FC; }
.mac--live iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  transform: scale(var(--mac-scale, 0.8));
  transform-origin: 0 0;
}

/* ---------- macOS window (design boards) ---------- */
.win {
  margin: 0 auto;
  max-width: 1080px;
  border-radius: 12px;
  overflow: hidden;
  background: #1B1B20;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.win--narrow { max-width: 860px; }

.win__bar {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  background: #26262C;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 12px;
  color: #A1A1AA;
}

.win__dots { display: flex; gap: 8px; }
.win__dots i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.win__dots i:nth-child(2) { background: #FEBC2E; }
.win__dots i:nth-child(3) { background: #28C840; }
.win__title { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win img { display: block; width: 100%; height: auto; }

.mock-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 36px);
}

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .mac__base { height: 7px; }
  .win__bar { height: 26px; grid-template-columns: 44px 1fr 44px; font-size: 10px; }
  .win__dots i { width: 8px; height: 8px; }
  .win__dots { gap: 5px; }

  /* The live laptop gives way to the prototype's own mobile layout */
  .mac--live { filter: none; }
  .mac--live .mac__lid { padding: 0; background: none; box-shadow: none; border-radius: 0; }
  .mac--live .mac__lid::before, .mac--live .mac__base, .mac--live .mac__screen::after { display: none; }
  .mac--live .mac__screen { aspect-ratio: auto; height: clamp(600px, 80vh, 760px); border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); }
  .mac--live iframe { width: 100%; height: 100%; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mac--scroll .mac__screen img { transition: none; }
}

/* Section that pairs intro copy with a stage (live prototype near the top) */
.nx-live { display: grid; row-gap: var(--space-lg); scroll-margin-top: 96px; }
.nx-live h2 { margin-top: var(--space-xs); }

/* Pinned slice (e.g. an app's side rail) that stays put while the screen scrolls */
.mac__screen img.mac__pin {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--pin-w, 4%);
  height: 100%;
  object-fit: fill;
  transition: none;
  z-index: 1;
  pointer-events: none;
}
