/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Martian+Mono:wght@400;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --rust: #A64426;
  --orange: #DB6532;
  --charcoal: #56494E;
  --silver: #A29C9B;
  --brown: #52271D;
  --cream: #FAF5F0;

  --bg-primary: #FAF5F0;
  --bg-secondary: #F3ECE4;
  --bg-card: #FFFFFF;
  --text-primary: #3B2F2F;
  --text-secondary: #56494E;
  --text-muted: #A29C9B;
  --border: #DB6532;
  --shadow: rgba(82, 39, 29, 0.1);
  --shadow-hover: rgba(82, 39, 29, 0.2);
  --nav-bg: rgba(250, 245, 240, 0.92);
  --accent: #A64426;
  --accent-hover: #DB6532;
  --tag-bg: #F3ECE4;
  --tag-text: #56494E;
  --wave-fill: #F3ECE4;
  --toggle-bg: #DB6532;
  --toggle-icon: #FAF5F0;
  --scrolltop-bg: #52271D;
  --scrolltop-color: #FAF5F0;
  --hero-gradient: linear-gradient(135deg, #FAF5F0 0%, #F3ECE4 40%, #e8d5c4 100%);
  --section-alt-bg: #F3ECE4;
  --timeline-line: #DB6532;
  --timeline-dot: #A64426;
  --link-color: #A64426;
  --link-hover: #DB6532;
  --lang-active-bg: #A64426;
  --lang-active-color: #FAF5F0;
  --lang-inactive-color: #56494E;
}

[data-theme="dark"] {
  --bg-primary: #2B2125;
  --bg-secondary: #36292E;
  --bg-card: #3D3035;
  --text-primary: #F0E8DC;
  --text-secondary: #DB6532;
  --text-muted: #A29C9B;
  --border: #52271D;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(43, 33, 37, 0.95);
  --accent: #DB6532;
  --accent-hover: #e8845a;
  --tag-bg: #52271D;
  --tag-text: #DB6532;
  --wave-fill: #36292E;
  --toggle-bg: #52271D;
  --toggle-icon: #DB6532;
  --scrolltop-bg: #DB6532;
  --scrolltop-color: #2B2125;
  --hero-gradient: linear-gradient(135deg, #2B2125 0%, #36292E 40%, #52271D 100%);
  --section-alt-bg: #36292E;
  --timeline-line: #52271D;
  --timeline-dot: #DB6532;
  --link-color: #DB6532;
  --link-hover: #e8845a;
  --lang-active-bg: #DB6532;
  --lang-active-color: #2B2125;
  --lang-inactive-color: #A29C9B;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Martian Mono', monospace;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.7; overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Martian Mono', monospace; font-weight: 700; line-height: 1.3; }
a { color: var(--link-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; height: auto; }

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border); padding: 0.8rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav-logo {
  font-family: 'Martian Mono', monospace; font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem;
}
.nav-logo:hover { color: var(--text-primary); }
.nav-logo svg { width: 36px; height: 36px; }
.nav-links { display: flex; align-items: center; gap: 1rem; list-style: none; }
.nav-links a {
  color: var(--text-secondary); font-weight: 600; font-size: 0.8rem;
  padding: 0.4rem 0.8rem; border-radius: 12px; transition: all 0.3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); background: var(--tag-bg); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Language Toggle */
.lang-toggle { display: flex; border-radius: 20px; overflow: hidden; border: 2px solid var(--border); }
.lang-btn {
  background: transparent; color: var(--lang-inactive-color); border: none; cursor: pointer;
  padding: 0.3rem 0.6rem; font-family: 'Martian Mono', monospace;
  font-size: 0.65rem; font-weight: 600; transition: all 0.3s ease;
}
.lang-btn.active { background: var(--lang-active-bg); color: var(--lang-active-color); }

/* Theme Toggle */
.theme-toggle {
  background: var(--toggle-bg); border: none; cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s ease; overflow: hidden;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.1); }
.theme-toggle svg { width: 22px; height: 22px; fill: var(--toggle-icon); transition: fill 0.4s ease; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 0.5rem; }
.hamburger span { display: block; width: 26px; height: 3px; background: var(--text-primary); border-radius: 3px; transition: all 0.3s ease; }

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh; background: var(--hero-gradient);
  display: flex; align-items: center; justify-content: center;
  padding: 8rem 2rem 4rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; width: 400px; height: 400px;
  background: var(--orange); opacity: 0.1;
  border-radius: 50% 40% 60% 50%; top: 10%; right: -100px;
  animation: float 8s ease-in-out infinite;
}
.hero::after {
  content: ''; position: absolute; width: 300px; height: 300px;
  background: var(--rust); opacity: 0.08;
  border-radius: 40% 50% 50% 60%; bottom: 10%; left: -80px;
  animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}
