:root {
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --bg-soft: #f3f1ec;
  --text: #1a1f2e;
  --text-soft: #5a6072;
  --text-muted: #8a8f9c;
  --accent: #c9743a;
  --accent-2: #d89766;
  --accent-soft: #f4e6d6;
  --border: #e8e4dc;
  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 25, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 25, 40, 0.12);
  --radius: 14px;
  --radius-lg: 24px;
  --max: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-soft: #1c222c;
  --text: #f1f3f7;
  --text-soft: #b3b9c5;
  --text-muted: #7d8493;
  --accent: #e6a06a;
  --accent-2: #f1b988;
  --accent-soft: #2d2218;
  --border: #242b36;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--accent); color: #fff; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

/* Spotlight cursor effect */
.spotlight {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s var(--ease);
  filter: blur(40px);
  will-change: transform;
}
.spotlight.on { opacity: 1; }

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: baseline;
}
.brand span {
  color: var(--accent);
  display: inline-block;
  transform-origin: bottom center;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}
.nav nav { display: flex; gap: 4px; align-items: center; }
.nav nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
}
.nav nav a:hover { color: var(--text); }
.nav nav a.active { color: var(--accent); }
.nav nav a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.nav-cta {
  background: var(--text);
  color: var(--bg) !important;
  padding: 9px 18px !important;
  border-radius: 999px;
  font-weight: 600 !important;
  margin-left: 8px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease) !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { color: var(--bg) !important; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(20deg);
}
.theme-toggle svg { transition: transform 0.4s var(--ease); }

/* ---------- HERO ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }
.hero { padding: 90px 0 110px; position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: word-in 0.8s var(--ease) forwards;
}
.hero h1 .word:nth-child(1) { animation-delay: 0.05s; }
.hero h1 .word:nth-child(2) { animation-delay: 0.18s; }
.hero h1 .word:nth-child(3) { animation-delay: 0.32s; }
@keyframes word-in {
  to { opacity: 1; transform: translateY(0); }
}
.accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  position: relative;
}
.role {
  font-size: 18px;
  color: var(--text-soft);
  margin-bottom: 26px;
  font-weight: 500;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.5s forwards;
}
.dot { color: var(--accent); margin: 0 8px; }
.lede {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 540px;
  margin-bottom: 34px;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.65s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.8s forwards;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.btn:hover::after { transform: translateX(100%); }
.btn.primary {
  background: var(--text);
  color: var(--bg);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px color-mix(in srgb, var(--text) 25%, transparent); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.quick-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.95s forwards;
}
.quick-meta > span { display: inline-flex; align-items: baseline; gap: 4px; }
.quick-meta strong {
  color: var(--text);
  font-weight: 700;
  font-size: 22px;
  font-family: 'Playfair Display', serif;
  margin-right: 4px;
}

/* Hero card stack with tilt */
.hero-card { position: relative; height: 440px; perspective: 1200px; }
.card-stack {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease);
}
.card {
  position: absolute;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
  width: 270px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  will-change: transform;
}
.card-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: 'Playfair Display', serif;
}
.card-sub { color: var(--text-soft); font-size: 14px; }
.card-since {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.card-1 { top: 20px; right: 0; transform: rotate(2deg) translateZ(40px); z-index: 3; opacity: 0; animation: card-in 0.7s var(--ease) 0.4s forwards; }
.card-2 { top: 140px; right: 80px; transform: rotate(-3deg) translateZ(20px); z-index: 2; background: var(--accent-soft); opacity: 0; animation: card-in 0.7s var(--ease) 0.55s forwards; }
.card-3 { top: 260px; right: 20px; transform: rotate(1deg) translateZ(0); z-index: 1; opacity: 0; animation: card-in 0.7s var(--ease) 0.7s forwards; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(40px) rotate(0); }
  to { opacity: 1; }
}
.card:hover {
  transform: translateY(-6px) rotate(0) translateZ(60px) !important;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

/* Floating background blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 380px;
  height: 380px;
  background: var(--accent-soft);
  top: -100px;
  right: -120px;
  animation: float 14s ease-in-out infinite;
}
.blob-2 {
  width: 260px;
  height: 260px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  bottom: 0;
  left: -80px;
  animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ---------- SECTIONS ---------- */
.section { padding: 90px 0; border-top: 1px solid var(--border); position: relative; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 56px;
}
.section-num {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
}
.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 880px;
}
.about-grid p { font-size: 17px; color: var(--text-soft); }
.about-grid strong { color: var(--text); font-weight: 600; }

