/* ============================================================
   DRIVE — styles.css (new layout)
   ============================================================ */

:root {
  --bg:     #05070b;
  --text:   #edf2f7;
  --muted:  rgba(255,255,255,.48);
  --green:  #7dffb3;
  --red:    #ff6b6b;
  --border: rgba(255,255,255,.07);
  --ease:   cubic-bezier(.16,.84,.44,1);

  /* Per-experience accent colors. Each DRIVE experience gets its own. */
  --silas-accent: #8b2635;
  --inmate-6382-accent: #7c3fd6;

  /* Active-experience accent — set dynamically by script.js when the
     carousel switches. Falls back to Silas's so nothing breaks pre-JS. */
  --active-accent: var(--silas-accent);
  --active-accent-border: rgba(139,38,53,.4);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

/* NOTE: letter-spacing here is intentionally .18em (homepage/marketing context).
   core/style.css defines .mono at .12em for the reader (tighter, denser text).
   The two values are deliberate — do not "unify" them without checking both contexts. */
.mono {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
}

/* GRAIN */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: soft-light;
  background-image: url("assets/noise.svg");
  z-index: 2;
}

/* NAVBAR */
.nav {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(8,10,14,.38);
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(110%);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.logo-img-link { display: flex; align-items: center; text-decoration: none; }
.logo-img {
  height: 22px;
  width: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  filter: brightness(1.15);
}
.logo {
  font-size: 14px;
  letter-spacing: .34em;
  text-shadow: 0 0 16px rgba(255,255,255,.14);
}

.logo-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.logo-tag {
  display: none;
  font-size: 9px;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  white-space: nowrap;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

@media (min-width: 640px) {
  .logo-tag { display: inline; }
}

.links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.links button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
  transition: color .3s ease;
}

.links button:hover { color: var(--text); }

/* Nav links (anchor tags in the desktop nav) */
.nav-link {
  color: var(--muted);
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
  text-decoration: none;
  transition: color .3s ease;
}
.nav-link:hover { color: var(--text); }

.burger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
}

/* MAIN — fixed app-shell: hero fills remaining space, carousel + status
   bar sit at their natural compact height beneath it. No page scroll. */
.home {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: max(90px, calc(env(safe-area-inset-top) + 76px)) 20px max(78px, calc(env(safe-area-inset-bottom) + 64px));
}

.home-main {
  flex: 0 0 calc(68% - 7px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Sidebar — desktop only. Hidden on mobile (Support/Store live in the burger there). */
.home-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* TILES */
.tile {
  position: relative;
  border: 1px solid var(--border);
  background: rgba(8,10,14,.55);
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(110%);
  border-radius: 12px;
  overflow: hidden;
}
/* Background image via --tile-bg inline CSS var */
.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--tile-bg, none);
  background-size: cover;
  background-position: center;
  opacity: .72;
  z-index: 0;
}
/* Gradient for text legibility */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5,7,11,.08) 0%,
    rgba(5,7,11,.48) 45%,
    rgba(5,7,11,.94) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.tile-corners,
.tile-body,
.tile-watermark { position: relative; z-index: 2; }

/* Corner markers */
.tile-corners { pointer-events: none; }

.corner {
  position: absolute;
  font-size: 13px;
  color: rgba(255,255,255,.18);
  font-family: monospace;
  line-height: 1;
}
.corner.tl { top: 14px;    left: 14px; }
.corner.tr { top: 14px;    right: 14px; }
.corner.bl { bottom: 14px; left: 14px; }
.corner.br { bottom: 14px; right: 14px; }

/* HERO — Active Observation panel */
.hero-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
}

/* Section header above the carousel */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 10px;
}
.section-title {
  font-size: 11px;
  color: var(--muted);
}
.section-count {
  font-size: 10px;
  color: rgba(255,255,255,.28);
}

.experiences-section { display: flex; flex-direction: column; flex: 0 0 auto; }

/* Sidebar tiles — Support / Store (desktop only) */
.qa-card {
  flex: 1;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.qa-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  font-size: 15px;
  color: rgba(255,255,255,.4);
}

.tile-body.qa-body { padding: 20px; }

.qa-title {
  font-weight: 200;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -.01em;
  line-height: 1;
  margin-bottom: 8px;
}

