/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f9f8f6;
  --surface:   #ffffff;
  --surface2:  #f4f3f1;

  --accent:    #6b4226;
  --accent2:   #8c5a36;

  --text:      #111110;
  --muted:     #6b6560;
  --faint:     #b5b0aa;

  --border:    #e8e5e0;
  --radius:    10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', sans-serif;
  --font-head: 'Syne', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 2px; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

/* ── Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Character reveal (hero title) ── */
@keyframes charReveal {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-title .line { overflow: hidden; }

/* ── Cursor follower ── */
.cursor-dot {
  position: fixed;
  top: -5px; left: -5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  pointer-events: none;
  z-index: 9999;
  transition: width 0.3s cubic-bezier(0.16,1,0.3,1),
              height 0.3s cubic-bezier(0.16,1,0.3,1),
              opacity 0.3s ease,
              background 0.3s ease;
  mix-blend-mode: darken;
}
.cursor-dot--active {
  width: 36px; height: 36px;
  top: -18px; left: -18px;
  opacity: 0.12;
  background: var(--text);
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 101;
  transition: none;
}

/* ── Timeline card slide-in ── */
@keyframes slideInCard {
  from {
    opacity: 0.4;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.timeline-card {
  opacity: 0.4;
}

/* ════════════════════
   NAV
════════════════════ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(249,248,246,0.96);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1040px; margin: 0 auto;
  padding: 0 32px; height: 60px;
  display: flex; align-items: center; gap: 24px;
}
.nav-logo {
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em; flex-shrink: 0;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.6; }
.nav-links { display: flex; list-style: none; gap: 0; flex: 1; }
.nav-links a {
  padding: 6px 12px; color: var(--muted);
  text-decoration: none; font-size: 0.84rem; font-weight: 450;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.btn-contact {
  margin-left: auto; padding: 7px 18px; border-radius: 8px;
  background: var(--text); color: #fff; font-size: 0.82rem; font-weight: 600;
  text-decoration: none; flex-shrink: 0; transition: opacity 0.2s;
}
.btn-contact:hover { opacity: 0.75; }
.hamburger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 20px; height: 1.5px; background: var(--text); border-radius: 2px; }

/* ════════════════════
   HERO
════════════════════ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(249, 248, 246, 0.25), rgba(249, 248, 246, 0.6)), url('photo_me_in_laboratory.png') center/cover no-repeat;
}
#hero-canvas { display: none; }

.hero-content {
  position: relative; z-index: 1;
  text-align: center; max-width: 720px;
  padding: 140px 32px 100px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 100px;
  border: 1px solid var(--border); color: var(--muted); font-size: 0.75rem;
  font-weight: 500; letter-spacing: 0.04em;
  margin-bottom: 32px; background: var(--surface);
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.hero-title {
  font-family: var(--font-head); font-size: clamp(3.2rem, 9vw, 6.5rem);
  font-weight: 800; line-height: 1.0; letter-spacing: -0.03em;
  display: flex; flex-direction: column; align-items: center; margin-bottom: 24px;
  color: var(--text);
}
.hero-title .accent {
  color: var(--accent);
}
.hero-subtitle {
  font-size: clamp(0.92rem, 2vw, 1.05rem); color: var(--muted);
  margin-bottom: 40px; line-height: 1.7; font-weight: 400;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }

.btn-primary {
  padding: 11px 26px; border-radius: 8px;
  background: var(--text);
  color: #fff; font-weight: 600; font-size: 0.88rem; text-decoration: none;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  will-change: transform;
}
.btn-primary:hover { opacity: 0.85; box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.btn-outline {
  padding: 11px 22px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--muted); font-weight: 500; font-size: 0.88rem; text-decoration: none;
  display: flex; align-items: center; gap: 7px; background: var(--surface);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  will-change: transform;
}
.btn-outline:hover { border-color: var(--text); color: var(--text); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

.hero-meta { display: flex; gap: 24px; justify-content: center; color: var(--faint); font-size: 0.8rem; }
.hero-meta span { display: flex; align-items: center; gap: 5px; }

.hero-scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--faint); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; z-index: 1;
}
.scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, var(--faint), transparent);
  animation: scrollAnim 2.2s ease-in-out infinite;
}
@keyframes scrollAnim {
  0%,100% { opacity: 1; transform: scaleY(1); }
  50%      { opacity: 0.3; transform: scaleY(0.4); }
}

/* ════════════════════
   SECTIONS SHARED
════════════════════ */
section { padding: 96px 0; }
section:nth-child(even) { background: var(--surface2); }

.section-header { margin-bottom: 48px; }
.section-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.section-header h2 {
  font-family: var(--font-head); font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.02em; color: var(--text);
}
.section-header h2::after { display: none; }

/* ════════════════════
   ABOUT
════════════════════ */
.about-grid { max-width: 640px; }
.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 1rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.stat-card {
  background: var(--surface);
  padding: 28px 20px; text-align: center;
  transition: background 0.2s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.stat-card:hover { background: var(--surface2); }
.stat-number {
  display: block; font-family: var(--font-head); font-size: 2.6rem;
  font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px;
  transition: color 0.3s ease;
}
.stat-card:hover .stat-number { color: var(--accent); }
.stat-label { font-size: 0.76rem; color: var(--muted); line-height: 1.5; }

/* ════════════════════
   TIMELINE
════════════════════ */
.timeline { position: relative; padding-left: 0; display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.timeline::before { display: none; }
.timeline-item { position: relative; margin-bottom: 0; }
.timeline-dot { display: none; }

.timeline-card {
  background: var(--surface); border: none; border-radius: 0;
  padding: 28px 32px; transition: background 0.2s;
  box-shadow: none;
}
.timeline-card:hover {
  background: var(--surface2); transform: none;
  box-shadow: none; border-color: transparent;
}
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }

.card-logo {
  flex-shrink: 0;
  width: 96px;
  height: 60px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  overflow: hidden;
}
.card-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.card-meta-inline {
  margin-top: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.card-meta-inline .card-date { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.card-meta-inline .card-location { font-size: 0.76rem; color: var(--faint); }
.card-header h3 { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.card-company { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin-top: 3px; }
.card-meta { text-align: right; }
.card-date { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.card-location { display: block; font-size: 0.76rem; color: var(--faint); margin-top: 2px; }

.card-list { list-style: none; margin-bottom: 16px; }
.card-list li {
  position: relative; padding-left: 14px; color: var(--muted);
  font-size: 0.88rem; margin-bottom: 6px;
}
.card-list li::before { content: '—'; position: absolute; left: 0; color: var(--faint); font-size: 0.72rem; top: 5px; }

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  padding: 2px 10px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.71rem; font-weight: 500;
}

/* ════════════════════
   SKILLS
════════════════════ */
.skills-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 48px;
}
.skill-group {
  background: var(--surface);
  padding: 28px 24px;
  transition: background 0.2s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.skill-group:hover { background: var(--surface2); }
.skill-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); margin-bottom: 16px;
  transition: background 0.3s ease, color 0.3s ease;
}
.skill-group:hover .skill-icon { background: var(--accent); color: #fff; }
.skill-group h3 { font-family: var(--font-head); font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.skill-group ul { list-style: none; }
.skill-group li { color: var(--muted); font-size: 0.83rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.skill-group li:last-child { border-bottom: none; }

/* Languages */
.lang-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.languages {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 48px;
}
.lang-item {
  display: grid; grid-template-columns: 28px 1fr auto; grid-template-rows: auto auto;
  column-gap: 10px; align-items: center;
  background: var(--surface); padding: 16px 18px;
}
.lang-flag { font-size: 1.2rem; grid-row: 1 / 3; align-self: center; }
.lang-name { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.lang-level { font-size: 0.72rem; color: var(--muted); font-weight: 500; justify-self: end; }
.lang-bar { grid-column: 2 / 4; height: 2px; background: var(--border); border-radius: 1px; margin-top: 8px; overflow: hidden; }
.lang-fill {
  height: 100%; width: 0; background: var(--accent);
  border-radius: 1px; transition: width 1.2s cubic-bezier(0.16,1,0.3,1);
}
.lang-item.animated .lang-fill { width: var(--w); }

/* Certs */
.certs {
  display: flex; gap: 1px; flex-wrap: wrap;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.cert-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  padding: 16px 20px; flex: 1; min-width: 200px;
  transition: background 0.2s;
}
.cert-card:hover { background: var(--surface2); transform: none; border-color: transparent; }
.cert-icon { font-size: 1.2rem; }
.cert-name { font-weight: 600; font-size: 0.88rem; color: var(--text); margin-bottom: 2px; }
.cert-issuer { font-size: 0.73rem; color: var(--muted); }

/* ════════════════════
   EDUCATION
════════════════════ */
.edu-grid {
  display: flex; flex-direction: column;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.edu-card {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--surface);
  padding: 24px 28px; transition: background 0.2s;
}
.edu-card:hover { background: var(--surface2); transform: none; }
.edu-year {
  font-family: var(--font-head); font-size: 0.72rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.03em; min-width: 88px;
  white-space: nowrap; align-self: flex-start;
  padding-top: 3px;
}
.edu-card h3 { font-size: 0.97rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.edu-institution { color: var(--muted); font-size: 0.84rem; }
.edu-note { margin-top: 6px; font-size: 0.78rem; color: var(--accent); }

/* Logo in education card */
.edu-logo {
  margin-left: auto;
  flex-shrink: 0;
  width: 100px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  overflow: hidden;
}
.edu-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ════════════════════
   ENGAGEMENT
════════════════════ */
.engage-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.engage-card {
  background: var(--surface);
  overflow: hidden; display: flex;
  transition: background 0.2s;
}
.engage-card:hover { background: var(--surface2); transform: none; box-shadow: none; border-color: transparent; }
.engage-accent { display: none; }
.engage-body { padding: 28px; flex: 1; }
.engage-date { display: inline-block; font-size: 0.70rem; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; margin-bottom: 8px; text-transform: uppercase; }
.engage-body h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.engage-org { color: var(--accent); font-size: 0.82rem; font-weight: 600; margin-bottom: 10px; }
.engage-body p { color: var(--muted); font-size: 0.86rem; }

/* Logo in engagement card */
.engage-logo {
  flex-shrink: 0;
  width: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-left: 1px solid var(--border);
  padding: 10px 12px;
  overflow: hidden;
}
.engage-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ════════════════════
   FOOTER
════════════════════ */
#footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 72px 0 36px;
}
.footer-inner { max-width: 640px; margin: 0 auto; text-align: center; padding: 0 32px; }
.footer-cta h2 { font-family: var(--font-head); font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; margin-bottom: 12px; color: #fff; }
.footer-cta p { color: rgba(255,255,255,0.55); margin-bottom: 32px; font-size: 0.9rem; }
#footer .btn-primary { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
#footer .btn-primary:hover { background: rgba(255,255,255,0.22); opacity: 1; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 36px 0 16px; font-size: 0.82rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.sep { color: rgba(255,255,255,0.2); }
.footer-copy { font-size: 0.72rem; color: rgba(255,255,255,0.25); }

/* ════════════════════
   RESPONSIVE
════════════════════ */
@media (max-width: 860px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .btn-contact { display: none; }
  .hamburger { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .engage-grid { grid-template-columns: 1fr; }
  .timeline { padding-left: 0; }
  .edu-card { flex-direction: column; gap: 6px; }
  .edu-year { min-width: unset; }
  section { padding: 64px 0; }
}
@media (max-width: 540px) {
  .skills-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 2.8rem; }
  .hero-badge { display: inline-flex; }
}
