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

:root {
  --bg:        #ffffff;
  --bg-alt:    #f7f7f5;
  --text:      #1c1c1e;
  --text-mid:  #555555;
  --text-dim:  #999999;
  --accent:    #2563eb;
  --accent-bg: #eff4ff;
  --border:    #e8e8e4;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --side:      clamp(24px, 6vw, 80px);
  --nav-h:     60px;
  --radius:    10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Nav ─────────────────────────────────────── */

#nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  //max-width: 1200px;
  max-width: calc(1280px + 2 * var(--side));
  margin: 0 auto;
  padding: 0 var(--side);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* ─── Hero ────────────────────────────────────── */

#hero {
  padding: calc(var(--nav-h) + 64px) var(--side) 72px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  //align-items: center;
  gap: 40px;
}

.hero-avatar {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg-alt);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero-text h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-title {
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 400;
  color: var(--text-mid);
  margin-bottom: 14px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.hero-meta span::before {
  content: '·';
  margin-right: 20px;
  opacity: 0;
}

.hero-meta span:first-child::before { display: none; }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

/* ─── Section base ────────────────────────────── */

.section {
  padding: clamp(56px, 8vw, 96px) var(--side);
  background: var(--bg);
}

.section--alt {
  background: var(--bg-alt);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 36px;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1.5px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
}

.js .section-title::after {
  transform: scaleX(0);
  transition: transform 0s;
}

.js .section-title.visible::after {
  transform: scaleX(1);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

/* ─── About ───────────────────────────────────── */

.about-lead {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 680px;
  margin-bottom: 24px;
}

.about-caps {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  line-height: 2;
}

/* ─── Timeline ────────────────────────────────── */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: var(--border);
}

.company {
  position: relative;
  padding-left: 56px;
  padding-bottom: 40px;
}

.company::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 24px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.company-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.company-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.company-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.company-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.roles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.role {
  padding: 16px 20px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
  margin-bottom: 8px;
  transition: border-color 0.25s;
}

.role:hover { border-left-color: var(--accent); }

.role-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.role-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.role-header .role-title { margin-bottom: 0; }

.role-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.role-date {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.role-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-mid);
}

/* ─── Education stack ─────────────────────────── */

.edu-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── Cards ───────────────────────────────────── */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.section--alt .card { background: var(--bg); }

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 16px rgba(37,99,235,0.07);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-icon--white,
.company-logo--white {
  background: #ffffff;
  border: 1px solid var(--border);
}

.company-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.card-sub {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}

.card-id {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: monospace;
}

/* ─── Skills ──────────────────────────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 32px;
}

.skill-group h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

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

.skill-tags span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mid);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: default;
}

.skill-tags span:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: transparent;
}

/* ─── Awards ──────────────────────────────────── */

.award-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
}

.award {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s;
}

.award:hover { border-color: var(--accent); }

.award-icon {
  font-size: 18px;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

.award-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.award-issuer {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.award-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-mid);
}

/* ─── Footer ──────────────────────────────────── */

footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: 40px var(--side);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.footer-title {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: #ffffff; }

.footer-copy {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}

/* ─── Fade-in (progressive enhancement) ──────── */

.js .fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 860px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(14px);
    padding: 20px var(--side) 28px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }

  .hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-avatar { width: 72px; height: 72px; font-size: 22px; }

  .timeline::before { left: 14px; }
  .company { padding-left: 40px; }
  .company::before { left: 9px; }

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

  .footer-inner { flex-direction: column; align-items: flex-start; }
}
