:root {
  --bg: #0f1115;
  --bg-elevated: #171a21;
  --text: #e9eaee;
  --text-muted: #9aa0ac;
  --accent: #7c9cff;
  --accent-soft: rgba(124, 156, 255, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --text: #1a1d24;
  --text-muted: #5b6270;
  --accent: #3b5bdb;
  --accent-soft: rgba(59, 91, 219, 0.1);
  --border: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb;
    --bg-elevated: #ffffff;
    --text: #1a1d24;
    --text-muted: #5b6270;
    --accent: #3b5bdb;
    --accent-soft: rgba(59, 91, 219, 0.1);
    --border: rgba(0, 0, 0, 0.08);
    --shadow: rgba(0, 0, 0, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, var(--accent-soft), transparent 40%),
    radial-gradient(circle at 85% 30%, var(--accent-soft), transparent 35%);
  pointer-events: none;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}

.toggle-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 10px;
}

.theme-toggle {
  position: static;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.lang-toggle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-photo {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 24px var(--shadow);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #fff;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  position: absolute;
  inset: 0;
}

.hero-text {
  flex: 1;
  min-width: 240px;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 44px);
  margin: 0 0 4px;
  font-weight: 600;
}

.role {
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 10px;
}

.tagline {
  color: var(--text-muted);
  margin: 0 0 16px;
  max-width: 480px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px 28px;
}

.contact-list-center {
  justify-content: center;
}

.contact-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.contact-line:hover {
  color: var(--accent);
  text-decoration: underline;
}

.contact-icon {
  flex-shrink: 0;
}

/* Section nav */
.section-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  position: sticky;
  top: 12px;
  z-index: 5;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  margin-bottom: 32px;
  box-shadow: 0 4px 16px var(--shadow);
}

.section-nav a {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.section-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  scroll-margin-top: 80px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: '';
  width: 6px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  display: inline-block;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-left: 4px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -24px;
  width: 1px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
}

.timeline-content {
  flex: 1;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.timeline-date {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-company {
  color: var(--accent);
  font-weight: 500;
  margin: 2px 0 8px;
  font-size: 14px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.timeline-content li {
  margin-bottom: 4px;
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.project-card {
  display: block;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.project-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.project-card p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.project-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.contact-card {
  text-align: center;
}


.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }
  .contact-list {
    grid-template-columns: 1fr;
    justify-content: center;
    justify-items: center;
  }
  .section-nav {
    overflow-x: auto;
  }
}

@media print {
  .toggle-stack, .section-nav { display: none; }
  .bg-decor { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
