:root {
  color-scheme: dark;
  --bg: #04060c;
  --text: #e8eefc;
  --muted: #aab8d8;
  --line: #33456e;
  --focus: #8fd3ff;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(ellipse at 66% 45%, #0e1730 0%, #060914 55%, #020308 100%) fixed, var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

/* pinch-zoom stays available; one-finger drags still reach the particle push */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: pinch-zoom; }

.card {
  position: fixed;
  left: 6vw;
  top: 50%;
  transform: translateY(-50%);
  max-width: min(38vw, 34rem);
  max-height: 100%;
  overflow-y: auto; /* at high zoom the card scrolls instead of being clipped */
  padding: 6px;     /* room for the focus ring inside the scroll box */
  z-index: 1;
}
.card h1 { font-weight: 800; font-size: clamp(2rem, 4.2vw, 4.4rem); letter-spacing: .02em; line-height: 1.05; }
.card p { margin-top: .9rem; font-size: clamp(1rem, 1.3vw, 1.4rem); line-height: 1.5; color: var(--muted); }
.card nav { margin-top: 1.4rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.card a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-size: .95rem;
}
.card a:hover { border-color: var(--muted); }
.card a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* app.js adds .anim (not with reduced motion): the card waits for the face, but shows at once if focused.
   The CSS-only reveal guarantees it appears by ~9 s if the script or the points request stalls; app.js adds
   .ready when the points arrive in time, handing the reveal to the intro (keeps a background tab's card hidden). */
.anim .card { opacity: 0; transition: opacity 1.2s ease; }
.anim:not(.ready) .card { animation: reveal 1.2s 8s forwards; }
.anim .card.show, .anim .card:focus-within { opacity: 1; }
@keyframes reveal { to { opacity: 1; } }

/* Tall screens: face at the top (see app.js), card at the bottom. Keep in sync with TALL in app.js. */
@media (max-aspect-ratio: 1/1) {
  .card {
    left: 8vw;
    right: 8vw;
    top: auto;
    bottom: max(7vh, env(safe-area-inset-bottom));
    transform: none;
    max-width: none;
    max-height: 88%;
  }
  .card h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .card p { font-size: clamp(.95rem, 3.8vw, 1.1rem); }
}
