:root {
  --bg: #ffffff;
  --bg-soft: #fff8e6;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.09);
  --blue: #f59e0b;
  --green: #d4af37;
  --blue-soft: rgba(245, 158, 11, 0.14);
  --green-soft: rgba(212, 175, 55, 0.16);
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 14px 45px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-soft: #1f1a10;
  --surface: rgba(17, 24, 39, 0.76);
  --surface-strong: #1a1a1a;
  --text: #f8fafc;
  --muted: #d5cab0;
  --line: rgba(248, 250, 252, 0.1);
  --blue-soft: rgba(245, 158, 11, 0.22);
  --green-soft: rgba(212, 175, 55, 0.2);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 16px 50px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 4%, var(--blue-soft), transparent 28rem),
    radial-gradient(circle at 84% 14%, var(--green-soft), transparent 26rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 48%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 300ms ease, color 300ms ease;
}

body.nav-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

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

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

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.25);
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-panel a,
.theme-toggle {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 0 15px;
  transition: color 260ms ease, background-color 260ms ease, transform 260ms var(--ease);
}

.nav-panel a:hover,
.theme-toggle:hover,
.nav-panel a.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--text);
  transform: translateY(-1px);
}

.nav-panel a.active::after {
  position: absolute;
  right: 15px;
  bottom: 6px;
  left: 15px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  content: "";
}

.theme-toggle {
  width: 42px;
  padding: 0;
}

.theme-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: inset -5px -5px 0 rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .theme-icon {
  box-shadow: inset -6px -4px 0 rgba(15, 23, 42, 0.92);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
  transition: transform 260ms var(--ease), opacity 260ms ease;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

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

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.app-shell {
  min-height: calc(100vh - 158px);
}

.page {
  animation: pageIn 520ms var(--ease) both;
}

.section {
  padding: 84px 0;
}

.section.compact {
  padding-top: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 12px;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px var(--green-soft);
  content: "";
}

.section-title,
.hero-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.25rem, 6vw, 5.8rem);
  font-weight: 860;
  letter-spacing: 0;
  line-height: 0.96;
}

.section-title {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.03;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead,
.section-subtitle {
  max-width: 700px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.25rem);
}

.lead {
  margin: 24px 0 0;
}

.section-subtitle {
  margin: 18px 0 0;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 52px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  padding: 0 20px;
  transition: transform 280ms var(--ease), box-shadow 280ms ease, background-color 280ms ease, border-color 280ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.24);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 42px rgba(245, 158, 11, 0.24);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.hero-visual {
  position: relative;
  min-height: 470px;
}

.profile-card,
.metric-card,
.glass-card,
.blog-card,
.skill-card,
.timeline-card,
.contact-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.profile-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(212, 175, 55, 0.12), transparent);
  content: "";
}

.profile-card img {
  position: relative;
  width: 100%;
  border-radius: 22px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.metric-card {
  position: absolute;
  right: -8px;
  bottom: 24px;
  width: min(210px, 50%);
  border-radius: 18px;
  padding: 18px;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.floating-chip {
  position: absolute;
  top: 24px;
  left: -10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-weight: 800;
  padding: 12px 16px;
}

.stats-grid,
.skills-grid,
.blog-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 44px;
}

.stat {
  border-left: 2px solid var(--line);
  padding-left: 18px;
}

.stat strong {
  display: block;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-weight: 700;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}

.glass-card {
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
}

.glass-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.glass-card p:last-child {
  margin-bottom: 0;
}

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

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-card {
  border-radius: 18px;
  padding: 20px;
  transition: transform 280ms var(--ease), box-shadow 280ms ease;
}

.skill-card:hover,
.blog-card:hover,
.cert-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.cert-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 22px;
  transition: transform 280ms var(--ease), box-shadow 280ms ease;
}

.cert-card h3 {
  margin: 12px 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.cert-card p {
  margin: 0;
  color: var(--muted);
}

.cert-card p + p {
  margin-top: 8px;
}

.skill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 850;
}

.skill-card span {
  color: var(--muted);
}

.progress {
  height: 9px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.15);
}

