/* ============================================
   DESIGN SYSTEM - Brutalist / donne
   ============================================ */

:root {
  --color-bg: #FFEC19;
  --color-text: #000000;
  --color-dark: #0a0a0a;
  --color-accent: #00ffc8;
  --color-highlight: #00ffc8;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;
  --border: 3px solid var(--color-text);
  --border-light: 3px solid var(--color-bg);
  --nav-height: 60px;
  --section-padding: clamp(4rem, 10vw, 8rem) clamp(1.5rem, 5vw, 6rem);
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  line-height: 1.6;
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

mark {
  background-color: var(--color-highlight);
  color: var(--color-text);
  padding: 0.1em 0.3em;
}

u {
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 6rem);
  height: var(--nav-height);
  background-color: var(--color-bg);
  border-bottom: var(--border);
}

.navbar__logo {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -1px;
}

.navbar__links {
  display: flex;
  gap: 2rem;
}

.navbar__links a {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding: 0.25rem 0;
}

.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--color-text);
  transition: width 0.3s;
}

.navbar__links a:hover::after,
.navbar__links a.active::after {
  width: 100%;
}

.navbar__lang {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border: var(--border);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.navbar__lang:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--color-text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================
   HERO
   ============================================ */

.hero {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  min-height: 100vh;
  padding: var(--section-padding);
  padding-top: calc(var(--nav-height) + 4rem);
  gap: 2rem;
}

.hero__vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.6;
  transform: rotate(180deg);
}

.hero__content {
  max-width: 700px;
}

.hero__title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero__description {
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pixel-brackets {
  font-family: var(--font-pixel);
  font-size: clamp(4rem, 10vw, 8rem);
  display: flex;
  gap: 1rem;
  opacity: 0.9;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.8rem 1.6rem;
  border: var(--border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn--dark {
  border-color: var(--color-bg);
  color: var(--color-bg);
}

.btn--dark:hover {
  background: var(--color-bg);
  color: var(--color-dark);
}

/* ============================================
   PIXEL TRANSITIONS
   ============================================ */

.pixel-transition {
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='10' height='10' fill='%23000'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%23000'/%3E%3C/svg%3E");
  background-size: 20px 20px;
  background-repeat: repeat-x;
  background-position: center;
}

.pixel-transition--to-dark {
  height: 40px;
  background-color: var(--color-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='20' height='20' fill='%230a0a0a'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='10' height='10' fill='%230a0a0a'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%230a0a0a'/%3E%3C/svg%3E");
  background-size: 20px 20px, 20px 20px;
  background-position: bottom, top;
  background-repeat: repeat-x, repeat-x;
}

.pixel-transition--from-dark {
  height: 40px;
  background-color: var(--color-dark);
  background-image:
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='20' height='20' fill='%23FFEC19'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='10' height='10' fill='%23FFEC19'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%23FFEC19'/%3E%3C/svg%3E");
  background-size: 20px 20px, 20px 20px;
  background-position: bottom, top;
  background-repeat: repeat-x, repeat-x;
}

.pixel-transition--black {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23000'/%3E%3Crect x='5' y='5' width='5' height='5' fill='%23000'/%3E%3C/svg%3E");
  background-size: 10px 10px;
  height: 10px;
}

/* ============================================
   ABOUT
   ============================================ */

.about {
  padding: var(--section-padding);
  position: relative;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.section-title--large {
  font-size: clamp(1rem, 2.5vw, 1.8rem);
}

.about__col p {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.8;
}

.about__pixel-art {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.pixel-character {
  width: 64px;
  height: 80px;
  background-color: var(--color-text);
  clip-path: polygon(
    30% 0%, 70% 0%, 70% 10%, 80% 10%, 80% 20%, 90% 20%, 90% 40%,
    80% 40%, 80% 50%, 70% 50%, 70% 60%, 80% 60%, 80% 70%, 90% 70%,
    90% 90%, 80% 90%, 80% 100%, 60% 100%, 60% 90%, 40% 90%, 40% 100%,
    20% 100%, 20% 90%, 10% 90%, 10% 70%, 20% 70%, 20% 60%, 30% 60%,
    30% 50%, 20% 50%, 20% 40%, 10% 40%, 10% 20%, 20% 20%, 20% 10%,
    30% 10%
  );
}

/* ============================================
   SKILLS
   ============================================ */

.skills {
  padding: var(--section-padding);
}

.skills__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.pixel-bracket {
  font-family: var(--font-pixel);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.skills__category h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-text);
}

.skills__category li {
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--color-text);
  margin-bottom: 0.5rem;
  transition: background 0.2s, color 0.2s;
}

.skills__category li:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ============================================
   PROJECTS (dark section)
   ============================================ */

.projects {
  background-color: var(--color-dark);
  color: var(--color-bg);
  padding: var(--section-padding);
}

.projects .section-title {
  color: var(--color-bg);
}

.projects__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.projects__pixel-art .code-symbol {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--color-accent);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.project-card {
  border: var(--border-light);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.project-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  flex-grow: 1;
  color: rgba(255, 236, 25, 0.85);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-card__tags span {
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.projects__cta {
  text-align: center;
}

/* ============================================
   CONTACT / FOOTER
   ============================================ */

.contact {
  padding: var(--section-padding);
  text-align: center;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.contact__description {
  font-size: clamp(0.9rem, 1.3vw, 1.1rem);
  max-width: 500px;
  margin-bottom: 1rem;
}

.contact__links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.contact__footer {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.open-source-badge {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 2px;
  padding: 0.5rem 1rem;
  border: var(--border);
}

.contact__footer p {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .navbar__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: var(--border);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .navbar__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .navbar__toggle {
    display: flex;
  }

  .navbar__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar__toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 3rem;
  }

  .hero__vertical {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.7rem;
    margin-bottom: 1rem;
  }

  .hero__art {
    display: none;
  }

  .about__grid {
    grid-template-columns: 1fr;
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }

  .skills__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .skills__grid {
    grid-template-columns: 1fr;
  }

  .hero__title {
    font-size: 1.6rem;
  }

  .contact__links {
    flex-direction: column;
    align-items: center;
  }
}
