:root {
  --bg: #fbfbfa;
  --text: #111111;
  --muted: #555555;
  --card: #ffffff;
  --border: #e2e2df;
  --soft: #f4f4f2;
  --icon-bg: #f1f3f5;
  --gold: #fff7df;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.045);
}

.dark {
  --bg: #101010;
  --text: #f5f5f5;
  --muted: #b9b9b9;
  --card: #171717;
  --border: #303030;
  --soft: #202020;
  --icon-bg: #242424;
  --gold: #211b10;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

svg {
  display: block;
}

.icon-svg,
.btn-icon,
.card-icon,
.small-icon,
.contact-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 74px;
  padding: 0 clamp(20px, 5vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.04em;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 34px);
  justify-self: center;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.nav a {
  text-decoration: none;
  font-size: 15px;
}

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

.theme-btn,
.menu-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-btn:hover,
.menu-btn:hover {
  background: var(--soft);
}

.theme-btn svg,
.menu-btn svg {
  width: 24px;
  height: 24px;
}

.menu-btn {
  display: none;
}

.hero,
.section,
.footer {
  width: min(100% - 40px, 1040px);
  margin-inline: auto;
}

.hero {
  padding: clamp(44px, 7vw, 72px) 0 clamp(36px, 5vw, 58px);
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 56px);
}

.hero-image {
  display: flex;
  justify-content: flex-start;
}

.hero-content {
  justify-self: start;
}

.hero-image img {
  width: min(100%, 330px);
  height: auto;
  object-fit: contain;
}

.dark .hero-image img {
  filter: drop-shadow(0 18px 30px rgba(255,255,255,0.03));
}

.hero-intro {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 25px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.hero-role {
  margin-bottom: 22px;
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 650;
}

.hero-role span {
  margin: 0 8px;
}

.hero-text,
.section p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-text {
  max-width: 560px;
}

.resume-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  text-decoration: none;
  font-weight: 650;
  box-shadow: var(--shadow);
}

.resume-btn:hover {
  transform: translateY(-1px);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.section {
  padding: 28px 0;
}

.about {
  padding-bottom: 38px;
  border-bottom: 1px solid var(--border);
}

.about-content {
  width: min(100%, 720px);
  margin-inline: auto;
}

.about-content h2 {
  text-align: center;
}

.about-content p {
  text-align: justify;
  line-height: 1.75;
}

.section h2 {
  margin-bottom: 18px;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.04em;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
}

.skill-card,
.project-card,
.education-card,
.achievement-card,
.contact-grid a {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.skill-card {
  min-height: 190px;
  padding: 24px 22px;
}

.card-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 24px;
}

.skill-card h3,
.project-card h3,
.education-card h3,
.achievement-card h3 {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.35;
}

.skill-card p,
.project-card p,
.education-card p,
.achievement-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.project-card {
  padding: 20px;
  min-height: 290px;
}

.project-top {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.project-title {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.project-title h3 {
  margin-top: 5px;
}

.project-icon,
.edu-icon,
.trophy {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--icon-bg);
}

.small-icon {
  width: 25px;
  height: 25px;
}

.tech {
  margin-bottom: 14px !important;
  color: var(--text) !important;
  font-size: 14px !important;
}

.year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 14px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  position: relative;
}

.dot {
  width: 12px;
  height: 12px;
  justify-self: center;
  z-index: 2;
  border-radius: 999px;
  background: var(--text);
}

.education-card {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.achievement-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: linear-gradient(90deg, var(--gold), var(--card));
  border-color: #efd78a;
}

.dark .achievement-card {
  border-color: #4c4021;
}

.trophy {
  font-size: 24px;
  background: #fff0b8;
}

.dark .trophy {
  background: #3a2f12;
}

.contact-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, auto));
  gap: 14px;
  align-items: center;
}

.contact-grid a {
  min-height: 44px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.contact-grid a:hover {
  transform: translateY(-1px);
}

.contact-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.footer {
  padding: 24px 0 42px;
  text-align: center;
  color: var(--muted);
}

.footer p {
  margin-bottom: 0;
}

@media (max-width: 1080px) {
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid a {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-buttons {
    justify-self: end;
  }

  .nav {
    position: absolute;
    top: 74px;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 14px;
    border-radius: 10px;
  }

  .nav a:hover {
    background: var(--soft);
  }

  .menu-btn {
    display: grid;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text {
    margin-inline: auto;
  }

  .hero-image img {
    width: min(280px, 78vw);
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .education-card,
  .achievement-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .education-card .year,
  .achievement-card .year {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .hero,
  .section,
  .footer {
    width: min(100% - 32px, 1040px);
  }

  .brand {
    font-size: 21px;
  }

  h1 {
    font-size: clamp(44px, 14vw, 62px);
  }

  .hero-role span {
    display: none;
  }

  .hero-role {
    display: grid;
    gap: 4px;
  }

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

  .project-card {
    min-height: auto;
  }

  .project-top {
    flex-direction: column;
  }

  .year {
    align-self: flex-start;
  }

  .education-card,
  .achievement-card {
    grid-template-columns: 1fr;
  }

  .education-card .year,
  .achievement-card .year {
    grid-column: auto;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before,
  .dot {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}
