/* =====================================================================
   immerse.css — fullscreen app shell (kernel, "draw to the screen")
   A Flipboard-style vertical snap deck: every site is one immersive
   scroller of edge-to-edge fullscreen cards. No browser chrome feel —
   the page IS the app. Each card fills the viewport, snap-scrolls, and
   is reached via the dot rail on the phone bezel or arrow keys.

   Consuming page structure:
     <body class="immerse">
       <div class="immerse-viewport">
         <section class="card" id="cover" style="--bg:#0e7490; --fg:#fff">...</section>
         <section class="card" id="jars">...</section>
       </div>
       <nav class="immerse-dots"></nav>   <!-- auto-built by immerse.js -->
     </body>

   Cards declare --bg / --fg (and optional --accent) inline so each panel
   can wear its own palette. Content lives in .card-inner so it gets safe
   areas and readable line length without the card worrying about it.
   ===================================================================== */

:root {
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html, body {
  height: 100%;
  margin: 0;
  background: #0a0f1a;
}

.immerse {
  height: 100dvh;
  overflow: hidden;
  position: relative;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  -webkit-text-size-adjust: 100%;
}

/* the vertical snap rail */
.immerse-viewport {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;              /* firefox: hide rail */
  overscroll-behavior-y: contain;     /* no rubber-banding the app */
}
.immerse-viewport::-webkit-scrollbar { display: none; } /* chrome/safari */

/* each panel = one fullscreen card */
.card {
  --bg: #101a2b;
  --fg: #f4f1ea;
  --accent: #ffb86b;
  min-height: 100dvh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  /* respect notched phones / home indicators */
  padding: max(1.5rem, env(safe-area-inset-top))
           max(1.25rem, env(safe-area-inset-right))
           max(5.5rem, env(safe-area-inset-bottom))
           max(1.25rem, env(safe-area-inset-left));
  box-sizing: border-box;
  overflow: hidden;
}

/* full-bleed background layer (image or gradient) a card can declare */
.card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  background-size: cover;
  background-position: center;
}
.card-bg::after {
  /* scrim so text stays readable over imagery */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%);
}

.card-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;          /* magazine: copy sits low */
  gap: .9rem;
  max-width: 30rem;
  width: 100%;
  margin: 0 auto;
}
.card-inner.is-center {
  justify-content: center;
  text-align: center;
  align-items: center;
}

.card-kicker {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.card-head {
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin: 0;
}
.card-lede {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  line-height: 1.45;
  color: color-mix(in srgb, var(--fg) 80%, transparent);
  margin: 0;
  max-width: 38ch;
}
.card-meta {
  font-size: .8rem;
  letter-spacing: .04em;
  color: color-mix(in srgb, var(--fg) 55%, transparent);
  margin: 0;
}

/* the action button on a cover card */
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  align-self: flex-start;
  margin-top: .5rem;
  padding: .85rem 1.4rem;
  border-radius: 10px;
  background: var(--accent);
  color: #101a2b;
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.card-cta:hover { transform: translateY(-2px); }
.card-cta.ghost {
  background: rgba(255,255,255,.12);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,.25);
}

/* link/content rows inside a card (replaces the old .tool / .t-ico / .t-go panels) */
.tool-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
  text-decoration: none;
  color: var(--fg);
  transition: background .15s ease;
}
.tool-row:first-of-type { border-top: 0; }
.tool-row:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.tool-ico {
  width: 2.4rem; height: 2.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}
.tool-ico svg { width: 1.2rem; height: 1.2rem; }
.tool-body { flex: 1; min-width: 0; }
.tool-body h3 { margin: 0 0 .15rem; font-size: 1.15rem; font-weight: 800; }
.tool-body p { margin: 0; font-size: .92rem; color: color-mix(in srgb, var(--fg) 75%, transparent); }

/* a card that hosts a live tool (map, scanner, etc.) hides the magazine
   copy styling and lets the tool own the viewport */
.card.is-tool .card-inner {
  justify-content: flex-start;
  max-width: none;
  height: 100%;
}

/* light cards (for variety) */
.card.light {
  --fg: #101a2b;
}
.card.light .card-lede { color: color-mix(in srgb, var(--fg) 75%, transparent); }

/* short-phase entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.card.is-active .card-inner > * {
  animation: rise .5s var(--ease) both;
}
.card.is-active .card-inner > *:nth-child(1) { animation-delay: .05s; }
.card.is-active .card-inner > *:nth-child(2) { animation-delay: .12s; }
.card.is-active .card-inner > *:nth-child(3) { animation-delay: .19s; }
.card.is-active .card-inner > *:nth-child(4) { animation-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
  .immerse-viewport { scroll-behavior: auto; }
  .card.is-active .card-inner > * { animation: none; }
}

/* ---- workflow rail: every deck page is a guided flow ------------------- */
.wf-rail {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  display: flex; align-items: center; gap: .45rem;
  padding: .4rem .5rem; border-radius: 999px;
  background: color-mix(in srgb, #0b1421 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg, #ffffff) 18%, transparent);
  backdrop-filter: blur(8px);
}
.wf-rail button, .wf-rail .wf-map, .wf-rail .wf-next, .wf-rail .wf-choice {
  font: inherit; font-weight: 700; font-size: .82rem;
  border: 1px solid color-mix(in srgb, var(--fg, #ffffff) 30%, transparent);
  background: transparent; color: var(--fg, #ffffff);
  border-radius: 999px; padding: .3rem .7rem; text-decoration: none; cursor: pointer;
}
.wf-step { min-width: 2.2rem; text-align: center; font: 600 .8rem system-ui, sans-serif; color: var(--fg, #ffffff); opacity: .75; }
.wf-next { background: var(--accent, #5fae6f); border-color: transparent; color: #08110a; }
.wf-choice { border-color: var(--accent, #5fae6f); }
@media (max-width: 480px) { .wf-rail { left: 1rem; right: 1rem; justify-content: space-between; } }

