/* ============================================================================
   STAND TO - Veteran app (mobile) layout + demo shell
   ============================================================================ */

/* ---------- Demo shell (scaffolding, not the product) ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-3) var(--space-5);
  background: rgba(20,27,20,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.demo-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.demo-brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--color-primary); color: #fff; display: grid; place-items: center; }
.demo-brand .mark svg { width: 18px; height: 18px; }
.demo-brand small { color: var(--color-text-tertiary); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; font-size: 10px; }
.seg { display: inline-flex; background: var(--color-surface-sunken); border-radius: var(--radius-pill); padding: 4px; gap: 2px; }
.seg button { border: none; background: none; cursor: pointer; min-height: 38px; padding: 0 var(--space-4); border-radius: var(--radius-pill); font-weight: 600; font-size: var(--fs-caption); color: var(--color-text-secondary); }
.seg button.is-on { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }
.demo-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

/* ---------- Stage ---------- */
.stage { min-height: calc(100vh - 64px); padding: var(--space-7) var(--space-5) var(--space-9); }
.stage-app { display: flex; flex-direction: column; align-items: center; gap: var(--space-5);
  background:
    radial-gradient(70% 50% at 50% -5%, #1C2A1B 0%, rgba(16,21,15,0) 60%),
    var(--color-bg);
}

/* ---------- Phone frame ---------- */
.phone {
  width: 390px; max-width: 100%; height: 844px; max-height: calc(100vh - 130px);
  background: var(--color-bg); border-radius: 46px; padding: 0;
  box-shadow: 0 0 0 11px #20262B, 0 0 0 13px #2c343a, var(--shadow-lg);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.phone-statusbar { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; font-size: 13px; font-weight: 700; color: var(--color-text); }
.phone-statusbar .notch { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; width: 120px; height: 26px; background: #20262B; border-radius: 0 0 16px 16px; }
.phone-statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.phone-statusbar .sb-icons svg { width: 17px; height: 17px; }
.phone-screen { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-nav { flex: none; }

.app-view { padding: var(--space-4) var(--space-5) var(--space-7); min-height: 100%; }
.app-view-flush { padding: 0 0 var(--space-7); }

/* ---------- App header ---------- */
.app-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0 var(--space-4); }
.app-head .greet-eyebrow { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .16em; text-transform: uppercase; color: var(--color-text-tertiary); font-weight: 500; }
.app-head .greet-name { font-family: var(--font-display); font-size: var(--fs-h2); }
.icon-btn { width: 42px; height: 42px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); display: grid; place-items: center; cursor: pointer; color: var(--color-text); position: relative; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot-badge { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--color-danger); border: 2px solid var(--color-surface); }

/* ---------- Ritual cards (Reveille / Stand Down) ---------- */
.ritual { display: flex; align-items: center; gap: var(--space-4); }
.ritual .ritual-ico { width: 56px; height: 56px; border-radius: var(--radius-lg); display: grid; place-items: center; flex: none; }
.ritual .ritual-ico svg { width: 30px; height: 30px; }
.ritual-reveille .ritual-ico { background: rgba(255,255,255,.18); color: #fff; }
.ritual-eyebrow { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .16em; text-transform: uppercase; font-weight: 500; opacity: .85; }

/* ---------- Crisis access (always reachable) ---------- */
.crisis-fab { display: flex; align-items: center; gap: var(--space-2); }
.help-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--color-danger-soft); color: var(--color-danger-text); border: 1px solid var(--color-border-strong);
  font-weight: 700; font-size: var(--fs-caption); cursor: pointer; min-height: 40px;
}
.help-pill svg { width: 18px; height: 18px; }

/* ---------- Onboarding ---------- */
.onb { min-height: 100%; display: flex; flex-direction: column; padding: var(--space-6) var(--space-5) var(--space-6); }
.onb-art { flex: 1; display: grid; place-items: center; min-height: 240px; }
.onb-blob { width: 200px; height: 200px; border-radius: 42% 58% 56% 44% / 50% 44% 56% 50%; display: grid; place-items: center; background: linear-gradient(140deg, #B5572C, #E0683A); color: #fff; animation: breathe 6s var(--ease-calm) infinite; }
.onb-blob svg { width: 96px; height: 96px; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.dots { display: flex; gap: 7px; justify-content: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-border-strong); }
.dots i.on { width: 22px; border-radius: var(--radius-pill); background: var(--color-primary); }

/* ---------- Learn unit / lesson tiles ---------- */
.course-card { position: relative; overflow: hidden; color: #fff; padding: var(--space-5); border: none; border-radius: var(--radius-lg); min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; text-shadow: 0 1px 3px rgba(30,18,6,.4); }

/* "For right now": a clean 2-column grid (matches the toolkit above it), no
   horizontal scroll, no truncation. The third card spans the full width so the
   row is balanced rather than leaving an empty half. */
.suggest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.suggest-grid .suggest-card { min-width: 0; min-height: 120px; }
.suggest-grid .suggest-card:nth-child(3):last-child { grid-column: 1 / -1; min-height: 104px; }
/* Scrim: guarantees white text meets contrast even on the light apricot/rose course gradients. */
.course-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(150deg, rgba(28,18,8,.12), rgba(28,18,8,.42)); pointer-events: none; }
.course-card > * { position: relative; z-index: 1; }
.course-card h3 { color: #fff; font-size: var(--fs-title); font-family: var(--font-body); font-weight: 700; }
.course-card .course-meta { font-size: var(--fs-caption); opacity: .9; }
.course-card .course-ico { position: absolute; right: -10px; bottom: -10px; opacity: .22; }
.course-card .course-ico svg { width: 96px; height: 96px; }

/* ---------- Resource cards ---------- */
.res-card { display: flex; flex-direction: column; gap: var(--space-2); }
.res-card .res-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.res-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-1); }
.res-call { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-on-primary); font-weight: 600; font-size: var(--fs-caption); min-height: 42px; }
.res-call svg { width: 17px; height: 17px; }
.res-call.is-crisis { background: var(--color-danger); }
.res-call.is-ghost { background: transparent; color: var(--color-primary-strong); border: 1px solid var(--color-border-strong); }

/* ---------- Support search ---------- */
.res-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 0 14px; background: var(--color-surface); margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.res-search svg { color: var(--color-text-secondary); flex: none; }
.res-search input { border: none; outline: none; background: none; flex: 1; min-height: 48px; font-family: inherit; font-size: 1rem; color: var(--color-text); }
.res-search input::placeholder { color: var(--color-text-tertiary); }

/* ---------- Give back / volunteering ---------- */
.vol-card .vol-tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Slider (mood deeper layer) ---------- */
.range { width: 100%; appearance: none; height: 8px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--mood-1), var(--mood-3), var(--mood-5)); outline: none; }
.range::-webkit-slider-thumb { appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-md); border: 3px solid var(--color-primary); cursor: pointer; }

