/* ==========================================================================
   DESIGN TOKENS
   Palette: clinical teal (nursing) + amber monitor-readout accent + cyan
   data-line, on a cool paper-white surface. Type: Space Grotesk (display,
   technical) / Source Serif 4 (body, human) / IBM Plex Mono (data & labels).
   ========================================================================== */
:root {
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --ink: #10221D;
  --ink-soft: #4A5B56;
  --border: #DCE4E1;
  --primary: #1B5E4F;
  --primary-dark: #123D33;
  --accent: #E4A73D;
  --data-line: #2FB6C4;
  --danger-soft: #C4562F;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --max-w: 1120px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 34, 29, 0.06), 0 8px 24px rgba(16, 34, 29, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

::selection { background: var(--accent); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--data-line);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   TYPE
   ========================================================================== */
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}
.mono { font-family: var(--font-mono); }

/* ==========================================================================
   NAV
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 248, 247, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .pulse-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--data-line);
  box-shadow: 0 0 0 0 rgba(47,182,196,0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47,182,196,0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(47,182,196,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,182,196,0); }
}
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: 7px;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--primary); background: rgba(27,94,79,0.07); }
.nav-links a.current { color: var(--primary); font-weight: 600; }
.nav-links .btn-cv {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
}
.nav-links .btn-cv:hover { background: var(--primary-dark); }
.nav-toggle { display: none; }

/* ==========================================================================
   HERO + SIGNATURE ECG-TO-BARCHART LINE
   ========================================================================== */
.hero {
  padding: 88px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.04;
  margin: 18px 0 20px;
}
.hero h1 .accent-word { color: var(--primary); }
.hero-sub {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

.btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.hero-meta {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.hero-meta span { display: flex; align-items: center; gap: 7px; }
.hero-meta strong { color: var(--ink); }

.signature-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px 16px;
  box-shadow: var(--shadow);
}
.signature-wrap .cap {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
#ecg-svg { width: 100%; height: auto; display: block; }
.ecg-path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.6s cubic-bezier(.4,0,.2,1) 0.2s forwards;
}
.bars rect {
  fill: var(--data-line);
  opacity: 0;
  transform-origin: bottom;
  animation: rise .5s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: scaleY(0);} to { opacity: 1; transform: scaleY(1);} }

/* ==========================================================================
   SECTIONS (shared)
   ========================================================================== */
section { padding: 76px 0; }
.section-head { margin-bottom: 42px; max-width: 62ch; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin-top: 10px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   DUAL EXPERTISE / CONVERGENCE
   ========================================================================== */
.convergence {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 26px;
  align-items: stretch;
}
.conv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.conv-card h3 { font-size: 19px; margin-bottom: 8px; }
.conv-card .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.conv-card p { color: var(--ink-soft); font-size: 15.5px; margin: 10px 0 0; }
.conv-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 22px;
}
.conv-result {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border);
  margin-top: 6px;
  padding-top: 22px;
  text-align: center;
}
.conv-result strong { color: var(--primary); font-family: var(--font-display); font-size: 20px; }

/* ==========================================================================
   SKILLS
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.skill-card h4 { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.skill-card .lvl { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.meter { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin-bottom: 10px; }
.meter > span { display: block; height: 100%; background: var(--data-line); border-radius: 4px; width: 0%; transition: width 1.1s cubic-bezier(.4,0,.2,1); }
.skill-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  background: var(--surface);
}

/* ==========================================================================
   NOW LEARNING / SQL PROGRESS
   ========================================================================== */
