/* ── Lookout MES Prototypes — Shared Styles ─────────────────────────────────
   Used by kiosk.html, kiosk-phone.html, and guided.html.
   Brand tokens match existing hex codes in lookout.html / attacker.html.
──────────────────────────────────────────────────────────────────────────── */

:root {
  /* Core palette — cool, consistent navy ramp; brand hues preserved.
     Ramp climbs monotonically 900→500 with a single hue (~220°), no purple cast. */
  --navy-900: #080b15;
  --navy-800: #111726;
  --navy-700: #1b2743;
  --navy-600: #003366;
  --navy-500: #2a3352;
  --cyan:     #00c8ff;
  --cyan-dim: #007ea8;
  --green:    #00c55f;
  --lime:     #c8ff00;
  --amber:    #ff9800;
  --red:      #f44336;
  --red-dim:  #7a1e1e;
  --white:    #ffffff;
  --gray-1:   #f4f6f9;
  --gray-2:   #c8ccd6;
  --gray-3:   #8b93ac;   /* lifted for legible small caps / labels on navy */
  --gray-4:   #3f4661;

  /* Signature accents — bridge cyan → the green/lime brand mark */
  --accent:    var(--cyan);
  --accent-2:  #35e6a4;
  --grad-brand:   linear-gradient(120deg, var(--cyan) 0%, var(--accent-2) 55%, var(--lime) 100%);
  --grad-live:    linear-gradient(120deg, var(--green), var(--lime));
  --grad-heading: linear-gradient(180deg, #ffffff 0%, #c4d9ee 100%);

  /* Surfaces & lines */
  --surface:         linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.012));
  --surface-sunken:  rgba(0, 0, 0, 0.26);
  --hairline:        rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  /* Type — system-first stacks with cross-platform + emoji fallbacks
     (the UI uses emoji as iconography, so the sans stack ends with emoji fonts) */
  --font-sans:    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --font-display: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, 'Liberation Mono', monospace;

  /* Radius — even +4 rhythm (8 / 12 / 16 / 20) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Spacing scale — 8pt grid */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  /* Elevation — two-layer (tight contact + soft ambient), cool-tinted to sit on navy */
  --shadow-sm: 0 1px 2px rgba(6, 9, 18, 0.40), 0 2px 6px rgba(6, 9, 18, 0.28);
  --shadow-md: 0 4px 12px rgba(6, 9, 18, 0.40), 0 14px 34px rgba(6, 9, 18, 0.44);
  --shadow-lg: 0 12px 28px rgba(6, 9, 18, 0.48), 0 44px 96px rgba(6, 9, 18, 0.60);
  --glow-cyan:  0 0 20px rgba(0, 200, 255, 0.35), 0 0 52px rgba(0, 200, 255, 0.18);
  --glow-brand: 0 0 20px rgba(53, 230, 164, 0.32), 0 0 56px rgba(53, 230, 164, 0.16);

  /* Motion vocabulary — snappy micro, composed macro (~1.6× steps) */
  --dur-1: 130ms; --dur-2: 210ms; --dur-3: 380ms; --dur-4: 620ms;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--font-sans);
  background: var(--navy-900);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* Keyboard focus — visible, on-brand, never on mouse press */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── Type utilities ────────────────────────────────────────────────────── */
/* The "display moment": tight, heavy, optically-sized headings with a soft
   white→ice gradient fill. Falls back to solid ink where clip is unsupported. */
.pt-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.03;
  color: #eaf5ff;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .pt-display {
    background: var(--grad-heading);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.pt-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
/* A word inside a heading that carries the brand gradient */
.pt-grad {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Brand header (used by all prototypes) ─────────────────────────────── */
.pt-header {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 28px;
  background: linear-gradient(180deg, rgba(17,23,38,0.9), rgba(8,11,21,0.65));
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
}
.pt-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.3px;
}
.pt-logo .diamond { color: var(--cyan); }

/* Lookout brand lockup (SVG mark + wordmark) */
.pt-brand {
  display: flex; align-items: center; gap: 10px;
}
.pt-brand .lookout-mark-holder {
  display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 8px rgba(62, 214, 85, 0.25));
}
.lookout-word {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--white);
  line-height: 1;
}

.pt-title {
  font-size: 11px; color: var(--gray-3);
  letter-spacing: 0.24em; text-transform: uppercase;
  font-weight: 700;
}
.pt-header .spacer { flex: 1; }
.pt-safety-badge {
  background: rgba(0, 197, 95, 0.12);
  color: #6ff0a6;
  border: 1px solid rgba(0, 197, 95, 0.4);
  font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: var(--r-pill);
  letter-spacing: 0.5px;
}
.pt-demo-badge {
  background: var(--red);
  color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-pill);
  letter-spacing: 1px;
}

