@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  /* Warm editorial base */
  --bg: #F9F8F5;
  --bg-gradient: radial-gradient(circle at 50% 0%, #FFFFFF 0%, #F5F2EB 100%);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #FFFFFF;
  --surface-muted: #F2EFE8;
  --surface-alt: #FAF8F4;

  /* Ink & Typography */
  --ink: #1B1A17;
  --ink-soft: #5E5B52;
  --ink-faint: #8E8B80;
  --ink-light: #B4B1A7;

  /* Borders & Dividers */
  --border: #E6E2D6;
  --border-subtle: #EFECE3;
  --border-strong: #CDC7B8;
  --border-highlight: rgba(255, 255, 255, 0.85);

  /* Semantic Palettes */
  --sage: #2D6A4F;
  --sage-light: #EDF7F1;
  --sage-border: #A3D9B5;
  --sage-text: #1B4332;
  --sage-glow: rgba(45, 106, 79, 0.28);

  --amber: #C97A1E;
  --amber-light: #FEF7EC;
  --amber-border: #F9D6A0;
  --amber-text: #8C3E08;
  --amber-glow: rgba(201, 122, 30, 0.32);

  --brick: #B93826;
  --brick-light: #FDF2F0;
  --brick-border: #F5C2BC;
  --brick-text: #7F1D1D;
  --brick-glow: rgba(185, 56, 38, 0.25);

  --indigo: #3D485C;
  --indigo-light: #EEF2F7;
  --indigo-border: #C8D3E0;
  --indigo-text: #232D3F;
  --indigo-glow: rgba(61, 72, 92, 0.25);

  --sky: #20639B;
  --sky-light: #EDF6FC;
  --sky-border: #BCDDF5;
  --sky-text: #164670;

  /* Layout & Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(27, 26, 23, 0.04), 0 1px 2px rgba(27, 26, 23, 0.02);
  --shadow-md: 0 8px 24px -4px rgba(27, 26, 23, 0.06), 0 3px 8px -2px rgba(27, 26, 23, 0.03);
  --shadow-lg: 0 20px 48px -8px rgba(27, 26, 23, 0.09), 0 8px 16px -4px rgba(27, 26, 23, 0.04);
  --shadow-glass: 0 16px 36px -6px rgba(27, 26, 23, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* Typography Stacks */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Smooth Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.18s var(--ease-spring);
  --transition-normal: 0.28s var(--ease-spring);
  --transition-slow: 0.45s var(--ease-smooth);
}

/* Base Reset & Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Atmospheric Organic Ambient Lighting */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.5;
  transition: all 1.2s ease;
  animation: float-ambient 12s infinite alternate ease-in-out;
}

@keyframes float-ambient {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -20px) scale(1.05); }
  100% { transform: translate(-15px, 15px) scale(0.96); }
}

.orb-top-left {
  top: -120px;
  left: -80px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 245, 230, 0.9) 0%, rgba(245, 230, 205, 0.45) 70%, transparent 100%);
}

.orb-top-right {
  top: -100px;
  right: -100px;
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, rgba(235, 248, 240, 0.85) 0%, rgba(215, 240, 225, 0.35) 70%, transparent 100%);
}

/* Dynamic theme warming when a parcel is waiting */
body.delivery-active .orb-top-left {
  background: radial-gradient(circle, rgba(254, 243, 199, 0.9) 0%, rgba(252, 211, 77, 0.35) 70%, transparent 100%);
  opacity: 0.7;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Smooth Tab Transitions */
.tab-view {
  animation: tab-enter 0.38s var(--ease-spring) forwards;
}

@keyframes tab-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top Sticky Navigation Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  box-shadow: var(--shadow-glass);
  position: sticky;
  top: 16px;
  z-index: 100;
  transition: all var(--transition-normal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #1C1B18 0%, #38352F 100%);
  color: #FFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform var(--transition-fast);
}

.brand:hover .brand-icon {
  transform: scale(1.08) rotate(-4deg);
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  background: var(--surface-muted);
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 3px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tab-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink);
  transform: translateY(-0.5px);
}

.tab-btn.active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Top Right Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.2);
}

