/* ── D.O.S First-Boot Mode Picker ── */

/* ── Splash overlay ── */
.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: var(--bg, #0a0a0f);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 1;
  transition: opacity 0.32s ease;
}

.intro-splash.fading {
  opacity: 0;
  pointer-events: none;
}

/* The site backdrop is mounted INSIDE the splash so it picks up palette
   colors and the drift-* keyframe from themes.css automatically. */
.intro-splash .intro-picker-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ── Picker layout ── */
.intro-picker {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px;
  min-height: 100vh;
  gap: 20px;
  box-sizing: border-box;
}

/* ── Title block — matches classic hero typography ── */
.intro-picker-title {
  text-align: center;
  margin: 0;
}

.intro-picker-eyebrow {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, rgba(107, 158, 248, 0.95));
  margin: 0 0 12px;
}

.intro-picker-name {
  font-family: var(--font-serif, 'Noto Serif', Georgia, serif);
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--text, rgba(255, 255, 255, 0.96));
  margin: 0;
}

.intro-picker-name em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent, #5b8ef0);
}

/* ── Cards row ── */
.intro-picker-cards {
  display: flex;
  gap: 32px;
  width: 100%;
  position: relative;
  margin-top: 36px;
}

/* ── Card ── */
.intro-picker-card {
  flex: 1 1 0;
  position: relative;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.18));
  background: var(--bg-card, rgba(16, 16, 24, 0.55));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 18px 18px 20px;
  cursor: pointer;
  font: inherit;
  color: var(--text, rgba(255, 255, 255, 0.96));
  text-align: left;
  transition:
    transform 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    opacity 0.24s ease;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.30);
}

.intro-picker-card:hover,
.intro-picker-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent, rgba(255, 255, 255, 0.55));
  box-shadow:
    0 10px 38px var(--accent-glow, rgba(107, 158, 248, 0.40)),
    0 4px 14px rgba(0, 0, 0, 0.35);
  outline: none;
}

/* When one card is hovered/focused, dim its sibling */
.intro-picker-cards:hover .intro-picker-card:not(:hover),
.intro-picker-cards:focus-within .intro-picker-card:not(:focus-visible):not(:hover) {
  opacity: 0.62;
}

/* Subtle attention pulse on the recommended card before any interaction */
.intro-picker-card.recommended {
  border-color: var(--accent, rgba(107, 158, 248, 0.55));
  box-shadow:
    0 6px 26px var(--accent-glow, rgba(107, 158, 248, 0.28)),
    0 4px 14px rgba(0, 0, 0, 0.30);
  animation: intro-card-pulse 2.6s ease-in-out infinite;
}

@keyframes intro-card-pulse {
  0%, 100% { box-shadow: 0 6px 22px var(--accent-glow, rgba(107, 158, 248, 0.25)), 0 4px 14px rgba(0, 0, 0, 0.30); }
  50%      { box-shadow: 0 8px 36px var(--accent-glow, rgba(107, 158, 248, 0.50)), 0 4px 14px rgba(0, 0, 0, 0.30); }
}

.intro-picker-card.recommended:hover,
.intro-picker-card.recommended:focus-visible {
  animation: none;
}