/* ── Progress dots ─────────────────────────────────────────────────────── */
.pt-progress {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 28px;
  background: linear-gradient(0deg, rgba(17,23,38,0.9), rgba(8,11,21,0.4));
  border-top: 1px solid var(--hairline);
  gap: 20px;
}
.pt-progress-label {
  font-size: 11px; color: var(--gray-3);
  text-transform: uppercase; letter-spacing: 0.16em;
  justify-self: end;
}
.pt-progress-nav {
  display: flex; align-items: center; gap: 16px;
  justify-self: center;
}
.pt-progress-dots {
  display: flex; gap: 10px; align-items: center;
}
.pt-progress-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gray-4);
  transition: transform var(--dur-2) var(--ease-spring),
              background var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.pt-progress-dot.done   { background: var(--cyan-dim); }
.pt-progress-dot.active {
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: scale(1.5);
}

/* ── Harm / feature status bar ─────────────────────────────────────────── */
.pt-harm-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px 28px 16px;
  background: linear-gradient(180deg, rgba(8,11,21,0), #06090f);
  border-top: 1px solid var(--hairline);
}
.pt-harm-cell {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 1px 12px;
  transition: border-color var(--dur-3) var(--ease-out),
              box-shadow var(--dur-3) var(--ease-out),
              background var(--dur-3) var(--ease-out),
              transform var(--dur-2) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.pt-harm-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(244,67,54,0.18));
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
  pointer-events: none;
}
.pt-harm-cell.armed {
  border-color: rgba(244,67,54,0.7);
  box-shadow: 0 0 34px rgba(244,67,54,0.4), inset 0 0 0 1px rgba(244,67,54,0.35);
  background: linear-gradient(160deg, rgba(80,20,20,0.55), rgba(30,10,10,0.55));
  animation: harm-arm var(--dur-4) var(--ease-out);
}
@keyframes harm-arm {
  0%   { transform: scale(0.99); }
  40%  { transform: scale(1.015); box-shadow: 0 0 48px rgba(244,67,54,0.6), inset 0 0 0 1px rgba(244,67,54,0.5); }
  100% { transform: scale(1); }
}
.pt-harm-cell.armed::before { opacity: 1; }
.pt-harm-icon {
  font-size: 28px; line-height: 1;
  grid-row: 1 / span 3;
  align-self: center;
  filter: grayscale(0.5) opacity(0.7);
  transition: filter var(--dur-3) var(--ease-out);
}
.pt-harm-cell.armed .pt-harm-icon { filter: none; }
.pt-harm-title {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--gray-3);
  font-weight: 800;
  transition: color var(--dur-3) var(--ease-out);
}
.pt-harm-cell.armed .pt-harm-title {
  color: #ff7a6f;
  text-shadow: 0 0 10px rgba(244,67,54,0.5);
}
.pt-harm-status {
  font-size: 13px; color: var(--gray-2); line-height: 1.4;
}
.pt-harm-cell.armed .pt-harm-status {
  color: var(--white); font-weight: 600;
}

