/* ========== CSS CUSTOM PROPERTIES (Light/Dark Mode) ========== */
:root {
  /* Light Mode (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e8e8e8;
  --text-primary: #000000;
  --text-secondary: rgba(0, 0, 0, 0.7);
  --text-muted: rgba(0, 0, 0, 0.5);
  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.3);
  --accent: #000000;
  --particle-color: #000000;
  --logo-filter: none;
}

[data-theme="dark"] {
  /* Dark Mode */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.3);
  --accent: #ffffff;
  --particle-color: #ffffff;
  --logo-filter: invert(1);
}

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

html {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  min-height: 100%;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ========== GEOMETRIC BACKGROUND ========== */
#geometric-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ========== NAVIGATION ========== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.minimal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 4rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease, border-color 0.3s ease;
  position: relative;
  z-index: 100;
}

.nav-brand a {
  text-decoration: none;
  display: block;
  line-height: 0;
}

.site-logo {
  height: 32px;
  width: auto;
  transition: opacity 0.3s ease, filter 0.3s ease;
  filter: var(--logo-filter);
}

.site-logo:hover {
  opacity: 0.7;
}

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

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
  letter-spacing: 0.02em;
}

.nav-menu a:hover {
  color: var(--text-muted);
}

/* Toggle Buttons Container */
.toggle-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language Toggle */
.language-form {
  margin: 0;
  padding: 0;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.3s ease;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.lang-toggle:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

/* ========== MAIN CONTENT ========== */
main {
  min-height: calc(100vh - 100px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-logo {
  max-width: 500px;
  width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
  filter: var(--logo-filter);
  transition: filter 0.3s ease;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 12rem;
  margin-bottom: 2rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  font-weight: 300;
}

/* ========== CONTENT SECTIONS ========== */
.content-section {
  max-width: 900px;
  width: 90%;
  margin: 0 auto;
  padding: 4rem 0;
}

.content-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.content-section h1 {
  font-size: 3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.content-section h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.content-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.content-section a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.3s ease;
}

.content-section a:hover {
  opacity: 0.6;
}

/* ========== PROJECT CARDS ========== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.project-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.project-images img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-images img:hover {
  border-color: var(--border-hover);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tech-tag {
  background: transparent;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  letter-spacing: 0.02em;
}

.project-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.project-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border-radius: 4px;
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #ffffff;
  font-size: 32px;
  font-weight: 300;
  transition: opacity 0.3s;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-close:hover {
  opacity: 0.6;
}

/* ========== CONTACT / BUTTONS ========== */
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-submit:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.btn-submit svg {
  width: 16px;
  height: 16px;
}

/* ========== SKILLS SECTION ========== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 2rem 0 3rem 0;
}

.skill-category {
  position: relative;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: background 0.3s ease, border-color 0.3s ease;
  overflow: visible;
  border-radius: 4px;
}


.skill-category:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.skill-category:hover::before {
  background: var(--text-primary);
  box-shadow: 
    calc(100% + var(--skill-box-width, 270px)) 0 0 0 var(--text-primary),
    calc(100% + var(--skill-box-width, 270px)) calc(100% + var(--skill-box-height, 180px)) 0 0 var(--text-primary),
    0 calc(100% + var(--skill-box-height, 180px)) 0 0 var(--text-primary),
    0 0 0 2px var(--text-primary);
}

.skill-category h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

.skill-category ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
}

.skill-category li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding-left: 1rem;
  position: relative;
}

.skill-category li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
  
  body {
    padding-top: 0;
  }
  
  .minimal-nav {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .nav-right {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }
  
  main {
    padding: 1rem 0;
    margin-top: 180px;
  }
  
  .hero {
    width: 90vw;
    max-width: 90vw;
    position: fixed;
    top: calc(9rem + 50%);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
  }
  
  .hero p {
    font-size: 1rem;
    margin-top: 0rem;
  }
  
  .hero-logo {
    max-width: 90%;
  }
  
  .content-section {
    width: 90vw;
    max-width: 90vw;
    padding: 2rem 0;
  }
  
  .content-section h1 {
    font-size: 2rem;
  }
  
  .content-box {
    padding: 1.5rem;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
  }
}
