/* ============================================================
   DESIGN TOKENS
   Light theme is the default. Dark overrides follow.
   ============================================================ */
:root {
  /* Backgrounds */
  --bg:           #f0f4f9;
  --bg-surface:   #ffffff;
  --bg-subtle:    #f8fafc;
  --bg-alt:       #f8fafc;

  /* Text */
  --text:         #0f172a;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  /* Borders */
  --border:       #e2e8f0;
  --border-s:     #f1f5f9;

  /* Brand */
  --brand:        #1c5aa5;
  --brand-text:   #1c5aa5;
  --brand-light:  #eff6ff;
  --brand-dark:   #1a4f8f;

  /* Status chips */
  --chip-bg:        #dbeafe;  --chip-t:         #1d4ed8;
  --chip-half-bg:   #f0fdf4;  --chip-half-t:    #16a34a;
  --chip-done-bg:   #dcfce7;  --chip-done-t:    #15803d;
  --chip-overdue-bg:#fef2f2;  --chip-overdue-t: #dc2626;

  /* Status badges */
  --sb-enroute-bg:  #fef3c7;  --sb-enroute-t:   #b45309;
  --sb-sched-bg:    #eff6ff;  --sb-sched-t:     #1d4ed8;
  --sb-done-bg:     #dcfce7;  --sb-done-t:      #15803d;
  --sb-overdue-bg:  #fef2f2;  --sb-overdue-t:   #dc2626;

  /* Nav */
  --nav-bg:       rgba(240, 244, 249, 0.92);
  --nav-border:   rgba(226, 232, 240, 0.9);

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 16px 48px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-xl:    0 2px 4px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.10), 0 40px 80px rgba(0,0,0,0.11);
  --shadow-card:  0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Fira Code', monospace;

  /* Text scale */
  --t-xs:   11px;
  --t-sm:   13px;
  --t-base: 15px;
  --t-md:   16px;
  --t-lg:   18px;
  --t-xl:   20px;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  18px;
  --r-2xl: 24px;

  /* Easing — strong ease-out for UI (see emil-design-eng skill) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Punchier curve for rare / marketing motion (hero, scroll reveal, tab swaps) */
  --ease-hero: cubic-bezier(0.22, 1, 0.32, 1);

  /* Micro-interactions: stay under ~300ms, instant feedback on press */
  --ui-fast: 140ms;
  --ui-nav: 160ms;

  /* Theme transition */
  --tt: 260ms ease;
}

/* ── DARK THEME ──────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #070e1b;
  --bg-surface:   #0d1f38;
  --bg-subtle:    #0a1628;
  --bg-alt:       #060c17;

  --text:         #f0f4f8;
  --text-2:       rgba(240, 244, 248, 0.6);
  --text-3:       rgba(240, 244, 248, 0.32);

  --border:       rgba(255, 255, 255, 0.09);
  --border-s:     rgba(255, 255, 255, 0.04);

  --brand:        #4a90d9;
  --brand-text:   #93c5fd;
  --brand-light:  rgba(28, 90, 165, 0.2);
  --brand-dark:   #2563eb;

  --chip-bg:        rgba(29, 78, 216, 0.22);  --chip-t:         #93c5fd;
  --chip-half-bg:   rgba(22, 163, 74, 0.18);  --chip-half-t:    #86efac;
  --chip-done-bg:   rgba(21, 128, 61, 0.2);   --chip-done-t:    #4ade80;
  --chip-overdue-bg:rgba(220, 38, 38, 0.18);  --chip-overdue-t: #f87171;

  --sb-enroute-bg:  rgba(180, 83, 9, 0.2);    --sb-enroute-t:   #fbbf24;
  --sb-sched-bg:    rgba(29, 78, 216, 0.2);   --sb-sched-t:     #93c5fd;
  --sb-done-bg:     rgba(21, 128, 61, 0.2);   --sb-done-t:      #4ade80;
  --sb-overdue-bg:  rgba(220, 38, 38, 0.18);  --sb-overdue-t:   #f87171;

  --nav-bg:       rgba(7, 14, 27, 0.92);
  --nav-border:   rgba(255, 255, 255, 0.08);

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:    0 16px 48px rgba(0,0,0,0.55);
  --shadow-xl:    0 2px 8px rgba(0,0,0,0.45), 0 16px 48px rgba(0,0,0,0.6), 0 40px 80px rgba(0,0,0,0.65);
  --shadow-card:  0 1px 4px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: 64px; /* offset for sticky nav */
}