.status-dot.pulse {
  animation: pulse-ring 2.2s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(45, 106, 79, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(45, 106, 79, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(45, 106, 79, 0); }
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
}

.btn-icon:hover {
  background: var(--surface-muted);
  color: var(--ink);
  border-color: var(--border-strong);
  transform: translateY(-1.5px);
}

/* ====================================================================
   HERO ACTIVE DELIVERY CARD (With Animated SVG Countdown Ring)
   ==================================================================== */
.active-deliveries-section {
  margin-bottom: 28px;
}

.hero-pending-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFDF8 100%);
  border: 1.5px solid var(--amber-border);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  box-shadow: var(--shadow-lg), 0 0 45px -8px var(--amber-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  overflow: hidden;
  animation: card-appear 0.4s var(--ease-spring);
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-pending-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #D97706, #FBBF24, #F59E0B);
}

.hero-content {
  flex: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--amber-light);
  color: var(--amber-text);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  border: 1px solid var(--amber-border);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.2;
}

.hero-desc {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 540px;
  line-height: 1.6;
}

/* Circular SVG Countdown Ring Widget */
.countdown-widget {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--amber-border);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.countdown-ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}

.countdown-circle-bg {
  fill: none;
  stroke: var(--amber-light);
  stroke-width: 7;
}

.countdown-circle-progress {
  fill: none;
  stroke: var(--amber);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 251.32;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease;
}

.countdown-center-icon {
  position: absolute;
  font-size: 24px;
  animation: pulse-slow 3s infinite ease-in-out;
}

@keyframes pulse-slow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.countdown-text-col {
  display: flex;
  flex-direction: column;
}