.progress i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms var(--ease);
}

.is-visible .progress i {
  transform: scaleX(1);
}

.page-head {
  max-width: 760px;
  margin-bottom: 34px;
}

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

.blog-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 280ms var(--ease), box-shadow 280ms ease;
}

.blog-art {
  min-height: 130px;
  background:
    linear-gradient(135deg, var(--blue-soft), var(--green-soft)),
    var(--pattern);
}

.blog-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.blog-meta,
.card-meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.blog-card h2,
.timeline-card h2,
.contact-card h2 {
  margin: 12px 0 10px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.blog-card p,
.timeline-card p,
.contact-card p {
  margin: 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.tag {
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: color-mix(in srgb, var(--blue) 70%, var(--text));
  font-size: 0.78rem;
  font-weight: 850;
  padding: 6px 10px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
  margin-top: 12px;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 16px;
  width: 2px;
  background: linear-gradient(var(--blue), var(--green));
  content: "";
}

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

.timeline-dot {
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 8px solid var(--bg);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(245, 158, 11, 0.22);
}

.timeline-card {
  border-radius: var(--radius);
  padding: 24px;
}

.timeline-card ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
}

.contact-card {
  border-radius: var(--radius);
  padding: 28px;
}

.contact-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.contact-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.32);
  color: var(--muted);
  font-weight: 800;
  padding: 14px 16px;
  transition: transform 260ms var(--ease), background-color 260ms ease;
}

.contact-list a:hover {
  background: rgba(245, 158, 11, 0.12);
  color: var(--text);
  transform: translateX(4px);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.footer-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--text);
}

.reveal {
  transform: translateY(24px);
  opacity: 0;
  transition: opacity 650ms ease, transform 650ms var(--ease);
}

.reveal.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.route-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: rgba(248, 250, 252, 0.46);
  backdrop-filter: blur(0);
  opacity: 0;
  transition: opacity 240ms ease, backdrop-filter 240ms ease;
}

[data-theme="dark"] .route-transition {
  background: rgba(15, 23, 42, 0.4);
}

.route-transition.active {
  backdrop-filter: blur(10px);
  opacity: 1;
}

@keyframes pageIn {
  from {
    transform: translateY(14px);
    opacity: 0;
    filter: blur(8px);
  }
  to {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav-panel {
    position: fixed;
    top: 76px;
    right: 16px;
    left: 16px;
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    padding: 14px;
    transform: translateY(-12px) scale(0.98);
    transform-origin: top;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease, transform 240ms var(--ease);
  }

  .nav-open .nav-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-panel a,
  .theme-toggle {
    justify-content: flex-start;
    width: 100%;
  }

  .theme-toggle {
    padding: 0 15px;
  }

  .hero-grid,
  .split-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 54px;
  }

  .hero-visual {
    min-height: auto;
  }

  .metric-card {
    right: 12px;
    bottom: 12px;
  }

  .floating-chip {
    left: 12px;
  }

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

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1120px);
  }

  .section {
    padding: 58px 0;
  }

  .hero {
    padding-bottom: 52px;
  }

  .hero-actions,
  .button-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .stats-grid,
  .skills-grid,
  .cert-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 22px 0;
  }
}

/* ==================== */
/* Scrollbar Styling */
/* ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4af37;
}

/* Final SPA overrides: keep legacy PHP stylesheet residue from changing the vanilla SPA. */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.blog-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 280ms var(--ease), box-shadow 280ms ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
  margin-top: 12px;
  padding-left: 0;
  border-left: 0;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 16px;
  width: 2px;
  height: auto;
  background: linear-gradient(var(--blue), var(--green));
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
}

.timeline-dot {
  position: relative;
  left: auto;
  top: auto;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 8px solid var(--bg);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(245, 158, 11, 0.22);
  transform: none;
}

.timeline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.section-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 860;
  letter-spacing: 0;
  line-height: 1.03;
}

.hero-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.25rem, 6vw, 5.8rem);
  font-weight: 860;
  letter-spacing: 0;
  line-height: 0.96;
}

@media (max-width: 860px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .skills-grid,
  .cert-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }
}
