/* Reset + warm-cream foundation + RTL base + global reduced-motion guard. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Warm cream radial wash — a PLACE, not a flat surface. */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 196, 122, .28) 0%, rgba(255, 248, 242, 0) 60%),
    radial-gradient(120% 90% at 50% 110%, rgba(139, 124, 246, .14) 0%, rgba(255, 248, 242, 0) 55%),
    var(--cream);
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Emotional headings ONLY use serif. Default everything to UI font. */
.serif { font-family: var(--font-serif); }
.kicker { font-family: var(--font-ui); letter-spacing: .14em; text-transform: uppercase; font-size: .68rem; font-weight: 700; }

/* The single mobile-portrait app container. */
.app {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

/* ---- THE LIVING LAYER: renders must breathe, respond, and move ---- */
/* Every screen enters warmly (no hard cuts). */
.screen { animation: obEnter .34s ease-out; }
@keyframes obEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Touch feedback: tapping the art answers with warm light. */
.ob2-hs:active { background: radial-gradient(circle, rgba(255,196,122,.35), rgba(255,111,97,.12) 70%, transparent) !important; transform: translate(-50%,-50%) scale(.97); }

/* Breathing presence halo — pin over any living element on a render. */
.live-halo { position: absolute; transform: translate(-50%,-50%); border-radius: 50%; pointer-events: none;
  animation: obBreathe 2.8s ease-in-out infinite; }
@keyframes obBreathe {
  0%,100% { box-shadow: 0 0 14px 2px var(--halo, rgba(255,111,97,.4)); opacity: .75; }
  50%     { box-shadow: 0 0 30px 8px var(--halo, rgba(255,111,97,.55)); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .live-halo { animation: none; box-shadow: 0 0 18px 4px var(--halo, rgba(255,111,97,.45)); }
}

/* Full-bleed render screens (shell-less): keep the phone column, drop only the nav padding. */
.app.app--full {
  padding-bottom: 0;
}
.app.app--full .screen { padding: 0; }
/* Narrow (phone): height-fit, exact aspect — the viewport trims the sides evenly. */
@media (max-width: 599px) {
  .app.app--full [class*="__frame"] {
    width: calc(100dvh * 941 / 1672) !important;
    height: 100dvh !important;
    flex: none;
  }
}

/* Wide windows: fit the WHOLE render inside the phone column — exact aspect, no crop, no stretch. */
@media (min-width: 600px) {
  .app.app--full [class*="__frame"] {
    height: min(100dvh, calc(min(var(--app-max), 100vw) * 1672 / 941)) !important;
    width: auto;
  }
  .app.app--full .screen { align-items: center; }
}

/* Onboarding (shell-less) screens fill the app frame directly. */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

/* Honor reduced-motion EVERYWHERE — no continuous animation, no transitions. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
