@import url("./vendor/fonts.css");

/* ------------------------------------------------------------------
   Shared shell for the AR demos.
   Each experience paints its own palette through --accent etc.
   ------------------------------------------------------------------ */

:root {
  --ink: #06080a;
  --ink-2: #0b0f12;
  --ink-3: #12181d;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --white: #f6f7f5;
  --muted: rgba(246, 247, 245, 0.62);
  --faint: rgba(246, 247, 245, 0.38);
  --accent: #9fe8ff;
  --accent-ink: #041014;
  --danger: #ff6b6b;
  --ok: #6ff2c0;
  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

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

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
}

canvas {
  display: block;
}

.hidden {
  display: none !important;
}

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

/* -- camera + render layer ---------------------------------------- */

#camerafeed {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #000;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#stage canvas {
  width: 100%;
  height: 100%;
}

/* -- brand chrome -------------------------------------------------- */

.chrome {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}

.chrome > * {
  pointer-events: none;
}

.chrome .interactive,
.chrome button,
.chrome a {
  pointer-events: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10px;
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 8, 10, 0.35);
  backdrop-filter: blur(10px);
}

.brand-mark svg {
  width: 14px;
  height: 14px;
  display: block;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 10, 0.42);
  backdrop-filter: blur(14px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faint);
  box-shadow: 0 0 0 0 transparent;
}

.status[data-state="live"] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 12px var(--ok);
}

.status[data-state="warn"] .status-dot {
  background: #ffc86b;
  box-shadow: 0 0 12px #ffc86b;
}

.status[data-state="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

.bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* -- controls ------------------------------------------------------ */

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ctl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 14, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
  transition:
    transform 160ms var(--ease),
    background 160ms var(--ease),
    border-color 160ms var(--ease);
}

.ctl:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.ctl:active {
  transform: scale(0.96);
}

.ctl[aria-pressed="true"],
.ctl.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.ctl svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.ctl.icon {
  width: 44px;
  padding: 0;
  justify-content: center;
}

.ctl.small {
  height: 36px;
  padding: 0 12px;
  font-size: 11px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition:
    transform 180ms var(--ease),
    filter 180ms var(--ease);
}

.primary:hover {
  filter: brightness(1.06);
}

.primary:active {
  transform: scale(0.97);
}

.primary.ghost {
  background: rgba(8, 12, 15, 0.5);
  color: var(--white);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: none;
}

.primary svg {
  width: 18px;
  height: 18px;
}

/* -- overlays ------------------------------------------------------ */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  padding-bottom: calc(18px + var(--safe-bottom));
  background:
    linear-gradient(to top, rgba(2, 4, 6, 0.94) 0%, rgba(2, 4, 6, 0.55) 46%, rgba(2, 4, 6, 0) 78%);
  opacity: 1;
  transition: opacity 320ms var(--ease);
}

.sheet.center {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: rgba(2, 4, 6, 0.72);
  backdrop-filter: blur(16px);
}

.sheet.leaving {
  opacity: 0;
  pointer-events: none;
}

.card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(9, 13, 16, 0.82);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  padding: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.card.wide {
  max-width: 560px;
}

.kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 10px 0 8px;
}

.title.serif {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
}

.copy {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.copy strong {
  color: var(--white);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.actions.row {
  flex-direction: row;
  align-items: center;
}

.actions.row > * {
  flex: 1;
}

.hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.5;
}

.hint svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}

/* -- loading ------------------------------------------------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity 420ms var(--ease);
}

.loader.leaving {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.loader-sub {
  max-width: 300px;
  color: var(--faint);
  font-size: 11.5px;
}

/* -- reticle ------------------------------------------------------- */

.reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 260ms var(--ease),
    transform 260ms var(--ease);
}

.reticle.visible {
  opacity: 1;
  transform: scale(1);
}

.reticle .pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--accent);
  opacity: 0.7;
  animation: reticle-pulse 2.4s var(--ease) infinite;
}

.reticle .ring {
  position: absolute;
  inset: 30px;
  border-radius: 999px;
  border: 1px solid var(--accent);
}

.reticle .core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}

@keyframes reticle-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.65;
  }
  70% {
    transform: scale(1.15);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* -- toast + banner ------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 25;
  transform: translate(-50%, 12px);
  max-width: min(90vw, 420px);
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 12, 0.86);
  backdrop-filter: blur(18px);
  font-size: 12px;
  color: var(--white);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 260ms var(--ease),
    transform 260ms var(--ease);
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.banner {
  position: fixed;
  top: calc(64px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  max-width: min(92vw, 440px);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 12, 0.6);
  backdrop-filter: blur(16px);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--white);
  text-align: center;
  opacity: 0;
  transition: opacity 300ms var(--ease);
}

.banner.visible {
  opacity: 1;
}

/* -- legal / footer ------------------------------------------------ */

.legal {
  font-size: 10px;
  line-height: 1.6;
  color: var(--faint);
  text-align: center;
  letter-spacing: 0.01em;
}

.legal a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* -- misc ---------------------------------------------------------- */

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  color: var(--muted);
}

.swatches {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 14, 0.55);
  backdrop-filter: blur(16px);
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
  transition:
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.swatch[aria-pressed="true"] {
  transform: scale(1.14);
  box-shadow:
    0 0 0 2px var(--ink),
    0 0 0 3px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
