/* ==========================================================================
   Hurst Data Consulting — Portfolio design tokens & shared styles
   Lane: Minimal / Swiss. Signature: the horizontal engagement timeline that
   doubles as primary navigation, in the HDC navy/teal/gold ink system.
   ========================================================================== */

:root {
  /* --- brand ink (from the HDC monogram) --- */
  --navy: #0a2342;
  --teal-900: #00434a;
  --teal-700: #006d77;
  --teal-500: #1f8e97;
  --teal-300: #6fb8bd;
  --teal-100: #d9ecee;
  --gold: #c9a84c;

  /* --- semantic tokens (light) --- */
  --bg: #ffffff;
  --surface: #f6f8f9;
  --surface-raised: #ffffff;
  --border: #dde4e7;
  --border-strong: #c3cdd2;
  --ink: #0a2342;
  --ink-body: #1c2e3d;
  --ink-muted: #5b6b76;
  --link: #006d77;
  --link-hover: #00434a;
  --focus-ring: #006d77;
  --shadow-sm: 0 1px 2px rgba(10, 35, 66, 0.06);
  --shadow-md: 0 4px 16px rgba(10, 35, 66, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 35, 66, 0.12);

  /* maturity ramp — sequential, one hue (teal), light -> dark.
     --stage-active uses teal-700, not teal-500: teal-500 reads well as a UI
     accent but only hits ~3.6:1 against white text (fails WCAG AA 4.5:1 at
     this label's 11.5px size); teal-700 clears it at ~5.8:1. */
  --stage-early: var(--teal-100);
  --stage-early-ink: var(--teal-900);
  --stage-active: var(--teal-700);
  --stage-active-ink: #ffffff;
  --stage-shipped: var(--teal-900);
  --stage-shipped-ink: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a141c;
    --surface: #0f1e28;
    --surface-raised: #132531;
    --border: #223441;
    --border-strong: #2e4552;
    --ink: #eef4f6;
    --ink-body: #d3dee3;
    --ink-muted: #8fa2ac;
    --link: #5fd0d8;
    --link-hover: #8fe0e6;
    --focus-ring: #5fd0d8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

    --stage-early: #17323a;
    --stage-early-ink: #8fd6dc;
    --stage-active: #2a8a92;
    --stage-active-ink: #06181c;
    --stage-shipped: #5fd0d8;
    --stage-shipped-ink: #06181c;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
h3 {
  font-size: 1.375rem;
}

p {
  margin: 0 0 var(--space-4);
  max-width: 65ch;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-700);
}
@media (prefers-color-scheme: dark) {
  .eyebrow {
    color: var(--link);
  }
}

.lede {
  font-size: 1.25rem;
  color: var(--ink-body);
  max-width: 58ch;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* --- top nav --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--ink);
}
.brand .mark {
  width: 26px;
  height: 26px;
  flex: none;
}
.nav-links {
  display: flex;
  gap: var(--space-6);
  font-size: 0.9375rem;
  font-weight: 600;
}
.nav-links a {
  color: var(--ink-body);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--teal-700);
}
@media (prefers-color-scheme: dark) {
  .nav-links a:hover {
    color: var(--link);
  }
}

