/* ==========================================================================
   Nathan Bowser, DNP, CRNA — personal site
   Single stylesheet, no build step.
   ========================================================================== */

:root {
  /* Neutrals (warm) */
  --bg:           #faf8f4;
  --bg-alt:       #f1efe9;
  --surface:      #ffffff;
  --ink:          #1c2620;
  --ink-soft:     #4a544c;
  --ink-muted:    #6f786f;
  --rule:         #e3e1d8;

  /* Accent (forest / sage) */
  --accent:       #2f5d3a;
  --accent-hover: #25492e;
  --accent-soft:  #d9e4d6;
  --accent-tint:  #eef3ec;

  /* TEG 6s channel colors — Global Hemostasis with Lysis cartridge */
  --teg-ck:       #2c7da0;   /* Citrated Kaolin — steel blue */
  --teg-crt:      #2f5d3a;   /* Citrated Rapid TEG — forest green (site accent) */
  --teg-cff:      #b8456a;   /* Citrated Functional Fibrinogen — muted rose */
  --teg-ly30:     #6f786f;   /* LY30 marker — neutral */

  /* Layout */
  --radius:       14px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 2px rgba(28, 38, 32, 0.04);
  --shadow-md:    0 8px 24px -12px rgba(28, 38, 32, 0.18);

  /* Type */
  --serif:        "Fraunces", Georgia, "Times New Roman", serif;
  --sans:         "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--teg-ck));
  z-index: 100;
  transition: width 80ms linear;
  pointer-events: none;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Reusable ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 200ms ease, color 200ms ease,
              border-color 200ms ease, transform 200ms ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.nav.is-scrolled { border-bottom-color: var(--rule); }
.nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 160ms ease;
}
.nav__links a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav__links { gap: 18px; }
  .nav__links a { font-size: 13px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 28px 110px;
  max-width: 1120px;
  margin: 0 auto;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 72px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero { padding: 56px 24px 72px; }
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
}
.hero__title {
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.05;
  margin: 0 0 22px;
}
.hero__title--accent {
  display: block;
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}
.hero__lede {
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 46ch;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* TEG 6s visualization */
.hero__viz {
  margin: 0;
  padding: 24px 24px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.hero__viz svg { width: 100%; height: auto; }

/* Axis + grid */
.teg-axis {
  stroke: var(--ink-soft);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  opacity: 0.45;
}
.teg-grid {
  stroke: var(--rule);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.teg-ly30 {
  stroke: var(--teg-ly30);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0.6;
}
.teg-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--teg-ly30);
  text-transform: uppercase;
}

/* Channel curves — animated stroke draw */
.teg-curve {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  transition: stroke-dashoffset 3500ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 320ms ease,
              stroke-width 320ms ease;
}
.hero__viz.is-visible .teg-curve { stroke-dashoffset: 0; }

.teg-channel--crt .teg-curve { stroke: var(--teg-crt); }
.teg-channel--ck  .teg-curve { stroke: var(--teg-ck); }
.teg-channel--cff .teg-curve { stroke: var(--teg-cff); }

/* Stagger the draw to mimic the live cartridge readout */
.teg-channel--crt .teg-curve { transition-delay: 0ms; }
.teg-channel--ck  .teg-curve { transition-delay: 450ms; }
.teg-channel--cff .teg-curve { transition-delay: 900ms; }

/* After the curves finish drawing, gently breathe — the "live device" feel */
@keyframes teg-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}
.hero__viz.is-drawn .teg-curve {
  animation: teg-pulse 2.6s ease-in-out infinite;
  transition-delay: 0ms;
}
.hero__viz.is-drawn .teg-channel--ck  .teg-curve { animation-delay: 0.5s; }
.hero__viz.is-drawn .teg-channel--cff .teg-curve { animation-delay: 1.0s; }

/* Legend */
.hero__viz-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.legend-swatch {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.legend-item--crt .legend-swatch { background: var(--teg-crt); }
.legend-item--ck  .legend-swatch { background: var(--teg-ck); }
.legend-item--cff .legend-swatch { background: var(--teg-cff); }

/* Replay button (sits in the legend bar) */
.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 200ms ease;
}
.btn-replay:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn-replay:active { transform: translateY(0); }

.legend-meta {
  margin-left: auto;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-size: 11px;
}
@media (max-width: 480px) {
  .legend-meta { margin-left: 0; width: 100%; }
}

/* Subtle scroll cue */
.hero__scroll {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--ink-muted));
  opacity: 0.5;
}