.qa-sub {
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* TILE BODY */
.tile-body {
  position: relative;
  z-index: 2;
  padding: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.tile-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.tile-title {
  font-weight: 200;
  font-size: clamp(52px, 6.5vw, 104px);
  letter-spacing: -.02em;
  line-height: .9;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.tile-title-sm {
  font-size: clamp(20px, 2.4vw, 38px);
  margin-bottom: 18px;
}

.tile-rule {
  width: 28px;
  height: 1px;
  background: rgba(255,255,255,.2);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.tile-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .1em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  flex-shrink: 0;
}

/* Fixed-height spacer between description and CTA — identical on every tile */
.tile-spacer {
  flex: 0 0 20px;
}

/* ENTER button — large tile CTA */
.tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background .3s ease, border-color .3s ease;
  flex-shrink: 0;
  align-self: flex-start;
  box-sizing: border-box;
}

.tile-btn:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.32);
}

/* LINK — small tile CTA */
.tile-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding-bottom: 5px;
  transition: color .3s ease, border-color .3s ease;
  flex-shrink: 0;
  align-self: flex-start;
}

.tile-link:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.3);
}

/* ── HERO BODY — status row, title, meta stats, CTA ──────────────────────── */
.hero-body { padding: 26px; }

.hero-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--active-accent-text, var(--active-accent));
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  margin-bottom: 14px;
}
.hero-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--active-accent-text, var(--active-accent));
  box-shadow: 0 0 7px var(--active-accent-text, var(--active-accent));
  flex-shrink: 0;
  animation: sp-pulse 2.4s ease infinite;
}
@keyframes sp-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}
/* No save yet — a plain, unlit status; not worth animating an alert colour */
.hero-status.idle { color: var(--muted); text-shadow: none; }
.hero-status.idle .hero-status-dot {
  background: var(--muted);
  box-shadow: none;
  animation: none;
}

.hero-line {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--active-accent-text, var(--active-accent));
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  margin-bottom: 20px;
}
.hero-line.idle { color: var(--muted); text-shadow: none; }

.hero-meta {
  display: flex;
  gap: 18px;
  padding-top: 16px;
  margin-bottom: 4px;
  border-top: 1px solid rgba(255,255,255,.09);
  flex-wrap: wrap;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-meta-label {
  font-size: 8px;
  letter-spacing: .12em;
  color: rgba(255,255,255,.32);
}
.hero-meta-val {
  font-size: 13px;
  color: var(--text);
  letter-spacing: .04em;
}

.hero-spacer { flex: 0 0 22px; }

.hero-btn { width: fit-content; }

/* FOOTER — docked at the bottom of the fixed app-shell */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  background: rgba(5,7,11,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  gap: 20px;
}

.footer-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-nominal {
  font-size: 9px;
  color: rgba(255,255,255,.55);
  letter-spacing: .14em;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  animation: statusPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.dot::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 36px; height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.dot.alert {
  background: var(--red);
  box-shadow: 0 0 18px var(--red);
  animation: none;
}

.system-status {
  font-size: 10px;
  letter-spacing: .14em;
  transition: color .4s ease;
}

.system-status.alert { color: var(--red); }

@keyframes statusPulse {
  0%   { opacity: .35; transform: scale(.9); box-shadow: 0 0 4px var(--green); }
  50%  { opacity: 1;   transform: scale(1);  box-shadow: 0 0 14px var(--green); }
  100% { opacity: .35; transform: scale(.9); box-shadow: 0 0 4px var(--green); }
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 18px;
}

.social-link {
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  text-decoration: none;
}
.social-link svg { width: 18px; height: 18px; }

.social-link:hover { color: var(--text); }

/* LEGAL PANELS */
.legal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5,7,11,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.legal.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.legal-box {
  width: min(760px, calc(100vw - 48px));
  max-height: 80svh;
  overflow: hidden;
  padding: 24px;
  background: rgba(8,10,14,.92);
  backdrop-filter: blur(24px) saturate(115%);
  -webkit-backdrop-filter: blur(24px) saturate(115%);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  box-shadow: 0 40px 120px rgba(0,0,0,.48);
  opacity: 0;
  transform: translateY(24px) scale(.985);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.legal.active .legal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.legal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.legal-top p {
  font-size: 10px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
}

pre {
  white-space: pre-wrap;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.8;
  font-size: 13px;
  color: rgba(255,255,255,.58);
  overflow-y: auto;
  max-height: calc(80svh - 80px);
}

.close-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
  padding: 5px 10px;
  border-radius: 6px;
  transition: color .25s ease, border-color .25s ease, opacity .3s ease;
}

.close-btn:hover { color: var(--text); border-color: rgba(255,255,255,.28); opacity: 1; }

/* BURGER MENU */
.burger-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
}

.burger-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.burger-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,7,11,.94);
}

