/* =============================================
   VARIABLES GLOBALES — aquí controlas los colores
   y fuentes de TODO el sitio desde un solo lugar
   ============================================= */
:root {
  --white: #ffffff;
  --black: #111111;
  --gray-light: #f5f5f5;
  --gray-mid: #aaaaaa;
  --gray-text: #555555;
  --sidebar-width: 220px;
  --font-display: 'EB Garamond', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.25s ease;
}

/* =============================================
   RESET Y BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  display: flex;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   MENÚ LATERAL
   ============================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-right: 1px solid #ebebeb;
  background: var(--white);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-name a {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--black);
  transition: opacity var(--transition);
}

.sidebar-name a:hover {
  opacity: 0.5;
}

.project-list,
.nav-extra {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-list li a,
.nav-extra li a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--gray-text);
  letter-spacing: 0.02em;
  transition: color var(--transition);
  line-height: 1.6;
}

.project-list li a:hover,
.nav-extra li a:hover {
  color: var(--black);
}

.nav-extra {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #ebebeb;
}

.nav-extra li a {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--black);
}

/* =============================================
   CONTENIDO PRINCIPAL
   ============================================= */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 60px 60px 100px;
  max-width: 1200px;
}

/* =============================================
   HEADER / HERO
   ============================================= */
.hero {
  margin-bottom: 70px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--black);
}

.hero h1 .last-name {
  font-style: italic;
}

.tagline {
  margin-top: 16px;
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--gray-mid);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* =============================================
   GRILLA DE PROYECTOS
   ============================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 32px;
}

.project-card a {
  display: block;
  cursor: pointer;
}

.project-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--gray-light);
  margin-bottom: 14px;
}

.project-img-wrap img {
  transition: transform 0.5s ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}

.project-overlay span {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--white);
  background: var(--black);
  padding: 6px 12px;
}

.project-card a:hover .project-img-wrap img {
  transform: scale(1.03);
}

.project-card a:hover .project-overlay {
  opacity: 1;
}

.project-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.project-caption {
  font-size: 0.78rem;
  color: var(--gray-text);
  line-height: 1.6;
  font-weight: 300;
}

/* =============================================
   PÁGINAS DE PROYECTO (project-page)
   ============================================= */
.project-page {
  max-width: 800px;
}

.project-page .back-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--gray-mid);
  letter-spacing: 0.05em;
  margin-bottom: 50px;
  transition: color var(--transition);
}

.project-page .back-link:hover {
  color: var(--black);
}

.project-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 12px;
}

.project-meta {
  font-size: 0.78rem;
  color: var(--gray-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 50px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gray-light);
  margin-bottom: 60px;
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.project-body h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 16px;
}

.project-body p {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--gray-text);
  font-weight: 300;
  max-width: 65ch;
}

.project-body img {
  width: 100%;
  height: auto;
  aspect-ratio: unset;
}

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.image-grid img {
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* =============================================
   PÁGINA ABOUT ME
   ============================================= */
.about-page {
  max-width: 720px;
}

.about-page .back-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--gray-mid);
  letter-spacing: 0.05em;
  margin-bottom: 60px;
  transition: color var(--transition);
}

.about-page .back-link:hover {
  color: var(--black);
}

.about-photo {
  width: 280px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--gray-light);
  margin-bottom: 50px;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 40px;
  line-height: 1.1;
}

.about-bio {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 60px;
}

.about-bio p {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--gray-text);
  font-weight: 300;
  max-width: 60ch;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-links a {
  font-size: 0.82rem;
  color: var(--gray-text);
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.about-links a:hover {
  color: var(--black);
  border-bottom-color: var(--black);
}

/* =============================================
   BOTÓN MENÚ MÓVIL
   ============================================= */
.menu-toggle {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 200;
  background: var(--white);
  border: 1px solid #ddd;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
}

/* =============================================
   RESPONSIVE — MÓVIL
   ============================================= */
@media (max-width: 700px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 70px 24px 60px;
  }

  .menu-toggle {
    display: block;
  }

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

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