:root {
  --bg: #FAF8F5;
  --bg-alt: #F0EDE8;
  --text: #1A1A1A;
  --text-muted: #6B6560;
  --accent: #C8102E;
  --accent-soft: rgba(200,16,46,0.08);
  --border: #E0DBD4;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --max-w: 960px;
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--accent); color: white; }

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Language Toggle */
.lang-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  gap: 2px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.lang-toggle a {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.lang-toggle a.active {
  background: var(--accent);
  color: white;
}

/* Navigation */
nav {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  display: flex;
  gap: 2px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
nav a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s;
  letter-spacing: 0.03em;
}
nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 40px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.hero-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  image-rendering: pixelated;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.1s;
}
.hero-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.2s;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.1;
  font-weight: 400;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.4s;
}
.hero h1 em {
  color: var(--accent);
  font-style: italic;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.6s;
}
.hero-meta {
  margin-top: 48px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.8s;
}
.hero-meta a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
}
.hero-meta a:hover { border-color: var(--accent); color: var(--accent); }

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 1.2s;
}
.scroll-hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 10px auto 0;
  animation: pulse 2s ease infinite;
}

/* Sections */
section {
  padding: 100px 40px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
section h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 48px;
  line-height: 1.2;
}

/* Divider */
.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}
.divider hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 20px;
}
.about-facts {
  display: grid;
  gap: 20px;
}
.fact {
  padding: 20px 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fact-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.fact-value {
  font-weight: 600;
  font-size: 15px;
}

/* Timeline */
.timeline { position: relative; }
.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.timeline-item:first-child { border-top: 1px solid var(--border); }
.timeline-item:hover { background: var(--accent-soft); margin: 0 -20px; padding: 32px 20px; border-radius: 12px; }
.timeline-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 4px;
}
.timeline-content h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-org {
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 10px;
}
.timeline-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}
.timeline-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 4px;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.skill-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s;
}
.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.skill-icon {
  font-size: 28px;
  margin-bottom: 16px;
}
.skill-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.skill-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.project-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}
.project-card:hover::before { transform: scaleX(1); }
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.project-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}
.project-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.project-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  background: var(--bg-alt);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Education */
.edu-grid {
  display: grid;
  gap: 16px;
}
.edu-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.edu-item:first-child { border-top: 1px solid var(--border); }
.edu-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 2px;
}
.edu-content h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.edu-content p { font-size: 14px; color: var(--text-muted); }

/* Awards */
.award-banner {
  background: var(--accent);
  color: white;
  border-radius: 16px;
  padding: 40px 48px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
}
.award-icon { font-size: 40px; }
.award-text h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.award-text p { font-size: 14px; opacity: 0.85; }

/* Footer */
footer {
  padding: 60px 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}
footer h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 24px;
}
footer p {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 17px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}
.footer-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.footer-copy {
  margin-top: 64px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  nav { display: none; }
  .lang-toggle { top: 16px; right: 16px; }
  .hero { padding: 100px 24px 60px; }
  section { padding: 60px 24px; }
  .divider { padding: 0 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .edu-item { grid-template-columns: 1fr; gap: 4px; }
  .projects-grid { grid-template-columns: 1fr; }
  .award-banner { flex-direction: column; text-align: center; padding: 32px 24px; }
}

/* Print */
@media print {
  body { font-size: 12px; line-height: 1.5; background: white; }
  .lang-toggle, nav, .scroll-hint, .skip-link { display: none !important; }
  .hero { min-height: auto; padding: 20px 0; }
  section { padding: 24px 0; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-label, .hero h1, .hero-sub, .hero-meta, .hero-logo { opacity: 1 !important; animation: none !important; }
  .timeline-item:hover { background: none; margin: 0; padding: 32px 0; }
  .skill-card:hover, .project-card:hover { transform: none; box-shadow: none; }
  .project-card::before { display: none; }
  .award-banner { background: white; color: var(--text); border: 2px solid var(--accent); }
  .award-text p { opacity: 1; color: var(--text-muted); }
  a { color: var(--text); }
  .footer-links a { border-color: var(--text-muted); }
  hr { border-color: #ccc; }
}
