/* =======================================
   AJ Sorensen — Global Styles (v3)
   - Sticky header + sticky first column
   - Group row styling + zebra rows
   - Status pulse (reduced-motion aware)
   - Badges for NEW/BETA
   - Nicer print styles
   ======================================= */

/* Design Tokens */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --surface-muted: #f0f0f3;

  --text: #1d1d1f;
  --text-muted: #4a4a4f;
  --text-subtle: #6e6e73;

  --border: #e0e0e0;
  --border-muted: #e5e7eb;

  --link: #0071e3;
  --accent: #34c759; /* status ON */
  --warn: #ffb020;   /* optional alt status */
  --off:  #d2d2d7;

  --shadow: 0 1px 2px rgba(0,0,0,.06);

  color-scheme: light;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --surface: #14161a;
    --surface-subtle: #181b20;
    --surface-muted: #1c2026;

    --text: #f5f5f7;
    --text-muted: #cfd2d6;
    --text-subtle: #9aa0a6;

    --border: #2a2e35;
    --border-muted: #2f353d;

    --link: #8ab4f8;
    --shadow: 0 1px 2px rgba(0,0,0,.4);

    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
::selection { background: rgba(0,113,227,.18); }

/* Typography & Body */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container { width: min(1200px, 90%); margin: 0 auto; padding: 2rem 0; }

/* Hero */
header.hero {
  background: var(--surface);
  text-align: center;
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  border-bottom: 1px solid var(--border);
}
header.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: .5rem;
}
header.hero p { color: var(--text-subtle); font-size: clamp(1rem, 2.5vw, 1.2rem); }

/* Pipeline Table Wrapper */
.pipeline { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable both-edges; }
.pipeline::after {
  content: ''; position: absolute; right: 0; top: 0; width: 30px; height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0), var(--bg)); pointer-events: none;
}

/* Table */
.table-wrapper {
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.pipeline table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; }

/* Head */
.pipeline thead {
  background: var(--surface-subtle);
  position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border);
}
.pipeline th {
  font-weight: 700; text-transform: uppercase; font-size: .82rem; letter-spacing: .06em;
  padding: 1rem; color: var(--text-subtle); text-align: center; white-space: nowrap;
}

/* Sticky first column (header + cells) */
.pipeline th:first-child,
.pipeline td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

/* Cells */
.pipeline td {
  padding: 1.1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

/* First column: business/label name */
.pipeline td:first-child {
  text-align: left; font-weight: 700; color: var(--text);
}

/* Group headers */
.business-header td {
  background: var(--surface-muted);
  font-weight: 800;
  text-align: left;
  font-size: 1rem;
  color: var(--text);
  border-top: 2px solid var(--border);
  box-shadow: inset 0 1px 0 var(--border);
}

/* Zebra rows (only non-header rows) */
.pipeline tbody tr:not(.business-header):nth-child(odd) td {
  background: color-mix(in oklab, var(--surface) 90%, var(--surface-subtle));
}

/* Hover row (non-header) */
.pipeline tbody tr:not(.business-header):hover td {
  background: var(--surface-subtle);
}

/* First data row: no top border */
.pipeline tbody tr:first-child td { border-top: none; }

/* Status dot */
.status {
  --dot: var(--off);
  font-size: 1.25rem; line-height: 1; display: inline-block; transform: translateY(1px);
  color: var(--off);
}
.status.active { color: var(--accent); --dot: var(--accent); }

/* Gentle status pulse for active dots */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 35%, transparent); }
  100% { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
}
.pipeline td .status.active {
  border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pipeline td .status.active { animation: none; }
}

/* Sections (Mission / About / Skills / Brands) */
.mission, .about, .skills, .brands {
  background: var(--surface);
  padding: clamp(3rem, 6vw, 4rem) 0;
  border-top: 1px solid var(--border);
}
.mission h2, .about h2, .skills h2, .brands h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  margin-bottom: 1rem; text-align: center; font-weight: 800; color: var(--text);
}
.mission-text, .about-text {
  max-width: 800px; margin: 0 auto; font-size: 1.075rem; line-height: 1.75; color: var(--text-muted); text-align: center;
}

/* Skills */
.skills h2 { margin-bottom: 1.6rem; }
.skills-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; list-style: none; max-width: 900px; margin: 0 auto;
}
.skills-list li {
  background: var(--surface-subtle); padding: 1rem 1.1rem; border: 1px solid var(--border-muted);
  border-radius: 10px; font-size: 1rem; font-weight: 500; color: var(--text); text-align: center;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease; box-shadow: var(--shadow);
}
.skills-list li:hover { background: var(--surface-muted); border-color: var(--border); transform: translateY(-2px); }

/* Badges (optional) */
.badge {
  display: inline-block; padding: .25rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; margin-left: .4rem;
  background: var(--surface-subtle); color: var(--text-subtle); border: 1px solid var(--border-muted);
}
.badge.new   { background: #e6f8ec; color: #137a3a; border-color: #bfe9cc; }
.badge.beta  { background: #fff4e5; color: #8a5600; border-color: #ffe2b8; }
.badge.hot   { background: #ffe9ec; color: #a3213a; border-color: #ffc6cf; }

/* Brands */
.brands h2 { margin-bottom: 1.25rem; }
.brand-list { list-style: none; max-width: 760px; margin: 0 auto; padding: 0; }
.brand-list li { margin: .9rem 0; font-size: 1.075rem; text-align: center; }
.brand-list a { color: var(--link); text-decoration: none; font-weight: 700; }
.brand-list a:hover { text-decoration: underline; }

/* Footer */
footer {
  background: var(--surface); text-align: center; padding: 2rem 1rem;
  font-size: .95rem; color: var(--text-subtle); border-top: 1px solid var(--border);
}

/* Focus */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }

/* Motion prefs */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Responsive niceties */
@media (max-width: 640px) {
  .pipeline th, .pipeline td { padding: .9rem; }
  .brand-list li { font-size: 1rem; }
  header.hero { padding: 3rem 0; }
}

/* Print: clean one-pager */
@media print {
  :root { --bg:#fff; --surface:#fff; --surface-subtle:#fff; --surface-muted:#fff; --border:#ccc; --text:#000; --text-subtle:#333; }
  body { background:#fff; color:#000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.hero { border-bottom: 0; padding: 1rem 0; }
  .pipeline { overflow: visible; }
  .table-wrapper { box-shadow: none; border: 1px solid var(--border); }
  .pipeline thead { position: static; }
  .pipeline th, .pipeline td { padding: .6rem .8rem; }
  .status.active { color: #000; animation: none !important; }
  footer { border: 0; }
}
