/* ============================================================
   Retro windows — self-contained homepage intro section.
   Old-school desktop window modals (draggable, closable, with
   typed/faded text). Paired with /retro-windows.js.

   To remove this feature entirely: delete this file,
   /retro-windows.js, the <section id="retro-windows"> block and
   the two matching tags in index.html. Nothing else depends on it.
   ============================================================ */

.retro-windows {
  margin-bottom: 48px;
}

/* Fixed-size canvas the windows cluster within — centered in the
   page, and scaled down to fit narrow screens by retro-windows.js. */
.retro-stage {
  position: relative;
  width: 820px;
  height: 520px;
  margin: 0 auto;
  /* Scoped to the intro only (this file loads on the homepage alone):
     stop iOS from auto-inflating the window text, which otherwise paints
     larger than its laid-out box and bursts the scaled-down windows. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── Window shell ─────────────────────────────────────────── */
.retro-window {
  position: absolute;
  background: #fff;             /* outer white window */
  border: 1px solid #000;
  border-radius: 4px;
  width: 210px;
  user-select: none;
  /* load-in animation start state */
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.retro-window.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.retro-window.is-dragging {
  transition: none;
  cursor: grabbing;
}

/* ── Title bar (X + stacked lines) ────────────────────────── */
.retro-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  cursor: grab;
  background: #fff;             /* titlebar sits on white, above the bezel */
  border-bottom: 1px solid #000;
  border-radius: 3px 3px 0 0;
}

.retro-titlebar:active { cursor: grabbing; }

.retro-close {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  line-height: 1;
  color: #000;
  cursor: pointer;
}

.retro-close:hover { color: #C8341A; }

/* the three thin horizontal rules that fill the title bar */
.retro-lines {
  flex: 1;
  height: 7px;
  background-image: repeating-linear-gradient(
    to bottom,
    #000 0, #000 1px,
    transparent 1px, transparent 3px
  );
}

/* ── Body (inset double-frame) ────────────────────────────── */
.retro-body {
  position: relative;
  margin: 14px;
  border: 1px solid #000;
  border-radius: 4px;          /* rounded innermost box (grey band stays square) */
  background: #fff;             /* inner white content box */
  padding: 16px;
}

/* Nested frame: a 7px grey band (with a tiny black polka-dot texture) plus a
   1px black stroke around the inner box, sitting on the outer white window.
   Sits behind the white content box via z-index, so only the ring shows. */
.retro-body::before {
  content: '';
  position: absolute;
  inset: -8px;
  background-color: #D2D2D2;
  background-image: radial-gradient(#000 0.6px, transparent 0.7px);
  background-size: 4px 4px;
  border: 1px solid #000;
  z-index: -1;
}

.retro-body--logo {
  padding: 18px 16px 14px;
  text-align: center;
}

.retro-body--loc {
  padding: 12px 16px;
  text-align: center;
}

.retro-body--sun {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Per-window sizing ────────────────────────────────────── */
.retro-window--bio { width: 460px; }
.retro-window--loc { width: 280px; }
.retro-window--sun { width: 120px; }

/* ── Typography ───────────────────────────────────────────── */
.retro-ml {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 72px;
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: #000;
  margin-bottom: 6px;
}

.retro-caption,
.retro-loc-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #000;
  white-space: nowrap;
}

.retro-bio {
  font-family: 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #000;
  margin: 0;
}

.retro-loc-label { margin-bottom: 4px; }

.retro-loc-city {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
  color: #000;
  white-space: nowrap; /* keep SAN FRANCISCO, CA on one line */
}

.retro-sun {
  width: 60px;
  height: 60px;
  fill: #000;
  display: block;
}

/* Retro pixel "shine": each outer ray pixel blinks hard on/off, staggered
   across phases so the rays sparkle like an 8-bit sun. */
.sun-tips path {
  animation: pixelShine 1.4s linear infinite;
}
.sun-tips path:nth-child(7n+1) { animation-delay: 0s;    }
.sun-tips path:nth-child(7n+2) { animation-delay: 0.6s;  }
.sun-tips path:nth-child(7n+3) { animation-delay: 0.2s;  }
.sun-tips path:nth-child(7n+4) { animation-delay: 0.9s;  }
.sun-tips path:nth-child(7n+5) { animation-delay: 0.4s;  }
.sun-tips path:nth-child(7n+6) { animation-delay: 1.1s;  }
.sun-tips path:nth-child(7n+7) { animation-delay: 0.75s; }

@keyframes pixelShine {
  0%      { opacity: 1; }
  80%     { opacity: 1; }
  80.01%  { opacity: 0; }
  98%     { opacity: 0; }
  98.01%  { opacity: 1; }
  100%    { opacity: 1; }
}

/* ── Typewriter caret ─────────────────────────────────────── */
.retro-caret::after {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 1px;
  background: currentColor;
  vertical-align: -0.12em;
  animation: retroBlink 0.8s steps(1) infinite;
}

@keyframes retroBlink {
  50% { opacity: 0; }
}

/* ── Mobile: keep the clustered canvas (scaled to fit by JS),
      just disable dragging ─────────────────────────────────── */
@media (max-width: 800px) {
  .retro-windows { margin-bottom: var(--gap-section); }
  .retro-titlebar { cursor: default; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .retro-window {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .sun-tips path { animation: none; }
}
