/* Tokens: Assets/LogoPopAR/Scripts/Runtime/UI/LpTheme.cs */
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --text: #E4DCCF;             /* LpTheme.Text */
  --shade: rgba(42, 38, 34, 0.95); /* LpTheme.Shade */
  --shade-solid: #2A2622;
  --u: 0.4px;                  /* CSS px per 1080x1920 reference px; set from main.js */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--text);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;       /* no page scroll or pinch zoom, ever */
}
button { touch-action: manipulation; }

/* Paper-like light backdrop (the app sits on a camera image, usually white paper). */
body {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 50% 46%, #EEE8DD 0%, var(--text) 55%, #CFC6B7 100%);
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;        /* gestures are ours: no scroll, no pinch zoom */
  cursor: grab;
  outline: none;
}
#stage:active { cursor: grabbing; }

/* Shade card: soft, feathered, no outline (RbShadeCard). The ::before is the feathered plate. */
.card {
  position: fixed;
  left: 50%;
  z-index: 2;
  margin: 0;
  padding: calc(42 * var(--u)) calc(60 * var(--u));
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: calc(40 * var(--u));   /* LpTheme.LabelSize */
  line-height: 1.32;
  text-align: center;
  white-space: nowrap;
  width: max-content;
  max-width: calc(100vw - 2 * (var(--safe-left) + var(--safe-right)) - 2 * 72 * var(--u));
  isolation: isolate;
  transform-origin: 50% 50%;
}
.card::before {
  content: "";
  position: absolute;
  inset: calc(28 * var(--u));
  z-index: -1;
  border-radius: calc(12 * var(--u));
  background: var(--shade);
  box-shadow: 0 0 calc(36 * var(--u)) calc(2 * var(--u)) var(--shade);
  transition: filter 0.08s linear;
}
.card-button { cursor: pointer; }
.card-button:active::before { filter: brightness(0.72); } /* LpTheme.PressedTint */
.card-button:focus-visible { outline: 2px solid var(--shade-solid); outline-offset: 4px; }

.card.bottom {
  bottom: calc(var(--safe-bottom) + 72 * var(--u));
}
.card.top {
  top: calc(var(--safe-top) + 40 * var(--u));
}
.card.bottom { white-space: pre-line; }
.card.note { white-space: normal; pointer-events: none; opacity: 0; visibility: hidden; z-index: 4; }
.reset {
  width: calc(288 * var(--u));      /* SceneBuilder reset card: 288 x 132 */
  height: calc(132 * var(--u));
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
#hint { pointer-events: none; opacity: 0; visibility: hidden; }
#reset { opacity: 0; visibility: hidden; }
#ar { z-index: 3; }
#ar[hidden] { display: none; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: transparent;
  color: var(--shade-solid);
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}
.loading.is-done { opacity: 0; visibility: hidden; transition: opacity 0.25s ease-out, visibility 0s 0.25s; }
.loading .bar {
  width: 56px;
  height: 2px;
  background: rgba(42, 38, 34, 0.18);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}
.loading .bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--shade-solid);
  animation: slide 1.1s ease-in-out infinite;
}
.loading.is-error .bar { display: none; }
.loading.is-error { padding: 0 24px; text-align: center; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.nojs {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--text);
  color: var(--shade-solid);
  font-size: 15px;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--safe-bottom);
  z-index: 1;
  text-align: center;
  font-size: 11px;
  pointer-events: none;
}
.footer a {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;           /* touch target */
  padding: 0 20px;
  color: rgba(42, 38, 34, 0.85);
  text-decoration: none;
}
.footer a:hover, .footer a:focus-visible { color: var(--shade-solid); text-decoration: underline; }

/* model-viewer lives off screen; it only does the AR hand-off. */
.ar-host {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
  .loading .bar::after { animation-duration: 3s; }
}
