/* --- Variables --- */
:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #3fb950;
  --accent-dim: rgb(63 185 80 / 12%);
  --accent-hover: #56d364;
  --border: rgb(255 255 255 / 6%);
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 0;
  --radius-sm: 0;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.25s;
  --duration-slow: 0.4s;
  --shadow-hover: 0 8px 32px rgb(0 0 0 / 25%);
}

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

html {
  scroll-behavior: auto;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 560px;
}

main {
  position: relative;
  z-index: 1;
  transform: translateZ(0);
}

.section {
  padding: 1rem 0;
  position: relative;
  z-index: 1;
}

#about.section {
  padding-top: 2.5rem;
}

.section__title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* --- Cards (no shadow/transition on base for smooth scroll) --- */
.glass {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: max(0.75rem, env(safe-area-inset-top)) 0 max(0.75rem, 0);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease);
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header__logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  flex-shrink: 0;
}

.header__logo:hover {
  color: var(--accent-hover);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition:
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.lang-switcher {
  display: flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--bg);
  background: var(--accent);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition:
    transform var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
}

.burger--open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.burger--open span:nth-child(2) {
  opacity: 0;
}

.burger--open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 50%);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease);
}

@media (width <= 768px) {
  .header__inner {
    padding-right: 0;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5.5rem 1.5rem 2rem;
    background: var(--bg);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform var(--duration-slow) var(--ease);
    z-index: 100;
  }

  .nav--open {
    transform: translateX(0);
  }

  .nav a {
    padding: 0.85rem 0;
    font-size: 0.9rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav a:hover {
    border-left-color: var(--accent);
  }

  .burger {
    display: flex;
    z-index: 101;
  }

  body.menu-open .nav-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 2.5rem 1.5rem 0;
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
  width: fit-content;
  animation: fade-up 0.6s var(--ease) forwards;
}

.hero__title {
  margin-bottom: 0.5rem;
  animation: fade-up 0.6s var(--ease) 0.08s both;
}

.hero__name {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero__role {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-top: 0.25rem;
}

.hero__tagline {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 1rem;
  line-height: 1.6;
  animation: fade-up 0.6s var(--ease) 0.16s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  animation: fade-up 0.6s var(--ease) 0.24s both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0;
  border: none;
  cursor: pointer;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease),
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgb(63 185 80 / 20%);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgb(255 255 255 / 10%);
  background: rgb(255 255 255 / 3%);
}

/* --- About --- */
.about__card {
  padding: 1.75rem 2rem;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.about__card:hover {
  border-color: rgb(63 185 80 / 12%);
  box-shadow: var(--shadow-hover);
}

.about__text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* --- Skills --- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.875rem;
}

.skill-group {
  padding: 1.5rem;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.skill-group:hover {
  border-color: rgb(63 185 80 / 15%);
  box-shadow: var(--shadow-hover);
}

.skill-group__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.3;
}

.skill-group__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-group .tech-pills {
  margin-top: 0.5rem;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  border: 1px solid rgb(63 185 80 / 15%);
  transition:
    background var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.pill:hover {
  background: rgb(63 185 80 / 18%);
  color: var(--accent-hover);
}

/* --- Experience / Timeline --- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.timeline__item {
  padding: 1.75rem 2rem;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.timeline__item:hover {
  border-color: rgb(63 185 80 / 12%);
  box-shadow: var(--shadow-hover);
}

.timeline__period {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.timeline__role {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline__company {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.list--bullets {
  list-style: none;
}

.list--bullets li {
  position: relative;
  padding-left: 1.25rem;
}

.list--bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.timeline__list {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.timeline__list li {
  margin-bottom: 0.4rem;
}

/* --- Education --- */
.education__card {
  padding: 2rem;
  max-width: 560px;
}

.education__degree {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.education__school {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.education__years {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

/* --- Certifications --- */
.certifications__card {
  padding: 2rem;
  max-width: 560px;
}

.cert-list {
  margin: 0;
}

.cert-list li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cert-list li:last-child {
  margin-bottom: 0;
}

/* --- Contact --- */
.contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition:
    border-color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    transform var(--duration) var(--ease);
}

.contact__link:hover {
  border-color: rgb(63 185 80 / 20%);
  background: rgb(63 185 80 / 6%);
  transform: translateY(-1px);
}

.contact__link-icon {
  font-size: 1rem;
  color: var(--accent);
}

.contact__social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition:
    border-color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    color var(--duration) var(--ease),
    transform var(--duration) var(--ease);
}

.contact__social-link:hover {
  border-color: rgb(63 185 80 / 20%);
  background: rgb(63 185 80 / 6%);
  color: var(--accent);
  transform: translateY(-2px);
}

.contact__social-icon {
  width: 24px;
  height: 24px;
}

/* --- Footer --- */
.footer {
  padding: 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer__text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Responsive: tablet & mobile --- */
@media (width <= 768px) {
  .container,
  .container--narrow {
    padding: 0 1.25rem;
  }

  .section {
    padding: 0.875rem 0;
  }

  .section__title {
    margin-bottom: 1rem;
    font-size: 1.5rem;
  }

  .hero {
    padding: 2.5rem 1.25rem 0;
    justify-content: flex-start;
  }

  .hero__name {
    font-size: clamp(2rem, 9vw, 2.75rem);
  }

  .hero__role {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  .hero__tagline {
    font-size: 1rem;
    margin-bottom: 1rem;
    max-width: 100%;
  }

  .hero__actions {
    gap: 0.75rem;
  }

  .hero__actions .btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .about__card {
    padding: 1.25rem 1.5rem;
  }

  .about__text {
    font-size: 1rem;
  }

  .skill-groups {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skill-group {
    padding: 1.25rem 1.5rem;
  }

  .skill-group__title {
    font-size: 0.95rem;
    overflow-wrap: break-word;
  }

  .tech-pills {
    gap: 0.4rem;
  }

  .pill {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .timeline__item {
    padding: 1.25rem 1.5rem;
  }

  .timeline__role {
    font-size: 1.1rem;
  }

  .timeline__list {
    font-size: 0.9rem;
  }

  .education__card {
    padding: 1.25rem 1.5rem;
  }

  .education__degree {
    font-size: 1rem;
  }

  .certifications__card {
    padding: 1.25rem 1.5rem;
  }

  .cert-list li {
    font-size: 0.9rem;
    padding-left: 1.1rem;
    overflow-wrap: break-word;
  }

  .contact__row {
    flex-direction: column;
    align-items: stretch;
  }

  .contact__link {
    padding: 0.875rem 1rem;
    min-height: 44px;
    align-items: center;
  }

  .contact__social {
    justify-content: center;
  }

  .contact__social-link {
    width: 44px;
    height: 44px;
  }

  .contact__social-icon {
    width: 22px;
    height: 22px;
  }

  .footer {
    padding: 1.5rem 1.25rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .footer__text {
    font-size: 0.8rem;
  }
}

/* --- Responsive: small phones --- */
@media (width <= 480px) {
  .container,
  .container--narrow {
    padding: 0 1rem;
  }

  .header {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: 0.75rem;
    padding-right: max(0.5rem, env(safe-area-inset-right));
  }

  .hero {
    padding: 2.5rem 1rem 0;
  }

  .hero__name {
    font-size: 1.75rem;
  }

  .hero__role {
    font-size: 1.35rem;
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .section {
    padding: 0.75rem 0;
  }

  .section__title {
    font-size: 1.35rem;
    margin-bottom: 0.875rem;
  }

  .about__card,
  .skill-group,
  .timeline__item,
  .education__card,
  .certifications__card {
    padding: 1rem 1.25rem;
  }
}