body {
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color var(--tt), color var(--tt);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.eyebrow,
.section-eyebrow {
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-text);
  margin-bottom: 12px;
  transition: color var(--tt);
}

.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 44px;
  transition: color var(--tt);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  border: 1.5px solid transparent;
  transition:
    transform var(--ui-fast) var(--ease-out),
    box-shadow var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    border-color var(--ui-fast) var(--ease-out),
    color var(--ui-fast) var(--ease-out);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-lg { padding: 13px 26px; font-size: var(--t-md); }

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--text-3);
}
.btn-ghost:active { transform: scale(0.98); }

.btn-nav {
  background: var(--brand);
  color: #ffffff;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border-radius: var(--r-md);
  border: 1.5px solid var(--brand);
  flex-shrink: 0;
  transition:
    transform var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    border-color var(--ui-fast) var(--ease-out);
  touch-action: manipulation;
}
.btn-nav:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-nav:active { transform: scale(0.98); }
.btn-nav:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nav-border);
  transition: background-color var(--tt), border-color var(--tt);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  transition:
    color var(--ui-fast) var(--ease-out),
    opacity var(--ui-fast) var(--ease-out);
}
.nav-brand:hover { color: var(--brand-text); }
.nav-brand:active { opacity: 0.88; }
.nav-brand:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-links a {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 11px;
  border-radius: var(--r-sm);
  transition:
    color var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    opacity var(--ui-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--text); background: var(--bg-subtle); }
.nav-links a:active { opacity: 0.9; }
.nav-links a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Theme toggle — pill shape with smooth icon crossfade */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-2);
  overflow: hidden;
  transition:
    transform var(--ui-fast) var(--ease-out),
    color var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    border-color var(--ui-fast) var(--ease-out),
    box-shadow var(--ui-fast) var(--ease-out);
  touch-action: manipulation;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-subtle);
  border-color: var(--text-3);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Icons cross-fade — both always rendered */
.icon-sun,
.icon-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  margin-left: -7.5px;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

/* Light mode: show moon */
.icon-sun  { opacity: 0; transform: rotate(-50deg) scale(0.75); }
.icon-moon { opacity: 1; transform: none; }

/* Dark mode: show sun */
[data-theme="dark"] .icon-sun  { opacity: 1; transform: none; }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(50deg) scale(0.75); }

/* Mobile burger — matches theme-toggle dimensions */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-2);
  transition:
    transform var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    border-color var(--ui-fast) var(--ease-out),
    box-shadow var(--ui-fast) var(--ease-out);
  touch-action: manipulation;
}
.nav-burger:hover {
  background: var(--bg-subtle);
  border-color: var(--text-3);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.nav-burger:active { transform: scale(0.96); }
.nav-burger:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.nav-burger span {
  display: block;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transform-origin: center;
  transition:
    transform var(--ui-nav) var(--ease-out),
    opacity var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out);
}

/* Burger → X when menu is open */
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding: 8px 0 14px;
  transition: background-color var(--tt), border-color var(--tt);
}

/* Entrance animation — only plays when becoming visible */
.nav-mobile:not([hidden]) {
  animation: menuSlide var(--ui-nav) var(--ease-out) both;
}

.nav-mob-link {
  display: block;
  padding: 11px 18px;
  margin: 0 10px;
  border-radius: var(--r-sm);
  font-size: var(--t-base);
  font-weight: 500;
  color: var(--text-2);
  transition:
    color var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    opacity var(--ui-fast) var(--ease-out);
}
.nav-mob-link:hover {
  color: var(--text);
  background: var(--bg-subtle);
}
.nav-mob-link:active { opacity: 0.88; }
.nav-mob-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(170deg, #e4ecf6 0%, #edf2f9 35%, #f5f8fc 100%);
  padding: 64px 0 56px;
  transition: background-color var(--tt);
}

