/* ── Color tokens ──────────────────────────────────────
   bg:          #f6f4f0  warm off-white (page)
   surface:     #ffffff  (cards, table hover)
   text:        #1c1c1e  near-black
   muted:       #6b6b6b  subtitles, org names, meta
   faint:       #9a9a9a  labels, years, tags
   accent:      #0000ee  one blue — links, stat nums
   border:      #e2dedd  warm light gray, all dividers
   border-hvy:  #1c1c1e  header bottom line only
   ──────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #333;
  background: #fff;
}

a {
  color: #0000ee;
  text-decoration: underline;
  transition: color 0.15s;
}

a:hover {
  color: #0000ee;
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Layout ── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px clamp(28px, 4vw, 72px) 90px;
}

/* Mid-range monitors (~1080p / 1366) — scale content down a touch */
@media (max-width: 1440px) {
  .page-wrap {
    max-width: 1080px;
    padding: 36px clamp(24px, 3.5vw, 56px) 80px;
  }
}

@media (max-width: 1200px) {
  .page-wrap {
    max-width: 960px;
  }
}

/* ── Header ── */
.site-header {
  display: flex;
  gap: 36px;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 2px solid #1c1c1e;
  margin-bottom: 20px;
}

.site-header img {
  width: 185px;
  height: 185px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #e2dedd;
  transition: transform 0.2s;
}

.site-header img:hover {
  transform: scale(1.04);
}

.header-text {
  padding-top: 4px;
  min-width: 0;
}

.header-text h1 {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.2;
  color: #1c1c1e;
}