.burger-panel {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 22px;
  padding: 0 28px;
  max-width: 380px;
  margin: 0 auto;
}

.burger-panel button {
  color: var(--text);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
}

#burgerClose {
  position: absolute;
  top: max(26px, env(safe-area-inset-top));
  right: 24px;
}

/* All 6 burger entries — Support, Store, Privacy, Terms, Queries, Feedback —
   as one uniform grid of tile buttons instead of 2 fancy tiles + a text list. */
.burger-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.burger-panel .burger-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  height: 96px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: rgba(8,10,14,.6);
  cursor: pointer;
  transition: border-color .25s ease, transform .25s cubic-bezier(.16,.84,.44,1);
}
.burger-tile-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--tile-bg, none);
  background-size: cover;
  background-position: center;
  opacity: .38;
  z-index: 0;
}
.burger-tile-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5,7,11,.15) 20%, rgba(5,7,11,.92) 100%);
  z-index: 0;
}
.burger-tile:hover {
  border-color: rgba(255,255,255,.24);
  transform: translateY(-2px);
}
.burger-tile-icon,
.burger-tile-label,
.burger-tile-arrow { position: relative; z-index: 1; }
.burger-tile-icon { font-size: 14px; color: rgba(255,255,255,.5); }
.burger-tile-label { font-size: 11px; letter-spacing: .12em; }
.burger-tile-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 12px;
  color: rgba(255,255,255,.4);
  transition: transform .3s cubic-bezier(.16,.84,.44,1);
}
.burger-tile:hover .burger-tile-arrow { transform: translateX(3px); }

/* SIGNAL POPUP */
.signal-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  z-index: 1000;
}

.signal-popup.active { opacity: 1; }

.signal-popup-box {
  width: min(82vw, 420px);
  background: rgba(5,7,11,.96);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 22px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,.78);
}

.signal-popup-title {
  letter-spacing: .22em;
  font-size: 11px;
  opacity: .75;
  margin-bottom: 10px;
}

.signal-popup-title::after {
  content: '';
  display: block;
  margin-top: 12px;
  height: 1px;
  background: rgba(255,255,255,.06);
}

#signalPopupContent {
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: .04em;
  white-space: pre-line;
}

/* WELCOME SCREEN */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5,7,11,.72);
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
  opacity: 1;
  visibility: visible;
  transition: opacity .6s var(--ease), visibility .6s ease;
}
html.no-welcome .welcome-screen { display: none; }
.welcome-screen.welcome-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-box {
  width: min(440px, calc(100vw - 48px));
  padding: 44px 36px;
  text-align: center;
  background: rgba(8,10,14,.92);
  backdrop-filter: blur(24px) saturate(115%);
  -webkit-backdrop-filter: blur(24px) saturate(115%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  box-shadow: 0 40px 120px rgba(0,0,0,.48);
  animation: welcomeRise .55s var(--ease) .05s both;
}

@keyframes welcomeRise {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-label {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--muted);
  margin-bottom: 22px;
}
.welcome-line { width: 56px; height: 1px; background: rgba(255,255,255,.14); margin: 0 auto 26px; }
.welcome-logo {
  display: block;
  width: min(260px, 70%);
  height: auto;
  margin: 0 auto 24px;
  border-radius: 8px;
}
.welcome-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.welcome-desc + .welcome-desc { margin-top: 14px; }
.welcome-desc:last-of-type { margin-bottom: 32px; }
.welcome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 28px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .24em;
  cursor: pointer;
  border-radius: 6px;
  transition: background .25s ease, border-color .25s ease;
}
.welcome-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.36); }

/* ROTATE SCREEN */
.rotate-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .8s var(--ease), visibility .8s ease;
}

.rotate-inner { text-align: center; padding: 40px; }
.rotate-label { font-size: 11px; opacity: .42; margin-bottom: 28px; }
.rotate-line { width: 90px; height: 1px; background: rgba(255,255,255,.14); margin: 0 auto 32px; }
.rotate-title { font-size: 52px; font-weight: 200; letter-spacing: -.04em; line-height: .95; margin-bottom: 24px; }
.rotate-sub { font-size: 13px; color: rgba(255,255,255,.38); }


