/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --border: #e6e8f0;
  --text: #14161f;
  --text-muted: #5a5f73;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-soft: #eef0fe;
  --shadow: 0 10px 30px -12px rgba(20, 22, 31, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
}

:root[data-theme="dark"] {
  --bg: #0d0f17;
  --bg-alt: #12141e;
  --surface: #171a26;
  --border: #262a3a;
  --text: #eef0f7;
  --text-muted: #9aa0b4;
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --accent-soft: #1c1f36;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f17;
    --bg-alt: #12141e;
    --surface: #171a26;
    --border: #262a3a;
    --text: #eef0f7;
    --text-muted: #9aa0b4;
    --accent: #818cf8;
    --accent-2: #22d3ee;
    --accent-soft: #1c1f36;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

ul { list-style: none; }

/* ===== Progress bar ===== */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 1000;
  transition: width 0.1s ease;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 900;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 6px 2px;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }

#themeToggle .moon { display: none; }
:root[data-theme="dark"] #themeToggle .sun { display: none; }
:root[data-theme="dark"] #themeToggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeToggle .sun { display: none; }
  :root:not([data-theme="light"]) #themeToggle .moon { display: block; }
}

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; }
.hamburger span {
  width: 18px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  position: relative;
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 50%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.typewriter {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
  min-height: 1.6em;
}
.cursor { animation: blink 1s step-end infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-3px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn.full { width: 100%; }

.hero-socials {
  display: flex;
  gap: 14px;
}
.hero-socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.hero-socials a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 420px;
}

.avatar-ring {
  width: 280px; height: 280px;
  border-radius: 50%;
  padding: 8px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
  animation: spin 8s linear infinite;
  display: flex; align-items: center; justify-content: center;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg);
  object-fit: cover;
  border: 6px solid var(--bg);
  animation: counter-spin 8s linear infinite;
}
@keyframes counter-spin { to { transform: rotate(-360deg); } }

.floating-tag {
  position: absolute;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 600;
  animation: float 5s ease-in-out infinite;
}
.tag-1 { top: 6%; left: 0%; animation-delay: 0s; }
.tag-2 { top: 18%; right: 0%; animation-delay: 1.2s; }
.tag-3 { bottom: 14%; left: 4%; animation-delay: 2.4s; }
.tag-4 { bottom: 2%; right: 10%; animation-delay: 3.6s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.scroll-down {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border);
  border-radius: 20px;
}
.scroll-down span {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin: 7px auto;
  animation: scrolldot 1.6s ease infinite;
}
@keyframes scrolldot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ===== Sections ===== */
.section { padding: 110px 0; }
.section.alt { background: var(--bg-alt); }

.section-label {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  margin-bottom: 8px;
  text-align: center;
}

.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 56px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.about-text { color: var(--text-muted); font-size: 1.05rem; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num, .stat-suffix {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 56px;
}
.skill-chip {
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.25s ease;
}
.skill-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-4px);
}

.cert-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}
.cert-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.cert-icon { font-size: 1.8rem; }
.cert-card h3 { font-size: 1rem; margin-bottom: 4px; }
.cert-card p { color: var(--text-muted); font-size: 0.88rem; }

/* Timeline */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 32px;
  border-left: 2px solid var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -41px;
  top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.timeline-content h3 { font-size: 1.15rem; margin-bottom: 10px; }
.timeline-content .company { color: var(--text-muted); font-weight: 500; }
.timeline-content p { color: var(--text-muted); font-size: 0.95rem; }
.project-note {
  margin-top: 12px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent-2);
  background: var(--bg-alt);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-list span {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
}
.contact-info p { color: var(--text-muted); margin-bottom: 28px; }
.contact-list { display: flex; flex-direction: column; gap: 18px; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
}
.contact-list svg { color: var(--accent); flex-shrink: 0; }
.contact-list a:hover { color: var(--accent); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-note { font-size: 0.85rem; color: var(--accent-2); text-align: center; min-height: 1.2em; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer p { color: var(--text-muted); font-size: 0.88rem; }
.to-top {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}
.to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-3px); }

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-socials { justify-content: center; }
  .hero-visual { height: 320px; order: -1; }
  .avatar-ring { width: 220px; height: 220px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .cert-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 18px;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .hamburger { display: flex; }
  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .form-row { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}
