/* ============================================================
   QUEEN LIA REGINA — APP SHELL  ·  v3.0.4
   Loads AFTER theme.css. Everything here is additive or an
   intentional mobile override; theme.css is untouched except
   for two 100vh → 100dvh corrections.
   Tokens come from theme.css :root — no new colour values.
   Breakpoint tracks theme.css: 768px.
   ============================================================ */

:root {
  --qlr-tabbar-h: 56px;
  --qlr-safe-b:   env(safe-area-inset-bottom, 0px);
  --qlr-safe-t:   env(safe-area-inset-top, 0px);
  --qlr-chrome-b: calc(var(--qlr-tabbar-h) + var(--qlr-safe-b));
}

/* ============================================================
   [ 01 ]  BROWSER TELLS
   ============================================================ */
html  { overscroll-behavior-y: none; }
body  { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }

a, button, summary, label, [role="button"] { touch-action: manipulation; }

/* Long-press selection on navigation chrome reads as "webpage".
   Reading surfaces stay selectable. */
@media (display-mode: standalone) {
  body { user-select: none; -webkit-user-select: none; }
  .post-content, .gh-content, .creation-excerpt, .post-card-excerpt,
  .hero-tagline, .hero-plain, p, li, blockquote, time {
    user-select: text; -webkit-user-select: text;
  }
}

/* ============================================================
   [ 02 ]  THE FRAME RETRACTS ON MOBILE
   theme.css draws the site inside a hairline box inset 10px.
   On desktop that is the brand. On a phone — especially in
   standalone, where there is no browser chrome to explain it —
   a hairline box floating 10px from every screen edge is the
   single loudest "this is a website" signal on the page.
   The header rule and the tab bar's top rule carry the motif
   instead. Revert by deleting this block.
   ============================================================ */
@media (max-width: 768px) {
  body {
    margin: 0;
    border: 0;
    min-height: 100dvh;
    padding-top: var(--qlr-safe-t);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: var(--qlr-chrome-b);
  }
  .site-header { position: relative; z-index: 1; }
}

/* The nav overlay tracks --frame-gap. With the frame gone it must go
   edge to edge, or it leaves a 10px seam showing the tab bar beneath. */
@media (max-width: 768px) {
  .site-nav {
    --frame-gap: 0px;
    inset: 0;
    border: 0;
    padding-top: var(--qlr-safe-t);
    padding-bottom: var(--qlr-safe-b);
  }
  .nav-close {
    top: var(--qlr-safe-t);
    right: 0;
  }
}

/* ============================================================
   [ 03 ]  TAB BAR
   z-index 480 — deliberately below .site-nav (500) so the
   full-screen menu covers it, and far below .qlr-overlay (8000).
   ============================================================ */
.qlr-tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 480;
  display: none;
  background: rgba(16, 16, 18, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--qlr-safe-b);
}

@media (max-width: 768px) { .qlr-tabbar { display: block; } }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .qlr-tabbar { background: var(--bg); }
}

.qlr-tabbar-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: var(--qlr-tabbar-h);
}

.qlr-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  color: var(--mute-2);
  transition: color var(--t);
}
.qlr-tab + .qlr-tab { border-left: 1px solid var(--line-soft); }

.qlr-tab-glyph { font-size: 13px; line-height: 1; }

.qlr-tab-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

/* The hairline is the state. No pill, no fill, no bounce. */
.qlr-tab::before {
  content: "";
  position: absolute;
  top: -1px; left: 22%; right: 22%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--t);
}
.qlr-tab[aria-current="page"] { color: var(--gold-light); }
.qlr-tab[aria-current="page"]::before { transform: scaleX(1); }

.qlr-tab:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -4px; }

/* Off-property routes are marked, so leaving the shell is never a surprise. */
.qlr-tab-external .qlr-tab-glyph::after {
  content: "";
  display: inline-block;
  width: 3px; height: 3px;
  margin-left: 4px;
  vertical-align: 4px;
  background: var(--mute-2);
  border-radius: 50%;
}

/* ============================================================
   [ 04 ]  HOMEPAGE MOBILE RHYTHM
   v3.2.3 removes the old full-viewport panel treatment. Small
   sections now occupy only the space their content needs and the
   page scrolls naturally instead of snapping from panel to panel.
   ============================================================ */
@media (max-width: 768px) {
  .home-template { scroll-snap-type: none; }
  .home-template .qlr-panel {
    min-height: 0;
    display: block;
    scroll-snap-align: none;
  }
}