/* Ending badge — shown in the hero when the active experience has reached
   a classified ending. */
.sp-ending {
  display: inline-block;
  margin-bottom: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--active-accent);
  border: 1px solid var(--active-accent-border);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

@media (orientation: landscape) and (max-width: 1100px) {
  .rotate-screen { opacity: 1; visibility: visible; pointer-events: auto; }
}

/* MOBILE */
@media (max-width: 768px) and (orientation: portrait) {
  .links { display: none; }
  .burger-btn { display: block; }

  .home {
    flex-direction: column;
    gap: 8px;
    padding: max(84px, calc(env(safe-area-inset-top) + 70px)) 14px max(76px, calc(env(safe-area-inset-bottom) + 62px));
  }

  .home-main { flex: 1; gap: 8px; }
  .home-side { display: none; }

  .hero-body { padding: 18px; }
  .tile-title { font-size: 40px; margin-bottom: 10px; }
  .hero-status { margin-bottom: 10px; }
  .hero-line { margin-bottom: 12px; }
  .hero-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    padding-top: 12px;
  }
  .hero-meta-label { font-size: 7px; }
  .hero-meta-val { font-size: 16px; font-weight: 500; letter-spacing: .02em; }
  .hero-spacer { flex-basis: 14px; }

  .section-head { margin-bottom: 6px; }

  .footer { gap: 12px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
}

/* Short phones (e.g. iPhone SE) — trim further so nothing clips */
@media (max-width: 768px) and (orientation: portrait) and (max-height: 700px) {
  .home { gap: 6px; }
  .home-main { gap: 6px; }
  .hero-body { padding: 14px; }
  .tile-title { font-size: 32px; margin-bottom: 6px; }
  .hero-status { margin-bottom: 6px; }
  .hero-line { margin-bottom: 8px; }
  .hero-meta { padding-top: 8px; }
  .hero-meta-val { font-size: 12px; }
  .carousel-strip-item { height: 112px; flex-basis: 94px; }
  .section-head { margin-bottom: 4px; }
}

/* ============================================================
   UI POLISH — Smooth animations & transitions
   ============================================================ */

/* Page enter animation — tiles fade+slide up on load */
@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.grid {
  animation: pageFadeUp .55s cubic-bezier(.16,.84,.44,1) both;
}
.nav {
  animation: pageFadeUp .45s cubic-bezier(.16,.84,.44,1) both;
}
.footer {
  animation: pageFadeUp .5s cubic-bezier(.16,.84,.44,1) .08s both;
}

