/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #09090f;
  --bg2:        #0f0f1a;
  --bg3:        #141422;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);
  --text:       #e8e8f2;
  --text2:      #9090aa;
  --text3:      #5a5a72;
  --accent:     #7c6cff;
  --accent2:    #a78bfa;
  --accent3:    #c4b5fd;
  --green:      #34d399;
  --radius:     14px;
  --radius-lg:  20px;
}

/* ── Light Mode Variables ─────────────────────── */
[data-theme="light"] {
  --bg:      #f4f4f8;
  --bg2:     #ffffff;
  --bg3:     #eeeef4;
  --border:  rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.15);
  --text:    #111118;
  --text2:   #4a4a62;
  --text3:   #9090aa;
  --accent:  #6c5ce7;
  --accent2: #7c6cff;
  --accent3: #5a4ad1;
  --green:   #00a86b;
}

[data-theme="light"] body::before { opacity: 0.15; }

[data-theme="light"] nav {
  background: rgba(244, 244, 248, 0.85);
}

[data-theme="light"] .hero-name {
  background: linear-gradient(135deg, #111118 0%, #4a4a62 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .stat-number {
  background: linear-gradient(135deg, #111118, #6c5ce7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .contact-title {
  background: linear-gradient(135deg, #111118 0%, #6c5ce7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .nav-cta {
  color: #fff;
  background: #111118;
}

html {
  scroll-behavior: smooth;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Noise Texture Overlay ────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Layout ───────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

section { padding: 96px 0; }
section + section { border-top: 1px solid var(--border); }

/* ── Navigation ───────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 9, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo span { color: var(--accent2); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--bg);
  background: var(--text);
  padding: 8px 18px;
  border-radius: 8px;
  transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.85; }

/* ── Theme Toggle ─────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.theme-toggle:hover {
  border-color: var(--accent2);
  background: var(--bg2);
}

.theme-toggle-track {
  width: 28px;
  height: 16px;
  background: var(--border2);
  border-radius: 100px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

[data-theme="light"] .theme-toggle-track {
  background: var(--accent2);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text2);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}

[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(12px);
  background: #fff;
}

.theme-toggle-icon {
  display: flex;
  align-items: center;
  color: var(--text3);
  transition: color 0.2s, opacity 0.2s;
  line-height: 1;
}

.theme-icon-dark  { opacity: 1; }
.theme-icon-light { opacity: 0.4; }

[data-theme="light"] .theme-icon-dark  { opacity: 0.4; }
[data-theme="light"] .theme-icon-light { opacity: 1; color: var(--accent2); }

/* ── Hero ─────────────────────────────────────── */
#hero {
  padding: 160px 0 96px;
  border-top: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(124, 108, 255, 0.1);
  border: 1px solid rgba(124, 108, 255, 0.25);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

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

.hero-name {
  font-size: clamp(52px, 8vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e8e8f2 0%, #9090aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(22px, 3.5vw, 32px);
  font-style: italic;
  color: var(--accent3);
  margin-bottom: 28px;
  line-height: 1.2;
}

.hero-desc {
  font-size: 17px;
  color: var(--text2);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 44px;
}

.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #9b5de5);
  padding: 12px 24px;
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 24px rgba(124, 108, 255, 0.3);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  background: transparent;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  transition: all 0.2s;
}

.btn-secondary:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); }

/* ── Hero Layout ─────────────────────────────── */
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  align-items: center;
  margin-bottom: 0;
}

.hero-photo-wrap {
  flex-shrink: 0;
}

.hero-photo-ring {
  position: relative;
  width: 240px;
  height: 240px;
}

.hero-photo-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2), transparent 60%);
  z-index: 0;
}

.hero-photo-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(124,108,255,0.15), transparent 70%);
  z-index: 2;
  pointer-events: none;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 234px;
  height: 234px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin: 3px;
  display: block;

  /* ── Clarity / Sharpening Enhancement ── */
  filter:
    contrast(1.08)
    brightness(1.04)
    saturate(1.1)
    drop-shadow(0 8px 32px rgba(0,0,0,0.5));

  /* Crisp rendering */
  image-rendering: -webkit-optimize-contrast;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* ── Stats Strip ──────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 72px;
}

.stat {
  background: var(--bg2);
  padding: 28px 32px;
  transition: background 0.2s;
}

.stat:hover { background: var(--bg3); }

.stat-number {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text3);
  font-weight: 500;
}

/* ── Section Headers ──────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--text2);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 52px;
}

/* ── About ────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-text p strong { color: var(--text); font-weight: 600; }

.about-sidebar { display: flex; flex-direction: column; gap: 16px; }

.info-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.info-card:hover { border-color: var(--border2); }

.info-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}

.info-card-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.info-card-sub {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}

/* ── Experience ───────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  padding-top: 4px;
  line-height: 1.4;
}

.timeline-date .year {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.timeline-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(124, 108, 255, 0.1);
  border: 1px solid rgba(124, 108, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.timeline-company {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.timeline-desc {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 16px;
}

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

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ── Skills ───────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.skill-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.25s;
}

.skill-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.skill-card:hover::before { opacity: 1; }

.skill-icon {
  font-size: 28px;
  margin-bottom: 14px;
}

.skill-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.skill-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* ── Projects ─────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}

.project-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }

.project-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.06), rgba(167, 139, 250, 0.04));
  border-color: rgba(124, 108, 255, 0.2);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #9b5de5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.project-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}

.status-live { color: var(--green); background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.2); }
.status-building { color: var(--accent2); background: rgba(167, 139, 250, 0.1); border: 1px solid rgba(167, 139, 250, 0.2); }

.project-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.project-metric {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent3);
  background: rgba(124, 108, 255, 0.08);
  border-radius: 6px;
  padding: 6px 12px;
  display: inline-block;
}

/* ── Contact ──────────────────────────────────── */
.contact-wrapper {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124,108,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contact-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.contact-sub {
  font-size: 16px;
  color: var(--text2);
  margin-bottom: 40px;
  position: relative;
}

.contact-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border2);
  padding: 12px 22px;
  border-radius: 10px;
  transition: all 0.2s;
}

.contact-link:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); transform: translateY(-1px); }

/* ── Footer ───────────────────────────────────── */
footer {
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text3);
}

.footer-copy {
  font-size: 13px;
  color: var(--text3);
}

/* ── Scroll Indicator ─────────────────────────── */
.scroll-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 200;
  transition: width 0.1s;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .container { padding: 0 20px; }
  section { padding: 72px 0; }
  #hero { padding: 120px 0 72px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo-wrap { display: flex; justify-content: center; order: -1; }
  .hero-photo-ring { width: 180px; height: 180px; }
  .hero-photo { width: 174px; height: 174px; }
  .stats { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: span 1; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .contact-wrapper { padding: 40px 24px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

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