/* ─────────────────────────────────────────
   FONTS
───────────────────────────────────────── */
@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}
@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: 'GeistMono';
  src: url('assets/fonts/GeistMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* ─────────────────────────────────────────
   TOKENS
───────────────────────────────────────── */
:root {
  --blue:    #0018FF;
  --grey:    #7E7F83;
  --light:   #F3F3F4;
  --dark:    #14110F;
  --sidebar-w: 512px;
  --stripe-w:  6px;
}

/* ─────────────────────────────────────────
   RESET
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--light);
  color: var(--dark);
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ─────────────────────────────────────────
   DESKTOP LAYOUT
───────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--light);
  border-right: 1px solid rgba(20,17,15,0.12);
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

/* ── Sidebar top ── */
.sidebar-top {
  padding: 52px 40px 40px;
  border-bottom: 1px solid rgba(20,17,15,0.12);
}

.role {
  font-family: 'GeistMono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--grey);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.name {
  font-family: 'Geist', sans-serif;
  font-weight: 800;
  font-size: clamp(44px, 5.5vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--dark);
}

/* ── Nav ── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nav-divider {
  height: 1px;
  background: rgba(20,17,15,0.12);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 1px solid rgba(20,17,15,0.12);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}
.nav-link:last-child { border-bottom: none; }
.nav-link:hover { background: rgba(20,17,15,0.04); }

/* Section links (sobre mí / contacto) */
.nav-link--section .nav-link__text {
  font-family: 'Geist', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.02em;
  color: var(--dark);
}
.nav-link--section .nav-link__arrow {
  font-size: 24px;
  color: var(--dark);
  transition: transform 0.2s ease;
}
.nav-link--section:hover .nav-link__arrow {
  transform: translate(3px, -3px);
}

/* Project links */
.nav-link--project {
  padding: 18px 40px;
}
.nav-link__project-name {
  display: block;
  font-family: 'Geist', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--dark);
  margin-bottom: 4px;
  transition: color 0.15s;
}
.nav-link__tag {
  display: block;
  font-family: 'GeistMono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--grey);
  text-transform: uppercase;
}

/* Active / hover project */
.nav-link--project.nav-link--active .nav-link__project-name,
.nav-link--project:hover .nav-link__project-name {
  color: var(--blue);
}
.nav-link--project.nav-link--active .nav-link__tag,
.nav-link--project:hover .nav-link__tag {
  color: var(--blue);
}

/* ─────────────────────────────────────────
   STAGE (right panel)
───────────────────────────────────────── */
.stage {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 100vh;
  overflow: hidden;
}