.hero-content { max-width: 900px; text-align: center; z-index: 1; position: relative; }
.hero-photo-wrapper {
  position: relative; display: inline-block; margin-bottom: 1.5rem;
}
.hero-photo-wrapper::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px dashed var(--orange); animation: spin-slow 36s linear infinite;
}
.hero-photo-wrapper::after {
  content: ''; position: absolute; inset: -18px; border-radius: 50%;
  border: 2px dotted var(--rust); opacity: 0.5; animation: spin-slow 60s linear infinite reverse;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.hero-photo {
  width: 180px; height: 180px; border-radius: 50%;
  object-fit: cover; border: 4px solid var(--orange);
  box-shadow: 0 8px 30px var(--shadow); display: block;
}
.hero-title { font-size: 2.2rem; color: var(--text-primary); margin-bottom: 0.3rem; }
.hero-subtitle { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 1rem; }
.hero-contact {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.hero-contact a, .hero-contact span {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--text-secondary); font-size: 0.82rem;
}
.hero-contact a:hover { color: var(--accent); }
.hero-contact svg { width: 20px; height: 20px; fill: currentColor; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--rust); color: #FAF5F0;
  padding: 0.9rem 2rem; border-radius: 50px;
  font-family: 'Martian Mono', monospace; font-size: 0.82rem; font-weight: 600;
  transition: all 0.3s ease; box-shadow: 0 4px 15px var(--shadow); margin-top: 0.5rem;
}
.hero-cta:hover {
  background: var(--brown); color: #FAF5F0;
  transform: translateY(-2px); box-shadow: 0 6px 20px var(--shadow-hover);
}
.hero-cta svg { width: 20px; height: 20px; fill: currentColor; }

/* ===== WAVE DIVIDER ===== */
.wave-divider { width: 100%; line-height: 0; overflow: hidden; }
.wave-divider svg { width: 100%; height: 80px; display: block; }
.wave-divider .wave-fill { fill: var(--wave-fill); transition: fill 0.4s ease; }
.wave-divider-flip { transform: scaleY(-1); }

/* ===== SECTIONS ===== */
.section { padding: 5rem 2rem; max-width: 1000px; margin: 0 auto; }
.section-alt { background: var(--section-alt-bg); transition: background 0.4s ease; }
.section-title {
  font-size: 1.4rem; color: var(--text-primary);
  margin-bottom: 2.5rem; text-align: center;
}
.section-title::after {
  content: ''; display: block; width: 60px; height: 4px;
  background: var(--accent); border-radius: 4px; margin: 0.6rem auto 0;
}

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 3px; background: var(--timeline-line); border-radius: 3px;
}
.timeline-item { position: relative; margin-bottom: 2.5rem; padding-bottom: 0.5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -2.5rem; top: 6px;
  width: 18px; height: 18px; background: var(--timeline-dot);
  border-radius: 50%; border: 3px solid var(--bg-primary); z-index: 1;
}
.timeline-header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.timeline-title { font-size: 0.95rem; color: var(--text-primary); }
.timeline-date {
  font-size: 0.72rem; color: var(--text-muted); background: var(--tag-bg);
  padding: 0.2rem 0.7rem; border-radius: 20px;
}
.timeline-company { font-size: 0.82rem; color: var(--accent); margin-bottom: 0.5rem; }
.timeline-desc { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 0.5rem; }
.timeline-tasks { list-style: none; padding: 0; }
.timeline-tasks li {
  position: relative; padding-left: 1.3rem;
  color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 0.3rem;
}
.timeline-tasks li::before { content: '▸'; position: absolute; left: 0; color: var(--orange); }

/* ===== INFO GRID ===== */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.info-card {
  background: var(--bg-card); border-radius: 16px; padding: 1.5rem;
  box-shadow: 0 4px 15px var(--shadow);
}
.info-card h3 {
  font-size: 0.95rem; margin-bottom: 1rem; color: var(--text-primary);
  display: flex; align-items: center; gap: 0.5rem;
}
.info-card h3 svg { width: 22px; height: 22px; fill: var(--accent); }
.info-list { list-style: none; padding: 0; }
.info-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0; border-bottom: 1px solid var(--tag-bg);
  font-size: 0.82rem; color: var(--text-secondary);
}
.info-list li:last-child { border-bottom: none; }
.info-list .level {
  font-size: 0.7rem; background: var(--tag-bg); color: var(--tag-text);
  padding: 0.15rem 0.5rem; border-radius: 10px;
}
.hobby-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hobby-tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--tag-bg); color: var(--tag-text);
  padding: 0.4rem 0.8rem; border-radius: 12px; font-size: 0.78rem;
}

