:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: inherit; }
a { color: inherit; }

/* AR page: camera must remain visible behind the WebGL canvas. */
.ar-page, .ar-page html { background: transparent !important; overflow: hidden; }
.ar-page { width: 100vw; height: 100dvh; min-height: 100dvh; }
#ar-container { position: fixed; inset: 0; width: 100vw; height: 100dvh; background: transparent; overflow: hidden; }
#ar-container > video { position: absolute !important; z-index: 0 !important; }
#ar-scene { position: absolute !important; inset: 0; z-index: 1; background: transparent !important; }
#ar-scene canvas { background: transparent !important; }

.screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 50% 25%, rgba(25,65,105,.55), rgba(4,8,15,.92) 55%, #030508); }
.panel { width: min(520px, 100%); padding: 28px; border: 1px solid rgba(255,255,255,.14); border-radius: 24px; background: rgba(6,12,22,.86); backdrop-filter: blur(16px); box-shadow: 0 24px 80px rgba(0,0,0,.45); color: white; }
.panel h1 { margin: 8px 0 14px; font-size: clamp(30px, 8vw, 46px); line-height: 1.02; }
.panel p { margin: 0 0 18px; color: rgba(255,255,255,.76); line-height: 1.55; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #57e8c3; }

.start-button, .controls button, .primary-link, .secondary-link, .text-button {
  appearance: none; border: 0; border-radius: 14px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer;
}
.start-button { width: 100%; padding: 15px 18px; margin-top: 14px; background: white; color: #07111c; font-size: 16px; }
.start-button:disabled { opacity: .55; cursor: wait; }
.text-button { width: 100%; padding: 10px; margin-top: 6px; background: transparent; color: rgba(255,255,255,.52); font-size: 13px; }
.text-button:hover { color: white; }
.warning { margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: rgba(255,159,67,.12); border: 1px solid rgba(255,159,67,.35); color: #ffd4a8; font-size: 13px; }
.hidden { display: none !important; }

.compile-status { min-height: 22px; margin-top: 8px; color: rgba(255,255,255,.66); font-size: 13px; }
.progress-track { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.progress-fill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #51e7c0, #5ab7ff); transition: width .18s ease; }

.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: space-between; }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status, .marker-badge { padding: 9px 12px; border-radius: 999px; background: rgba(3,8,14,.65); border: 1px solid rgba(255,255,255,.15); color: white; font-size: 13px; backdrop-filter: blur(10px); }
.marker-badge { color: #65f1c8; }
.controls { display: grid; gap: 8px; pointer-events: auto; }
.controls--four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.controls button { min-height: 45px; padding: 8px 6px; color: white; background: rgba(5,12,22,.72); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); font-size: 12px; }
.controls button:active { transform: scale(.98); }

.rotate-hint { display: none; position: fixed; z-index: 30; inset: auto 16px calc(82px + env(safe-area-inset-bottom)); padding: 10px 14px; border-radius: 12px; text-align: center; color: white; background: rgba(10,15,24,.8); border: 1px solid rgba(255,255,255,.15); }
@media (orientation: landscape) and (max-height: 600px) { .rotate-hint { display: block; } }
@media (max-width: 420px) { .controls--four { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Menu / marker pages */
.menu-page, .single-marker-page { min-height: 100vh; background: #080c12; color: #eef5ff; }
.menu-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 80px; }
.menu-shell h1 { font-size: clamp(36px, 7vw, 68px); margin: 8px 0 14px; line-height: .98; }
.lead { max-width: 760px; color: #9ca9b8; font-size: 18px; line-height: 1.55; }
.menu-actions, .card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.primary-link, .secondary-link { display: inline-flex; align-items: center; justify-content: center; padding: 13px 18px; }
.primary-link { background: #f5f8ff; color: #09111b; }
.secondary-link { background: #111925; color: #dce9f7; border: 1px solid #243142; }
.primary-link.small, .secondary-link.small { padding: 10px 13px; font-size: 13px; }
.marker-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.marker-card { padding: 16px; border-radius: 20px; background: #0e151f; border: 1px solid #202c3b; }
.marker-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: white; }
.marker-number { margin-top: 14px; color: #59e3bf; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.marker-card h2 { margin: 5px 0 8px; font-size: 23px; }
.marker-card p { min-height: 64px; margin: 0; color: #93a1b2; line-height: 1.45; }

.single-marker-page { background: #f2f2f2; color: #111; }
.single-marker-shell { width: min(920px, calc(100% - 28px)); min-height: 100vh; margin: 0 auto; padding: 18px 0 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.marker-caption { margin-bottom: 10px; font-weight: 800; }
.single-marker-image { width: min(78vmin, 760px); max-width: 100%; aspect-ratio: 1; object-fit: contain; background: white; box-shadow: 0 12px 55px rgba(0,0,0,.12); }
.single-marker-shell p { max-width: 700px; color: #555; text-align: center; }
.centered { justify-content: center; }
.single-marker-page .secondary-link { background: white; color: #111; border-color: #ccc; }

@media (max-width: 820px) { .marker-grid { grid-template-columns: 1fr; } .marker-card p { min-height: auto; } }