/* --- hero --- */
.hero {
  padding: var(--space-24) 0 var(--space-16);
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow {
  margin-bottom: var(--space-4);
}
.hero-cta-row {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out,
    background 150ms ease-out;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--teal-700);
  color: #fff;
}
.btn-primary:hover {
  background: var(--teal-900);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-secondary:hover {
  border-color: var(--teal-700);
  color: var(--teal-700);
}
@media (prefers-color-scheme: dark) {
  .btn-secondary:hover {
    color: var(--link);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
  .btn:hover {
    transform: none;
  }
}

/* --- section rhythm --- */
.section {
  padding: var(--space-16) 0;
}
.section-head {
  margin-bottom: var(--space-8);
  max-width: 70ch;
}

/* --- capability grid (resume) --- */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-6);
}
.capability {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--surface);
}
.capability .num {
  font-family: var(--font-mono);
  color: var(--teal-700);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
@media (prefers-color-scheme: dark) {
  .capability .num {
    color: var(--link);
  }
}
.capability h3 {
  margin: var(--space-2) 0 var(--space-2);
  font-size: 1.0625rem;
}
.capability p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* --- stat row --- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat .value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .label {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* --- timeline / gantt --- */
.timeline-wrap {
  overflow-x: auto;
  padding-bottom: var(--space-2);
}
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.timeline-legend .item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.timeline-legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: none;
}
.timeline-svg {
  min-width: 720px;
  width: 100%;
  height: auto;
  font-family: var(--font-sans);
}
.tl-row-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.tl-row-sub {
  fill: var(--ink-muted);
  font-size: 11.5px;
}
.tl-axis-label {
  fill: var(--ink-muted);
  font-size: 11px;
}
.tl-gridline {
  stroke: var(--border);
  stroke-width: 1;
}
.tl-bar {
  cursor: pointer;
}
.tl-bar-hit {
  cursor: pointer;
  fill: transparent;
}
.tl-bar-label {
  /* fill intentionally omitted: js/timeline.js sets a per-stage ink color as
     an inline SVG attribute so the label passes contrast against every bar
     fill; a fill declared here would win the cascade and override it. */
  font-size: 11.5px;
  font-weight: 700;
  pointer-events: none;
}
.tl-marker {
  stroke: var(--gold);
  stroke-width: 2;
}
.tl-row-group:hover .tl-bar {
  filter: brightness(1.08);
}
.tl-row-group:focus-visible .tl-bar {
  outline: 2px solid var(--focus-ring);
}

/* --- project grid / cards --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  padding: var(--space-6);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease-out, box-shadow 150ms ease-out,
    border-color 150ms ease-out;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-500);
}
@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
  .card:hover {
    transform: none;
  }
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.card h3 {
  margin: 0;
  font-size: 1.1875rem;
}
.card .tagline {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-4);
}
.card .feature {
  font-size: 0.875rem;
  color: var(--ink-body);
  margin: 0 0 var(--space-1);
  padding-left: 1.1em;
  position: relative;
}
.card .feature::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-500);
}
.card .view-link {
  margin-top: auto;
  padding-top: var(--space-4);
  font-weight: 700;
  font-size: 0.875rem;
}

/* --- status badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.badge-shipped {
  background: color-mix(in srgb, var(--stage-shipped) 16%, transparent);
  color: var(--teal-900);
}
.badge-shipped .dot {
  background: var(--stage-shipped);
}
.badge-active {
  background: color-mix(in srgb, var(--stage-active) 18%, transparent);
  color: var(--teal-900);
}
.badge-active .dot {
  background: var(--stage-active);
}
.badge-early {
  background: var(--stage-early);
  color: var(--stage-early-ink);
}
.badge-early .dot {
  background: var(--teal-500);
}
@media (prefers-color-scheme: dark) {
  .badge-shipped {
    color: #eafcfd;
  }
  .badge-active {
    color: #eafcfd;
  }
}

/* --- project detail page --- */
.detail-hero {
  padding: var(--space-16) 0 var(--space-8);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: var(--space-8);
}
.back-link:hover {
  color: var(--teal-700);
}
@media (prefers-color-scheme: dark) {
  .back-link:hover {
    color: var(--link);
  }
}
.detail-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-4) 0 var(--space-8);
}
.mini-timeline {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  margin-bottom: var(--space-12);
}
.mini-timeline .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}
.mini-timeline .track {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: visible;
}
.mini-timeline .fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--teal-700);
}
.mini-timeline .caption {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: var(--space-3);
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-16);
}
@media (max-width: 860px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.detail-block {
  margin-bottom: var(--space-12);
}
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feature-list li {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  padding-left: var(--space-6);
  position: relative;
}
.feature-list li:first-child {
  border-top: none;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--space-3) + 0.5em);
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--teal-700);
}
@media (prefers-color-scheme: dark) {
  .feature-list li::before {
    background: var(--link);
  }
}

.sidebar-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.sidebar-card h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
}
.tech-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tech-pill {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--ink-body);
}

.outcome-block {
  border-left: 3px solid var(--gold);
  padding: var(--space-2) 0 var(--space-2) var(--space-6);
  background: transparent;
}

.project-pager {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  font-weight: 700;
}
.project-pager a {
  text-decoration: none;
  color: var(--ink);
}
.project-pager a:hover {
  color: var(--teal-700);
}
.project-pager .dir {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.project-pager .next {
  text-align: right;
}

/* --- footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* --- source note --- */
.source-note {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .hero {
    padding: var(--space-16) 0 var(--space-12);
  }
  .nav-links {
    display: none;
  }
}