[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 130% 110% at 50% 50%, transparent 30%, rgba(0,0,0,0.5) 100%),
    radial-gradient(ellipse 90% 80% at 50% -10%, rgba(14, 68, 150, 0.7) 0%, transparent 100%),
    #070e1b;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}

.hero-text {
  text-align: center;
  max-width: 620px;
}

.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.03;
  letter-spacing: -0.042em;
  margin-bottom: 18px;
  transition: color var(--tt);
}

.hero-sub {
  font-size: var(--t-lg);
  color: var(--text-2);
  line-height: 1.6;
  max-width: 490px;
  margin: 0 auto 28px;
  transition: color var(--tt);
}

.hero-ctas {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero entrance — vivid stagger + expressive easing (occasional / first paint) */
.hero-text .eyebrow { animation: fadeUp 0.62s var(--ease-hero) both 0.06s; }
.hero-h1            { animation: fadeUp 0.78s var(--ease-hero) both 0.16s; }
.hero-sub           { animation: fadeUp 0.7s  var(--ease-hero) both 0.3s; }
.hero-ctas          { animation: fadeUp 0.64s var(--ease-hero) both 0.48s; }

/* ============================================================
   HERO SCENE — layered product composition
   ============================================================ */
.hero-scene {
  position: relative;
  width: 100%;
  max-width: 840px;
  animation:
    sceneEnter 0.95s var(--ease-hero) both 0.52s,
    sceneFloat 9s ease-in-out infinite 2.2s;
}

/* Main app window */
.app-win {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: background-color var(--tt), border-color var(--tt), box-shadow var(--tt);
}

.win-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--tt), border-color var(--tt);
}

.win-dots { display: flex; gap: 6px; flex-shrink: 0; }
.win-dots span {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.win-dots span:nth-child(1) { background: #ff5f57; }
.win-dots span:nth-child(2) { background: #febc2e; }
.win-dots span:nth-child(3) { background: #28c840; }

.win-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  flex: 1;
  text-align: center;
  transition: color var(--tt);
}

.win-action {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-text);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--brand-light);
  flex-shrink: 0;
  transition: color var(--tt), background-color var(--tt);
}

.win-body { padding: 0; }

/* Dispatch card overlay */
.dispatch-card {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 216px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  opacity: 0;
  animation: cardEnter 0.68s var(--ease-hero) both 1s;
  transition: background-color var(--tt), border-color var(--tt), box-shadow var(--tt);
}

.dc-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--tt), border-color var(--tt);
}

.dc-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: color var(--tt);
}

.dc-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #16a34a;
  flex-shrink: 0;
}
[data-theme="dark"] .dc-live { color: #4ade80; }

.dc-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.85s var(--ease-out) infinite;
}

.dc-body { padding: 3px 0; }

.dc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-s);
  transition: border-color var(--tt);
}
.dc-row:last-child { border-bottom: none; }

.dc-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

.dc-crew {
  font-size: 11.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; transition: color var(--tt);
}
.dc-addr {
  font-size: 10.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--tt);
}

/* ============================================================
   SCHEDULE GRID — shared between hero and product section
   ============================================================ */
.sg-head,
.sg-row {
  display: grid;
  grid-template-columns: 140px repeat(5, 1fr);
  border-bottom: 1px solid var(--border-s);
  transition: border-color var(--tt);
}
.sg-row:last-child { border-bottom: none; }
.sg-head { background: var(--bg-subtle); transition: background-color var(--tt); }

.sg-head > *,
.sg-row > * {
  padding: 9px 10px;
  border-right: 1px solid var(--border-s);
  display: flex;
  align-items: center;
  transition: border-color var(--tt);
}
.sg-head > *:last-child,
.sg-row > *:last-child { border-right: none; }

.sg-head .sg-day {
  font-size: 10.5px; font-weight: 600;
  color: var(--text-3); justify-content: center;
  transition: color var(--tt);
}
.sg-head .sg-crew-col {
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  transition: color var(--tt);
}

