/* ---------- tokens ---------- */
:root{
  --bg: #ffffff;
  --bg-elevated: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e4e4e7;
  --text: #18181b;
  --text-muted: #52525b;
  --text-faint: #71717a;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #ede9fe;
  --on-accent: #ffffff;
  --header-bg: rgba(255,255,255,.75);
  --danger: #ff5f57;
  --warn: #febc2e;
  --ok: #28c840;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 20px 45px -20px rgba(24,24,27,.18);
  --card-shadow: 0 1px 2px rgba(24,24,27,.04), 0 1px 3px rgba(24,24,27,.06);
  --maxw: 1120px;
  --font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"]{
  --bg: #27272a;
  --bg-elevated: #1c1c1f;
  --surface: #333338;
  --surface-2: #3f3f46;
  --border: #4b4b53;
  --text: #fafafa;
  --text-muted: #d4d4d8;
  --text-faint: #a1a1aa;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, .16);
  --on-accent: #1e1523;
  --header-bg: rgba(39,39,42,.75);
  --shadow: 0 20px 50px -20px rgba(0,0,0,.65);
  --card-shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px -4px rgba(0,0,0,.35);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

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

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a{ color: inherit; text-decoration: none; }

h1, h2, h3{ margin: 0; font-weight: 700; letter-spacing: -0.01em; }

p{ margin: 0; }

ul{ margin: 0; padding: 0; list-style: none; }

.accent{ color: var(--accent); }
.dim{ color: var(--text-muted); font-weight: 400; }

/* faint background grid + noise */
.noise-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(124,58,237,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent 70%);
}