.countdown-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.countdown-digits {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.countdown-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Primary, Secondary, Tactile Buttons */
.btn-primary {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  background: var(--sage);
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 10px rgba(45, 106, 79, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: #23553E;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(45, 106, 79, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-solid);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-amber {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  background: var(--amber);
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(201, 122, 30, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all var(--transition-fast);
}

.btn-amber:hover {
  background: #B26A18;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(201, 122, 30, 0.35);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.stat-icon {
  font-size: 20px;
  opacity: 0.9;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.4;
}

.stat-card.sage .stat-value { color: var(--sage); }
.stat-card.amber .stat-value { color: var(--amber); }
.stat-card.brick .stat-value { color: var(--brick); }
.stat-card.indigo .stat-value { color: var(--indigo); }

/* Controls & Settings Bar */
.controls-bar {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.select-custom {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.select-custom:focus {
  border-color: var(--ink);
  background: #FFF;
  box-shadow: 0 0 0 3px rgba(27, 26, 23, 0.08);
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
}

.switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
  cursor: pointer;
}

.divider-vertical {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* Dashboard 2-column layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

/* Content Cards */
.content-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.filter-pills {
  display: flex;
  gap: 4px;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--ink);
}

.filter-btn.active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Events List */
.events-list {
  max-height: 600px;
  overflow-y: auto;
}

.event-item {
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 95px 135px 1fr auto;
  align-items: start;
  gap: 18px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.event-item:hover {
  background: var(--surface-alt);
}

.event-item:last-child {
  border-bottom: none;
}

.event-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.event-device {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.event-status-badge.retrieved {
  background: var(--sage-light);
  color: var(--sage-text);
  border: 1px solid var(--sage-border);
}

.event-status-badge.pending {
  background: var(--amber-light);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

.event-status-badge.escalated {
  background: var(--brick-light);
  color: var(--brick-text);
  border: 1px solid var(--brick-border);
}

.event-status-badge.held {
  background: var(--indigo-light);
  color: var(--indigo-text);
  border: 1px solid var(--indigo-border);
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-digest {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.5;
  background: var(--surface-muted);
  border-left: 3px solid var(--border-strong);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-family: var(--font-serif);
}

.event-digest.escalated {
  border-left-color: var(--brick);
  background: var(--brick-light);
  color: var(--brick-text);
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-faint);
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--sky-light);
  color: var(--sky-text);
  border: 1px solid var(--sky-border);
}

.ai-badge.bedrock {
  background: #EBF8FF;
  color: #20639B;
  border-color: #BCDDF5;
}

.ai-badge.fallback {
  background: #F4F6F8;
  color: #4A5568;
  border-color: #CBD5E0;
}

/* Sidebar: Connected Porch Cameras */
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.porch-camera-card {
  padding: 16px 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.porch-camera-card:hover {
  background: #FFF;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1.5px);
}

.porch-camera-card.active-waiting {
  border-color: var(--amber-border);
  background: linear-gradient(135deg, #FFF 0%, #FFFDF8 100%);
  box-shadow: 0 4px 14px -2px var(--amber-glow);
}

.camera-preview-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.porch-camera-card.active-waiting .camera-preview-icon {
  background: var(--amber-light);
  color: var(--amber);
}

.camera-meta-col {
  flex: 1;
  margin-left: 12px;
}

.camera-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.camera-sub {
  font-size: 11.5px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.signal-bar {
  color: var(--sage);
  font-size: 10px;
}

/* ====================================================================
   RESIDENT CALM VIEW (Ambient Wall / Tablet Screen)
   ==================================================================== */
.resident-screen-wrap {
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 60px;
  text-align: center;
  position: relative;
}

.ambient-clock-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.ambient-clock-digits {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.calm-plaque {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 64px 54px;
  max-width: 620px;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-slow);
}

.calm-plaque.clear {
  border-top: 6px solid var(--sage);
  box-shadow: var(--shadow-lg), 0 0 50px -10px var(--sage-glow);
}

.calm-plaque.waiting {
  border-top: 6px solid var(--amber);
  box-shadow: var(--shadow-lg), 0 0 60px -8px var(--amber-glow);
  animation: gentle-aura 4s infinite alternate ease-in-out;
}

@keyframes gentle-aura {
  0% { box-shadow: var(--shadow-lg), 0 0 35px -8px rgba(201, 122, 30, 0.25); }
  100% { box-shadow: var(--shadow-lg), 0 0 65px -4px rgba(201, 122, 30, 0.45); }
}

.calm-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
  background: var(--surface-muted);
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.calm-icon-halo {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: all var(--transition-normal);
}

.calm-plaque.clear .calm-icon-halo {
  background: var(--sage-light);
  color: var(--sage);
}

.calm-plaque.waiting .calm-icon-halo {
  background: var(--amber-light);
  color: var(--amber);
  animation: pulse-icon 2.5s infinite ease-in-out;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.calm-heading {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.calm-plaque.clear .calm-heading { color: var(--sage); }
.calm-plaque.waiting .calm-heading { color: var(--amber-text); }

.calm-support {
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 44ch;
  margin: 0 auto 40px;
}

.btn-got-it-hero {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  background: var(--sage);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  padding: 18px 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all var(--transition-fast);
}

.btn-got-it-hero:hover {
  background: #23553E;
  transform: translateY(-2.5px) scale(1.02);
  box-shadow: 0 10px 28px rgba(45, 106, 79, 0.42);
}

.btn-got-it-hero:active {
  transform: translateY(0) scale(0.99);
}

.calm-footer-bar {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: var(--ink-faint);
}

.calm-footer-link {
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
}

/* ====================================================================
   SIMULATOR & LAB (Interactive Test Bench)
   ==================================================================== */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.sim-box {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}

.sim-box-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-box-desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 22px;
  line-height: 1.55;
}

.sim-buttons-grid {
  display: grid;
  gap: 12px;
}

.sim-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.sim-btn-row:hover {
  background: #FFF;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
}

.sim-btn-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sim-btn-icon {
  font-size: 24px;
  transition: transform var(--transition-fast);
}

.sim-btn-row:hover .sim-btn-icon {
  transform: scale(1.15);
}

.sim-btn-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.sim-btn-sub {
  font-size: 12px;
  color: var(--ink-faint);
}

.sim-btn-trigger {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.sim-btn-row:hover .sim-btn-trigger {
  background: var(--ink);
  color: #FFF;
  border-color: var(--ink);
}

.prompt-inspector {
  background: #191816;
  color: #F8F7F4;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  margin-top: 16px;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 480px;
  border: 1px solid #2E2B25;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Formatted Digest Preview Card in Simulator */
.digest-card-preview {
  background: linear-gradient(135deg, #FFFDF9 0%, #FBF6EE 100%);
  border: 1.5px solid #E6D2B5;
  border-left: 5px solid #C98A2C;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-top: 14px;
  margin-bottom: 6px;
  box-shadow: 0 4px 16px rgba(201, 138, 44, 0.12);
}

.digest-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.digest-badge {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  color: #8C3E08;
}

.digest-source-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.digest-source-pill.bedrock {
  background: #EEEDFD;
  color: #3C3489;
  border: 1px solid #AEA6EB;
}

.digest-source-pill.fallback {
  background: #FEF7EC;
  color: #8C3E08;
  border: 1px solid #F9D6A0;
}

.digest-preview-text {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  font-style: italic;
  margin: 0 0 12px;
}

.digest-preview-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(201, 138, 44, 0.2);
  padding-top: 8px;
}

/* ====================================================================
   REDUCED & ANIMATED PIPELINE JOURNEY (Simple vs Tech Mode)
   ==================================================================== */
.pipeline-container {
  padding: 36px 38px 48px;
}

.pipeline-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.pipeline-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.pipeline-subtitle {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* Mode Switcher Pill (Simple Story vs Technical Architecture) */
.pipeline-mode-toggle {
  display: flex;
  background: var(--surface-muted);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mode-btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 7px;
}

.mode-btn:hover {
  color: var(--ink);
}

.mode-btn.active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

/* Action Bar with Animated Journey Play Button */
.pipeline-anim-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 248, 244, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.anim-play-btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #1C1B18 0%, #3B3830 100%);
  color: #FFF;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.anim-play-btn:hover {
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.anim-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}

.anim-pulse-box {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse-ring 1.8s infinite ease-out;
}

/* 4-Step Animated Interactive Journey Track */
.pipeline-journey-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
  margin-bottom: 20px;
}

/* Connecting animated progress line behind cards */
.pipeline-journey-track::before {
  content: '';
  position: absolute;
  top: 48px;
  left: 60px;
  right: 60px;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.pipeline-active-line {
  position: absolute;
  top: 48px;
  left: 60px;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--amber));
  z-index: 1;
  transition: width 0.7s var(--ease-spring);
  box-shadow: 0 0 10px rgba(201, 122, 30, 0.4);
}

/* Individual Pipeline Step Card */
.pipe-step-card {
  position: relative;
  z-index: 2;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s var(--ease-spring);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pipe-step-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.pipe-step-card.active-step {
  border-color: var(--amber);
  box-shadow: var(--shadow-lg), 0 0 35px -5px var(--amber-glow);
  transform: translateY(-6px) scale(1.02);
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFDF8 100%);
}

.pipe-step-card.passed-step {
  border-color: var(--sage);
}

.pipe-step-card.passed-step .pipe-step-icon-halo {
  background: var(--sage-light);
  color: var(--sage);
  border-color: var(--sage-border);
}

/* Icon Halo */
.pipe-step-icon-halo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-muted);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.35s var(--ease-spring);
}

.pipe-step-card.active-step .pipe-step-icon-halo {
  background: var(--amber-light);
  color: var(--amber);
  border-color: var(--amber);
  transform: scale(1.12);
  box-shadow: 0 0 20px var(--amber-glow);
  animation: pulse-slow 2s infinite ease-in-out;
}

.pipe-step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.pipe-step-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.25;
}

.pipe-step-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  transition: opacity 0.25s ease;
}

.pipe-tech-detail {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-muted);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  color: var(--ink);
  margin-top: 10px;
  text-align: left;
  border: 1px solid var(--border-subtle);
  width: 100%;
  word-break: break-all;
}

/* In Tech Mode, display technical detail boxes */
body.pipeline-tech-mode .pipe-tech-detail {
  display: block;
}

body.pipeline-tech-mode .pipe-step-desc {
  font-size: 12px;
  color: var(--ink-faint);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(27, 26, 23, 0.94);
  backdrop-filter: blur(12px);
  color: #FFF;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: slide-in-toast 0.35s var(--ease-spring) forwards;
}

@keyframes slide-in-toast {
  from { transform: translateY(24px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.toast.toast-fadeout {
  animation: fade-out-toast 0.3s ease-out forwards;
}

@keyframes fade-out-toast {
  to { transform: translateY(12px) scale(0.95); opacity: 0; }
}

/* ====================================================================
   LANDING PAGE (/ ROUTE) — STRIKING, COLORFUL & ANIMATED ENTRANCE
   Scoped strictly to landing page; preserves calm simplicity on resident & caretaker
   ==================================================================== */
.landing-hero-section {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 68px 52px 56px;
  margin-bottom: 36px;
  overflow: hidden;
  border: 1.5px solid rgba(230, 226, 214, 0.9);
  box-shadow: 0 14px 40px -16px rgba(27, 26, 23, 0.08);
  /* Subtly animated gradient background shifting slowly between warm tones:
     amber #C98A2C, sage #5B7A5E, sky blue #3F6C86 */
  background: linear-gradient(
    130deg,
    #FFFFFF 0%,
    rgba(201, 138, 44, 0.12) 26%,
    rgba(91, 122, 94, 0.10) 52%,
    rgba(63, 108, 134, 0.12) 78%,
    #FFFFFF 100%
  );
  background-size: 320% 320%;
  animation: landingGradientDrift 20s ease-in-out infinite alternate;
}

@keyframes landingGradientDrift {
  0% {
    background-position: 0% 15%;
  }
  50% {
    background-position: 100% 85%;
  }
  100% {
    background-position: 25% 100%;
  }
}

/* Floating Ambient Orbs (Amber #C98A2C, Sage #5B7A5E, Sky Blue #3F6C86) */
.landing-orbs-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.landing-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  transition: all 1s ease;
}

.landing-orb.orb-amber {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #C98A2C 0%, rgba(201, 138, 44, 0) 70%);
  top: -80px;
  left: -80px;
  animation: orbDrift1 18s ease-in-out infinite alternate;
}

.landing-orb.orb-sage {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, #5B7A5E 0%, rgba(91, 122, 94, 0) 70%);
  bottom: -110px;
  right: 15%;
  animation: orbDrift2 22s ease-in-out infinite alternate;
}

.landing-orb.orb-sky {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #3F6C86 0%, rgba(63, 108, 134, 0) 70%);
  top: 10%;
  right: -80px;
  animation: orbDrift3 20s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.45; }
  50% { transform: translate(65px, 45px) scale(1.12); opacity: 0.62; }
  100% { transform: translate(25px, 85px) scale(0.95); opacity: 0.42; }
}

@keyframes orbDrift2 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.42; }
  50% { transform: translate(-55px, -35px) scale(1.15); opacity: 0.58; }
  100% { transform: translate(35px, -65px) scale(0.92); opacity: 0.46; }
}

@keyframes orbDrift3 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.38; }
  50% { transform: translate(-45px, 55px) scale(1.10); opacity: 0.55; }
  100% { transform: translate(-85px, 25px) scale(0.98); opacity: 0.42; }
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
}

/* Badge Pill */
.landing-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-strong);
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.landing-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C98A2C;
  box-shadow: 0 0 10px #C98A2C;
  animation: pulse-dot 2.2s infinite ease-in-out;
}

