:root {
  --bg: #0b0f14;
  --bg-alt: #0f151c;
  --surface: #131a22;
  --surface-hover: #17202b;
  --border: #232d38;
  --text: #e6edf3;
  --text-dim: #8b98a5;
  --text-faint: #5b6773;
  --accent: #5eead4;
  --accent-dim: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --gold: #f5c451;
  --radius: 14px;
  --maxw: 1080px;
  --font-head: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(94,234,212,0.07), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(245,196,81,0.05), transparent 40%);
}

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

::selection { background: var(--accent); color: #0b0f14; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* NAV */
#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.75);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}
.logo .dot { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.cv-btn {
  padding: 8px 16px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  color: var(--accent) !important;
  font-family: var(--font-mono);
  font-size: 0.82rem !important;
}
.cv-btn:hover { background: var(--accent-soft); }

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

/* LANGUAGE SWITCHER */
.lang { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.lang-btn:hover,
.lang-btn[aria-expanded="true"] { border-color: var(--accent-dim); }
.lang-btn .chev { color: var(--text-dim); transition: transform 0.2s; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.flag {
  display: inline-flex;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}
.flag svg { width: 100%; height: 100%; display: block; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  list-style: none;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.6);
  z-index: 60;
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.lang-menu button:hover,
.lang-menu button:focus-visible { background: var(--surface-hover); color: var(--text); outline: none; }
.lang-menu button[aria-current="true"] { color: var(--accent); }

#navToggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
#navToggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* HERO */
.hero {
  position: relative;
  z-index: 1;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.blink { animation: blink 1.8s infinite; font-size: 0.6rem; }
@keyframes blink { 50% { opacity: 0.2; } }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.highlight {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-role {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 1.15rem;
  margin: 16px 0 20px;
  min-height: 1.6em;
}
.cursor { color: var(--accent); animation: blink 1s infinite; }

.hero-desc {
  color: var(--text-dim);
  max-width: 46ch;
  font-size: 1rem;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.btn {
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  display: inline-block;
}
.btn-primary {
  background: var(--accent);
  color: #06110e;
}
.btn-primary:hover { background: var(--gold); transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-links {
  display: flex;
  gap: 18px;
}
.hero-links a {
  color: var(--text-dim);
  transition: color 0.2s, transform 0.2s;
}
.hero-links a:hover { color: var(--accent); transform: translateY(-2px); }

.hero-photo {
  position: relative;
  display: flex;
  justify-content: center;
}
.photo-frame {
  width: min(280px, 80%);
  aspect-ratio: 4/5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  box-shadow: 0 0 0 1px rgba(94,234,212,0.08), 0 20px 60px -20px rgba(94,234,212,0.25);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(15%) contrast(1.05);
}
.photo-tag {
  position: absolute;
  bottom: -14px;
  right: 8%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin: 0 auto;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.scroll-hint span {
  width: 1px;
  height: 24px;
  background: linear-gradient(var(--text-faint), transparent);
  display: block;
}

/* SECTIONS */
.section {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px 24px;
  border-top: 1px solid var(--border);
}
.section-label {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
}
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: start;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
}
.stat-label { font-size: 0.82rem; color: var(--text-faint); }

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s, transform 0.2s;
}
.skill-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }
.skill-card-wide { grid-column: 1 / -1; }
.skill-card h3 {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 6px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

/* PROJECTS */
.project-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 22px;
  transition: border-color 0.25s, transform 0.25s;
}
.project-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
}
.project-card.reverse { grid-template-columns: 1fr 1.1fr; }
.project-card.reverse .project-media { order: 2; }
.project-media {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.5s ease;
}
.project-card:hover .project-media img { transform: scale(1.03); }
.project-info p.project-role { color: var(--text); font-size: 0.92rem; }

.case {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
}
.case summary {
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.case summary::-webkit-details-marker { display: none; }
.case summary::before {
  content: '+';
  width: 14px;
  text-align: center;
  transition: transform 0.2s;
}
.case[open] summary::before { content: '−'; }
.case dl { padding: 0 14px 14px 36px; }
.case dt {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 10px;
}
.case dt:first-child { margin-top: 0; }
.case dd { color: var(--text-dim); font-size: 0.9rem; margin-top: 2px; }
.project-role strong { color: var(--accent); font-weight: 600; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
  display: block;
  margin-bottom: 10px;
}
.project-info h3 { font-size: 1.5rem; margin-bottom: 10px; }
.project-info p { color: var(--text-dim); margin-bottom: 18px; max-width: 65ch; }
.project-info .chips { margin-bottom: 20px; }
.project-links { display: flex; gap: 22px; flex-wrap: wrap; }
.project-links a {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.project-links a:hover { border-color: var(--accent); }

/* TIMELINE */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}
.timeline-item h3 { margin: 6px 0 2px; font-size: 1.15rem; }
.timeline-sub { color: var(--accent-dim); font-size: 0.9rem; margin-bottom: 8px; }
.timeline-item p:not(.timeline-sub) { color: var(--text-dim); font-size: 0.95rem; }

/* CONTACT */
.contact-section { text-align: center; }
.contact-section h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  max-width: 20ch;
  margin: 0 auto 16px;
}
.contact-desc {
  color: var(--text-dim);
  max-width: 50ch;
  margin: 0 auto 44px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, transform 0.2s;
}
.contact-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contact-value { font-size: 0.88rem; word-break: break-word; }

footer {
  text-align: center;
  padding: 36px 24px;
  color: var(--text-faint);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* RESPONSIVE */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { order: -1; margin-bottom: 12px; }
  .photo-frame { width: 200px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .project-card,
  .project-card.reverse { grid-template-columns: 1fr; gap: 24px; padding: 20px; }
  .project-card.reverse .project-media { order: 0; }

  #navToggle { display: flex; }
  .nav-right { gap: 12px; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