.sg-row .sg-day {
  justify-content: center;
  min-height: 50px; padding: 6px 8px;
}
.sg-row .sg-crew-col {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text);
  padding: 10px 12px; transition: color var(--tt);
}

/* Small variant — used inside mock-panel in product section */
.sg-sm.sg-head,
.sg-sm.sg-row {
  grid-template-columns: 88px repeat(5, 1fr);
}
.sg-sm.sg-head > *,
.sg-sm.sg-row > * { padding: 6px 7px; }
.sg-sm.sg-row .sg-day { min-height: 36px; padding: 4px 5px; }
.sg-sm.sg-row .sg-crew-col {
  font-size: 10.5px; gap: 5px; padding: 6px 8px;
}
.sg-sm.sg-head .sg-day { font-size: 9.5px; }

/* Crew dot */
.crew-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cd, #94a3b8);
  flex-shrink: 0;
}

/* ============================================================
   JOB CHIPS
   ============================================================ */
.jc {
  font-size: 10.5px; font-weight: 600;
  padding: 3px 7px; border-radius: 4px;
  background: var(--chip-bg); color: var(--chip-t);
  white-space: nowrap; text-align: center;
  transition: background-color var(--tt), color var(--tt);
}
.jc.jc-half    { background: var(--chip-half-bg);    color: var(--chip-half-t); }
.jc.jc-done    { background: var(--chip-done-bg);    color: var(--chip-done-t); }
.jc.jc-overdue { background: var(--chip-overdue-bg); color: var(--chip-overdue-t); }

.jc.jc-sm { font-size: 9.5px; padding: 2px 5px; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.sbadge {
  font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
  transition: background-color var(--tt), color var(--tt);
}
.sb-enroute { background: var(--sb-enroute-bg); color: var(--sb-enroute-t); }
.sb-sched   { background: var(--sb-sched-bg);   color: var(--sb-sched-t); }
.sb-done    { background: var(--sb-done-bg);     color: var(--sb-done-t); }
.sb-overdue { background: var(--sb-overdue-bg);  color: var(--sb-overdue-t); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 80px 0;
  background: var(--bg);
  transition: background-color var(--tt);
}

.section-alt {
  background: var(--bg-alt);
  transition: background-color var(--tt);
}

/* ============================================================
   PRODUCT SECTION
   ============================================================ */
.ptabs-row {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 44px;
  transition: border-color var(--tt);
}

.ptab {
  padding: 10px 22px 11px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border: none;
  position: relative;
  top: 1px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    transform var(--ui-fast) var(--ease-out);
  touch-action: manipulation;
}
.ptab:hover { color: var(--text-2); }
.ptab:active { transform: scale(0.98); }
.ptab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.ptab.active {
  color: var(--text);
  background: var(--brand-light);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.ptab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 22px; right: 22px;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
  transition: background-color var(--tt);
}

/* Product views container */
.product-views {
  max-width: 960px;
  margin: 0 auto;
}

/* Individual product view — visual left, copy right */
.pv {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: center;
}
.pv[hidden] { display: none; }

/* Entrance animation on tab switch */
.pv.pv-entering {
  animation: pvEnter 0.34s var(--ease-hero) both;
}

/* Mock panel — shared card surface */
.mock-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: background-color var(--tt), border-color var(--tt), box-shadow var(--tt);
}

.mock-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--tt), border-color var(--tt);
}

.mock-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: color var(--tt);
}

.mock-chip {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  background: var(--brand-light); color: var(--brand-text);
  margin-left: auto;
  transition: background-color var(--tt), color var(--tt);
}

.mock-body { overflow: hidden; }

/* Copy block */
.pv-copy { padding: 4px 0; }

.pv-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.028em;
  line-height: 1.2;
  margin-bottom: 10px;
  transition: color var(--tt);
}

.pv-copy p {
  font-size: var(--t-base);
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 22px;
  transition: color var(--tt);
}

.pv-list { display: flex; flex-direction: column; gap: 10px; }