.stage-images {
  position: absolute;
  inset: 0;
  right: var(--stripe-w);
  transition: opacity 0.4s ease;
  cursor: pointer;
}
.stage-images:after {
  content: 'Ver proyecto ↓';
  position: absolute;
  bottom: 24px;
  right: 24px;
  font-family: 'GeistMono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.35);
  padding: 8px 14px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.stage-images:hover:after { opacity: 1; }

.stage-image {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.stage-image.active {
  opacity: 1;
}
.stage-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Blue stripe */
.stage-stripe {
  position: absolute;
  top: 0; right: 0;
  width: 6px;
  height: 100%;
  background: var(--blue);
  z-index: 5;
}

/* ─────────────────────────────────────────
   PROJECT DETAIL OVERLAY
───────────────────────────────────────── */
.project-detail {
  position: absolute;
  inset: 0;
  right: var(--stripe-w);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 4;
}
.project-detail.visible {
  opacity: 1;
  pointer-events: auto;
}
.project-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ─────────────────────────────────────────
   SIDEBAR CONTACT BLOCK
───────────────────────────────────────── */
.nav-contact {
  padding: 24px 40px 32px;
}
.nav-contact__title {
  display: block;
  font-family: 'Geist', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.02em;
  color: var(--dark);
  margin-bottom: 16px;
}
.nav-contact__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-contact__item {
  font-family: 'GeistMono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--grey);
  text-decoration: none;
  transition: color 0.15s;
  padding: 2px 0;
}
.nav-contact__item:hover { color: var(--blue); }
.nav-contact__social {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.nav-contact__handle {
  color: var(--grey);
  font-size: 10px;
}
.nav-contact__social:hover .nav-contact__handle { color: var(--blue); }

/* ─────────────────────────────────────────
   MOBILE SECTIONS (hidden on desktop)
───────────────────────────────────────── */
.mobile-sections { display: none; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .stage   { display: none; }

  .mobile-sections {
    display: flex;
    flex-direction: column;
    background: var(--light);
    min-height: 100vh;
  }

  /* ── Header ── */
  .m-header {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(20,17,15,0.12);
  }
  .m-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .m-header .role {
    font-family: 'GeistMono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--grey);
    text-transform: uppercase;
  }
  .m-header .name {
    font-family: 'Geist', sans-serif;
    font-weight: 800;
    font-size: clamp(44px, 12vw, 64px);
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: var(--dark);
  }
  .m-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .m-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--dark);
  }

  /* ── Nav ── */
  .m-nav {
    display: flex;
    flex-direction: column;
  }
  .m-nav-divider {
    height: 1px;
    background: rgba(20,17,15,0.12);
  }
  .m-nav-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(20,17,15,0.12);
    font-family: 'Geist', sans-serif;
    font-weight: 800;
    font-size: clamp(24px, 7vw, 34px);
    letter-spacing: -0.02em;
    color: var(--dark);
    text-decoration: none;
  }
  .m-nav-section .arrow { font-size: 18px; }

  .m-nav-project {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border: none;
    border-bottom: 1px solid rgba(20,17,15,0.12);
    background: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s;
  }
  .m-nav-project:hover,
  .m-nav-project.active {
    background: rgba(20,17,15,0.03);
  }
  .m-nav-project__name {
    display: block;
    font-family: 'Geist', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 3px;
    transition: color 0.15s;
  }
  .m-nav-project__tag {
    display: block;
    font-family: 'GeistMono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: var(--grey);
    text-transform: uppercase;
    transition: color 0.15s;
  }
  .m-nav-project.active .m-nav-project__name,
  .m-nav-project:hover .m-nav-project__name { color: var(--blue); }
  .m-nav-project.active .m-nav-project__tag,
  .m-nav-project:hover .m-nav-project__tag  { color: var(--blue); }

  .m-nav-project__indicator {
    display: block;
    width: 4px;
    height: 24px;
    background: transparent;
    border-radius: 2px;
    flex-shrink: 0;
    margin-left: 12px;
    transition: background 0.15s;
  }
  .m-nav-project.active .m-nav-project__indicator { background: var(--blue); }

  /* ── Contact block ── */
  .m-contact {
    padding: 20px 24px 28px;
  }
  .m-contact__title {
    display: block;
    font-family: 'Geist', sans-serif;
    font-weight: 800;
    font-size: clamp(24px, 7vw, 34px);
    letter-spacing: -0.02em;
    color: var(--dark);
    margin-bottom: 14px;
  }
  .m-contact__links {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .m-contact__item {
    font-family: 'GeistMono', monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--grey);
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.15s;
  }
  .m-contact__item:hover { color: var(--blue); }
  .m-contact__social {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 3px;
  }
  .m-contact__handle {
    font-size: 10px;
    color: var(--grey);
  }
  .m-contact__social:hover .m-contact__handle { color: var(--blue); }

  /* ── Carousel ── */
  .m-carousel {
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(20,17,15,0.12);
    flex-shrink: 0;
  }
  .m-carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
  }
  .m-slide {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }
  .m-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Dots */
  .m-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 10px;
  }
  .m-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(20,17,15,0.2);
    transition: background 0.2s;
    cursor: pointer;
  }
  .m-dot.active { background: var(--blue); }

  /* Blue stripe bottom */
  .m-carousel-stripe {
    height: 5px;
    background: var(--blue);
    width: 100%;
  }
}

@media (max-width: 480px) {
  .m-slide { aspect-ratio: 4/5; }
}
