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

:root {
  --bg: #0a0a0b;
  --bg-raised: #111113;
  --bg-card: #16161a;
  --red: #d63031;
  --red-glow: #e6393a;
  --red-dim: #8b1a1a;
  --text: #e8e6e3;
  --text-dim: #7f8694;
  --text-bright: #ffffff;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Outfit', sans-serif;
  --border: #222228;
}

[data-theme="light"] {
  --bg: #f5f4f1;
  --bg-raised: #edecea;
  --bg-card: #ffffff;
  --red: #c0392b;
  --red-glow: #d63031;
  --red-dim: #e8c4c0;
  --text: #2d2d2d;
  --text-dim: #6b7280;
  --text-bright: #111111;
  --border: #ddd9d4;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

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

/* === NAV === */
nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
[data-theme="light"] nav {
  background: rgba(245, 244, 241, 0.85);
}
nav.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-family: var(--mono); font-weight: 700; font-size: 1.1rem;
  color: var(--text-bright); text-decoration: none;
}
.nav-logo span { color: var(--red); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim);
  text-decoration: none; text-transform: lowercase; transition: color 0.2s;
}
.nav-links a:hover { color: var(--red); }

/* === HERO === */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem; position: relative;
}
.hero::before {
  content: ''; position: absolute; top: -20%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--red-dim) 0%, transparent 70%);
  opacity: 0.15; pointer-events: none;
}
[data-theme="light"] .hero::before { opacity: 0.3; }
.hero-inner {
  max-width: 1100px; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.hero-text { z-index: 1; }
.hero-label {
  font-family: var(--mono); font-size: 0.8rem; color: var(--red);
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 1.5rem;
  opacity: 0; animation: fadeUp 0.6s ease 0.2s forwards;
}
.hero-title {
  font-family: var(--sans); font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 600; color: var(--text-bright); line-height: 1.15; margin-bottom: 1.5rem;
  opacity: 0; animation: fadeUp 0.6s ease 0.35s forwards;
}
.hero-title .accent { color: var(--red); }
.hero-desc {
  font-size: 1.1rem; color: var(--text-dim); max-width: 480px;
  margin-bottom: 2.5rem; font-weight: 300;
  opacity: 0; animation: fadeUp 0.6s ease 0.5s forwards;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--mono); font-size: 0.85rem; padding: 0.85rem 1.75rem;
  background: var(--red); color: white; text-decoration: none; border-radius: 4px;
  transition: all 0.25s; opacity: 0; animation: fadeUp 0.6s ease 0.65s forwards;
}
.hero-cta:hover {
  background: var(--red-glow);
  box-shadow: 0 0 30px rgba(214, 48, 49, 0.3); transform: translateY(-1px);
}
.hero-cta svg { transition: transform 0.2s; }
.hero-cta:hover svg { transform: translateX(3px); }
.hero-image {
  display: flex; justify-content: center; align-items: center;
  opacity: 0; animation: fadeIn 0.8s ease 0.4s forwards;
}
.hero-image img {
  width: 340px; max-width: 100%;
  filter: drop-shadow(0 0 60px rgba(214, 48, 49, 0.2)); transition: transform 0.4s ease;
}
[data-theme="light"] .hero-image img {
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.15));
}
.hero-image img:hover { transform: scale(1.03) rotate(1deg); }

/* === SECTIONS === */
section { padding: 6rem 2rem; max-width: 1100px; margin: 0 auto; }
.section-label {
  font-family: var(--mono); font-size: 0.75rem; color: var(--red);
  text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 0.75rem;
}
.section-title { font-size: 2rem; font-weight: 600; color: var(--text-bright); margin-bottom: 3rem; }
.divider { border: none; height: 1px; background: var(--border); max-width: 1100px; margin: 0 auto; }

/* === ABOUT === */
.about-inner {
  display: grid; grid-template-columns: 1fr auto; gap: 4rem; align-items: start;
}
.about-image {
  display: flex; justify-content: center; align-items: start;
}
.about-image img {
  width: 280px; max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  transition: transform 0.4s ease;
}
.about-image img:hover { transform: scale(1.02); }
.about-content { max-width: 640px; }
.about-content p {
  font-size: 1.05rem; font-weight: 300; color: var(--text-dim);
  margin-bottom: 1.25rem; line-height: 1.75;
}
.about-content p:last-child { margin-bottom: 0; }
.about-content strong { color: var(--text); font-weight: 500; }