.pv-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: var(--t-sm); color: var(--text-2); line-height: 1.5;
  transition: color var(--tt);
}
.pv-list li::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: var(--brand);
  flex-shrink: 0; margin-top: 6px;
  transition: background-color var(--tt);
}

/* ============================================================
   DISPATCH LIST (product dispatch tab)
   ============================================================ */
.dl-list {}

.dl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-s);
  transition: border-color var(--tt);
}
.dl-row:last-child { border-bottom: none; }

.dl-time {
  font-size: 11px; font-weight: 500; color: var(--text-3);
  flex-shrink: 0; font-family: var(--font-mono);
  transition: color var(--tt);
}

/* ============================================================
   DATA TABLE (jobs & invoices tabs)
   ============================================================ */
.dt {}

.dt-head,
.dt-row {
  display: grid;
  border-bottom: 1px solid var(--border-s);
  transition: border-color var(--tt);
}
.dt-row:last-child { border-bottom: none; }
.dt-head { background: var(--bg-subtle); transition: background-color var(--tt); }

.dt-c {
  padding: 9px 12px;
  font-size: 11.5px;
  display: flex; align-items: center;
  color: var(--text-2);
  transition: color var(--tt);
}
.dt-head .dt-c {
  font-size: 10px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.dt-id {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3);
  transition: color var(--tt);
}
.dt-name { font-weight: 500; color: var(--text); transition: color var(--tt); }
.dt-amt  { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; transition: color var(--tt); }
.dt-r    { justify-content: flex-end; }

/* Grid column definitions */
.dt[data-cols="jobs"] .dt-head,
.dt[data-cols="jobs"] .dt-row {
  grid-template-columns: 74px 1fr 104px 90px;
}
.dt[data-cols="invoices"] .dt-head,
.dt[data-cols="invoices"] .dt-row {
  grid-template-columns: 74px 1fr 76px 72px;
}

/* ============================================================
   KPI GRID (reporting tab)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  transition: background-color var(--tt);
}

.kpi-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 22px;
  background: var(--bg-surface);
  transition: background-color var(--tt);
}

.kpi-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em;
  transition: color var(--tt);
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  color: var(--text); letter-spacing: -0.022em;
  transition: color var(--tt);
}

.kpi-sub {
  font-size: 11px; color: var(--text-3);
  transition: color var(--tt);
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: var(--t-xs); font-weight: 700;
  color: var(--brand-text); letter-spacing: 0.06em;
  margin-bottom: 16px;
  transition: color var(--tt);
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.18rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.025em;
  margin-bottom: 9px;
  transition: color var(--tt);
}

.step p {
  font-size: var(--t-base); color: var(--text-2); line-height: 1.65;
  transition: color var(--tt);
}

/* ============================================================
   USE CASES
   ============================================================ */
.uc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.uc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px 24px 28px;
  box-shadow: var(--shadow-card);
  transition:
    background-color var(--tt),
    border-color var(--tt),
    box-shadow var(--ui-fast) var(--ease-out),
    transform var(--ui-fast) var(--ease-out);
}
.uc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.uc-card:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-md);
}

.uc-tag {
  font-size: 10.5px; font-weight: 700;
  color: var(--brand-text);
  text-transform: uppercase; letter-spacing: 0.09em;
  margin-bottom: 10px;
  transition: color var(--tt);
}

.uc-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.025em; line-height: 1.28;
  margin-bottom: 10px;
  transition: color var(--tt);
}

.uc-desc {
  font-size: var(--t-sm); color: var(--text-2); line-height: 1.65;
  margin-bottom: 18px;
  transition: color var(--tt);
}

.uc-list { display: flex; flex-direction: column; gap: 8px; }

.uc-list li {
  font-size: var(--t-sm); color: var(--text-2);
  display: flex; align-items: flex-start; gap: 8px;
  transition: color var(--tt);
}
.uc-list li::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: var(--brand);
  flex-shrink: 0; margin-top: 7px;
  transition: background-color var(--tt);
}

/* ============================================================
   PRICING / FINAL CTA
   ============================================================ */