/* ============================================================
   [ 05 ]  CROSS-DOCUMENT VIEW TRANSITIONS
   Removes the white flash between Ghost pages.
   Chrome + Safari 18+. Firefox navigates normally.
   ============================================================ */
@view-transition { navigation: auto; }

/* Furniture must hold still or the persistent-shell illusion dies. */
.qlr-tabbar   { view-transition-name: qlr-tabbar; }
.site-header  { view-transition-name: qlr-header; }

::view-transition-old(root) { animation: qlr-vt-out 90ms ease both; }
::view-transition-new(root) { animation: qlr-vt-in 170ms ease both; }

@keyframes qlr-vt-out { to   { opacity: 0; } }
@keyframes qlr-vt-in  { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ============================================================
   [ 06 ]  INSTALL INVITATION
   ============================================================ */
.qlr-install {
  position: fixed;
  left: 10px; right: 10px;
  bottom: calc(var(--qlr-chrome-b) + 10px);
  z-index: 470;
  display: none;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.5;
}
.qlr-install[data-visible="true"] { display: flex; }
.qlr-install-mark  { color: var(--gold); flex: 0 0 auto; }
.qlr-install-copy  { flex: 1 1 auto; }
.qlr-install-close {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--mute);
  font: inherit;
  padding: 7px 10px;
  cursor: pointer;
}
.qlr-install-close:hover { color: var(--ink); border-color: var(--mute-2); }

@media (min-width: 769px) { .qlr-install { display: none !important; } }
@media (display-mode: standalone) { .qlr-install { display: none !important; } }

/* ============================================================
   [ 07 ]  THE STANDING HOUR — recurring live show
   State is computed by qlr-live.js, never hand-set.
   ============================================================ */

/* ---- Homepage panel ---- */
.live-notice { border-top: 1px solid var(--line); }

.live-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) var(--pad);
}

.live-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.live-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute-2);
  border: 1px solid var(--line);
  padding: 5px 10px;
}
.live-state[data-live="on"] { color: var(--gold-light); border-color: var(--gold); }

.live-dot {
  width: 6px; height: 6px;
  background: var(--mute-2);
  border-radius: 50%;
  flex: 0 0 auto;
}
.live-state[data-live="on"] .live-dot,
.live-dot-on { background: var(--crimson); }

/* The pulse is the one non-user-triggered motion on the page, and it earns
   it: it only ever runs while the room is actually open. */
@media (prefers-reduced-motion: no-preference) {
  .live-state[data-live="on"] .live-dot,
  .live-dot-on { animation: qlr-live-pulse 2.4s ease-in-out infinite; }
}
@keyframes qlr-live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.live-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.live-subject {
  font-family: var(--font-serif);
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--ink-dim);
  max-width: 46ch;
  margin-bottom: 10px;
}

.live-when {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 28px;
}

.live-actions { display: flex; flex-wrap: wrap; }
.live-actions[hidden] { display: none !important; }

/* ---- Fixed live strip — only while the show is running ---- */
.live-strip {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 475;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px + var(--qlr-safe-b));
  background: var(--bg-sink);
  border-top: 1px solid var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}
.live-strip[hidden] { display: none; }

/* Above the tab bar, not behind it. */
@media (max-width: 768px) {
  .live-strip { bottom: var(--qlr-chrome-b); padding-bottom: 12px; }
}

@media (min-width: 769px) {
  .live-strip {
    left: auto;
    right: var(--frame-gap);
    bottom: var(--frame-gap);
    max-width: 420px;
    border: 1px solid var(--gold);
  }
}

.live-strip-copy   { flex: 1 1 auto; }
.live-strip-copy strong { color: var(--ink); font-weight: 400; }

.live-strip-cta {
  flex: 0 0 auto;
  color: var(--gold-light);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}
.live-strip-cta:hover { color: var(--ink); }

.live-strip-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--mute-2);
  font: inherit;
  cursor: pointer;
  padding: 4px 6px;
}
.live-strip-close:hover { color: var(--ink); }

/* The tab bar's live tint, when the room is open. */
.qlr-tab-live[data-live="on"] { color: var(--gold-light); }


/* v3.2.2 — live NiteFlirt state in the persistent mobile Lines tab. */
.qlr-tab[data-nf-tab][data-status="open"] { color: var(--gold-light); }
.qlr-tab[data-nf-tab][data-status="open"]::before { transform: scaleX(1); }
.qlr-tab-line-dot { font-size: 8px; }
.qlr-tab[data-nf-tab]:not([data-status="open"]) .qlr-tab-line-dot { color: var(--mute-2); }
