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

:root {
  --accent: #b8860b;
  --accent-hover: #96690c;
  --text-on-accent: #18181b;

  --bg-body: #fafaf9;
  --text-body: #18181b;
  --bg-hero: #fafaf9;
  --text-hero-sub: #71717a;
  --bg-stats: #ffffff;

  --bg-card: #ffffff;
  --border-card: #e7e5e4;
  --shadow-card: rgba(0, 0, 0, 0.06);

  --bg-tag: #fbf1d9;
  --text-tag: #92660b;

  --text-meta: #71717a;

  --bg-input: #ffffff;
  --border-input: #000000;
  --text-input: #18181b;

  --text-social: #18181b;
}

[data-theme="dark"] {
  --accent: #d4af37;
  --accent-hover: #aa8c2c;
  --text-on-accent: #0c0c0c;

  --bg-body: #0c0c0c;
  --text-body: #fafaf9;
  --bg-hero: #0c0c0c;
  --text-hero-sub: #a1a1aa;
  --bg-stats: #171717;

  --bg-card: #171717;
  --border-card: #27272a;
  --shadow-card: rgba(0, 0, 0, 0.5);

  --bg-tag: #27272a;
  --text-tag: #d4af37;

  --text-meta: #a1a1aa;

  --bg-input: #171717;
  --border-input: #52525b;
  --text-input: #fafaf9;

  --text-social: #fafaf9;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text-body);
  line-height: 1.6;
  background: var(--bg-body);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
  z-index: 300;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s ease-out;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #111;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  font-weight: bold;
  font-size: 1.2rem;
}

.navbar nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navbar nav a {
  color: #fff;
  text-decoration: none;
}

.navbar nav a {
  position: relative;
  padding-bottom: 0.2rem;
  transition: color 0.2s ease;
}

.navbar nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.navbar nav a:hover {
  color: var(--accent);
}

.navbar nav a:hover::after,
.navbar nav a.active::after {
  width: 100%;
}

.navbar nav a.active {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle,
.nav-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.75rem;
  padding: 0.2rem;
  border: 1px solid #444;
  border-radius: 999px;
}

.lang-option {
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-option.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
}

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--bg-hero);
  padding: 2rem;
  transition: background-color 0.3s ease;
}

.hero > * {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-in 0.7s ease forwards;
}

.hero h1 { animation-delay: 0.05s; }
.hero p { animation-delay: 0.2s; }
.hero .hero-buttons { animation-delay: 0.35s; }

@keyframes hero-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-hero-sub);
}

.hero-buttons {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s ease;
}

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

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

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

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  padding: 2.5rem 2rem;
  background: var(--bg-stats);
  text-align: center;
  transition: background-color 0.3s ease;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-hero-sub);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

.project-grid .reveal:nth-child(1),
.timeline .reveal:nth-child(1),
.skills-list .reveal:nth-child(1),
.stats .reveal:nth-child(1) { transition-delay: 0s; }

.project-grid .reveal:nth-child(2),
.timeline .reveal:nth-child(2),
.skills-list .reveal:nth-child(2),
.stats .reveal:nth-child(2) { transition-delay: 0.1s; }

.project-grid .reveal:nth-child(3),
.timeline .reveal:nth-child(3),
.skills-list .reveal:nth-child(3),
.stats .reveal:nth-child(3) { transition-delay: 0.2s; }

.project-grid .reveal:nth-child(4),
.skills-list .reveal:nth-child(4),
.stats .reveal:nth-child(4) { transition-delay: 0.3s; }

.project-grid .reveal:nth-child(5),
.skills-list .reveal:nth-child(5),
.stats .reveal:nth-child(5) { transition-delay: 0.4s; }
.skills-list .reveal:nth-child(6) { transition-delay: 0.5s; }

.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section h2 {
  margin-bottom: 1.5rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.3rem;
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px var(--shadow-card);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.project-card h3 {
  margin-bottom: 0.5rem;
}

.project-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.tag-list li {
  background: var(--bg-tag);
  color: var(--text-tag);
  padding: 0.25rem 0.7rem;
  border-radius: 12px;
  font-size: 0.75rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.skills-group-title {
  font-size: 1rem;
  color: var(--text-hero-sub);
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}

.skills-group-title:first-of-type {
  margin-top: 1.5rem;
}

.skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.skills-group-title + .skills-list {
  margin-top: 0;
}

.skills-list li {
  background: var(--bg-tag);
  color: var(--text-tag);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.timeline {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.timeline-item h3 {
  margin-bottom: 0.2rem;
}

.timeline-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--text-meta);
  margin-bottom: 0.5rem;
}

.timeline-details {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 480px;
  margin-top: 1.5rem;
}

.contact-form label {
  font-size: 0.85rem;
  color: var(--text-hero-sub);
  margin-top: 0.6rem;
}

.contact-form input,
.contact-form textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 5px;
  padding: 0.6rem 0.8rem;
  color: var(--text-input);
  font-family: inherit;
  font-size: 0.95rem;
  transition: background-color 0.3s ease, border-color 0.2s ease, color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form button {
  align-self: flex-start;
  margin-top: 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.social-icons {
  display: flex;
  gap: 1.2rem;
  margin-top: 1rem;
}

.social-icons a {
  color: var(--text-social);
  display: inline-flex;
  transition: color 0.2s ease;
}

.social-icons a:hover {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: background 0.2s ease;
}

.back-to-top:hover {
  background: var(--accent-hover);
}

.back-to-top.visible {
  display: flex;
}

footer {
  text-align: center;
  padding: 1.5rem;
  background: #111;
  color: #aaa;
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .nav-toggle {
    display: block;
  }

  .navbar nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
  }

  .navbar nav.open {
    display: block;
  }

  .navbar nav ul {
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
  }
}