/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0a0a0f;
  color: #e8e8ee;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

:root {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8e8ee;
  --text-dim: #a0a0b0;
  --text-mute: #6b6b7d;
  --accent: #ff5e3a;
  --accent-2: #ff2a68;
  --accent-3: #5e5cff;
  --gradient: linear-gradient(135deg, #ff5e3a 0%, #ff2a68 50%, #5e5cff 100%);
  --container: 1180px;
  --radius: 16px;
}

/* ---------- Animated background ---------- */
.bg-gradient {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 94, 58, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(94, 92, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 100%, rgba(255, 42, 104, 0.12) 0%, transparent 50%),
    var(--bg);
  animation: bgShift 20s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0%   { background-position: 0% 0%, 100% 50%, 30% 100%, 0 0; }
  100% { background-position: 10% 10%, 90% 40%, 40% 90%, 0 0; }
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
}

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 120px 0; position: relative; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 15, 0.85);
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
}
.nav-logo .dot { color: var(--accent); }
.nav-links {
  display: flex; gap: 32px;
  font-size: 14px; font-weight: 500;
}
.nav-links a {
  color: var(--text-dim); transition: color 0.2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--gradient);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px 24px 80px; position: relative;
  max-width: var(--container); margin: 0 auto;
}
.hero-content { max-width: 900px; }
.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent); font-size: 14px; font-weight: 500;
  margin-bottom: 24px; letter-spacing: 0.02em;
  opacity: 0; animation: fadeUp 0.6s 0.1s forwards;
  min-height: 1.5em;
}
.typewriter { white-space: nowrap; }
.caret {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(40px, 8vw, 96px);
  line-height: 1.05; letter-spacing: -0.03em; font-weight: 700;
  margin-bottom: 32px;
}
.hero-title .line {
  display: block; opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.8s forwards;
}
.hero-title .line:nth-child(1) { animation-delay: 0.2s; }
.hero-title .line:nth-child(2) { animation-delay: 0.4s; }
.hero-title .line:nth-child(3) { animation-delay: 0.6s; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.hero-subtitle {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--text-dim); max-width: 640px;
  margin-bottom: 48px;
  opacity: 0; animation: fadeUp 0.8s 0.8s forwards;
}
.hero-cta {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 80px;
  opacity: 0; animation: fadeUp 0.8s 1s forwards;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.2s, box-shadow 0.3s;
}
.btn-primary {
  background: var(--gradient); background-size: 200% 200%;
  color: white;
  box-shadow: 0 10px 40px rgba(255, 94, 58, 0.3);
  animation: gradShift 4s ease infinite;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 50px rgba(255, 94, 58, 0.5);
}
.btn-primary svg { transition: transform 0.2s; }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover {
  border-color: var(--text);
  background: rgba(255,255,255,0.06);
}
.btn-resume svg { transition: transform 0.2s; }
.btn-resume:hover svg { transform: translateY(3px); }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; max-width: 720px;
  opacity: 0; animation: fadeUp 0.8s 1.2s forwards;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 13px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.hero-scroll {
  position: absolute; bottom: 40px; right: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.2em;
  opacity: 0; animation: fadeUp 0.8s 1.4s forwards;
}
.scroll-line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, var(--text-mute), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.6; }
  50%      { transform: scaleY(1.3); opacity: 1; }
}

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

/* ---------- Section header ---------- */
.section-header {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 64px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent); font-size: 16px; font-weight: 500;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700; letter-spacing: -0.02em;
}

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 64px; align-items: start;
}
.about-text .lead {
  font-size: clamp(20px, 2vw, 28px);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500; line-height: 1.3; letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.about-text p {
  color: var(--text-dim); margin-bottom: 16px;
}
.about-text strong { color: var(--text); font-weight: 600; }
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.card-row:last-child { border-bottom: none; }
.card-row span { color: var(--text-mute); }
.card-row strong { font-weight: 600; }
.pulse {
  display: inline-block; width: 8px; height: 8px;
  background: #4ade80; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------- Timeline / Experience ---------- */
.timeline { display: flex; flex-direction: column; gap: 40px; }
.job {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 48px; padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s;
}
.job:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.job-period {
  display: flex; align-items: center; gap: 12px;
  padding-top: 8px;
}
.dot-marker {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 16px rgba(255, 94, 58, 0.6);
  flex-shrink: 0;
}
.period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text-dim);
}
.job-head { margin-bottom: 16px; }
.job-head h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.job-head .prev {
  font-size: 14px; color: var(--text-mute); font-weight: 400;
  font-family: 'JetBrains Mono', monospace;
}
.company {
  color: var(--accent); font-size: 15px; font-weight: 500;
}
.company em { color: var(--text-mute); font-style: normal; font-size: 13px; }
.job-points {
  display: flex; flex-direction: column; gap: 12px;
  color: var(--text-dim);
}
.job-points li {
  position: relative; padding-left: 20px; font-size: 15px;
}
.job-points li::before {
  content: '▸'; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: bold;
}
.job-points strong { color: var(--text); font-weight: 600; }
.sub-role { margin-top: 24px; padding-top: 24px; border-top: 1px dashed var(--border); }
.sub-role:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.sub-role h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px; font-weight: 600; margin-bottom: 12px;
  color: var(--text);
}
.sub-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text-mute); font-weight: 400;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s;
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient); opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}
.skill-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}
.skill-card > * { position: relative; z-index: 1; }
.skill-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  display: inline-block;
}
.skill-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
  color: var(--text-dim);
  transition: all 0.2s;
}
.chips span:hover {
  background: rgba(255, 94, 58, 0.1);
  border-color: var(--accent);
  color: var(--text);
}

/* ---------- Education ---------- */
.edu-card {
  display: flex; align-items: center; gap: 32px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.edu-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 56px; font-weight: 700; letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}
.edu-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 600; margin-bottom: 4px;
}
.edu-body p { color: var(--text-dim); font-size: 15px; }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 64px 48px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
  position: relative; overflow: hidden;
}
.contact-card::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 94, 58, 0.15), transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(94, 92, 255, 0.15), transparent 50%);
  z-index: 0;
}
.contact-card > * { position: relative; z-index: 1; }
.contact-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(24px, 3.5vw, 40px);
  line-height: 1.2; letter-spacing: -0.02em; font-weight: 700;
  margin-bottom: 48px;
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.contact-links {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; max-width: 800px; margin: 0 auto;
}
.contact-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
  text-align: left;
  white-space: nowrap;
}
.contact-link:hover {
  background: rgba(255, 94, 58, 0.06);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.contact-value {
  font-size: 15px; font-weight: 500;
  word-break: break-all;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-mute); flex-wrap: wrap; gap: 12px;
}

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s, transform 0.8s; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px); padding: 24px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
  }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .skills-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 16px; padding: 24px; }
  .contact-links { grid-template-columns: 1fr; }
  .edu-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .edu-year { font-size: 40px; }
  .section { padding: 80px 0; }
  .hero { padding: 100px 24px 60px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-scroll { display: none; }
}

@media (max-width: 480px) {
  .nav { padding: 16px 20px; }
  .container { padding: 0 20px; }
  .contact-card { padding: 40px 24px; }
}

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