/* Shared layout for Nimbic product pages (/gatehold/, /levents/, ...).
   Each page sets its own palette and fonts as tokens on :root (and in a dark-mode block if it has one),
   and keeps only product-specific bits (hero background, special lists) in its own <style>.

   Tokens a page sets:
     --bg --surface --raised --line --text --muted   surfaces and text
     --accent        highlight colour: links on hover, bullets, store badges, focus rings
     --accent-ink    text on an --accent fill
     --heading       section headings (often --accent or --text)
     --display       heading font stack     --body   body font stack
     --shadow        shadow under screenshots
     --viewer-bg     screenshot viewer backdrop (always dark) */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.075rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 14px; color: var(--heading); }
h3 { font-size: 1.15rem; margin: 0 0 8px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Back to the studio */
.topbar { padding: 20px 0; }
.topbar.over { position: absolute; inset: 0 0 auto; z-index: 2; }
.topbar a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font-size: .95rem; }
.topbar a:hover { color: var(--text); }
.topbar img { height: 26px; width: auto; }

/* "Coming soon" store badges, plain text: the official badge images may only link to a live listing (see .badge) */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; flex-direction: column; padding: 10px 20px; border-radius: 12px;
  border: 1.5px dashed var(--accent); color: var(--accent); line-height: 1.25; text-decoration: none;
}
.store small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.store b { font-size: 1.05rem; }

/* Official store badges (Google Play, itch.io), used unmodified and only as links to a live listing.
   Google's PNG has transparent padding built in, so it's set taller to look the same size. */
.stores { align-items: center; }
.badge { display: inline-block; line-height: 0; }
.badge .gp { height: 64px; width: auto; }
.badge .itch { height: 46px; width: auto; }

/* App hero: icon, name, tagline, pitch and badges beside a lead screenshot */
.app-hero { padding: 24px 0 8px; }
.app-hero .grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.app-hero .icon { width: 88px; height: 88px; border-radius: 20px; margin: 0 0 20px; box-shadow: var(--shadow); }
.app-hero h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); letter-spacing: -.02em; margin: 0 0 6px; }
.app-hero .tag { font-size: clamp(1.15rem, 3vw, 1.4rem); font-weight: 600; margin: 0 0 14px; }
.app-hero .pitch { color: var(--muted); max-width: 32em; margin: 0 0 26px; }
.app-hero .lead { max-width: 340px; justify-self: center; }

section { padding: 72px 0 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 40px; align-items: center; }
/* Let grid columns shrink below an image's natural width. */
.split > *, .phones > *, .screens > *, .gallery > *, .features > *, .stats > *, .app-hero .grid > * { min-width: 0; }
.shot { width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; background: var(--surface); }

/* Numbers strip */
.stats { display: grid; grid-template-columns: repeat(var(--stats, 6), minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 72px; }
.stats div { background: var(--surface); padding: 18px 10px; text-align: center; }
.stats b { display: block; font-family: var(--display); font-size: 1.9rem; color: var(--accent); line-height: 1.1; }
.stats span { color: var(--muted); font-size: .9rem; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.feature p { color: var(--muted); margin: 0; }
.feature .rule { width: 36px; height: 3px; background: var(--accent); border-radius: 2px; margin: 0 0 14px; }

/* Phone screenshots: .phones is a small row beside text, .screens a full-width strip */
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 760px; }
.screens { display: grid; grid-template-columns: repeat(var(--screens, 4), minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.phones .shot, .screens .shot, .app-hero .lead.shot { border-radius: 22px; }

/* Wide (PC) screenshot gallery */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.gallery a { display: block; }
.gallery .shot { transition: transform .15s ease, border-color .15s ease; }
.gallery a:hover .shot, .gallery a:focus-visible .shot { transform: translateY(-2px); border-color: var(--accent); }

/* Bulleted list with small diamond markers */
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.list li { padding-left: 24px; position: relative; }
.list li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 9px; height: 9px; transform: rotate(45deg); background: var(--accent); }

.note { margin-top: 24px; padding: 16px 20px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.note p:last-child { margin: 0; }

.cta { margin: 80px 0 0; padding: 40px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.cta .stores { justify-content: center; margin-top: 20px; }

footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer p { margin: 0; }

/* Screenshot viewer (assets/viewer.js): every main .shot opens it; arrows cycle through all of them and loop. */
.js main .shot { cursor: zoom-in; }
.js main .shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--viewer-bg, rgba(8,9,12,.94)); color: #F2F2F0; }
.viewer::backdrop { background: var(--viewer-bg, rgba(8,9,12,.94)); }
.viewer[open] { display: grid; grid-template-rows: 1fr auto; }
.viewer figure { margin: 0; min-height: 0; display: grid; place-items: center; padding: 56px 72px 8px; }
.viewer img { max-width: 100%; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); user-select: none; -webkit-user-drag: none; }
.viewer figcaption { text-align: center; color: rgba(242,242,240,.7); padding: 10px 20px 22px; font-size: .95rem; }
.viewer figcaption b { color: #F2F2F0; font-weight: 600; margin-right: 10px; }
.viewer button {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(30,32,38,.85); color: #F2F2F0; cursor: pointer;
}
.viewer button:hover { border-color: var(--accent); color: var(--accent); }
.viewer button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.viewer button svg { width: 22px; height: 22px; }
.viewer .prev { left: 14px; top: 50%; transform: translateY(-50%); }
.viewer .next { right: 14px; top: 50%; transform: translateY(-50%); }
.viewer .close { right: 14px; top: 12px; width: 42px; height: 42px; }

@media (max-width: 860px) {
  .split, .phone-split, .app-hero .grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .app-hero .lead { max-width: 280px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screens { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  section { padding-top: 56px; }
  .phones { gap: 10px; }
  .phones .shot, .screens .shot { border-radius: 14px; }
  .screens { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .stats b { font-size: 1.5rem; }
  .cta { padding: 28px 20px; }
  .viewer figure { padding: 60px 10px 8px; }
  .viewer .prev, .viewer .next { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
  .viewer figcaption { padding: 10px 70px 24px; min-height: 76px; }
  .viewer img { max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); }
}
