@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Work+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Force mobile layout */
html {
  max-width: 390px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* ── Design Tokens ── */
:root {
  --bg:        #ECDCC4;
  --paper:     #F7EDD9;
  --ink:       #352618;
  --sub:       rgba(53,38,24,0.62);
  --faint:     rgba(53,38,24,0.44);
  --line:      rgba(53,38,24,0.16);
  --accent:    #B26A1E;
  --accent-2:  #9E4A2C;

  --font-serif: 'DM Serif Display', serif;
  --font-sans:  'Work Sans', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  --radius-card:   16px;
  --radius-sheet:  26px;
  --radius-pill:   999px;

  --shadow-card:   0 8px 26px rgba(53,38,24,0.24);
  --shadow-sheet:  0 -10px 30px rgba(53,38,24,0.18);
  --shadow-btn:    0 2px 6px rgba(53,38,24,0.12);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Paper grain overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── App shell ── */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* ── Screens ── */
.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.screen.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}
.screen.exit-left  { transform: translateX(-30%); opacity: 0; }
.screen.exit-right { transform: translateX(100%);  opacity: 0; }

/* ── Typography helpers ── */
.serif   { font-family: var(--font-serif); }
.mono    { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Round button ── */
.btn-round {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-btn);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Primary button ── */
.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-btn);
}

/* ── Tab bar ── */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 86px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: 22px;
  z-index: 100;
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--faint);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  border: none; background: none;
}
.tab-item.active { color: var(--accent); }
.tab-item svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* ── Fullscreen AR range input ── */
.ar-fs-range {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  outline: none;
  cursor: ew-resize;
}
.ar-fs-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  cursor: ew-resize;
}
.ar-fs-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: none;
  cursor: ew-resize;
}

/* ── Proximity pulse — list-view card border ── */
@keyframes proximity-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(178,106,30,0.5), var(--shadow-card); }
  60%       { box-shadow: 0 0 0 8px rgba(178,106,30,0),   var(--shadow-card); }
}
.nearby-pulse {
  border-color: var(--accent) !important;
  animation: proximity-pulse 1.8s ease-out infinite;
}