/* ── Recommended badge ── */
.intro-picker-badge {
  position: absolute;
  top: -11px;
  left: 16px;
  background: var(--accent, #5b8ef0);
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

/* Sparkle overlay on the badge — reuses .slime-sparkles + slime-sparkle keyframe
   from desktop.css; we just override size + drop-shadow for the smaller area. */
.intro-picker-badge .intro-badge-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.intro-picker-badge .intro-badge-sparkles span {
  position: absolute;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  opacity: 0;
  /* sharp drop-shadow (no blur) — keeps the sparkle crisp */
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.85),
    0 0 3px var(--accent-glow, rgba(107, 158, 248, 0.55));
}

/* ── Card preview frame ── */
.intro-picker-card-preview {
  aspect-ratio: 16 / 10;
  width: 100%;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── DOS preview — dark desktop with terminal + content window ── */
.preview-dos {
  background:
    radial-gradient(ellipse 70% 50% at 30% 20%, rgba(107, 158, 248, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(167, 120, 232, 0.10), transparent 60%),
    linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

.preview-dos-window {
  position: absolute;
  top: 10%;
  left: 6%;
  width: 56%;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.preview-dos-chrome {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.pd-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pd-dot-r { background: #ff5f57; }
.pd-dot-y { background: #febc2e; }
.pd-dot-g { background: #28c840; }

.preview-dos-body {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-dos-line {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.preview-dos-prompt { color: var(--accent, #5b8ef0); font-weight: 700; }
.preview-dos-out    { color: rgba(255, 255, 255, 0.55); padding-left: 10px; }

.preview-dos-cursor {
  display: inline-block;
  width: 6px;
  height: 11px;
  background: var(--accent, #5b8ef0);
  animation: preview-dos-blink 1.05s steps(2) infinite;
}

@keyframes preview-dos-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Mini content window (offset behind the terminal for depth) */
.preview-dos-mini {
  position: absolute;
  top: 32%;
  right: 6%;
  width: 46%;
  height: 56%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(107, 158, 248, 0.40);
  border-radius: 5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-dos-mini-chrome {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(107, 158, 248, 0.10);
}

.preview-dos-mini-chrome .pd-dot {
  width: 6px;
  height: 6px;
}

.preview-dos-mini-body {
  padding: 9px 9px 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.preview-dos-mini-h {
  width: 56%;
  height: 8px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 2px;
  margin-bottom: 2px;
}

.preview-dos-mini-line {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.20);
  border-radius: 2px;
}
.preview-dos-mini-line.short { width: 64%; }

/* ── Classic preview — mirrors the classic.html hero ── */
.preview-classic {
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
  display: flex;
  flex-direction: column;
}

.preview-classic-nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.preview-classic-logo {
  font-family: var(--font-serif, 'Noto Serif', serif);
  font-weight: 700;
  font-size: 11px;
  color: #1a1a1a;
}

.preview-classic-links {
  display: flex;
  gap: 7px;
}

.preview-classic-link {
  width: 18px;
  height: 4px;
  background: rgba(0, 0, 0, 0.30);
  border-radius: 2px;
}

.preview-classic-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.preview-classic-eyebrow {
  width: 38%;
  height: 4px;
  background: var(--accent, #5b8ef0);
  border-radius: 2px;
  margin-bottom: 6px;
}

.preview-classic-h1 {
  width: 38%;
  height: 13px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 3px;
}

.preview-classic-h1.italic {
  width: 56%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.65) 100%);
  transform: skewX(-8deg);
  margin-bottom: 8px;
}

.preview-classic-line {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  margin-bottom: 5px;
}

.preview-classic-line.short { width: 64%; }

.preview-classic-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.preview-classic-btn {
  width: 70px;
  height: 14px;
  background: var(--accent, #5b8ef0);
  border-radius: 4px;
  box-shadow: 0 2px 6px var(--accent-glow, rgba(107, 158, 248, 0.30));
}

.preview-classic-btn.outline {
  background: transparent;
  border: 1.5px solid rgba(0, 0, 0, 0.40);
  box-shadow: none;
  width: 70px;
}

/* ── Card label (under preview) ── */
.intro-picker-card-label {
  padding: 0 2px;
}

.intro-picker-card-label h2 {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 3px;
  color: var(--text, rgba(255, 255, 255, 0.96));
  letter-spacing: 0.05em;
}

.intro-picker-card-label p {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  margin: 0;
  text-transform: lowercase;
}

/* ── Floor walker — JS-driven random walking like desktop slimes ── */
.intro-floor-walker {
  position: fixed;
  bottom: 70px;            /* clears the patch notes pill */
  left: 0;
  z-index: 9201;            /* above splash content, below modal */
  pointer-events: none;
  /* transform is set by JS each frame */
  will-change: transform;
}

/* Slime sprite — uses .slime base from desktop.css, 48×48 native size */
.intro-floor-slime {
  /* .slime already provides sprite + idle walk animation */
  position: relative;
}

/* Bubble — uses .goop-bubble styles from goop.css for the colors/shape,
   but we override position so it follows the walker (instead of fixed).
   Selectors are extra-specific to win over goop.css (which loads later).
   left: 24px = slime center (half of 48px walker). translateX(-50%) then
   centers the bubble on that anchor so it grows outward symmetrically in
   both directions during typewriting — same behavior as the desktop bubble.
   --bubble-clamp-offset shifts the anchor when Goop is near a screen edge
   (JS sets this via setProperty/removeProperty, never touching transform). */
.intro-splash .intro-floor-bubble {
  position: absolute;
  bottom: 58px;
  left: calc(24px + var(--bubble-clamp-offset, 0px));
  transform: translateX(-50%) translateY(2px);
  margin: 0;
  width: max-content;
  max-width: 260px;
  white-space: normal;
}

.intro-splash .intro-floor-bubble.visible {
  transform: translateX(-50%) translateY(0);
}

/* Arrow at the bottom of the bubble pointing down at Goop.
   left is set by JS to keep pointing at Goop even when the bubble is clamped. */
.intro-splash .intro-floor-bubble .goop-bubble-arrow {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Footer (patch notes pill) ── */
.intro-picker-footer {
  display: flex;
  width: 100%;
  justify-content: flex-start;
}

.intro-picker-patch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card, rgba(16, 16, 24, 0.5));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.18));
  color: var(--text-muted, rgba(255, 255, 255, 0.75));
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.intro-picker-patch:hover,
.intro-picker-patch:focus-visible {
  color: var(--accent, #5b8ef0);
  border-color: var(--accent, rgba(107, 158, 248, 0.5));
  outline: none;
}

.intro-picker-patch-mark { color: var(--accent, #5b8ef0); font-size: 10px; }

/* ── Sound-unlock hint — subtle pill at bottom center.
   Sits above the changelog window's z-index so it's always readable.
   Fades out the moment any user gesture unlocks AudioContext. */
.intro-sound-hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9310;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  background: var(--bg-card, rgba(16, 16, 24, 0.45));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  animation: intro-sound-hint-in 0.6s ease 1.4s forwards;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

@keyframes intro-sound-hint-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 0.85; transform: translateX(-50%) translateY(0); }
}

.intro-sound-hint.faded {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(6px);
}

.intro-sound-hint-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent, #5b8ef0);
}

@media (prefers-reduced-motion: reduce) {
  .intro-sound-hint { animation: none; opacity: 0.85; }
}

/* ── Changelog — reuses .window from desktop.css; positioned centered
   in viewport since there's no desktop layer yet. No backdrop.
   Center via inset+margin auto (NOT transform — the .window's windowOpen
   animation ends with `transform: none` which would clobber translate). */
.intro-changelog-window {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(620px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 80px));
  z-index: 9300; /* above the splash */
}

.intro-changelog-window[hidden] { display: none !important; }

/* Invisible click-shield. Sits over the picker, below the window. Catches
   any click outside the window and closes the modal — prevents picker
   cards from triggering through the modal. */
.intro-changelog-shield {
  position: fixed;
  inset: 0;
  z-index: 9290;
  background: transparent;
}
.intro-changelog-shield[hidden] { display: none !important; }

/* Override default .window-title cursor (it's `move` for dragging) — this
   modal isn't draggable. */
.intro-changelog-window .window-title { cursor: default; }

/* The inline ICONS.changelog SVG sits to the left of the title text */
.intro-changelog-window .window-title .name svg {
  margin-right: 6px;
  color: var(--accent);
  vertical-align: -2px;
}

/* ── Mobile — horizontal card layout, shorter cards ── */
@media (max-width: 720px) {
  .intro-picker { padding: 18px 14px; gap: 18px; }

  .intro-picker-eyebrow { font-size: 10px; margin: 0 0 8px; }
  .intro-picker-name { font-size: clamp(40px, 12vw, 56px); }

  .intro-picker-cards {
    flex-direction: column;
    gap: 14px;
  }

  /* Card switches to horizontal: preview left, label right */
  .intro-picker-card {
    padding: 12px;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    align-items: center;
  }

  .intro-picker-card-preview {
    margin-bottom: 0;
    aspect-ratio: 4 / 3;
    width: 130px;
  }

  .intro-picker-card-label { padding: 0; }
  .intro-picker-card-label h2 { font-size: 15px; margin-bottom: 4px; }
  .intro-picker-card-label p  { font-size: 11px; }

  /* Recommended badge moves to top of card, smaller */
  .intro-picker-badge {
    top: -9px;
    left: 12px;
    font-size: 11px;
    padding: 3px 8px;
    letter-spacing: 0.16em;
  }

  /* Preview details scale down for the smaller mobile preview */
  .preview-dos-window { width: 60%; top: 8%; }
  .preview-dos-line { font-size: 8px; }
  .preview-dos-mini { width: 50%; height: 60%; top: 28%; }
  .preview-dos-mini-h { height: 6px; }
  .preview-dos-mini-line { height: 2px; }

  .preview-classic-body { padding: 8px 10px; }
  .preview-classic-h1 { height: 9px; }
  .preview-classic-eyebrow { height: 3px; margin-bottom: 4px; }
  .preview-classic-line { height: 3px; margin-bottom: 3px; }
  .preview-classic-btn { width: 38px; height: 9px; }

  .intro-picker-patch { font-size: 11px; padding: 7px 12px; }

  /* Goop walker — JS picks targets within tighter bounds on mobile */
  .intro-floor-walker { bottom: 60px; }
  .intro-splash .intro-floor-bubble {
    max-width: min(260px, calc(100vw - 32px));
  }

  .intro-changelog-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 60px);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .intro-splash { transition: none; }

  .intro-picker-card.recommended { animation: none; }
  .intro-picker-card:hover,
  .intro-picker-card:focus-visible { transform: none; }

  .intro-floor-slime { animation: none; }

  .preview-dos-cursor { animation: none; }
}
