/* ---------- Tokens ---------- */
:root {
  --bg: #FAFAFC;
  --surface: #FFFFFF;
  --ink: #121218;
  --ink-soft: #5B5B6E;
  --line: #E6E5EF;

  --violet: #6C5CE7;
  --violet-soft: #EFECFD;
  --coral: #FF5A45;
  --coral-soft: #FFEBE7;
  --mint: #14B8A6;
  --mint-soft: #E3FBF7;
  --amber: #F5A524;
  --amber-soft: #FFF3DE;

  --chip-coral-text: #D6472F;
  --chip-mint-text: #0B8F80;
  --chip-amber-text: #B4720C;

  --shadow-color: 17, 17, 24;

  --display: "Space Grotesk", "Inter", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --topbar-h: 76px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0F0F17;
  --surface: #17161F;
  --ink: #F4F3FA;
  --ink-soft: #A6A4BE;
  --line: #29283A;

  --violet: #9B8CFF;
  --violet-soft: #262047;
  --coral: #FF7D68;
  --coral-soft: #3A2432;
  --mint: #3DD9C4;
  --mint-soft: #163330;
  --amber: #FFC466;
  --amber-soft: #3A2E14;

  --chip-coral-text: #FF9C89;
  --chip-mint-text: #6FE3D2;
  --chip-amber-text: #FFCE85;

  --shadow-color: 0, 0, 0;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.topnav {
  display: flex;
  gap: 2.25rem;
}

.topnav a {
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.topnav a:hover { color: var(--ink); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cta-pill {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, var(--violet), #8B7CF6);
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-pill:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(108, 92, 231, 0.38); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover { transform: translateY(-1px); border-color: var(--violet); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 16px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem clamp(1.25rem, 6vw, 5rem);
}

.hero-kicker {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--violet);
  margin: 0 0 1.5rem 0;
}

.hero-giant {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-size: clamp(3.2rem, 13vw, 9.5rem);
}

.hero-giant .line { display: block; }

.line-outline {
  -webkit-text-stroke: 2px var(--ink);
  color: transparent;
}

.hero-role {
  margin: 1.75rem 0 0 0;
  max-width: 40ch;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft);
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-solid {
  color: #fff;
  background: linear-gradient(120deg, var(--violet), var(--coral));
  box-shadow: 0 10px 24px rgba(108, 92, 231, 0.3);
}

.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(108, 92, 231, 0.4); }

.btn-ghost {
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
}

.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  padding: 1.1rem 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 1.5rem;
  animation: marqueeScroll 26s linear infinite;
  will-change: transform;
}

.marquee-track span {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--bg);
  white-space: nowrap;
  opacity: 0.9;
}

@keyframes marqueeScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 6vw, 5rem);
  max-width: 1280px;
  margin: 0 auto;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1;
  background: linear-gradient(120deg, var(--violet), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-plus { font-size: 0.55em; }

.stat-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---------- Sections ---------- */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}

.section-heading {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 2.75rem 0;
}

/* ---------- Work cards ---------- */
.work-card {
  padding: 2rem clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(var(--shadow-color), 0.08);
  border-color: var(--violet);
}

.work-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.work-role {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0;
}

.work-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.work-org {
  color: var(--violet);
  font-weight: 500;
  font-size: 0.94rem;
  margin: 0 0 1.1rem 0;
}

.work-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.work-list li {
  margin-bottom: 0.55rem;
  font-size: 0.97rem;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.25rem 2.5rem;
}

.skill-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 0.8rem 0;
  font-weight: 500;
}

.label-violet { color: var(--violet); }
.label-coral  { color: var(--chip-coral-text); }
.label-mint   { color: var(--chip-mint-text); }
.label-amber  { color: var(--chip-amber-text); }

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover {
  transform: translateY(-2px);
  border-color: var(--violet);
  box-shadow: 0 6px 14px rgba(var(--shadow-color), 0.08);
}

.chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .chip-badge-invert {
  background: #e8e8e8 !important;
  color: #111 !important;
}

/* ---------- Certifications ---------- */
.cert-block { margin-top: 2.5rem; }

.cert-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.cert-list li {
  margin-bottom: 0.4rem;
  font-size: 0.94rem;
}

/* ---------- Contact CTA ---------- */
.contact-cta {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  text-align: center;
}

.contact-giant {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-violet:hover { box-shadow: 0 8px 18px rgba(108, 92, 231, 0.22); }

.pill-coral { background: var(--coral-soft); color: var(--chip-coral-text); }
.pill-coral:hover { box-shadow: 0 8px 18px rgba(255, 90, 69, 0.22); }

.pill-mint { background: var(--mint-soft); color: var(--chip-mint-text); }
.pill-mint:hover { box-shadow: 0 8px 18px rgba(20, 184, 166, 0.22); }

/* ---------- Footer ---------- */
.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem clamp(1.25rem, 6vw, 5rem) 3rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- Hero entrance + scroll reveal ---------- */
.hero-in {
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

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

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.stats .stat:nth-child(2) { transition-delay: 0.08s; }
.stats .stat:nth-child(3) { transition-delay: 0.16s; }
.stats .stat:nth-child(4) { transition-delay: 0.24s; }

.skills-grid .skill-group:nth-child(2) { transition-delay: 0.08s; }
.skills-grid .skill-group:nth-child(3) { transition-delay: 0.16s; }
.skills-grid .skill-group:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .hero-in, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topnav {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform 0.25s ease;
    z-index: 25;
  }

  .topnav.open { transform: translateY(0); }

  .topnav a {
    padding: 1rem clamp(1.25rem, 6vw, 5rem);
    border-bottom: 1px solid var(--line);
  }

  .cta-pill { display: none; }
  .nav-toggle { display: flex; }

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

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 1.75rem 1rem; }
}
