/* ============================================================
   Culture — Theme tokens
   ------------------------------------------------------------
   All colors, spacing, radii, and shadow tokens live here.
   Components/screens read these via var(--...).  Adjust in one
   place to re-skin the entire app.
   ============================================================ */

:root {
  /* Industrial Strength — Concrete & Carbon
     True black background, charcoal surfaces, bone-white CTAs,
     blood-red reserved for tier/PR moments. */

  /* Surfaces */
  --bg:           #000000;
  --surface:      #0E0E0E;
  --surface-2:    #141414;
  --surface-3:    #1C1C1C;
  --border:       #242424;
  --border-soft:  rgba(255,255,255,0.08);

  /* Text */
  --text:         #E8E1D4;  /* bone — primary */
  --text-muted:   #9A968D;
  --text-dim:     #6B6864;

  /* Accent — bone white. Primary CTAs, headlines, active states. */
  --accent:        #E8E1D4;
  --accent-hover:  #FFFFFF;
  --accent-soft:   rgba(232,225,212,0.10);
  --accent-glow:   rgba(232,225,212,0.25);

  /* Blood — reserved for tier moments, PR notifications, redemptions */
  --blood:         #7A1F2B;
  --blood-hover:   #8E2535;
  --blood-soft:    rgba(122,31,43,0.18);

  /* Status */
  --success:       #4FBE79;
  --warning:       #E5A848;
  --danger:        #D9534F;

  /* Radii — Industrial: hard edges, minimal rounding */
  --radius-sm:     2px;
  --radius-md:     4px;
  --radius-lg:     6px;
  --radius-pill:   999px;

  /* Shadows */
  --shadow-card:   0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lift:   0 1px 0 rgba(255,255,255,0.06), 0 16px 36px rgba(0,0,0,0.55);

  /* Spacing scale (4pt grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  /* Type scale */
  --t-xs:   11px;
  --t-sm:   13px;
  --t-base: 15px;
  --t-md:   17px;
  --t-lg:   20px;
  --t-xl:   24px;
  --t-2xl:  32px;
  --t-3xl:  40px;
  --t-4xl:  56px;  /* condensed display */

  /* Display font — condensed caps for headlines/numbers */
  --font-display: 'Bebas Neue', 'Oswald', 'Inter', sans-serif;

  /* Layout */
  --max-w:        440px;        /* phone-frame upper bound on desktop */
  --bottom-nav-h: 64px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);

  /* Motion */
  --ease:        cubic-bezier(.2,.7,.2,1);
  --dur-fast:    140ms;
  --dur-base:    220ms;
  --dur-slow:    320ms;
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: var(--t-base);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* Display headlines — condensed caps */
.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 0.95;
}
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  /* App-like tap feel */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  overscroll-behavior-y: contain;
}
/* Allow text input/selection inside form fields and chat composer */
input, textarea, [contenteditable="true"], .selectable, .selectable * {
  user-select: text;
  -webkit-user-select: text;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }

img { display: block; max-width: 100%; }

/* App shell layout. The phone-frame width is capped on desktop so
   the design reads as a portrait device. On real phones it fills. */
#app {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

@media (min-width: 480px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, rgba(232,225,212,0.04), transparent 60%),
      #000000;
  }
  #app {
    min-height: 100vh;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
  }
}

/* Screen container — scrolls under the bottom nav. */
.screen {
  padding-top: calc(var(--safe-top) + var(--s-5));
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--s-6));
  min-height: 100vh;
  min-height: 100dvh;
  animation: screen-in var(--dur-base) var(--ease);
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* When not authed, the bottom nav is hidden and we don't need its padding */
.screen.no-nav { padding-bottom: calc(var(--safe-bottom) + var(--s-6)); }

/* Utility */
.row { display: flex; align-items: center; }
.row.gap-2 { gap: var(--s-2); }
.row.gap-3 { gap: var(--s-3); }
.row.gap-4 { gap: var(--s-4); }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); }
.accent { color: var(--accent); }
.center { text-align: center; }
.hidden { display: none !important; }
.spacer { flex: 1 1 auto; }
.cap { font-size: var(--t-xs); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }

/* Wide-tracked section label — industrial section dividers */
.section-label {
  font-size: var(--t-xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--s-3);
}

/* Blood accent utility for tier/PR/redemption moments */
.blood { color: var(--blood); }

/* Page padding — every screen uses .pad for its content gutter */
.pad { padding-left: var(--s-5); padding-right: var(--s-5); }
