:root {
  --ink-900: #181f2a;
  --ink-700: #33465f;
  --ink-500: #607286;
  --ink-200: #d7e4f5;
  --paper: #f4f5ef;
  --paper-soft: #fefbf3;
  --paper-cool: #eef4f8;
  --panel: #fffcf4cc;
  --line: #1e2c451f;
  --line-strong: #284f7a47;
  --accent-cyan: #00a8a8;
  --accent-coral: #ff6f4d;
  --accent-sky: #2e67f8;
  --accent-green: #12a05c;
  --header-bg: #f4f5efb8;
  --hero-bg-a: #ffffffed;
  --hero-bg-b: #ffffffc9;
  --surface: #ffffffdb;
  --surface-soft: #ffffffd6;
  --nav-hover: #ffffffd9;
  --shadow-lg: 0 24px 80px #152a3b2b;
  --shadow-md: 0 12px 36px #1a27311a;
  --radius-lg: 26px;
  --radius-md: 18px;
}

body[data-theme="dark"] {
  --ink-900: #f4f7ff;
  --ink-700: #b5c9e6;
  --ink-500: #8ca2c1;
  --paper: #0b1322;
  --paper-soft: #0f1a31;
  --paper-cool: #0b1f2f;
  --panel: #13213ad6;
  --line: #d6e4ff24;
  --line-strong: #8db4ff5e;
  --accent-cyan: #33d6ce;
  --accent-coral: #ff9b7e;
  --accent-sky: #7ea8ff;
  --accent-green: #2ecc82;
  --header-bg: #091324cb;
  --hero-bg-a: #0f1a31f2;
  --hero-bg-b: #132642d1;
  --surface: #152540e0;
  --surface-soft: #152844dd;
  --nav-hover: #1b2f50d9;
  --shadow-lg: 0 24px 80px #02060d6b;
  --shadow-md: 0 12px 36px #03070f70;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: radial-gradient(circle at 15% 20%, #ffd8b8 0%, var(--paper) 45%),
    radial-gradient(circle at 85% 12%, #b8d7ff 0%, var(--paper) 48%),
    linear-gradient(165deg, var(--paper-soft) 0%, var(--paper-cool) 100%);
  line-height: 1.5;
  transition: color 0.4s ease, background 0.5s ease;
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-sky), var(--accent-cyan));
  z-index: 100;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(to right, #ffffff05 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff08 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
  z-index: -3;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(48px);
  pointer-events: none;
  z-index: -2;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #ff7b5f4f;
  top: -40px;
  right: 4%;
}

.orb-b {
  width: 340px;
  height: 340px;
  background: #2e67f83b;
  left: -70px;
  top: 42%;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 3px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 6vw;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid #15253a14;
}

.brand {
  text-decoration: none;
  color: white;
  background: linear-gradient(132deg, var(--accent-sky), var(--accent-cyan));
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--ink-700);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

nav a:hover,
nav a.active {
  background: var(--nav-hover);
  color: var(--ink-900);
  transform: translateY(-2px);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-900);
  border-radius: 999px;
  padding: 0.34rem 0.5rem;
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  transition: transform 0.25s ease, background 0.3s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
}

.theme-icon {
  border-radius: 999px;
  padding: 0.2rem 0.4rem;
  transition: background 0.3s ease, color 0.3s ease, transform 0.35s ease;
}

body[data-theme="light"] .theme-icon.sun,
body:not([data-theme]) .theme-icon.sun,
body[data-theme="dark"] .theme-icon.moon {
  background: linear-gradient(122deg, var(--accent-sky), var(--accent-cyan));
  color: white;
}

body[data-theme="dark"] .theme-toggle {
  box-shadow: inset 0 0 0 1px #ffffff10;
}

/* ── Main layout ── */
main {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 3rem 0 5rem;
  display: grid;
  gap: 2.2rem;
}

/* ── Hero ── */
.hero {
  padding: 2.6rem 2.6rem 2.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--hero-bg-a), var(--hero-bg-b));
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -48px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(from 80deg, #2e67f86b, #00a8a85f, #ff6f4d73, #2e67f86b);
  filter: blur(4px);
  opacity: 0.88;
}

/* ── Hero inner layout ── */
.hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.hero-text {
  flex: 1 1 0;
  min-width: 0;
}

.hero-avatar-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.4rem;
}

.hero-avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-cyan), var(--accent-coral));
  box-shadow: 0 8px 32px #2e67f83a, 0 2px 8px #0003;
  position: relative;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 3px solid var(--hero-bg-a);
}

/* ── Status badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #12a05c18;
  border: 1px solid #12a05c44;
  color: var(--accent-green);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.75); }
}

/* ── Typing effect ── */
.hero-typed-wrap {
  color: var(--ink-700);
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0.6rem 0 0;
}

.typed-role {
  color: var(--accent-sky);
  font-weight: 700;
}

.typed-cursor {
  color: var(--accent-sky);
  animation: blink 0.85s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent-sky);
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Syne", sans-serif;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.7rem);
  line-height: 1.06;
  max-width: 17ch;
  margin-bottom: 0.8rem;
}

.hero-copy {
  max-width: 62ch;
  color: var(--ink-700);
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.3rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  padding: 0.72rem 1.18rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: none;
}

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

