:root {
  --bg: #0f1722;
  --bg-2: #121f2d;
  --surface: rgba(16, 30, 43, 0.72);
  --text: #eff6fb;
  --muted: #a9becd;
  --line: rgba(221, 237, 249, 0.17);
  --accent: #2cd3a7;
  --accent-2: #ffb266;
  --shadow: 0 25px 55px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f8f1e2;
  --bg-2: #f2f7ee;
  --surface: rgba(255, 255, 255, 0.92);
  --text: #13202a;
  --muted: #3b4d5b;
  --line: rgba(19, 32, 42, 0.18);
  --accent: #0f7f68;
  --accent-2: #92511d;
  --shadow: 0 18px 40px rgba(25, 33, 41, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Sora", sans-serif;
  color: var(--text);
  background: linear-gradient(145deg, var(--bg), var(--bg-2));
  min-height: 100vh;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.28;
  pointer-events: none;
  z-index: -3;
}

.mesh {
  position: fixed;
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  z-index: -2;
  pointer-events: none;
}

.mesh-a {
  background: #13bc96;
  top: -12rem;
  right: -13rem;
}

.mesh-b {
  background: #f19044;
  bottom: -12rem;
  left: -14rem;
}

:root[data-theme="light"] .mesh-a {
  background: #7fc6b3;
}

:root[data-theme="light"] .mesh-b {
  background: #ddb17a;
}

.site-header {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  z-index: 10;
}

.header-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0.9rem;
}

.logo {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
}

.nav {
  display: flex;
  gap: 1.2rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .theme-toggle:hover {
  background: rgba(18, 33, 44, 0.08);
}

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3.2rem;
}

.hero {
  position: relative;
  padding: 3.4rem 0 1.8rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 5.2vw, 5rem);
  line-height: 1;
  max-width: 12ch;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--accent-2);
  margin: 0.8rem 0 0;
  font-weight: 600;
}

.lead {
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.75;
  margin-top: 0.9rem;
}

.hero-location-top {
  position: absolute;
  top: 0.4rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.44rem 0.68rem;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.hero-location-top svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: var(--accent-2);
}

.hero-location-top:hover {
  border-color: rgba(44, 211, 167, 0.6);
}

.theme-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.theme-icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.contact-line {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.contact-line a {
  color: var(--text);
  text-decoration: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.72rem 1.08rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #05231b;
  background: linear-gradient(125deg, var(--accent), #7ff0d1);
  box-shadow: 0 12px 32px rgba(44, 211, 167, 0.35);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.btn-social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-social svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

:root[data-theme="light"] .btn-ghost {
  background: rgba(19, 32, 42, 0.03);
}

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0;
  margin: 1.9rem 0 0;
}

.stats li {
  background: linear-gradient(150deg, rgba(35, 61, 83, 0.65), rgba(16, 30, 43, 0.82));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .stats li {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(243, 248, 239, 0.95));
}

.stats strong {
  font-size: 1.15rem;
  display: block;
}

.stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head {
  margin-top: 3.2rem;
}

.section-head h2,
.panel h2,
.contact h2 {
  margin-bottom: 0.38rem;
  font-size: clamp(1.4rem, 2.3vw, 2.05rem);
}

.section-head p,
.panel p,
.contact p {
  color: var(--muted);
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.card {
  background: linear-gradient(145deg, var(--surface), rgba(19, 42, 60, 0.65));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(245, 250, 242, 0.96));
}

.experience-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 280px;
}

.exp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.exp-title {
  display: grid;
  gap: 0.15rem;
}

.exp-company {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  color: var(--text);
}

.exp-role {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.exp-logo {
  max-height: 42px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.exp-logo-lg {
  max-height: 54px;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.1rem;
}

.stack-tags span {
  display: inline-flex;
  align-items: center;
  white-space: normal;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.34rem 0.56rem;
  background: rgba(0, 0, 0, 0.14);
}

:root[data-theme="light"] .stack-tags span {
  background: rgba(19, 32, 42, 0.04);
}

@media (max-width: 520px) {
  .exp-head {
    gap: 0.6rem;
  }
}

.card h3 {
  margin: 0.25rem 0 0.6rem;
  line-height: 1.35;
}

.card p {
  color: var(--muted);
  line-height: 1.62;
  margin: 0.35rem 0;
}

.card span {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
  font-size: 0.78rem;
  display: inline-block;
  margin-top: 0.55rem;
}

.experience-card > span {
  display: none;
}

.meta {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.meta-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.36rem;
}

.meta-sep {
  display: none;
}

.meta-location {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
}

.meta-location svg {
  width: 0.78rem;
  height: 0.78rem;
  fill: var(--accent-2);
}

.panel,
.contact {
  margin-top: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.7rem;
}

.edu-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
}

.edu-like-card,
.cert-like-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}

.edu-like-card .meta-bottom,
.cert-like-card .meta-bottom {
  margin-top: 0;
}

.cert-like-card {
  min-height: 260px;
}

.cert-like-card .meta-bottom {
  margin-top: auto;
}

.edu-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.45rem;
}

