/* ==========================================================
   Live Canvas — site stylesheet
   Single file, no preprocessor, mobile-first.
   ========================================================== */

:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --fg: #f4f1ea;
  --fg-dim: #a6a29a;
  --accent: #ffb86b;
  --accent-2: #7cf0ff;
  --border: #2a2a2a;
  --radius: 12px;
  --maxw: 1100px;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* -------- Site chrome -------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(10,10,10,0.85);
  backdrop-filter: blur(8px); z-index: 10;
}
.site-brand { color: var(--fg); font-weight: 700; letter-spacing: 0.02em; }
.site-nav a { margin-left: 18px; color: var(--fg-dim); }
.site-nav a:hover { color: var(--fg); }
.site-main { max-width: var(--maxw); margin: 0 auto; padding: 28px 22px 64px; }
.site-footer {
  padding: 28px 22px; color: var(--fg-dim); text-align: center;
  border-top: 1px solid var(--border); font-size: 14px;
}

/* -------- Hero -------- */
.hero { padding: 36px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 8px; letter-spacing: -0.01em; }
.hero p  { color: var(--fg-dim); margin: 0 auto; max-width: 560px; }

/* -------- Gallery grid -------- */
.gallery {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery-loading, .gallery-empty { color: var(--fg-dim); padding: 40px 0; text-align: center; }

.card {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: var(--fg);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-thumb { aspect-ratio: 4 / 3; background: #1c1c1c; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 14px 16px 6px; flex: 1; }
.card-body h3 { margin: 0 0 4px; font-size: 18px; }
.card-meta { color: var(--fg-dim); font-size: 13px; margin: 0 0 8px; }
.card-story { color: var(--fg-dim); font-size: 14px; margin: 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-cta { padding: 10px 16px 16px; color: var(--accent); font-weight: 600; font-size: 14px; }

/* -------- About / prose -------- */
.about .prose { max-width: 680px; margin: 0 auto; line-height: 1.65; }
.prose h1 { font-size: 32px; margin: 8px 0 16px; }
.prose h2 { margin-top: 28px; font-size: 20px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose-back { margin-top: 32px; }

/* ==========================================================
   AR Viewer page
   ========================================================== */

.viewer-body { background: #000; overflow: hidden; height: 100vh; height: 100dvh; }

/* Splash */
.splash, .inapp-warning, .error-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 100%);
  z-index: 5;
}
.splash-inner { max-width: 420px; text-align: center; }
.splash-thumb {
  width: 180px; height: 180px; object-fit: cover; border-radius: var(--radius);
  margin: 0 auto 18px; box-shadow: var(--shadow);
}
.splash-title { font-size: 24px; margin: 0 0 8px; }
.splash-story { color: var(--fg-dim); margin: 0 0 24px; line-height: 1.55; }
.splash-hint  { color: var(--fg-dim); font-size: 13px; margin: 14px 0 0; }

.start-btn {
  appearance: none; -webkit-appearance: none;
  background: var(--accent); color: #1a1100; border: 0;
  font-weight: 700; font-size: 16px; padding: 14px 28px;
  border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 184, 107, 0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.start-btn:disabled { opacity: 0.5; cursor: default; }
.start-btn:not(:disabled):active { transform: scale(0.97); }

/* AR layer */
.ar-container { position: fixed; inset: 0; z-index: 1; }
.ar-container video, .ar-container canvas {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  object-fit: cover;
}

/* AR UI overlay */
.ar-ui {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  padding: 16px; display: flex; gap: 10px; align-items: center;
  pointer-events: none;
}
.ar-btn {
  pointer-events: auto;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); color: #fff; border: 0;
  font-size: 18px; cursor: pointer; backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
.ar-btn-mute { margin-left: auto; }
.ar-btn-info { font-style: italic; font-family: Georgia, serif; }

/* Seek prompt (target lost) */
.seek-prompt {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  pointer-events: none; z-index: 4;
}
.seek-frame {
  width: 70vw; max-width: 320px; aspect-ratio: 4 / 3;
  border: 2px dashed rgba(255,255,255,0.55); border-radius: 16px;
  animation: seek-pulse 1.6s ease-in-out infinite;
}
.seek-prompt p { color: #fff; background: rgba(0,0,0,0.45); padding: 8px 14px;
  border-radius: 999px; font-size: 14px; backdrop-filter: blur(4px); }
@keyframes seek-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.03); }
}