.header-text .subtitle {
  font-size: 16px;
  color: #6b6b6b;
  margin-bottom: 0;
  font-style: italic;
  line-height: 1.5;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 12px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1c1c1e;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.social-icons a:hover {
  background: #333;
  transform: scale(1.1);
  text-decoration: none;
}

.social-icons a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-icons .icon-text {
  font-size: 10.5px;
  font-weight: 800;
  font-family: "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.3px;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  font-size: 12.5px;
  color: #6b6b6b;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* ── Nav ── */
nav {
  padding: 10px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid #ddd;
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  z-index: 100;
}

nav a {
  margin-right: 20px;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}

nav a:hover {
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

nav a.active {
  color: #000;
  border-bottom: 1px solid #000;
}

/* ── Sections ── */
section {
  margin-bottom: 46px;
}

section h2 {
  font-size: 36px;
  font-weight: normal;
  color: #333;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 20px;
  margin-top: 0;
  letter-spacing: normal;
  text-transform: none;
}

section p {
  margin-bottom: 10px;
}

.sub-label {
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  color: #555;
  margin-top: 22px;
  margin-bottom: 5px;
}

/* ── Stat bar ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background: #fafafa;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.stat-item {
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid #e2dedd;
}

.stat-item:last-child {
  border-right: none;
}

.stat-item .stat-num {
  font-size: 20px;
  font-weight: 700;
  display: block;
  color: #333;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-item .stat-label {
  font-size: 9.5px;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.35;
}

/* ── Publications ── */
.pub-list {
  list-style: none;
}

.pub-list li {
  margin-bottom: 12px;
  padding: 2px 0 2px 10px;
  border-left: 4px solid #333;
  font-size: 14px;
}

.pub-list li:last-child {
  margin-bottom: 0;
}

.pub-title {
  font-weight: bold;
  line-height: 1.45;
  color: #1c1c1e;
}

.pub-meta {
  font-size: 13px;
  color: #6b6b6b;
  margin-top: 3px;
}

.pub-desc {
  font-size: 13px;
  color: #4a4a4a;
  margin-top: 5px;
  line-height: 1.6;
}

.pub-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
}

.pub-venue {
  font-size: 13px;
  color: #090;
  font-weight: normal;
  display: inline;
}

.pub-authors {
  font-size: 13px;
  color: #6b6b6b;
  font-style: italic;
  margin-top: 3px;
  margin-bottom: 4px;
}

a.pub-title {
  color: #0000ee;
  text-decoration: underline;
}

.badge {
  display: inline-block;
  font-size: 10px;
  background: #fdf0d5;
  color: #8a5c00;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 7px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  vertical-align: middle;
  position: relative;
  top: -1px;
  letter-spacing: 0.02em;
}

.badge.new {
  background: #e4f4ec;
  color: #1a6040;
}

/* ── Experience ── */
.exp-timeline {
  position: relative;
}

.exp-timeline::before {
  content: '';
  position: absolute;
  left: 88px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: #cfcfcf;
  z-index: 0;
}

.exp-item {
  display: grid;
  grid-template-columns: 80px 18px 1fr;
  column-gap: 0;
  margin-bottom: 0;
  align-items: start;
}

.exp-left {
  text-align: right;
  padding-top: 14px;
  padding-right: 5px;
}

.exp-period {
  font-size: 14px;
  color: #bbb;
  line-height: 1.45;
  display: block;
}

.exp-ico {
  position: relative;
  padding-left: 14px;
  padding-bottom: 20px;
  z-index: 1;
}

.entry-dot {
  position: absolute;
  top: 15px;
  left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfcfcf;
  border: 2px solid #fff;
  z-index: 2;
}

.exp-badge {
  display: none;
}

.exp-right {
  padding-left: 16px;
  padding-bottom: 24px;
}

.exp-role {
  font-weight: 600;
  font-size: 15px;
  color: #222;
  padding-top: 2px;
  line-height: 1.3;
}

.exp-org {
  font-size: 13px;
  color: #777;
  margin: 4px 0 9px;
}

.exp-right ul {
  padding-left: 18px;
  font-size: 14px;
  color: #444;
}

.exp-right ul li {
  margin-bottom: 4px;
}

/* ── Projects ── */
.proj-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.proj-entry {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s;
}

.proj-entry:hover {
  border-color: #aaa;
}

.proj-thumb {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.proj-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 14px 12px;
  gap: 6px;
}

.proj-text > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proj-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #0000ee;
  text-decoration: underline;
  line-height: 1.4;
}

.proj-name:hover {
  color: #1d4a80;
  text-decoration: underline;
}

.proj-name-plain {
  font-weight: 600;
  font-size: 13.5px;
  color: #1c1c1e;
  line-height: 1.4;
}

.proj-tags-inline {
  font-size: 11.5px;
  color: #999;
  margin-left: 0;
  display: block;
}

.proj-text p {
  font-size: 12.5px;
  color: #3a3a3a;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.proj-links-row {
  font-size: 12px;
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 6px;
}

@media (max-width: 768px) {
  .proj-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .proj-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
}

.skill-group h3 {
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  color: #555;
  margin-bottom: 8px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.skill-tag {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
  color: #444;
  background: #fafafa;
  line-height: 1.7;
}

/* ── Certs ── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.cert-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.cert-card:hover {
  border-color: #aaa;
  text-decoration: none;
}

.cert-thumb {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.cert-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cert-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1c1c1e;
  line-height: 1.4;
}

.cert-meta {
  font-size: 11.5px;
  color: #777;
}


@media (max-width: 768px) {
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ── Awards ── */
.award-item {
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 3px solid #b8d0e8;
}

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

.award-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: #1c1c1e;
}

.award-meta {
  font-size: 12px;
  color: #9a9a9a;
  margin-bottom: 4px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.award-item p {
  font-size: 13px;
  color: #4a4a4a;
  margin: 0;
}

/* ── Footer ── */
footer {
  margin-top: 60px;
  padding-top: 18px;
  border-top: 1px solid #e2dedd;
  font-size: 12px;
  color: #b8b4ae;
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .page-wrap {
    padding: 28px clamp(14px, 4vw, 24px) 70px;
  }

  section h2 {
    font-size: 28px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2) {
    border-right: none;
  }

  .stat-item:nth-child(3),
  .stat-item:nth-child(4) {
    border-top: 1px solid #e2dedd;
  }

  .exp-item {
    grid-template-columns: 60px 16px 1fr;
  }

  .exp-timeline::before {
    left: 67px;
  }

  .exp-period {
    font-size: 12px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* cert-table removed */

  nav {
    font-size: 11px;
    gap: 2px 0;
    padding: 8px 0;
  }

  nav a {
    margin-right: 12px;
  }
}

/* ── Scroll-to-top ── */
#top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
  pointer-events: none;
  z-index: 200;
}

#top-btn.visible {
  opacity: 0.82;
  transform: translateY(0);
  pointer-events: auto;
}

#top-btn:hover {
  opacity: 1;
  background: #000;
}

/* ── Print ── */
@media print {
  nav, #top-btn { display: none; }
  .page-wrap { max-width: 100%; padding: 16px; }
  section { break-inside: avoid; margin-bottom: 28px; }
  a { color: #1c1c1e; text-decoration: none; }
  .proj-entry { break-inside: avoid; }
  body { font-size: 11pt; line-height: 1.5; background: #fff; }
  .stats-row { background: #f6f4f0; }
}

@media (max-width: 480px) {
  .page-wrap {
    padding: 20px clamp(12px, 4vw, 20px) 60px;
  }

  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .social-icons {
    justify-content: center;
  }

  .header-meta {
    justify-content: center;
  }

  .site-header img {
    width: 120px;
    height: 120px;
  }

  .header-text h1 {
    font-size: 24px;
  }

  .header-text .subtitle {
    font-size: 14px;
  }

  section h2 {
    font-size: 24px;
  }

  .exp-timeline::before {
    display: none;
  }

  .exp-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .exp-left {
    display: none;
  }

  .exp-ico {
    display: none;
  }

  .exp-right {
    padding-left: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
  }

  .exp-item:last-child .exp-right {
    border-bottom: none;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .pub-list li {
    padding-left: 8px;
  }

  .pub-title-row {
    flex-direction: column;
    gap: 4px;
  }

  #top-btn {
    bottom: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
}