/* ---------- caption note ---------- */
.foot-note { font-size: var(--fs-label); color: var(--color-text-tertiary); text-align: center; margin-top: var(--space-4); }

.app-caption-bar { padding: var(--space-3) var(--space-5); max-width: 420px; text-align: center; color: var(--color-text-secondary); font-size: var(--fs-caption); }

/* ---------- Decluttered demo: the phone is the hero; scaffolding lives in a floating dock ---------- */
.stage { min-height: 100vh; padding: var(--space-5) var(--space-4); }
.stage-app { justify-content: center; }
.phone { max-height: calc(100vh - 36px); }

/* subtle launcher (top-right) - opens the demo controls on demand */
.demo-dock-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 9001;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-surface); color: var(--color-text-secondary);
  border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); cursor: pointer;
  opacity: .6; transition: opacity var(--dur) var(--ease-calm), box-shadow var(--dur) var(--ease-calm);
}
.demo-dock-toggle:hover, .demo-dock-toggle:focus-visible { opacity: 1; box-shadow: var(--shadow-lg); }
.demo-dock-toggle svg { width: 18px; height: 18px; }

.demo-dock {
  position: fixed; top: 14px; right: 14px; z-index: 9002;
  width: 320px; max-width: 92vw;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 14px; animation: sheet-up var(--dur) var(--ease-calm);
}
.demo-dock.is-collapsed { display: none; }
.demo-dock-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* reuse the existing bar markup, stacked compactly inside the dock */
.demo-dock .demo-bar { position: static; padding: 0; gap: var(--space-3); background: none; backdrop-filter: none; border: 0; flex-direction: column; align-items: stretch; z-index: auto; }
.demo-dock .demo-brand { display: none; }
.demo-dock .seg { width: 100%; }
.demo-dock .seg button { flex: 1; }
.demo-dock .demo-actions { margin-left: 0; }
.demo-dock .pt-role { width: 100%; }