/* === PROJECTS === */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.project-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
  padding: 2rem; transition: all 0.3s ease; position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--red), transparent); opacity: 0; transition: opacity 0.3s;
}
.project-card[data-href] { cursor: pointer; }
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  border-color: var(--red-dim); transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
[data-theme="light"] .project-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.project-year { font-family: var(--mono); font-size: 0.7rem; color: var(--red); margin-bottom: 0.75rem; }
.project-card h3 { font-size: 1.15rem; font-weight: 600; color: var(--text-bright); margin-bottom: 0.75rem; }
.project-card p { font-size: 0.9rem; color: var(--text-dim); font-weight: 300; line-height: 1.6; margin-bottom: 1.25rem; }
.project-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-stack span {
  font-family: var(--mono); font-size: 0.65rem; padding: 0.2rem 0.5rem;
  background: var(--bg); border-radius: 2px; color: var(--text-dim);
}
.project-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--red);
  text-decoration: none; margin-top: 1rem; transition: gap 0.2s;
}
.project-link:hover { gap: 0.7rem; }

/* === CONTACT === */
.contact-section { text-align: center; padding: 8rem 2rem; }
.contact-section .section-title { margin-bottom: 1rem; }
.contact-desc {
  color: var(--text-dim); font-weight: 300; font-size: 1.05rem;
  margin-bottom: 2.5rem; max-width: 500px; margin-left: auto; margin-right: auto;
}
.contact-email {
  font-family: var(--mono); font-size: 1.2rem; color: var(--red);
  text-decoration: none; padding: 1rem 2.5rem; border: 1px solid var(--red-dim);
  border-radius: 4px; display: inline-block; transition: all 0.3s;
}
.contact-email:hover {
  background: var(--red); color: white;
  box-shadow: 0 0 30px rgba(214, 48, 49, 0.3);
}
.contact-links { margin-top: 2rem; display: flex; justify-content: center; gap: 1.5rem; }
.contact-links a {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim);
  text-decoration: none; transition: color 0.2s;
}
.contact-links a:hover { color: var(--text); }

/* === LEGAL PAGES === */
.legal-page {
  padding: 8rem 2rem 4rem;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
}

.legal-page h1 {
  font-size: 2rem; font-weight: 600; color: var(--text-bright); margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.15rem; font-weight: 600; color: var(--text-bright);
  margin-top: 2rem; margin-bottom: 0.75rem;
}

.legal-page p, .legal-page li {
  font-size: 0.95rem; font-weight: 300; color: var(--text-dim); line-height: 1.75;
  margin-bottom: 0.75rem;
}

.legal-page ul { padding-left: 1.25rem; margin-bottom: 1rem; }

.legal-page a { color: var(--red); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }

.legal-back {
  font-family: var(--mono); font-size: 0.8rem; color: var(--red);
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
  margin-bottom: 2rem; transition: gap 0.2s;
}
.legal-back:hover { gap: 0.7rem; }

/* === FOOTER === */
footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
}

.footer-right {
  display: flex; align-items: center; gap: 1.5rem;
}

.footer-right a {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
  text-decoration: none; transition: color 0.2s;
}
.footer-right a:hover { color: var(--text); }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 3px;
  padding: 0.25rem 0.5rem; cursor: pointer; font-size: 0.8rem;
  line-height: 1; transition: all 0.2s; color: var(--text-dim);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-dim); }

.lang-toggle {
  display: flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden;
}
.lang-btn {
  font-family: var(--mono); font-size: 0.65rem; padding: 0.25rem 0.5rem;
  background: transparent; color: var(--text-dim); border: none; cursor: pointer; transition: all 0.2s;
}
.lang-btn.active { background: var(--red); color: white; }
.lang-btn:not(.active):hover { color: var(--text); }

/* === ANIMATIONS === */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  nav { padding: 0.75rem 1.25rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.7rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-image { order: -1; }
  .hero-image img { width: 220px; }
  section { padding: 4rem 1.25rem; }
  .about-inner { grid-template-columns: 1fr; }
  .about-image { order: -1; }
  .about-image img { width: 220px; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-section { padding: 5rem 1.25rem; }
  footer { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) { .nav-links { display: none; } }