.edu-brand svg {
  width: 100%;
  height: 100%;
}

.edu-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.edu-logo-ring {
  fill: rgba(255, 255, 255, 0.06);
  stroke: var(--accent);
  stroke-width: 2;
}

.edu-logo-text {
  fill: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.edu-logo-line {
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
}

:root[data-theme="light"] .edu-card {
  background: rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .edu-logo-ring {
  fill: rgba(15, 127, 104, 0.08);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chips span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 0.48rem 0.78rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.79rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.chips span::before {
  content: "";
  width: 0.82rem;
  height: 0.82rem;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffb266' d='M12 2 3 6v6c0 5 3.8 9.6 9 10 5.2-.4 9-5 9-10V6l-9-4zm0 3.1 6 2.7v4.1c0 3.6-2.5 7-6 7.9-3.5-.9-6-4.3-6-7.9V7.8l6-2.7z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-grid a {
  display: inline-flex;
  text-decoration: none;
}

.badge-grid img {
  display: block;
  height: 28px;
  width: auto;
  border-radius: 8px;
}

.badge-grid a:hover {
  transform: translateY(-1px);
  transition: transform 0.18s ease;
}

.skill-groups {
  display: grid;
  gap: 0.8rem;
}

.skill-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.skill-group h3 {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  font-family: "JetBrains Mono", monospace;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.skill-group h3 svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: var(--accent-2);
}

:root[data-theme="light"] .skill-group {
  background: rgba(19, 32, 42, 0.03);
}

.languages-strip {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.7rem;
}

.languages-strip .lang-title {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 0.98rem;
}

.language-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.language-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.58rem 0.65rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.language-item .flag {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.08rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  line-height: 1;
}

.language-item .flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.language-item strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.language-item p {
  margin: 0.12rem 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

:root[data-theme="light"] .language-item {
  background: linear-gradient(145deg, rgba(19, 32, 42, 0.04), rgba(19, 32, 42, 0.02));
}

:root[data-theme="light"] .language-item .flag {
  background: rgba(19, 32, 42, 0.06);
}

.gpa-highlight {
  color: var(--text);
  font-size: 1.05em;
}

.cert-logo-wrap {
  margin-bottom: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem 0.58rem;
  background: rgba(255, 255, 255, 0.03);
}

.cert-logo {
  max-height: 30px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

:root[data-theme="light"] .cert-logo-wrap {
  background: rgba(19, 32, 42, 0.03);
}

.pacman-block {
  margin-top: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
}

.pacman-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
}

.pacman-block img {
  width: 100%;
  height: auto;
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
  z-index: 30;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 11, 18, 0.56);
  backdrop-filter: blur(5px);
}

.modal-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem;
  background: linear-gradient(145deg, var(--surface), rgba(16, 30, 43, 0.92));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.28s ease;
}

.modal.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
}

.modal-head {
  padding-right: 2.35rem;
}

.section-head-inline {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.github-status {
  margin-top: 0.7rem;
}

.github-stats {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.github-stats article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
}

.github-stats strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.github-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.github-repos {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gh-repo {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.gh-repo h3 {
  margin: 0;
  font-size: 0.95rem;
}

.gh-repo a {
  color: var(--text);
  text-decoration: none;
}

.gh-repo a:hover {
  color: var(--accent);
}

.gh-repo p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

:root[data-theme="light"] .github-stats article,
:root[data-theme="light"] .gh-repo {
  background: rgba(19, 32, 42, 0.03);
}

:root[data-theme="light"] .pacman-block {
  background: rgba(19, 32, 42, 0.03);
}

.muted {
  color: var(--muted);
}

.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .timeline,
  .edu-grid,
  .github-repos {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .github-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav {
    display: none;
  }

  .site-header {
    gap: 0.5rem;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .hero h1 {
    max-width: 16ch;
  }

  .language-cards {
    grid-template-columns: 1fr;
  }

  .hero-location-top {
    position: static;
    margin-top: 0.85rem;
    margin-right: auto;
    width: fit-content;
  }

  .theme-icon {
    position: static;
    margin-top: 0;
  }

}

@media (max-width: 560px) {
  .github-stats {
    grid-template-columns: 1fr;
  }

  .section-head-inline {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
