/* === VARIABLES === */
:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #6c63ff;
  --accent-light: rgba(108, 99, 255, 0.08);
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 24px rgba(0,0,0,0.10);
  --radius: 16px;
  --radius-sm: 10px;
}

body.dark {
  --bg: #000000;
  --bg-card: #111111;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --accent: #ffffff;
  --accent-light: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 24px rgba(0,0,0,0.4);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s, color 0.4s;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
ul { list-style: none; }

/* === CARD === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s, transform 0.3s;
}
.card:hover { box-shadow: var(--shadow-hover); }

/* === HEADER === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
body:not(.dark) header { background: rgba(245,245,247,0.72); }
body.dark header { background: rgba(0,0,0,0.72); }

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 16px;
}

.identity h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

nav ul { display: flex; gap: 4px; }
nav ul li a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.25s;
}
nav ul li a:hover {
  color: var(--text);
  background: var(--accent-light);
  opacity: 1;
}

/* === TOGGLE === */
.theme-toggle {
  width: 48px; height: 26px;
  border-radius: 26px;
  background: linear-gradient(135deg, #6c63ff, #4834d4);
  position: relative; cursor: pointer;
  transition: background 0.4s;
  flex-shrink: 0;
}
.theme-toggle.active { background: linear-gradient(135deg, #fbc02d, #f9a825); }
.toggle-track { position: relative; width: 100%; height: 100%; }
.toggle-thumb {
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
  transition: transform 0.4s cubic-bezier(0.68,-0.15,0.27,1.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.theme-toggle.active .toggle-thumb { transform: translateX(22px); }

/* === HERO === */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 360px);
  align-items: center;
  gap: 40px;
  padding: 0;
}
.hero-text { max-width: 580px; }
.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-greeting::before {
  content: '';
  width: 36px;
  height: 1px;
  background: var(--accent);
}
.hero-name {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: 14px;
}
.hero-subtitle {
  max-width: 34ch;
  font-size: 1.08rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-weight: 500;
}
.hero-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 14px;
  margin-bottom: 32px;
}
.badge {
  position: relative;
  display: block;
  min-height: auto;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0 0 12px 18px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.badge::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 14px;
  transition: all 0.25s;
  cursor: pointer;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--text-secondary);
  opacity: 1;
  transform: translateY(-1px);
}
.hero-visual {
  display: flex;
  justify-content: flex-end;
}
.hero-photo-card {
  width: min(100%, 340px);
  padding: 0;
}
.hero-image {
  width: 100%;
  aspect-ratio: 1 / 1.08;
  border-radius: 24px;
  overflow: hidden;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.hero-image:hover img { transform: scale(1.04); }

/* === MAIN === */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* === SECTIONS === */
.section { padding-top: 64px; }
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  position: relative;
  padding-bottom: 12px;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 36px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* === ABOUT === */
.about-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 14px;
}
.about-card p:last-child { margin-bottom: 0; }
.quote {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
  margin-top: 12px;
  font-size: 1rem !important;
}

/* === TIMELINE === */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -28px; top: 36px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}
body.dark .timeline-dot { background: #fff; }
.timeline-card { padding: 24px 28px; }
.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-top h3 { font-size: 1.05rem; font-weight: 600; }
.date-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.timeline-card ul { padding-left: 18px; list-style: disc; }
.timeline-card ul li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* === EXPERIENCE === */
.experience-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* === CHIPS === */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.chip {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--text);
  border: 1px solid var(--border);
}

/* === EDUCATION === */
.education-card {
  display: flex;
  align-items: center;
  gap: 24px;
}
.edu-icon { font-size: 2.4rem; flex-shrink: 0; }
.edu-info h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.edu-school {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* === PROJECT === */
.project-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}
.project-tech {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-style: italic;
}
.project-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid var(--border);
}
.feature-icon { font-size: 1.15rem; flex-shrink: 0; }

/* === SKILLS === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.skill-card { padding: 24px; }
.skill-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }

/* === CERTIFICATIONS === */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.cert-card { text-align: center; padding: 28px 20px; }
.cert-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.cert-card h4 { font-size: 0.92rem; font-weight: 600; margin-bottom: 4px; }
.cert-card p { font-size: 0.8rem; color: var(--text-secondary); }

/* === CONTACT === */
.contact-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.social-icons { display: flex; gap: 12px; }
.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.social-icons a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  background: var(--accent-light);
  opacity: 1;
}
.social-icons a img {
  width: 22px; height: 22px;
  filter: brightness(0);
  transition: filter 0.3s;
}
body.dark .social-icons a img { filter: brightness(0) invert(1); }

/* === FOOTER === */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
footer p { margin: 0; }

/* === ANIMATIONS === */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.fade-in.appear { opacity: 1; transform: translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 12px 16px;
  }
  nav ul { justify-content: center; flex-wrap: wrap; gap: 2px; }
  nav ul li a { padding: 5px 10px; font-size: 0.7rem; }

  .hero { padding: 48px 16px 40px; }
  .hero-panel {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0;
  }
  .hero-text {
    max-width: none;
    text-align: left;
  }
  .hero-greeting { margin-bottom: 14px; }
  .hero-name { font-size: 2.4rem; }
  .hero-subtitle { max-width: none; }
  .hero-badges {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 12px;
  }
  .hero-cta { justify-content: flex-start; }
  .hero-visual { justify-content: center; }
  .hero-photo-card {
    width: min(100%, 280px);
    padding: 0;
  }
  .hero-image {
    border-radius: 20px;
  }

  main { padding: 0 16px 60px; }
  .section { padding-top: 48px; }
  .section-title { font-size: 1.35rem; }

  .card { padding: 24px 20px; }
  .timeline { padding-left: 24px; }
  .timeline-dot { left: -24px; }
  .education-card { flex-direction: column; text-align: center; gap: 12px; }
  .project-features { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .social-icons { justify-content: center; }
  #contact { text-align: center; }
  .section-title::after { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2rem; }
  .identity h1 { font-size: 1rem; }
  .hero-greeting {
    gap: 8px;
    font-size: 0.76rem;
    letter-spacing: 0.14em;
  }
  .hero-greeting::before { width: 26px; }
  .badge {
    font-size: 0.84rem;
    padding: 0 0 10px 16px;
  }
  .btn {
    width: 100%;
    padding: 10px 22px;
    font-size: 0.82rem;
  }
  .card { padding: 20px 16px; }
  .social-icons a { width: 46px; height: 46px; border-radius: 12px; }
}