/* Tile hover — smoother scale and border glow */
.tile {
  transition: border-color .4s ease, transform .35s cubic-bezier(.16,.84,.44,1), box-shadow .35s ease;
  will-change: transform;
}
.tile:hover {
  border-color: rgba(255,255,255,.18);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

/* Tile image parallax-lite */
.tile::before {
  transition: opacity .5s ease, transform .5s cubic-bezier(.16,.84,.44,1);
}
.tile:hover::before {
  opacity: .88;
  transform: scale(1.03);
}

/* Navbar hover states — smooth link underline grow */
.nav-link, .links button {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width .25s cubic-bezier(.16,.84,.44,1);
}
.nav-link:hover::after { width: 100%; }

/* Burger button — subtle scale on hover */
.burger-btn {
  transition: opacity .25s ease, transform .2s ease;
}
.burger-btn:hover { opacity: .8; transform: scale(1.04); }

/* Burger menu — refined slide-in with panel stagger */
.burger-menu {
  transition: opacity .38s cubic-bezier(.16,.84,.44,1), visibility .38s ease;
  visibility: hidden;
}
.burger-menu.active {
  opacity: 1;
  visibility: visible;
}

.burger-backdrop {
  transition: opacity .38s cubic-bezier(.16,.84,.44,1);
  opacity: 0;
}
.burger-menu.active .burger-backdrop { opacity: 1; }

.burger-panel {
  transform: translateY(-16px);
  transition: transform .42s cubic-bezier(.16,.84,.44,1), opacity .38s ease;
  opacity: 0;
}
.burger-menu.active .burger-panel {
  transform: translateY(0);
  opacity: 1;
}

/* Burger items — staggered entrance */
#burgerClose,
.burger-tile {
  opacity: 0;
  transform: translateY(10px);
  transition: color .25s ease, border-color .25s ease, opacity .35s ease, transform .35s cubic-bezier(.16,.84,.44,1);
}
.burger-menu.active #burgerClose,
.burger-menu.active .burger-tile {
  opacity: 1;
  transform: translateY(0);
}
.burger-menu.active #burgerClose { transition-delay: .06s; }
.burger-menu.active .burger-grid .burger-tile:nth-child(1) { transition-delay: .1s; }
.burger-menu.active .burger-grid .burger-tile:nth-child(2) { transition-delay: .13s; }
.burger-menu.active .burger-grid .burger-tile:nth-child(3) { transition-delay: .16s; }
.burger-menu.active .burger-grid .burger-tile:nth-child(4) { transition-delay: .19s; }
.burger-menu.active .burger-grid .burger-tile:nth-child(5) { transition-delay: .22s; }
.burger-menu.active .burger-grid .burger-tile:nth-child(6) { transition-delay: .25s; }

/* Legal overlay — already has transitions, enhance the backdrop */
.legal {
  transition: opacity .5s var(--ease), visibility .5s ease;
}

/* Signal popup — subtle scale entrance */
.signal-popup-box {
  transform: scale(.97);
  transition: transform .35s cubic-bezier(.16,.84,.44,1);
}
.signal-popup.active .signal-popup-box {
  transform: scale(1);
}

/* Social links — lift on hover */
.social-link {
  transition: color .3s ease, transform .25s cubic-bezier(.16,.84,.44,1);
}
.social-link:hover {
  color: var(--text);
  transform: translateY(-2px);
}

/* Enter button — arrow slide */
.tile-btn span,
.tile-link span {
  display: inline-block;
  transition: transform .3s cubic-bezier(.16,.84,.44,1);
}
.tile-btn:hover span,
.tile-link:hover span { transform: translateX(4px); }

/* ── Feedback panel ──────────────────────────────────────────────────────── */
.legal-box-feedback {
  overflow-y: auto;
}

.feedback-body {
  padding-top: 4px;
}

.feedback-intro {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
  letter-spacing: .04em;
}

.feedback-form-wrap .form-group {
  margin-bottom: 20px;
}

.feedback-form-wrap .form-label {
  display: block;
  font-size: 9px;
  letter-spacing: .26em;
  color: var(--muted);
  margin-bottom: 8px;
}

.feedback-form-wrap .form-optional {
  font-size: 9px;
  color: rgba(255,255,255,.2);
  margin-left: 8px;
  letter-spacing: .1em;
}

.feedback-form-wrap .form-select,
.feedback-form-wrap .form-textarea,
.feedback-form-wrap .form-input {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease;
  box-sizing: border-box;
  letter-spacing: .02em;
}

.feedback-form-wrap .form-select:focus,
.feedback-form-wrap .form-textarea:focus,
.feedback-form-wrap .form-input:focus {
  border-color: rgba(255,255,255,.28);
}

.feedback-form-wrap .form-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.feedback-form-wrap .form-select {
  appearance: none;
  cursor: pointer;
}

.feedback-form-wrap .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 24px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .18em;
  cursor: pointer;
  border-radius: 6px;
  transition: background .25s ease, border-color .25s ease;
  margin-top: 6px;
}

.feedback-form-wrap .form-submit:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.3);
}

.feedback-form-wrap .form-note {
  font-size: 10px;
  color: rgba(255,255,255,.2);
  text-align: center;
  margin-top: 12px;
  letter-spacing: .04em;
}

.feedback-form-wrap .form-success {
  text-align: center;
  padding: 32px 16px;
}

.feedback-form-wrap .form-success-title {
  font-weight: 200;
  font-size: 26px;
  letter-spacing: -.01em;
  margin-bottom: 10px;
  color: var(--text);
}

.feedback-form-wrap .form-success-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
}


/* ============================================================
   EXPERIENCE CAROUSEL — swipeable/selectable main tile
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.tile-carousel {
  touch-action: pan-y; /* let vertical page scroll through, we handle horizontal swipe ourselves */
}

/* Real dual-layer background — lets the image genuinely cross-fade instead
   of hard-swapping mid-transition (which used to flash the outgoing image
   back into view for a moment). The carousel doesn't use ::before at all. */
.tile-carousel::before { display: none; }

.tile-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .6s ease;
}

/* Loading state — a quiet scanline shimmer instead of a blank flash while
   an experience's background image is still loading. Only shown if the
   load takes long enough to notice (see the delay in script.js), so fast/
   cached loads never see it. */