/* Timeline */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 0;
  max-width: 820px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 70%);
}
.timeline li {
  position: relative;
  padding-left: 44px;
  padding-bottom: 48px;
}
.timeline li:last-child { padding-bottom: 0; }
.t-marker {
  position: absolute;
  left: 4px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  z-index: 2;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.timeline li:hover .t-marker { transform: scale(1.3); background: var(--accent); }
.t-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.t-date { font-weight: 600; color: var(--accent); }
.t-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}
.t-company { color: var(--text-soft); font-weight: 500; }
.t-content p { color: var(--text-soft); margin-bottom: 14px; max-width: 640px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span {
  font-size: 12px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  transition: all 0.2s var(--ease);
  cursor: default;
}
.chips span:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.skill-card:hover::before { opacity: 1; }
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.skill-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  transition: transform 0.3s var(--ease);
}
.skill-card:hover .skill-icon { transform: rotate(-8deg) scale(1.08); }
.skill-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.skill-card p { color: var(--text-soft); font-size: 14px; position: relative; }

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  max-width: 820px;
}
.edu-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.edu-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}
.edu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.edu-card:hover::after { transform: scaleY(1); }
.edu-year {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  padding: 4px 10px;
  background: var(--accent-soft);
  border-radius: 999px;
}
.edu-card h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 6px;
}
.edu-school { color: var(--text); font-weight: 500; margin-bottom: 2px; }
.edu-field { color: var(--text-muted); font-size: 14px; }

/* Contact */
.contact-section { padding-bottom: 110px; }
.contact-lede {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 560px;
  margin-bottom: 36px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 720px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: '→';
  position: absolute;
  right: 22px;
  font-size: 20px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s var(--ease);
}
.contact-card:hover::before { opacity: 1; transform: translateX(0); }
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.contact-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}
.contact-card:hover .contact-icon { transform: scale(1.1) rotate(-6deg); }
.contact-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.contact-value { font-weight: 500; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

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

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero-grid { gap: 40px; }
  .quick-meta { gap: 22px; }
  .quick-meta strong { font-size: 20px; }
}

@media (max-width: 880px) {
  .hero { padding: 40px 0 70px; }
  .hero-grid { grid-template-columns: 1fr; gap: 50px; }
  .hero-card { height: 380px; max-width: 360px; margin: 0 auto; }
  .card-1, .card-2, .card-3 { right: auto; left: 0; }
  .card-2 { left: 60px; }
  .card-3 { left: 20px; }
  .about-grid { grid-template-columns: 1fr; gap: 18px; }
  .nav nav { gap: 4px; }
  .nav nav a:not(.nav-cta) { display: none; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .spotlight { display: none; }
  .blob-1 { width: 280px; height: 280px; top: -80px; right: -100px; }
  .blob-2 { width: 200px; height: 200px; }
  .timeline li { padding-bottom: 38px; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 14px 18px; }
  main { padding: 0 18px; }
  .hero { padding: 24px 0 50px; }
  .hero h1 { font-size: clamp(40px, 11vw, 56px); margin-bottom: 16px; }
  .role { font-size: 16px; margin-bottom: 20px; }
  .lede { font-size: 15.5px; margin-bottom: 26px; }
  .cta-row { gap: 10px; margin-bottom: 28px; }
  .btn { padding: 12px 20px; font-size: 13.5px; flex: 1; min-width: 0; justify-content: center; }
  .quick-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    text-align: center;
  }
  .quick-meta > span { flex-direction: column; gap: 2px; }
  .quick-meta strong { display: block; font-size: 22px; margin-right: 0; }
  .hero-card { height: 340px; max-width: 320px; }
  .card { width: 240px; padding: 22px; }
  .card-title { font-size: 18px; }
  .card-1 { top: 10px; }
  .card-2 { top: 110px; left: 40px; }
  .card-3 { top: 220px; }
  .section { padding: 56px 0; border-top: 1px solid var(--border); }
  .section-head { margin-bottom: 32px; gap: 12px; }
  .section h2 { font-size: 32px; }
  .skill-card { padding: 22px; }
  .skill-card h3 { font-size: 16px; }
  .edu-card { padding: 22px; }
  .contact-card { padding: 18px; }
  .contact-section { padding-bottom: 80px; }
  .timeline { padding-left: 4px; }
  .timeline::before { left: 7px; }
  .timeline li { padding-left: 32px; }
  .t-marker { left: 0; width: 14px; height: 14px; }
  .t-content h3 { font-size: 17px; }
  .t-meta { gap: 10px; font-size: 12px; }
  .footer-inner { flex-direction: column; text-align: center; padding: 0 18px; }
  .scroll-progress { height: 3px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 40px; }
  .quick-meta { grid-template-columns: 1fr; }
  .btn { padding: 11px 16px; }
  .nav-inner { padding: 12px 16px; }
  .brand { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
