:root {
  --bg: #0b1220;
  --bg-alt: #0f192c;
  --surface: #121e33;
  --border: #22314d;
  --text: #e7edf7;
  --text-dim: #9fb0c9;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --radius: 14px;
  --max-width: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fc;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #10192b;
    --text-dim: #51607a;
    --accent: #0f9c8d;
    --accent-2: #0284c7;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f192c;
  --surface: #121e33;
  --border: #22314d;
  --text: #e7edf7;
  --text-dim: #9fb0c9;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
}

:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #10192b;
  --text-dim: #51607a;
  --accent: #0f9c8d;
  --accent-2: #0284c7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.3,1), transform 0.7s cubic-bezier(.2,.7,.3,1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.nav-links a {
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active { color: var(--text); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a;
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--accent); }

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
  background:
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 55%);
}

.hero-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.35;
  animation: floatOrb 14s ease-in-out infinite;
}

.orb-1 {
  width: 280px;
  height: 280px;
  top: -60px;
  left: 8%;
  background: var(--accent);
}

.orb-2 {
  width: 220px;
  height: 220px;
  top: 40%;
  right: 6%;
  background: var(--accent-2);
  animation-duration: 18s;
  animation-delay: -4s;
}

.orb-3 {
  width: 160px;
  height: 160px;
  bottom: -40px;
  left: 40%;
  background: var(--accent-2);
  animation-duration: 11s;
  animation-delay: -8s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.08); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

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

.hero-photo { flex: 0 0 auto; }

.hero-photo-ring {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: ringSpin 8s linear infinite;
}

@keyframes ringSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(15deg); }
}

.hero-photo-ring::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.35;
  filter: blur(16px);
  z-index: -1;
}

.hero-photo-ring img,
.avatar-fallback {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--surface);
  z-index: 0;
}

.hero-photo-ring img {
  z-index: 1;
}

@media (max-width: 860px) {
  .hero-inner { flex-direction: column-reverse; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-photo-ring { width: 160px; height: 160px; }
}

.type-cursor {
  color: var(--accent);
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border);
  border-radius: 16px;
  z-index: 1;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollCue 1.8s ease infinite;
}

@keyframes scrollCue {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; transform: translateY(14px); }
}

@media (max-width: 720px) {
  .scroll-cue { display: none; }
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-role {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text);
  font-weight: 600;
  margin: 0 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  max-width: 640px;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.stat { display: flex; flex-direction: column; gap: 4px; }

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}

.about-text {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 760px;
  margin: 0 0 20px;
}

.languages { margin-top: 36px; }

.lang-title {
  display: block;
  font-weight: 700;
  margin-bottom: 12px;
}

.lang-list { display: flex; gap: 10px; flex-wrap: wrap; }

.lang-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Skills */
.skill-group { margin-bottom: 36px; }

.skill-group h3 {
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 14px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 720px) {
  .skill-grid { grid-template-columns: 1fr; }
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 30%, transparent);
}

.skill-card h4 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.tag-accent {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  font-weight: 600;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 44px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: dotPulse 2.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 12%, transparent); }
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}

.timeline-header h3 { margin: 0; font-size: 1.15rem; }

.timeline-date {
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

.timeline-company {
  color: var(--accent);
  font-weight: 600;
  margin: 4px 0 12px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
}

.timeline-content li { margin-bottom: 8px; }

/* Education */
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
}

.edu-card h3 { margin: 0 0 6px; }
.edu-school { color: var(--accent); font-weight: 600; margin: 0 0 4px; }
.edu-date { color: var(--text-dim); margin: 0; font-size: 0.9rem; }

/* Contact */
.contact-section { text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-sub {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 0 32px;
}
.contact-section .hero-actions { justify-content: center; margin-bottom: 0; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, border-color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}
