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

:root {
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --section-gap: 3.5rem;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 15px;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand { font-weight: 600; font-size: 1rem; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--accent); }

/* ── LAYOUT ── */
main { max-width: 860px; margin: 0 auto; padding: 0 2rem 5rem; }

/* ── HERO ── */
.hero {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero p {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.hero-meta a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: border-color .15s, color .15s;
}
.hero-meta a:hover { border-color: var(--accent); color: var(--accent); }
.hero-meta a svg { flex-shrink: 0; }

/* ── STATS BAR ── */
.stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 2.5rem 0 0;
}
.stat {
  flex: 1;
  padding: 1.25rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: .25rem;
}
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }

/* ── SECTIONS ── */
section { padding-top: var(--section-gap); }
.section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── EXPERIENCE (grouped eras + timeline per era) ── */
.exp-era-stack {
  min-width: 0;
  width: 100%;
}

.exp-timeline {
  position: relative;
  padding: 0;
}

.exp-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: var(--border);
  border-radius: 999px;
}

.exp-item {
  position: relative;
  margin-left: 1.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: border-color .15s, box-shadow .15s;
  background: var(--bg);
}

.exp-item:last-child {
  margin-bottom: 0;
}

.exp-item::before {
  content: '';
  position: absolute;
  left: calc(8px - 6px - 1.75rem);
  top: 1.15rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}

.exp-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(37,99,235,.07);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}

.exp-company { font-weight: 700; font-size: .95rem; }
.exp-period {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.exp-role { color: var(--accent); font-size: .82rem; font-weight: 600; }
.exp-bullets { padding-left: 1.1rem; margin: .1rem 0 .2rem; }
.exp-bullets li { color: var(--text-muted); font-size: .82rem; line-height: 1.5; margin-bottom: .25rem; }
.exp-bullets li::marker { color: var(--accent); }
.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.exp-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  padding: .2rem .5rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 5px;
}

/* ── SKILLS ── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.skill-group h4 { font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .75rem;
  font-weight: 500;
  padding: .25rem .65rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
}

/* ── PATENTS + EXPERIENCE (shared intro & era/year rails) ── */
.patents-intro,
.experience-intro {
  margin-bottom: 2rem;
}

.patents-intro .section-title,
.experience-intro .section-title {
  margin-bottom: 1rem;
}

.patents-lede,
.experience-lede {
  max-width: 52ch;
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.patents-lede strong,
.experience-lede strong {
  color: var(--text);
  font-weight: 600;
}

.patents-kpis,
.experience-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-light) 0%, rgba(255,255,255,0.6) 48%, var(--bg) 100%);
}

.patents-kpi,
.experience-kpi {
  display: grid;
  gap: .15rem;
  min-width: 0;
}

.patents-kpi-label,
.experience-kpi-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.patents-kpi-value,
.experience-kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.experience-by-era {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.exp-era {
  display: grid;
  grid-template-columns: minmax(6.25rem, 8.25rem) 1fr;
  gap: 1.25rem 1.5rem;
  align-items: start;
}

.exp-era-rail {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding-top: .15rem;
  border-left: 3px solid var(--accent);
  padding-left: .85rem;
  margin-left: 2px;
}

.exp-era-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.2;
}

/* ── PATENTS (flat grid + catalog index) ── */

.patents-grid {
  counter-reset: patents;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.patent-item {
  counter-increment: patents;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1rem 2.35rem 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  min-height: 100%;
  background: var(--bg);
  overflow: hidden;
}

.patent-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(37,99,235,0.35) 100%);
  opacity: 0;
  transition: opacity .15s;
}

.patent-item::after {
  content: counter(patents, decimal-leading-zero);
  position: absolute;
  top: .65rem;
  right: .75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-muted);
  opacity: .45;
}

.patent-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(37,99,235,.07);
  background: linear-gradient(165deg, rgba(239,246,255,0.65) 0%, var(--bg) 42%);
}

.patent-item:hover::before {
  opacity: 1;
}

.patent-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: .22rem .5rem;
  border-radius: 5px;
  align-self: flex-start;
  white-space: nowrap;
  letter-spacing: .02em;
}

.patent-body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
  min-height: 0;
}

.patent-title {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  flex: 1;
  margin: 0;
}

.patent-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin-top: auto;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}

.patent-date { font-size: .72rem; color: var(--text-muted); }

.patent-link {
  font-size: .72rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  opacity: .85;
}

.patent-link:hover { opacity: 1; text-decoration: underline; }

/* ── EDUCATION ── */
.edu-list { display: flex; flex-direction: column; gap: 1.25rem; }
.edu-item { display: flex; align-items: flex-start; gap: 1rem; }
.edu-icon {
  width: 40px; height: 40px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1.1rem;
}
.edu-school { font-weight: 600; font-size: .95rem; }
.edu-degree { font-size: .85rem; color: var(--text-muted); }

/* ── FOOTER ── */
footer {
  margin-top: 4rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
}
footer a { color: inherit; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .stats { flex-direction: column; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
  .exp-header { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .exp-period { white-space: normal; text-align: left; }
  .nav-links { gap: 1rem; }
  .exp-era {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .exp-era-rail {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-left: none;
    border-bottom: 3px solid var(--accent);
    padding-left: 0;
    padding-bottom: .65rem;
    width: 100%;
  }
}