.learning-card {
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.learning-card h3 { color: #fff; font-size: 21px; margin-bottom: 8px; }
.learning-card p { color: rgba(255,255,255,0.82); font-size: 14.5px; max-width: 52ch; margin: 0; }
.ring-wrap { position: relative; width: 108px; height: 108px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 301; stroke-dashoffset: 301; transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 18px; font-weight: 600; }

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.timeline { position: relative; padding-left: 28px; border-left: 1.5px solid var(--border); }
.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -33.5px;
  top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--primary);
}
.tl-date { font-family: var(--font-mono); font-size: 12px; color: var(--primary); letter-spacing: .05em; }
.tl-item h3 { font-size: 18px; margin: 6px 0 4px; }
.tl-item .org { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; font-family: var(--font-mono); }
.tl-item ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 15px; }
.tl-item li { margin-bottom: 4px; }

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-thumb {
  height: 140px;
  background: linear-gradient(135deg, rgba(27,94,79,0.08), rgba(47,182,196,0.12));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--primary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.project-body h3 { font-size: 16.5px; margin-bottom: 6px; }
.project-body p { font-size: 14px; color: var(--ink-soft); flex: 1; }
.project-body .chip-row { margin-top: 10px; margin-bottom: 12px; }
.project-link { font-family: var(--font-mono); font-size: 12.5px; color: var(--primary); text-decoration: none; font-weight: 600; }
.project-link:hover { text-decoration: underline; }
.placeholder-flag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--danger-soft);
  border: 1px dashed var(--danger-soft);
  border-radius: 5px;
  padding: 2px 7px;
  align-self: flex-start;
  margin-bottom: 8px;
}

/* ==========================================================================
   CONTACT / FOOTER
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.contact-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.contact-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgb(var(--accent-rgb, 27,94,79));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.contact-card:hover {
  border-color: rgba(var(--accent-rgb, 27,94,79), 0.4);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.contact-card:hover::before { transform: scaleX(1); }
.cc-icon {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb, 27,94,79), 0.12);
  color: rgb(var(--accent-rgb, 27,94,79));
  transition: transform .18s ease;
}
.contact-card:hover .cc-icon { transform: scale(1.06); }
.cc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-text .k { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.cc-text .v { font-family: var(--font-mono); font-size: 14px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-go {
  margin-left: auto;
  flex: none;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  transition: color .18s ease, transform .18s ease, background .18s ease;
}
.contact-card:hover .cc-go { color: rgb(var(--accent-rgb, 27,94,79)); background: rgba(var(--accent-rgb, 27,94,79), 0.1); transform: translate(2px,-2px); }

/* CV card reads as the primary call to action, filled solid */
.contact-card.cc-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.contact-card.cc-primary .cc-icon { background: rgba(255,255,255,0.16); color: #fff; }
.contact-card.cc-primary .cc-text .k { color: rgba(255,255,255,0.7); }
.contact-card.cc-primary .cc-text .v { color: #fff; }
.contact-card.cc-primary .cc-go { background: rgba(255,255,255,0.14); color: #fff; }
.contact-card.cc-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary-dark); }
.contact-card.cc-primary:hover .cc-go { background: rgba(255,255,255,0.24); color: #fff; }
.contact-card.cc-primary::before { background: var(--accent); }

.form-note { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); margin-top: 8px; }

footer { border-top: 1px solid var(--border); padding: 30px 0; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
footer p { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
footer .foot-links { display: flex; gap: 16px; }
footer .foot-links a { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); text-decoration: none; }
footer .foot-links a:hover { color: var(--primary); }

/* ==========================================================================
   CV PAGE
   ========================================================================== */
.cv-hero { padding: 56px 0 30px; }
.cv-hero .section-head { margin-bottom: 0; max-width: none; }
.cv-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.cv-viewer {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-top: 34px;
}
.cv-viewer .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.cv-viewer .bar .dots { display: flex; gap: 6px; }
.cv-viewer .bar .dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.cv-embed { width: 100%; height: 78vh; min-height: 520px; border: none; display: block; background: #fff; }
.cv-fallback {
  padding: 60px 30px;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  display: none;
}
.cv-fallback.show { display: block; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .convergence { grid-template-columns: 1fr; }
  .conv-arrow { transform: rotate(90deg); padding: 4px 0; }
  .learning-card { grid-template-columns: 1fr; text-align: left; }
}
@media (max-width: 680px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    gap: 2px;
    margin-top: 8px;
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { padding: 13px 14px; font-size: 15px; border-radius: 8px; color: var(--ink); }
  .nav-links a:not(:last-child) { border-bottom: 1px solid var(--border); border-radius: 8px; }
  .nav-links a.current { background: rgba(27,94,79,0.07); }
  .nav-links .btn-cv { margin-top: 4px; text-align: center; justify-content: center; border-bottom: none !important; }
  .nav-toggle {
    display: inline-flex;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 16px; height: 1.5px; background: var(--ink); position: relative;
  }
  .nav-toggle span::before { position: absolute; top: -5px; }
  .nav-toggle span::after { position: absolute; top: 5px; }
}