/* ---------- Full-screen app (device frame removed) ---------- */
.stage { min-height: 100dvh; padding: 0; }
.stage-app { justify-content: flex-start; align-items: stretch; background: var(--color-surface-sunken); }
.appfull {
  box-sizing: border-box;
  width: 100%; max-width: 480px; margin: 0 auto;
  height: 100dvh; min-height: 100dvh;
  background: var(--color-bg);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  padding-top: env(safe-area-inset-top);
  box-shadow: var(--shadow-lg);
}
.appfull .phone-screen { flex: 1; min-height: 0; }
.appfull .phone-nav { flex: none; padding-bottom: env(safe-area-inset-bottom); }
/* move the operator control out of the app's header zone -> floating above the nav */
.demo-dock-toggle { top: auto; bottom: calc(82px + env(safe-area-inset-bottom)); right: 14px; }

/* ---------- Smooth screen transitions + tactile press (no web-1.0 instant jumps) ---------- */
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.phone-screen.screen-in { animation: screen-in .32s var(--ease-calm); }
.card-link, .nav-item, .btn, .list-row, .seg button, .mood-tile { transition: transform .12s var(--ease-calm), box-shadow .18s var(--ease-calm); }
.card-link:active, .nav-item:active, .btn:active, .list-row:active, .mood-tile:active { transform: scale(.975); }
@media (prefers-reduced-motion: reduce) {
  .phone-screen.screen-in { animation: none; }
  .card-link:active, .nav-item:active, .btn:active, .list-row:active, .mood-tile:active { transform: none; }
}

@media (max-width: 480px) {
  .demo-dock { top: 10px; right: 10px; left: 10px; width: auto; }
  .demo-dock-toggle { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; }
}

/* ============================================================================
   FIELD signatures - grain, mil-spec readouts, photo hero
   ============================================================================ */

/* faint film grain over the whole app for texture/depth on dark */
.appfull::after {
  content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* mil-spec numeric readouts: mono, tabular, bone */
.stat .stat-num { font-family: var(--font-mono) !important; font-weight: 500 !important; font-feature-settings: "tnum" 1; letter-spacing: -.01em; }
.stat .stat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-tertiary); }

/* Today photo hero: a desaturated dawn image behind a serif greeting + mono eyebrow */
.field-hero { position: relative; margin: 0 calc(-1 * var(--space-5)) var(--space-2); padding: 0 var(--space-5); min-height: 244px; display: flex; flex-direction: column; justify-content: flex-end; }
.field-hero .hero-img { position: absolute; inset: 0; z-index: 0; background: #0c100b center/cover no-repeat; }
.field-hero .hero-img::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,21,15,.30) 0%, rgba(16,21,15,.20) 34%, rgba(16,21,15,.86) 80%, var(--color-bg) 100%); }
.field-hero .hero-inner { position: relative; z-index: 1; padding: 56px 0 18px; }
.field-hero .hero-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--color-text); opacity: .82; margin-bottom: 6px; }
.field-hero .hero-name { font-family: var(--font-display); font-size: 2.4rem; line-height: .98; }

/* section headings: keep serif but tighten; the eyebrow/labels carry the mono mil-spec tone */
.section-head h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