/* ---------- header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

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

.logo{
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.main-nav{
  display: flex;
  gap: 28px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-link{
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
  transition: color .2s ease;
}
.nav-link::before{ content: "./"; opacity: 0; color: var(--accent); transition: opacity .2s ease; }
.nav-link:hover{ color: var(--text); }
.nav-link:hover::before{ opacity: 1; }
.nav-link.active{ color: var(--accent); }
.nav-link.active::before{ opacity: 1; }

/* language switch */
.lang-switch{
  display: flex;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
}
.lang-btn{
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.lang-btn:hover{ color: var(--text); }
.lang-btn[aria-pressed="true"]{ background: var(--accent); color: var(--on-accent); }
.lang-btn[aria-pressed="true"]:hover{ color: var(--on-accent); }

.lang-switch-desktop{ margin-left: 20px; }

/* theme switch */
.theme-toggle{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, transform .15s ease;
}
.theme-toggle:hover{ border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle .icon-sun{ display: none; }
.theme-toggle .icon-moon{ display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-sun{ display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon{ display: none; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span{
  display: block;
  height: 2px;
  width: 16px;
  margin: 0 auto;
  background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity: 0; }
.nav-toggle.open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover{ transform: translateY(-1px); }

.btn-primary{
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover{ background: var(--accent-hover); }

.btn-outline{
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.btn-outline:hover{ border-color: var(--accent); color: var(--accent); }

.btn-ghost{
  border-color: var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 9px 16px;
}
.btn-ghost:hover{ color: var(--accent); border-color: var(--accent); }

/* ---------- hero ---------- */
.hero{
  position: relative;
  z-index: 1;
  padding: 96px 0 88px;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.eyebrow .dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(40,200,64,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(40,200,64,.5); }
  70%{ box-shadow: 0 0 0 8px rgba(40,200,64,0); }
  100%{ box-shadow: 0 0 0 0 rgba(40,200,64,0); }
}

.hero-text h1{
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  margin-bottom: 12px;
}

.hero-role{
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-lede{
  color: var(--text-muted);
  font-size: 16px;
  max-width: 52ch;
  margin-bottom: 32px;
}

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

.hero-meta{
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-faint);
}

/* photo window */
.photo-window{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-titlebar{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.terminal-titlebar .dot{ width: 11px; height: 11px; border-radius: 50%; }
.terminal-titlebar .dot.red{ background: var(--danger); }
.terminal-titlebar .dot.yellow{ background: var(--warn); }
.terminal-titlebar .dot.green{ background: var(--ok); }
.terminal-title{
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.photo-body{
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.photo-body img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.03);
}
.photo-body::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,14,20,0) 55%, rgba(10,14,20,.55) 100%);
  pointer-events: none;
}
.photo-corner{
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  opacity: .85;
  pointer-events: none;
}
.photo-corner.tl{ top: 14px; left: 14px; border-right: none; border-bottom: none; }
.photo-corner.tr{ top: 14px; right: 14px; border-left: none; border-bottom: none; }
.photo-corner.bl{ bottom: 14px; left: 14px; border-right: none; border-top: none; }
.photo-corner.br{ bottom: 14px; right: 14px; border-left: none; border-top: none; }

/* ---------- sections ---------- */
.section{
  position: relative;
  z-index: 1;
  padding: 100px 0;
}
.section-alt{ background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-kicker{
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  margin-bottom: 10px;
}

.section-title{
  font-size: clamp(26px, 3.4vw, 34px);
  margin-bottom: 48px;
}

.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in-view{ opacity: 1; transform: translateY(0); }

/* about */
.about-grid{
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 56px;
  align-items: start;
}
.about-text p{ color: var(--text-muted); margin-bottom: 18px; }
.about-text p:last-child{ margin-bottom: 0; }

.stat-cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--card-shadow);
  transition: border-color .2s ease, transform .2s ease;
}
.stat-card:hover{ border-color: var(--accent); transform: translateY(-2px); }
.stat-num{
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat-label{
  font-size: 12.5px;
  color: var(--text-muted);
}

/* skills */
.skills-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.skill-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: border-color .2s ease, transform .2s ease;
}
.skill-card:hover{ border-color: var(--accent); transform: translateY(-2px); }
.skill-card h3{
  font-size: 14px;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.tag-row{ display: flex; flex-wrap: wrap; gap: 8px; }
.tag{
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
}
.tag-strong{ color: var(--accent); border-color: rgba(124,58,237,.3); background: var(--accent-soft); }
.tag-row.small .tag{ font-size: 11.5px; padding: 4px 9px; }

.lang-row{ flex-direction: column; gap: 12px; }
.lang-item{ font-size: 13.5px; color: var(--text); }
.lang-item em{ color: var(--text-faint); font-style: normal; }

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

.timeline-item{ position: relative; margin-bottom: 40px; }
.timeline-item:last-child{ margin-bottom: 0; }

.timeline-dot{
  position: absolute;
  left: -33px;
  top: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-item-compact .timeline-dot{ border-color: var(--text-faint); }

.timeline-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--card-shadow);
  transition: border-color .2s ease;
}
.timeline-card:hover{ border-color: var(--accent); }

.timeline-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.timeline-head h3{ font-size: 16.5px; margin-bottom: 4px; }
.company{ font-size: 13.5px; color: var(--accent); }

.period{
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

.role-desc{ color: var(--text-muted); font-size: 14px; margin-bottom: 14px; }

.role-points{ margin-bottom: 16px; }
.role-points li{
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.role-points li::before{
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.role-points li:last-child{ margin-bottom: 0; }

/* two column (education / certs) */
.two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.edu-list{ display: flex; flex-direction: column; gap: 22px; }
.edu-item{
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
}
.edu-item h3{ font-size: 15px; margin-bottom: 6px; }
.edu-degree{ font-size: 13.5px; color: var(--text-muted); margin-bottom: 8px; }
.edu-item .period{ padding: 4px 10px; }

.cert-list{ display: flex; flex-direction: column; gap: 4px; }
.cert-list li{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 14px 4px;
  border-bottom: 1px dashed var(--border);
}
.cert-list li:last-child{ border-bottom: none; }
.cert-icon{ color: var(--accent); font-size: 14px; }

/* contact */
.contact-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--card-shadow);
}
.contact-lede{ color: var(--text-muted); max-width: 60ch; margin-bottom: 32px; font-size: 15px; }

.contact-links{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.contact-link{
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s ease, transform .2s ease;
}
a.contact-link:hover{ border-color: var(--accent); transform: translateY(-2px); }
.contact-link-static{ cursor: default; }
.contact-label{ font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.contact-value{ font-size: 14.5px; color: var(--text); word-break: break-word; }

/* footer */
.site-footer{
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner{
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* back to top */
.back-to-top{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 40;
}
.back-to-top.visible{ opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover{ background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- responsive ---------- */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .about-grid{ grid-template-columns: 1fr; }
  .stat-cards{ grid-template-columns: repeat(4, 1fr); }
  .skills-grid{ grid-template-columns: repeat(2, 1fr); }
  .two-col{ grid-template-columns: 1fr; gap: 48px; }
  .contact-links{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .main-nav{
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }
  .main-nav.open{ display: flex; }
  .nav-link{ padding: 12px 0; border-bottom: 1px dashed var(--border); }
  .nav-link:last-child{ border-bottom: none; }
  .nav-toggle{ display: flex; }
  .lang-switch-desktop{ margin-left: 12px; }
  .stat-cards{ grid-template-columns: 1fr 1fr; }
  .skills-grid{ grid-template-columns: 1fr; }
  .contact-card{ padding: 28px 22px; }
  .section{ padding: 72px 0; }
  .hero{ padding: 64px 0 56px; }
}
