/* ===== LOCAL FONTS ===== */
@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/SpaceMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/SpaceMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/SpaceMono-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/SpaceMono-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ===== RESET & VARIABLES (DARK MODE BY DEFAULT) ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colores claros (default) */
  --bg: #f7f5f0;
  --text: #1a1a1a;
  --card-bg: #ffffff;
  --border: #1a1a1a;
  --shadow: #1a1a1a;
  --primary: #ff5e00;
  --secondary: #0066ff;
  --accent: #ffe600;
}

/* Class added to body for dark mode */
.dark-mode {
  --bg: #121212;
  --text: #e0e0e0;
  --card-bg: #1e1e1e;
  --border: #e0e0e0;
  --shadow: #e0e0e0;
  --primary: #ff7b00;
  --secondary: #3b82f6;
  --accent: #facc15;
}

/* Class added to body for light mode */
.light-mode {
  --bg: #f7f5f0;
  --text: #1a1a1a;
  --card-bg: #ffffff;
  --border: #1a1a1a;
  --shadow: #1a1a1a;
  --primary: #ff5e00;
  --secondary: #0066ff;
  --accent: #ffe600;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Mono', 'Courier New', monospace;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== FIXED TOOLBAR ===== */
#toolbar {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 1000;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: var(--card-bg);
  padding: 0.5rem 0.8rem;
  border: 4px solid var(--border);
  box-shadow: 6px 6px 0 var(--shadow);
  border-radius: 0;
  transition: background 0.2s, border 0.2s, box-shadow 0.2s;
}

#theme-toggle,
#lang-toggle {
  background: transparent;
  border: 3px solid var(--border);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  box-shadow: 3px 3px 0 var(--shadow);
  transition: all 0.15s ease;
}

#theme-toggle:hover,
#lang-toggle:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

#toolbar .btn {
  font-size: 0.75rem;
  padding: 0.3rem 1rem;
  margin: 0;
  box-shadow: 3px 3px 0 var(--shadow);
}

/* ===== BRUTAL TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title {
  font-size: 2.8rem;
  text-transform: uppercase;
  border-bottom: 6px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  display: inline-block;
  transition: border-color 0.2s;
}

.highlight {
  background-color: var(--accent);
  color: #1a1a1a;          /* Fixed, always dark for readability */
  padding: 0.1rem 0.3rem;
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: background 0.2s, border 0.2s, box-shadow 0.2s, color 0.2s;
}

/* ===== SECTIONS ===== */
.section {
  padding: 5rem 0;
  border-bottom: 6px solid var(--border);
  transition: border-color 0.2s;
}

.section:last-of-type {
  border-bottom: none;
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-color: var(--bg);
  border-bottom: 6px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.hero-content {
  width: 100%;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  line-height: 2;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.hero-desc {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  border-left: 6px solid var(--secondary);
  padding-left: 1rem;
  transition: border-color 0.2s;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.8rem;
  border: 4px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  font-size: 0.9rem;
  box-shadow: 5px 5px 0 var(--shadow);
  background-color: transparent;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--border);
  box-shadow: 5px 5px 0 var(--shadow);
}

.btn-primary:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--shadow);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

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

.btn-small {
  background: transparent;
  padding: 0.4rem 1.2rem;
  font-size: 0.8rem;
}

.btn-small:hover {
  padding: 0.5rem 1.3rem;
  font-size: 1rem;
  background: var(--border);
  color: var(--bg);
}

/* ===== ABOUT ME ===== */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
}

.stat-box {
  background: var(--card-bg);
  border: 4px solid var(--border);
  padding: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 6px 6px 0 var(--secondary);
  transition: background 0.2s, border 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
  background: var(--secondary);  /* Fondo del color secundario */
  color: var(--bg);  /* Texto del color de fondo (inversión) */
  transform: scale(1.05);  /* Se agranda un 5% */
  box-shadow: 8px 8px 0 var(--primary);  /* Sombra más grande y de otro color */
  border-color: var(--secondary);  /* Borde del color secundario */
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  border: 4px solid var(--border);
  padding: 1.8rem;
  box-shadow: 8px 8px 0 var(--primary);
  transition: all 0.15s ease;
}

.project-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 var(--primary);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.project-header h3 {
  font-size: 1.6rem;
  text-transform: uppercase;
}

.project-tag {
  background: var(--accent);
  color: #101010;
  font-weight: 700;
  padding: 0.2rem 0.8rem;
  border: 3px solid var(--border);
  font-size: 0.7rem;
  text-transform: uppercase;
  transition: background 0.2s, border 0.2s, color 0.2s;
}

.project-card p {
  margin: 1rem 0 1.5rem;
}

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

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
}

.skill-group h4 {
  font-size: 1.4rem;
  border-bottom: 4px solid var(--secondary);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  transition: border-color 0.2s;
}

.skill-group ul {
  list-style: none;
}

.skill-group ul li {
  padding: 0.3rem 0;
  border-left: 6px solid var(--primary);
  padding-left: 1rem;
  margin-bottom: 0.3rem;
  font-weight: 700;
  transition: border-color 0.2s;
}

/* ===== CONTACT ===== */
.contact-content {
  text-align: center;
}

.contact-content p {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
footer {
  padding: 2rem 0;
  border-top: 6px solid var(--border);
  text-align: center;
  font-weight: 700;
  transition: border-color 0.2s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .hero-sub {
    font-size: 1.4rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  #toolbar {
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.3rem 0.6rem;
    gap: 0.4rem;
  }
  #toolbar .btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.7rem;
  }
  #theme-toggle,
  #lang-toggle {
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}