/* ===== PROJECTS GRID ===== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.8rem; }
.project-card {
  background: var(--bg-card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  display: flex; flex-direction: column; border: 2px solid transparent;
  transition: all 0.4s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 12px 35px var(--shadow-hover); border-color: var(--accent); }
.project-card-thumb {
  width: 100%; height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.project-card-thumb.thumb-gol { background: linear-gradient(135deg, #A64426, #DB6532); }
.project-card-thumb.thumb-host { background: linear-gradient(135deg, #56494E, #52271D); }
.project-card-thumb.thumb-igesture { background: linear-gradient(135deg, #52271D, #A64426); }
.project-card-thumb.thumb-orif { background: linear-gradient(135deg, #DB6532, #A29C9B); }
.project-card-thumb.thumb-poker { background: linear-gradient(135deg, #56494E, #DB6532); }
.project-card-thumb svg { width: 80px; height: 80px; opacity: 0.9; }
.project-card-body { padding: 1.3rem; flex: 1; display: flex; flex-direction: column; }
.project-card-title { font-size: 0.92rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.project-card-desc { font-size: 0.8rem; color: var(--text-secondary); flex: 1; margin-bottom: 0.8rem; }
.project-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { background: var(--tag-bg); color: var(--tag-text); padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.68rem; }

/* ===== PROJECT PAGE ===== */
.project-hero { padding: 7rem 2rem 3rem; text-align: center; background: var(--hero-gradient); }
.project-hero-title { font-size: 1.8rem; margin-bottom: 0.5rem; }
.project-hero-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.project-hero-tags .tag { font-size: 0.75rem; padding: 0.3rem 0.8rem; }
.project-content { max-width: 800px; margin: 0 auto; padding: 3rem 2rem 5rem; }
.project-video-container {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-secondary);
  border-radius: 16px; overflow: hidden; margin-bottom: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--border);
}
.project-video-container video, .project-video-container iframe { width: 100%; height: 100%; border: none; }
.project-video-placeholder { text-align: center; color: var(--text-muted); padding: 2rem; }
.project-video-placeholder svg { width: 60px; height: 60px; fill: var(--text-muted); margin-bottom: 0.8rem; }
.project-section { margin-bottom: 2rem; }
.project-section h2 { font-size: 1.15rem; margin-bottom: 1rem; color: var(--text-primary); }
.project-section h3 { font-size: 0.92rem; margin-bottom: 0.5rem; color: var(--accent); }
.project-section p, .project-section li { color: var(--text-secondary); font-size: 0.85rem; }
.project-section ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.project-section li { margin-bottom: 0.3rem; }
.project-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--accent); font-size: 0.85rem; margin-bottom: 2rem;
}
.project-back:hover { color: var(--accent-hover); }
.project-back svg { width: 18px; height: 18px; fill: currentColor; }

/* ===== SCROLL TO TOP ===== */
.scroll-top {
  position: fixed; bottom: 2rem; right: 2rem; width: 50px; height: 50px;
  background: var(--scrolltop-bg); color: var(--scrolltop-color);
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: all 0.4s ease; box-shadow: 0 4px 15px var(--shadow); z-index: 999;
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { transform: translateY(-3px) scale(1.05); }
.scroll-top svg { width: 22px; height: 22px; fill: currentColor; }

/* ===== FOOTER ===== */
.footer {
  text-align: center; padding: 2rem; background: var(--bg-secondary);
  border-top: 2px solid var(--border); color: var(--text-muted); font-size: 0.78rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 0.6rem 1rem; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(12px);
    flex-direction: column; padding: 1rem; border-bottom: 2px solid var(--border); gap: 0.5rem;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .hero { padding: 6rem 1.2rem 3rem; }
  .hero-title { font-size: 1.5rem; }
  .hero-photo { width: 140px; height: 140px; }
  .section { padding: 3rem 1.2rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .project-hero-title { font-size: 1.3rem; }
  .project-content { padding: 2rem 1.2rem 4rem; }
  .timeline { padding-left: 2rem; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.2rem; }
  .hero-contact { flex-direction: column; gap: 0.5rem; }
  .nav-logo { font-size: 0.8rem; }
}

/* ===== ANIMATIONS ===== */
.fade-in { opacity: 0; transform: translateY(25px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.stagger > * { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger.visible > * { opacity: 1; transform: translateY(0); }