/* ── Event cards ───────────────────────────────────────────────────────── */
.pt-card {
  background: var(--navy-800);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  position: relative;
}
/* Hairline highlight along the top edge for a lit, dimensional feel */
.pt-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding-top: 1px;
  background: linear-gradient(180deg, var(--hairline-strong), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.pt-card.danger { border-color: rgba(244,67,54,0.55); }
.pt-card.safe   { border-color: rgba(0,197,95,0.45); }

.pt-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.pt-card-chip {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(0, 200, 255, 0.12);
  border: 1px solid rgba(0, 200, 255, 0.3);
  color: var(--cyan);
  text-transform: uppercase;
}
.pt-card.danger .pt-card-chip { background: rgba(244,67,54,0.14); border-color: rgba(244,67,54,0.4); color: #ffb0b0; }
.pt-card.safe   .pt-card-chip { background: rgba(0,197,95,0.14); border-color: rgba(0,197,95,0.4); color: #a8f0b8; }

.pt-card-title  { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; }
.pt-card-sub    { font-size: 13px; color: var(--gray-2); margin-top: 5px; line-height: 1.55; }

.pt-kv-list {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.pt-kv {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 12px;
  background: var(--surface-sunken);
  border-radius: var(--r-sm);
  font-size: 13px;
  border-left: 2px solid var(--cyan);
}
.pt-kv.leaked { border-left-color: var(--red); }
.pt-kv-key { color: var(--gray-3); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
.pt-kv-val { color: var(--white); font-family: var(--font-mono); font-size: 13px; text-align: right; max-width: 65%; word-break: break-all; }
.pt-kv.leaked .pt-kv-val { color: #ffb0b0; }

.pt-callout {
  margin-top: 14px;
  padding: 11px 15px;
  background: rgba(0,200,255,0.07);
  border-left: 3px solid var(--cyan);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--gray-2);
  line-height: 1.55;
}
.pt-callout.danger {
  background: rgba(244,67,54,0.08);
  border-left-color: var(--red);
  color: #ffcaca;
}
.pt-callout.safe {
  background: rgba(0,200,83,0.08);
  border-left-color: var(--green);
  color: #b9f5c7;
}
.pt-callout b { color: var(--white); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.pt-btn {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline-strong);
  background: var(--navy-700);
  color: var(--white);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out),
              background var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.pt-btn:hover { background: var(--navy-500); transform: translateY(-1px); }
.pt-btn:active { transform: translateY(1px) scale(0.985); }
.pt-btn.primary {
  background: var(--cyan);
  color: var(--navy-900);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(0,200,255,0.25);
}
.pt-btn.primary:hover { background: #4fdcff; box-shadow: 0 10px 26px rgba(0,200,255,0.4); }
.pt-btn.danger {
  background: var(--red);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(244,67,54,0.3);
}
.pt-btn.danger:hover { background: #ff6a5f; box-shadow: 0 10px 26px rgba(244,67,54,0.45); }
.pt-btn.ghost {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--gray-2);
  box-shadow: none;
}
.pt-btn.ghost:hover { background: rgba(255,255,255,0.04); color: var(--white); }
.pt-btn.large { padding: 16px 28px; font-size: 15px; }
.pt-btn.full  { width: 100%; }
.pt-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── QR panel ──────────────────────────────────────────────────────────── */
.pt-qr-panel {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 22px;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.6) inset;
  position: relative;
}
.pt-qr-panel img {
  width: 100%; max-width: 260px; height: auto;
  display: block;
}
.pt-qr-panel .qr-cap {
  color: var(--navy-900);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
}
.pt-qr-panel .qr-hint {
  color: var(--gray-4);
  font-size: 11px;
  text-align: center;
  margin-top: -4px;
  font-family: var(--font-mono);
}
@keyframes qr-pulse {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.6) inset; }
  50%      { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.6) inset, 0 0 64px rgba(0,200,255,0.35); }
}
.pt-qr-panel.attract { animation: qr-pulse 2.6s var(--ease-in-out) infinite; }

/* ── Utility ───────────────────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

.fade-in { animation: fade-in var(--dur-3) var(--ease-out); }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.slide-up { animation: slide-up 500ms var(--ease-out); }
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* Staged reveal — direct children rise in sequence. Re-runs whenever the
   container is re-rendered or re-shown, so each chapter entrance feels composed. */
.pt-stagger > * { animation: rise var(--dur-3) var(--ease-out) both; }
.pt-stagger > *:nth-child(1)  { animation-delay: 40ms; }
.pt-stagger > *:nth-child(2)  { animation-delay: 90ms; }
.pt-stagger > *:nth-child(3)  { animation-delay: 140ms; }
.pt-stagger > *:nth-child(4)  { animation-delay: 190ms; }
.pt-stagger > *:nth-child(5)  { animation-delay: 240ms; }
.pt-stagger > *:nth-child(6)  { animation-delay: 290ms; }
.pt-stagger > *:nth-child(7)  { animation-delay: 340ms; }
.pt-stagger > *:nth-child(8)  { animation-delay: 390ms; }
.pt-stagger > *:nth-child(9)  { animation-delay: 440ms; }
.pt-stagger > *:nth-child(10) { animation-delay: 490ms; }
.pt-stagger > *:nth-child(11) { animation-delay: 540ms; }
.pt-stagger > *:nth-child(12) { animation-delay: 590ms; }

/* ── Phone-only helpers (kiosk-phone.html) ────────────────────────────── */
.phone-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 0 0 32px;
}
.phone-hero {
  padding: 26px 22px 18px;
  text-align: center;
}
.phone-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 7.5vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  color: #eaf5ff;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .phone-hero h1 {
    background: var(--grad-heading);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.phone-hero p {
  color: var(--gray-2);
  font-size: 14px;
  line-height: 1.55;
}
.phone-body {
  padding: 0 22px;
  flex: 1;
  display: flex; flex-direction: column;
  gap: 14px;
}
.phone-footer {
  padding: 20px 22px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.chapter-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.checklist {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
  margin: 6px 0 4px;
}
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px;
  background: rgba(0,200,255,0.06);
  border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.4;
  color: var(--gray-2);
  border-left: 2px solid var(--cyan);
}
.checklist li::before {
  content: '✓';
  color: var(--cyan);
  font-weight: 700;
  flex-shrink: 0;
}
.checklist.warn li { border-left-color: var(--amber); background: rgba(255,152,0,0.08); }
.checklist.warn li::before { content: '⚠'; color: var(--amber); }

/* ── Ambient background — shared aurora + faint grid across all screens ── */
.pt-bg-grid {
  background-image:
    radial-gradient(circle at 18% 16%, rgba(0,200,255,0.10), transparent 42%),
    radial-gradient(circle at 84% 30%, rgba(53,230,164,0.07), transparent 44%),
    radial-gradient(circle at 78% 82%, rgba(244,67,54,0.05), transparent 42%),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
/* Slow-drifting aurora sits behind content; peeks through gaps & panels */
.pt-bg-grid::before {
  content: '';
  position: fixed; inset: -25%;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 40% at 20% 24%, rgba(0,200,255,0.12), transparent 70%),
    radial-gradient(42% 44% at 82% 72%, rgba(53,230,164,0.09), transparent 70%);
  filter: blur(24px);
  animation: aurora 24s var(--ease-in-out) infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(2%, 1.5%, 0) scale(1.08); }
}

/* ── Scrollbar polish ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-4); }

/* ── Reduced motion — calm the ambient/looping animations ─────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