.tile-bg-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0px, rgba(255,255,255,.05) 1px, transparent 1px, transparent 3px),
    rgba(8,10,14,.4);
  transition: opacity .3s ease;
}
.tile-bg-shimmer.active {
  opacity: 1;
  animation: bgShimmerScan 1.4s linear infinite;
}
@keyframes bgShimmerScan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 12px, 0 0; }
}

.tile-carousel #experience-tile-body {
  transition: opacity .4s ease;
}
.tile-carousel.is-switching #experience-tile-body {
  opacity: 0;
}

/* Selection row: arrows flank the strip, sitting below the card entirely —
   there is no tile content down here for them to ever overlap. */
.carousel-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-arrow {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(8,10,14,.55);
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(110%);
  color: var(--text);
  font-size: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.carousel-arrow:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.32);
}
.carousel-arrow:active { transform: scale(.92); }

/* Single-experience sites (or while data is loading) don't need a picker at all */
.experiences-section.single-experience .carousel-select-row,
.experiences-section.single-experience .section-head {
  display: none;
}

/* Strip of selectable experience cards */
.carousel-strip {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  padding: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel-strip::-webkit-scrollbar { display: none; }

.carousel-strip-item {
  flex: 0 0 132px;
  scroll-snap-align: start;
  position: relative;
  display: block;
  height: 172px;
  padding: 0;
  background: rgba(8,10,14,.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .25s ease, transform .25s cubic-bezier(.16,.84,.44,1);
}
.carousel-strip-item:hover { transform: translateY(-2px); }
.carousel-strip-item.active {
  border-color: var(--active-accent-border);
  box-shadow: 0 0 0 1px var(--active-accent-border);
}

.carousel-strip-item-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,.06);
  opacity: .5;
  transition: opacity .25s ease;
}
.carousel-strip-item.active .carousel-strip-item-thumb,
.carousel-strip-item:hover .carousel-strip-item-thumb {
  opacity: .85;
}
.carousel-strip-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5,7,11,.1) 30%, rgba(5,7,11,.92) 100%);
}

.carousel-strip-item-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 10px;
}
.carousel-strip-item-title {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}
.carousel-strip-item-pct {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,.5);
  margin-bottom: 6px;
}
.carousel-strip-item-track {
  height: 2px;
  background: rgba(255,255,255,.12);
  border-radius: 1px;
  overflow: hidden;
}
.carousel-strip-item-fill {
  height: 100%;
  width: 0;
  background: var(--item-accent, var(--active-accent));
  transition: width .8s cubic-bezier(.16,.84,.44,1);
}

/* Locked / future-experience teaser card — deliberately mysterious, not just greyed out */
.carousel-strip-item.locked {
  cursor: default;
}
.carousel-strip-item.locked:hover { transform: none; }
.carousel-strip-item-lock-bg {
  position: absolute;
  inset: -6px; /* overshoot so the blur never reveals a hard edge */
  background-size: cover;
  background-position: center;
  filter: blur(7px) brightness(.35) saturate(.7);
  z-index: 0;
}
.carousel-strip-item-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(5,7,11,.32);
}
.carousel-strip-item-lock-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Small CSS padlock — shackle arc + body, monochrome to match the rest of
   the app's typographic glyph set instead of a colour emoji. */
.lock-icon { position: relative; width: 16px; height: 16px; }
.lock-shackle {
  position: absolute;
  top: 0; left: 3px;
  width: 10px; height: 8px;
  border: 1.5px solid rgba(255,255,255,.45);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.lock-body {
  position: absolute;
  bottom: 0; left: 0;
  width: 16px; height: 10px;
  background: rgba(255,255,255,.45);
  border-radius: 2px;
}
.carousel-strip-item-lock-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .16em;
  color: rgba(255,255,255,.5);
}

@media (max-width: 768px) and (orientation: portrait) {
  .carousel-select-row { gap: 6px; }
  .carousel-arrow { width: 40px; height: 40px; font-size: 11px; }

  .carousel-strip-item { flex-basis: 112px; height: 148px; }
  .carousel-strip-item-title { font-size: 10px; }
}

/* Respect reduced-motion preferences for the crossfade */
@media (prefers-reduced-motion: reduce) {
  .tile-bg-layer,
  .tile-carousel #experience-tile-body {
    transition: none;
  }
}