.cta-block {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.cta-h2 { margin-bottom: 14px; }

.cta-sub {
  font-size: var(--t-lg);
  color: var(--text-2); line-height: 1.6;
  margin-bottom: 36px;
  transition: color var(--tt);
}

.cta-actions {
  display: flex; gap: 12px;
  justify-content: center; flex-wrap: wrap;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  transition: background-color var(--tt), border-color var(--tt);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand-col { display: flex; flex-direction: column; gap: 5px; }

.footer-brand {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--text); letter-spacing: -0.02em;
  border-radius: var(--r-sm);
  transition:
    color var(--ui-fast) var(--ease-out),
    opacity var(--ui-fast) var(--ease-out);
}
.footer-brand:hover { color: var(--brand-text); }
.footer-brand:active { opacity: 0.88; }
.footer-brand:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.footer-tag {
  font-size: var(--t-xs); color: var(--text-3); line-height: 1.5;
  transition: color var(--tt);
}

.footer-links { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.footer-links a {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-3);
  padding: 8px 12px;
  margin: -4px 0;
  border-radius: var(--r-sm);
  transition:
    color var(--ui-fast) var(--ease-out),
    background-color var(--ui-fast) var(--ease-out),
    opacity var(--ui-fast) var(--ease-out);
}
.footer-links a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}
.footer-links a:active { opacity: 0.88; }
.footer-links a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.footer-copy {
  font-size: var(--t-xs); color: var(--text-3);
  transition: color var(--tt);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 0.68s var(--ease-hero), transform 0.68s var(--ease-hero);
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ============================================================
   ANIMATIONS / KEYFRAMES
   ============================================================ */
@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sceneEnter {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes pvEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sceneFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.42; }
}

/* ============================================================
   RESPONSIVE — tablet
   ============================================================ */