.landing-pill-text {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.landing-pill-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #5B7A5E;
  background: rgba(91, 122, 94, 0.12);
  padding: 2px 7px;
  border-radius: 12px;
}

/* Staggered Animated Headline */
.landing-headline {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.4vw, 64px);
  font-weight: 500;
  line-height: 1.12;
  color: var(--ink);
  letter-spacing: -0.028em;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.26em;
  row-gap: 0.06em;
}

.landing-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  filter: blur(5px);
  animation: wordEntrance 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--w-i, 1) * 0.11s);
}

@keyframes wordEntrance {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Palette Highlight Classes */
.highlight-amber {
  color: #C98A2C;
}

.highlight-sage {
  color: #5B7A5E;
}

.highlight-sky {
  color: #3F6C86;
}

.accent-sage {
  color: #5B7A5E;
  font-weight: 600;
  background: rgba(91, 122, 94, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
}

.accent-sky {
  color: #3F6C86;
  font-weight: 600;
  background: rgba(63, 108, 134, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
}

.accent-brick {
  color: #B93826;
  font-weight: 600;
  background: rgba(185, 56, 38, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Colorful Animated Underline */
.underline-drift {
  position: relative;
  display: inline-block;
}

.underline-drift::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 9px;
  background: linear-gradient(90deg, rgba(201, 138, 44, 0.42) 0%, rgba(91, 122, 94, 0.38) 50%, rgba(63, 108, 134, 0.42) 100%);
  border-radius: 4px;
  z-index: -1;
  transform-origin: left center;
  transform: scaleX(0);
  animation: drawUnderline 1s cubic-bezier(0.22, 1, 0.36, 1) 0.82s forwards;
}

@keyframes drawUnderline {
  to {
    transform: scaleX(1);
  }
}

.landing-subhead {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--ink-soft);
  line-height: 1.62;
  max-width: 820px;
  margin-bottom: 36px;
}

/* Action Cards Grid */
.landing-action-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.landing-card {
  position: relative;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px 26px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.28s ease,
              background 0.35s ease,
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(27, 26, 23, 0.04);
  overflow: hidden;
}

/* Card Glow Halos */
.card-glow-halo {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.card-resident .card-glow-halo { background: rgba(91, 122, 94, 0.35); }
.card-caretaker .card-glow-halo { background: rgba(63, 108, 134, 0.35); }
.card-simulator .card-glow-halo { background: rgba(201, 138, 44, 0.35); }

/* Card Badges */
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  align-self: flex-start;
}

.badge-sage {
  background: rgba(91, 122, 94, 0.12);
  color: #5B7A5E;
  border: 1px solid rgba(91, 122, 94, 0.25);
}

.badge-sky {
  background: rgba(63, 108, 134, 0.12);
  color: #3F6C86;
  border: 1px solid rgba(63, 108, 134, 0.25);
}

.badge-amber {
  background: rgba(201, 138, 44, 0.12);
  color: #C98A2C;
  border: 1px solid rgba(201, 138, 44, 0.25);
}

/* Card Icons */
.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform 0.3s ease;
}

.icon-sage { background: #EBF4EE; color: #5B7A5E; }
.icon-sky { background: #E9F1F6; color: #3F6C86; }
.icon-amber { background: #FBF4E8; color: #C98A2C; }

.card-main-icon {
  font-size: 26px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.58;
  margin-bottom: 20px;
  flex: 1;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.feature-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  transition: gap 0.25s ease;
}

.cta-sage { color: #5B7A5E; }
.cta-sky { color: #3F6C86; }
.cta-amber { color: #C98A2C; }

.cta-arrow {
  transition: transform 0.25s ease;
}

/* ====================================================================
   LIVELY HOVER STATES: Scale, Color Shift, Shadow Bloom
   ==================================================================== */
/* Resident View Card Hover */
.landing-card.card-resident:hover {
  transform: translateY(-9px) scale(1.025);
  border-color: #5B7A5E;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F8F5 100%);
  box-shadow: 0 22px 46px -12px rgba(91, 122, 94, 0.32),
              0 0 0 1.5px rgba(91, 122, 94, 0.38);
}

.landing-card.card-resident:hover .card-glow-halo { opacity: 1; }
.landing-card.card-resident:hover .card-main-icon { transform: scale(1.18) rotate(-7deg); }
.landing-card.card-resident:hover .cta-arrow { transform: translateX(5px); }

/* Caretaker View Card Hover */
.landing-card.card-caretaker:hover {
  transform: translateY(-9px) scale(1.025);
  border-color: #3F6C86;
  background: linear-gradient(165deg, #FFFFFF 0%, #F0F6FA 100%);
  box-shadow: 0 22px 46px -12px rgba(63, 108, 134, 0.32),
              0 0 0 1.5px rgba(63, 108, 134, 0.38);
}

.landing-card.card-caretaker:hover .card-glow-halo { opacity: 1; }
.landing-card.card-caretaker:hover .card-main-icon { transform: scale(1.18) rotate(7deg); }
.landing-card.card-caretaker:hover .cta-arrow { transform: translateX(5px); }

/* Simulator Card Hover */
.landing-card.card-simulator:hover {
  transform: translateY(-9px) scale(1.025);
  border-color: #C98A2C;
  background: linear-gradient(165deg, #FFFFFF 0%, #FDF9F2 100%);
  box-shadow: 0 22px 46px -12px rgba(201, 138, 44, 0.32),
              0 0 0 1.5px rgba(201, 138, 44, 0.38);
}

.landing-card.card-simulator:hover .card-glow-halo { opacity: 1; }
.landing-card.card-simulator:hover .card-main-icon { transform: scale(1.18) scaleY(1.08); }
.landing-card.card-simulator:hover .cta-arrow { transform: translateX(5px); }

/* ====================================================================
   HOW IT WORKS SECTION: 3 Steps with Drawing Colored Connecting Line
   ==================================================================== */
.landing-steps-section {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 52px 44px 52px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.steps-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 12px;
}

.steps-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #C98A2C;
  display: block;
  margin-bottom: 8px;
}

.steps-heading {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.steps-sub {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* The Steps Track & Connecting Drawing Line */
.landing-steps-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}

/* Colored connecting line that draws itself */
.steps-draw-line {
  position: absolute;
  top: 48px;
  left: 12%;
  right: 12%;
  height: 4px;
  border-radius: 2px;
  /* Palette gradient: Amber #C98A2C -> Sage #5B7A5E -> Sky Blue #3F6C86 */
  background: linear-gradient(90deg, #C98A2C 0%, #5B7A5E 50%, #3F6C86 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.3s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
  z-index: 1;
}

.landing-steps-section.is-visible .steps-draw-line {
  transform: scaleX(1);
}

/* Step Cards */
.landing-step-card {
  position: relative;
  z-index: 2;
  background: #FAF8F4;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 26px 28px;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

/* Scroll-triggered reveal with staggered delays */
.landing-steps-section.is-visible .landing-step-card[data-step="1"] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

.landing-steps-section.is-visible .landing-step-card[data-step="2"] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.38s;
}

.landing-steps-section.is-visible .landing-step-card[data-step="3"] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.62s;
}

.landing-step-card:hover {
  background: #FFFFFF;
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.landing-step-card.step-amber:hover { border-color: #C98A2C; }
.landing-step-card.step-sage:hover { border-color: #5B7A5E; }
.landing-step-card.step-sky:hover { border-color: #3F6C86; }

/* Number Bubble */
.step-num-bubble {
  position: absolute;
  top: -16px;
  left: 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.step-amber .step-num-bubble { background: #C98A2C; }
.step-sage .step-num-bubble { background: #5B7A5E; }
.step-sky .step-num-bubble { background: #3F6C86; }

.step-icon-box {
  font-size: 30px;
  margin-bottom: 16px;
  display: inline-block;
  line-height: 1;
}

.step-card-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.step-card-text {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.58;
  margin-bottom: 18px;
}

.step-tag-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-block;
}

/* Tech Stack Callout Banner */
.landing-stack-banner {
  background: linear-gradient(135deg, #1B1A17 0%, #2A2823 100%);
  color: #FAF8F4;
  border-radius: var(--radius-xl);
  padding: 36px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
}

.stack-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #F9D6A0;
  margin-bottom: 6px;
}

.stack-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 12px;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-chips .chip {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #E6E2D6;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stack-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .landing-hero-section { padding: 40px 24px 36px; }
  .landing-action-cards { grid-template-columns: 1fr; gap: 16px; }
  .landing-steps-track { grid-template-columns: 1fr; gap: 24px; }
  .steps-draw-line { display: none; }
  .landing-stack-banner { flex-direction: column; align-items: stretch; text-align: left; }
  .stack-banner-actions { flex-direction: column; }
  .stack-banner-actions button { width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sim-grid { grid-template-columns: 1fr; }
  .pipeline-journey-track { grid-template-columns: 1fr; gap: 16px; }
  .pipeline-journey-track::before { display: none; }
  .pipeline-active-line { display: none; }
  .hero-pending-card { flex-direction: column; align-items: stretch; text-align: center; }
  .countdown-widget { justify-content: center; }
  .hero-desc { margin: 0 auto; }
  .top-bar { flex-direction: column; gap: 14px; align-items: stretch; }
  .nav-tabs { justify-content: center; overflow-x: auto; }
  .event-item { grid-template-columns: 1fr; gap: 10px; }
  .calm-plaque { padding: 40px 24px; }
  .calm-heading { font-size: 34px; }
}
