/* ============ TOKENS ============ */
:root {
  --navy: #0B1E3D;
  --navy-light: #15305C;
  --teal: #14B8A6;
  --teal-deep: #0E8074;
  --coral: #FF6B5E;
  --ink: #131A24;
  --slate: #5B6878;
  --slate-light: #8A95A3;
  --line: #DFE4E9;
  --bg: #F7F8FA;
  --bg-tint: #EEF2F3;
  --white: #FFFFFF;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

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

.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

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

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247, 248, 250, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(247, 248, 250, 0.96);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.nav-logo-dot { color: var(--teal); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--slate);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--navy); }
.nav-cta {
  background: var(--navy);
  color: var(--white) !important;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13.5px !important;
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover { background: var(--teal-deep); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 28px 0;
  background: var(--bg);
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(11,30,61,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,30,61,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 65% 30%, black 0%, transparent 75%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(20,184,166,0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20,184,166,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(20,184,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
}
.hero-eyebrow .mono {
  font-size: 12.5px;
  color: var(--slate);
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.08;
  color: var(--navy);
  letter-spacing: -0.01em;
  max-width: 880px;
}
.hero-title-alt { color: var(--teal-deep); }
.accent-comma { color: var(--coral); }
.hero-sub {
  margin-top: 28px;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--slate);
  max-width: 620px;
  line-height: 1.65;
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11,30,61,0.18);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
}

.hero-trace {
  margin-top: 56px;
  width: 100%;
  max-width: 760px;
  opacity: 0.85;
}
.ecg-svg { width: 100%; height: 60px; display: block; }
.ecg-line {
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-ecg 3.4s ease-out forwards 0.3s;
}
@keyframes draw-ecg {
  to { stroke-dashoffset: 0; }
}

.hero-stats {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 64px auto 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 0;
}
.stat {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat-num {
  display: block;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--navy);
}
.stat-unit { font-size: 1.2rem; color: var(--teal-deep); }
.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--slate-light);
  line-height: 1.5;
}

/* ============ SECTIONS ============ */
.section { padding: 110px 28px; }
.section-tint { background: var(--bg-tint); }
.section-dark { background: var(--navy); }
.section-inner { max-width: var(--container); margin: 0 auto; }

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  color: var(--teal-deep);
  font-weight: 600;
  margin-bottom: 18px;
}
.section-head { margin-bottom: 56px; max-width: 700px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.section-sub {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--slate);
}
.section-head-light h2 { color: var(--white); }
.section-head-light .eyebrow { color: var(--teal); }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}
.about-content .lede {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.45;
  margin-bottom: 28px;
}
.about-content p {
  color: var(--slate);
  font-size: 1.02rem;
  margin-bottom: 20px;
  max-width: 680px;
}
.about-content em { color: var(--teal-deep); font-style: normal; font-weight: 600; }
.about-langs {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.lang-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lang-name { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.lang-level { font-size: 11px; color: var(--teal-deep); }

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--line);
}
.tl-item {
  position: relative;
  padding-bottom: 48px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute;
  left: -35px;
  top: 4px;
}
.tl-dot {
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--teal);
}
.tl-muted .tl-dot { border-color: var(--slate-light); }
.tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tl-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
}
.tl-muted .tl-content h3 { font-size: 1.05rem; color: var(--slate); }
.tl-date {
  font-size: 12px;
  color: var(--slate-light);
  white-space: nowrap;
}
.tl-org {
  margin-top: 4px;
  color: var(--slate);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.tl-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.tl-list li {
  position: relative;
  padding-left: 20px;
  color: var(--ink);
  font-size: 0.96rem;
}
.tl-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  background: var(--teal);
  border-radius: 1px;
  transform: rotate(45deg);
}
.tl-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--slate);
}

.edu-cards {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.edu-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}
.edu-tag { font-size: 11px; color: var(--teal-deep); }
.edu-card h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy);
  margin: 10px 0 8px;
}
.edu-card p { color: var(--slate); font-size: 0.92rem; }

/* ---- Project ---- */
.project-context {
  max-width: 760px;
  margin-bottom: 56px;
}
.project-context p {
  font-size: 1.08rem;
  color: var(--ink);
  line-height: 1.75;
}

.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 64px;
}
.pipeline-step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pipeline-step:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
}
.pipe-num {
  display: block;
  font-size: 12px;
  color: var(--teal-deep);
  margin-bottom: 12px;
}
.pipeline-step h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.pipeline-step p {
  font-size: 0.88rem;
  color: var(--slate);
  line-height: 1.55;
}
.pipeline-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-light);
  font-size: 1.2rem;
}

.model-bench { margin-bottom: 56px; }
.model-bench h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 24px;
}
.bench-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.bench-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.bench-table th, .bench-table td {
  padding: 16px 22px;
  text-align: left;
  font-size: 0.92rem;
}
.bench-table thead th {
  color: var(--slate-light);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.bench-table tbody tr { border-bottom: 1px solid var(--line); }
.bench-table tbody tr:last-child { border-bottom: none; }
.bench-table td:first-child { font-weight: 600; color: var(--navy); }
.bench-table td.mono { color: var(--slate); }
.bench-best { background: rgba(20,184,166,0.07); }
.bench-best td { color: var(--teal-deep) !important; font-weight: 600; }
.bench-best td:first-child::after {
  content: ' — best';
  font-weight: 400;
  font-size: 11px;
  color: var(--slate-light);
}
.bench-note {
  margin-top: 20px;
  font-size: 0.92rem;
  color: var(--slate);
  max-width: 760px;
  line-height: 1.65;
}

.project-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.pf-block h4 {
  font-size: 11.5px;
  color: var(--teal-deep);
  margin-bottom: 10px;
}
.pf-block p { color: var(--slate); font-size: 0.92rem; line-height: 1.6; }

/* ---- Skills (dark) ---- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
}
.skill-card {
  background: var(--navy-light);
  padding: 32px;
}
.skill-card h4 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 18px;
}
.skill-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.skill-pills span {
  font-size: 12.5px;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px;
  color: #C9D6E3;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.skill-pills span:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.contact-left .lede {
  margin: 18px 0 32px;
  color: var(--slate);
  font-size: 1.05rem;
  max-width: 460px;
}
.contact-left h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--navy);
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.2s ease;
}
.contact-link:hover { padding-left: 10px; }
.cl-label { font-size: 11px; color: var(--slate-light); }
.cl-value { font-weight: 600; color: var(--navy); font-size: 0.98rem; }
.contact-link:hover .cl-value { color: var(--teal-deep); }

.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
}
.form-row input, .form-row textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--teal);
}
.form-submit { justify-content: center; margin-top: 4px; }
.form-note {
  font-size: 12px;
  color: var(--slate-light);
  text-align: center;
}

/* ============ FOOTER ============ */
.footer {
  background: var(--navy);
  padding: 28px;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 11.5px;
}
.footer-sep { color: var(--teal); }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-arrow { transform: rotate(90deg); padding: 4px 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .project-footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 20px 28px 28px;
    gap: 18px;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-cta { margin-top: 4px; }
  .hero { padding-top: 120px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 20px 16px; }
  .stat-num { font-size: 1.8rem; }
  .edu-cards { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 20px; }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