@media (max-width: 1023px) {
  .pv {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pv-copy { order: -1; }

  .steps { gap: 40px; }

  .dispatch-card { right: 10px; top: 10px; width: 188px; }
}

/* ============================================================
   RESPONSIVE — mobile
   ============================================================ */
@media (max-width: 767px) {
  .container { padding: 0 18px; }

  /* ── NAV — brand left, icons right ────────────────────── */
  html { scroll-padding-top: 52px; } /* matches mobile header height */
  .nav-inner {
    display: flex;
    align-items: center;
    gap: 0;
    height: 52px;
  }
  .nav-links   { display: none; }
  .btn-nav     { display: none; }
  .nav-actions { margin-left: auto; }
  .nav-burger  { display: flex; }

  /* ── HERO ──────────────────────────────────────────────── */
  .hero { padding: 36px 0 32px; }
  .hero-container { gap: 24px; }
  .hero-text { max-width: 100%; }
  .hero-text .eyebrow { display: none; } /* save vertical space, headline is self-explanatory */
  .hero-h1 { font-size: clamp(2.0rem, 9vw, 2.6rem); margin-bottom: 14px; }
  .hero-sub { font-size: var(--t-sm); max-width: 100%; margin-bottom: 20px; line-height: 1.55; }
  /* Stack CTAs full-width for easy tapping */
  .hero-ctas { flex-direction: column; gap: 8px; }
  .hero-ctas .btn { width: 100%; justify-content: center; }

  /* ── HERO SCENE — 3-day schedule, denser ───────────────── */
  /* Show only Mon–Wed to reduce density */
  .sg-head, .sg-row { grid-template-columns: 70px repeat(3, 1fr); }
  .sg-head > *:nth-child(n+5),
  .sg-row > *:nth-child(n+5) { display: none; }
  .sg-head > *, .sg-row > * { padding: 5px 4px; }
  .sg-row .sg-day { min-height: 36px; padding: 3px 4px; }
  .sg-row .sg-crew-col { font-size: 10px; gap: 4px; padding: 7px 6px; }
  .jc { font-size: 9px; padding: 2px 4px; }

  /* Dispatch overlay hidden — too cramped */
  .dispatch-card { display: none; }

  /* ── SECTIONS ──────────────────────────────────────────── */
  .section { padding: 48px 0; }
  .section-h2 { font-size: 1.5rem; letter-spacing: -0.025em; margin-bottom: 24px; }
  .section-eyebrow { margin-bottom: 8px; }

  /* ── PRODUCT TABS — static equal distribution ─────────── */
  /* flex: 1 fills the row evenly; overflow-x: auto is a silent
     safety net that only activates when future tabs are added */
  .ptabs-row {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 28px;
  }
  .ptabs-row::-webkit-scrollbar { display: none; }
  .ptab {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 4px;
    font-size: 12px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    flex-shrink: 1;
    top: 1px;
  }
  .ptab.active { border-radius: var(--r-sm) var(--r-sm) 0 0; }
  .ptab.active::after { left: 4px; right: 4px; }

  /* ── PRODUCT VIEW — compact, copy-first ────────────────── */
  .pv { gap: 20px; }
  .pv-copy { order: -1; }
  .pv-copy h3 { font-size: 1.15rem; margin-bottom: 8px; }
  .pv-copy p  { display: none; } /* headline + bullets sufficient on mobile */
  .pv-list { gap: 7px; }

  /* Small schedule grid in product section */
  .sg-sm.sg-head,
  .sg-sm.sg-row { grid-template-columns: 64px repeat(3, 1fr); }
  .sg-sm.sg-head > *:nth-child(n+5),
  .sg-sm.sg-row > *:nth-child(n+5) { display: none; }
  .sg-sm.sg-row .sg-day { min-height: 30px; }
  .sg-sm.sg-row .sg-crew-col { font-size: 9.5px; }

  /* Tables */
  .dt[data-cols="jobs"] .dt-head,
  .dt[data-cols="jobs"] .dt-row { grid-template-columns: 60px 1fr 80px; }
  .dt[data-cols="invoices"] .dt-head,
  .dt[data-cols="invoices"] .dt-row { grid-template-columns: 60px 1fr 62px; }
  .dt-hide-sm { display: none; }

  /* Dispatch list */
  .dl-row { padding: 10px 14px; }
  .dl-time { display: none; } /* reduce visual noise */

  /* KPI grid */
  .kpi-val { font-size: 22px; }
  .kpi-card { padding: 14px 16px; }

  /* ── HOW IT WORKS ───────────────────────────────────────── */
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .step-num { margin-bottom: 10px; }

  /* ── USE CASES ─────────────────────────────────────────── */
  .uc-grid { grid-template-columns: 1fr; gap: 10px; }
  .uc-card { padding: 18px 18px 20px; }
  .uc-desc { display: none; } /* tag + h3 + bullets is sufficient on mobile */

  /* ── EARLY ACCESS CTA ──────────────────────────────────── */
  .section#access { padding: 40px 0; }
  .cta-h2 { margin-bottom: 10px; }
  .cta-sub { font-size: var(--t-base); margin-bottom: 24px; }
  .cta-actions { flex-direction: column; gap: 8px; }
  .cta-actions .btn { width: 100%; justify-content: center; }

  /* ── FOOTER ─────────────────────────────────────────────── */
  .footer { padding: 24px 0; }
  .footer-inner { flex-direction: column; text-align: center; gap: 14px; }
  .footer-links { justify-content: center; gap: 16px; }
  .footer-tag { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-text .eyebrow,
  .hero-h1, .hero-sub, .hero-ctas,
  .hero-scene, .dispatch-card,
  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: background-color var(--tt), color var(--tt), border-color var(--tt) !important;
  }
  .pv.pv-entering { animation: none !important; opacity: 1 !important; transform: none !important; }
  .nav-mobile:not([hidden]) { animation: none !important; }
  .nav-burger span { transition: none !important; }
  .dc-dot { animation: none !important; }
  .icon-sun, .icon-moon { transition: opacity 180ms var(--ease-out) !important; transform: none !important; }
  [data-theme="dark"] .icon-moon { transform: none !important; }

  .uc-card:hover,
  .uc-card:active {
    transform: none !important;
    box-shadow: var(--shadow-card) !important;
  }

  html { scroll-behavior: auto; }
}