/* ---------- Section shell ---------- */
.section {
  padding: 110px 28px;
  border-top: 1px solid var(--rule);
}
.section--alt { background: var(--bg-alt); }
.section__inner { max-width: 1120px; margin: 0 auto; }
.section__inner--narrow { max-width: 720px; }
.section__header { max-width: 760px; margin-bottom: 56px; }
.section__header h2 {
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.15;
  margin: 0 0 14px;
}
.section__lede {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 800px) { .about__grid { grid-template-columns: 1fr; gap: 32px; } }
.about__photo-frame {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-tint), var(--accent-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
}
/* When the frame is an actual <img>, fit it nicely and favor showing the face. */
img.about__photo-frame {
  object-fit: cover;
  object-position: center 22%;
  display: block;
  transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}
.about__photo:hover img.about__photo-frame {
  transform: scale(1.015);
}
.about__copy p {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.about__copy strong { color: var(--ink); font-weight: 600; }
.about__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.about__chips li {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
}

/* ---------- Focus section: hint + interactive TEG ---------- */
.section__hint {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 14px 0 0;
  letter-spacing: 0.02em;
  font-style: italic;
}

.focus__viz {
  margin: 0 auto 56px;
  max-width: 760px;
  padding: 22px 24px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.focus__viz svg { width: 100%; height: auto; }

/* Focus TEG curves draw when section comes into view */
.focus__viz .teg-curve {
  transition: stroke-dashoffset 2800ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 280ms ease,
              stroke-width 280ms ease;
}
.focus__viz.is-visible .teg-curve { stroke-dashoffset: 0; }

/* Channel highlight: when one card is hovered, others fade */
.focus__viz.is-highlighting .teg-channel .teg-curve {
  opacity: 0.12;
  stroke-width: 1.5;
}
.focus__viz.is-highlighting .teg-channel.is-active .teg-curve {
  opacity: 1;
  stroke-width: 3.5;
}

/* LY30 region — invisible by default, lights up when LY30 card hovered */
.teg-ly30-rect {
  fill: var(--teg-ly30);
  opacity: 0;
  transition: opacity 280ms ease;
}
.focus__viz.is-highlighting .teg-ly30-region.is-active .teg-ly30-rect {
  opacity: 0.10;
}
.focus__viz.is-highlighting .teg-ly30-region.is-active .teg-ly30 {
  opacity: 1;
  stroke-width: 2;
}
.focus__viz.is-highlighting .teg-ly30-region.is-active .teg-label {
  fill: var(--ink);
}

/* ---------- Focus / TEG cards ---------- */
.focus__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 64px;
}
@media (max-width: 1000px) { .focus__cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .focus__cards { grid-template-columns: 1fr; } }

/* Stagger card reveals so they appear one after another */
.focus__cards .card.reveal:nth-child(1) { transition-delay: 0ms; }
.focus__cards .card.reveal:nth-child(2) { transition-delay: 120ms; }
.focus__cards .card.reveal:nth-child(3) { transition-delay: 240ms; }
.focus__cards .card.reveal:nth-child(4) { transition-delay: 360ms; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rule);
  transition: background 220ms ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}
.card--crt::before   { background: var(--teg-crt); }
.card--ck::before    { background: var(--teg-ck); }
.card--cff::before   { background: var(--teg-cff); }
.card--lysis::before { background: var(--teg-ly30); }

.card__tag {
  display: inline-block;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  background: var(--bg-alt);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.card--crt   .card__tag { color: var(--teg-crt); background: rgba(47, 93, 58, 0.10); }
.card--ck    .card__tag { color: var(--teg-ck);  background: rgba(44, 125, 160, 0.10); }
.card--cff   .card__tag { color: var(--teg-cff); background: rgba(184, 69, 106, 0.10); }
.card--lysis .card__tag { color: var(--ink);     background: var(--bg-alt); }

.card h3 { font-size: 20px; margin: 0 0 10px; }
.card p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

.focus__statement {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 28px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.focus__statement blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
}
.focus__statement em { color: var(--accent); font-style: italic; }

/* ---------- CV ---------- */
.cv__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 56px;
}
@media (max-width: 720px) {
  .cv__panel { flex-direction: column; align-items: flex-start; }
}
.cv__panel h3 { font-size: 22px; margin: 0 0 6px; }
.cv__panel p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.cv__highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 40px;
}
@media (max-width: 800px) { .cv__highlights { grid-template-columns: 1fr; } }
.cv__col h4 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 14px;
}
.cv__col ul li {
  font-size: 14.5px;
  color: var(--ink-soft);
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  line-height: 1.55;
}
.cv__col ul li:first-child { border-top: 0; padding-top: 0; }
.cv__col ul li strong { color: var(--ink); font-weight: 600; }
.cv__col ul li em { color: var(--ink); font-style: italic; }

/* ---------- Contact ---------- */
.contact__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 28px;
  background: var(--bg);
}
.footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.footer p { margin: 0; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .teg-curve { stroke-dashoffset: 0 !important; transition: none; animation: none !important; }
  .scroll-progress { transition: none; }
}