.btn-solid {
  color: #fff;
  background: linear-gradient(132deg, #15356b, #2e67f8);
  box-shadow: 0 10px 22px #2650b52b;
}

.btn-outline {
  color: var(--ink-900);
  border: 1px solid #263a5f42;
  background: #ffffffcc;
}

/* ── Metric strip ── */
.metric-strip {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric-strip li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  box-shadow: var(--shadow-md);
}

.metric-strip strong {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.42rem;
}

.metric-strip span {
  color: var(--ink-700);
  font-size: 0.84rem;
}

/* ── Panels ── */
.panel {
  padding: 2rem 2rem 2.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.section-title-wrap {
  margin-bottom: 1.4rem;
}

h2 {
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  margin-bottom: 0;
}

/* ── About ── */
.about-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1.2fr 1fr;
}

.about-grid p,
.about-grid li,
.timeline-item li,
.project-card li,
.pm-grid p,
.oss-card li {
  color: var(--ink-700);
}

.about-grid ul,
.timeline-item ul,
.project-card ul,
.oss-card ul {
  margin: 0;
  padding-left: 1rem;
}

/* ── Skills bento ── */
.skills-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.skill-category {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  border-top: 3px solid transparent;
}

.cat-lang { border-top-color: var(--accent-sky); }
.cat-fe   { border-top-color: var(--accent-cyan); }
.cat-be   { border-top-color: var(--accent-coral); }
.cat-db   { border-top-color: #a855f7; }
.cat-cloud{ border-top-color: #f59e0b; }
.cat-process { border-top-color: var(--accent-green); }

.skill-category h3 {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 0.8rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-900);
  white-space: nowrap;
}

/* ── Leadership ── */
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.lead-card {
  background: linear-gradient(145deg, var(--hero-bg-a), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.2rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lead-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.lead-icon {
  color: var(--accent-sky);
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.lead-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.lead-card p {
  color: var(--ink-700);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.55;
}

/* ── Timeline ── */
.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.2rem 1.2rem 1.3rem;
  border-left: 4px solid var(--accent-cyan);
}

.timeline-item header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.timeline-item h3 {
  margin-bottom: 0.15rem;
  font-size: 1.08rem;
}

.company-tag {
  margin: 0;
  color: var(--accent-coral);
  font-weight: 600;
  font-size: 0.88rem;
}

.timeline-date {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  padding-top: 0.15rem;
}

.timeline-item ul {
  margin: 0 0 0.8rem;
  padding-left: 1rem;
}

.timeline-item li {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

/* ── Open Source grid ── */
.oss-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 1rem;
}

.oss-card {
  background: linear-gradient(155deg, var(--hero-bg-a), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.oss-primary {
  border-left: 4px solid var(--accent-sky);
}

.oss-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.oss-header h3 {
  margin-bottom: 0;
}

.oss-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-sky);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-sky);
}

.oss-card > p:not(.project-context) {
  color: var(--ink-700);
  font-size: 0.93rem;
  margin-bottom: 0.7rem;
}

.oss-card h3 {
  margin-bottom: 0.25rem;
}

/* ── Project cards (legacy, kept for compat) ── */
.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  background: linear-gradient(167deg, var(--hero-bg-a), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1.2rem;
}

.project-card h3 {
  margin-bottom: 0.28rem;
}

.project-context {
  margin: 0 0 0.65rem;
  color: var(--accent-coral);
  font-weight: 700;
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tag-row span {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--ink-900);
  background: var(--surface-soft);
}

/* ── Product Management ── */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.pm-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  position: relative;
}

.pm-num {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-sky);
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.pm-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.pm-card p {
  color: var(--ink-700);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.55;
}

/* ── Certifications ── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.cert-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.cert-highlight {
  border-top: 3px solid var(--accent-sky);
}

.cert-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.32rem;
}

.cert-card p {
  margin: 0 0 0.45rem;
  color: var(--ink-700);
  font-size: 0.88rem;
}

.cert-card a {
  color: var(--accent-sky);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── Resume ── */
.resume-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.resume-box p {
  margin-top: 0;
  color: var(--ink-700);
}

/* ── Contact ── */
.contact-box {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
}

.contact-box a,
.contact-box p {
  margin: 0;
  color: var(--ink-700);
  font-weight: 700;
  font-size: 1rem;
}

.contact-box a {
  text-decoration: none;
  border-bottom: 2px solid var(--line-strong);
}

/* ── Shared utilities ── */
.section-note {
  margin: 0.35rem 0 0;
  color: var(--ink-500);
  font-size: 0.92rem;
}

footer {
  width: min(1120px, 92vw);
  margin: 0 auto 2.2rem;
  color: var(--ink-500);
  font-size: 0.9rem;
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ── Responsive ── */
@media (max-width: 1040px) {
  .oss-grid {
    grid-template-columns: 1fr 1fr;
  }

  .oss-primary {
    grid-column: 1 / -1;
  }

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

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

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

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

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

  .about-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 0.5rem;
    align-items: flex-start;
    flex-direction: column;
    padding: 0.85rem 4vw;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
    gap: 0.9rem;
  }

  nav {
    gap: 0.35rem;
  }

  nav a {
    font-size: 0.82rem;
    padding: 0.35rem 0.5rem;
  }

  main {
    width: 94vw;
    padding-top: 1.2rem;
  }

  .hero,
  .panel {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .hero-inner {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .hero-avatar {
    width: 110px;
    height: 110px;
  }

  h1 {
    max-width: 100%;
  }

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

  .skills-bento,
  .leadership-grid,
  .pm-grid,
  .cert-grid,
  .oss-grid {
    grid-template-columns: 1fr;
  }

  .oss-primary {
    grid-column: auto;
  }

  .timeline-item header {
    flex-direction: column;
    gap: 0.2rem;
  }
}
