/* ================================================================
   1. COLORES Y TIPOGRAFÍAS
   Para cambiar un color en todo el sitio, cambialo solo acá.
   ================================================================ */
:root {
  --black: #000;     /* bordes, sombras, texto y pie de contacto */
  --white: #fff;     /* fondo de las tarjetas */
  --paper: #f3f3f1;  /* fondo general */
  --gray: #dedfdb;   /* fondo de "Sobre mí" y de Formación */
  --muted: #555b57;  /* texto secundario (fechas, subtítulos) */
  --forest: #183e32; /* verde de la marca */
  --line: 3px solid var(--black); /* borde grueso que usan tarjetas y secciones */

  --display: "Archivo Black", "Arial Black", sans-serif; /* títulos */
  --sans: "Archivo", Arial, sans-serif;                  /* texto */
}

/* ================================================================
   2. BASE (aplica a toda la página)
   ================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--black);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 5px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a:hover {
  text-decoration-thickness: 2px;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
::selection {
  background: var(--forest);
  color: var(--white);
}
:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 6px;
}
.wrap {
  width: min(1180px, calc(100% - 96px));
  margin-inline: auto;
}
.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  background: white;
  border: var(--line);
  padding: 10px;
  z-index: 20;
}
.skip:focus {
  transform: none;
}

/* ================================================================
   3. MENÚ SUPERIOR
   ================================================================ */
.site-header {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.mark {
  font-family: var(--display);
  font-size: 2.7rem;
  letter-spacing: -4px;
  text-decoration: none;
  line-height: 1;
}
.mark span {
  color: var(--forest);
}
nav {
  display: flex;
  gap: 34px;
}
nav a,
.nav-contact {
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-contact {
  border-bottom: 2px solid;
  padding-block: 5px;
}
.nav-contact span {
  margin-left: 16px;
}

/* ================================================================
   4. PORTADA (placa verde con el nombre)
   ================================================================ */
.hero {
  padding-top: 44px;
  padding-bottom: 96px;
}
.intro {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 17px;
}
.intro span:last-child {
  font-size: 0.85rem;
}
.intro span span {
  margin-left: 12px;
}
.nameplate {
  background: var(--forest);
  color: var(--white);
  border: var(--line);
  border-radius: 16px;
  box-shadow: 10px 10px 0 var(--black);
  padding: 24px 40px 22px;
}
.nameplate-top,
.nameplate-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}
.nameplate-top {
  border-bottom: 1px solid #ffffff55;
  padding-bottom: 15px;
}
.nameplate-top span:last-child {
  font-weight: 800;
}
h1 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.99;
  font-size: clamp(4rem, 9.5vw, 8rem);
  letter-spacing: -0.065em;
  padding: 35px 0 30px;
}
.name-dot {
  color: var(--gray);
}
.nameplate-bottom {
  border-top: 1px solid #ffffff55;
  padding-top: 15px;
}
.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 38px;
}
.hero-bottom p {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ================================================================
   5. BOTONES
   ================================================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--forest);
  color: white;
  border: var(--line);
  border-radius: 6px;
  padding: 12px 20px;
  box-shadow: 4px 4px 0 var(--black);
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}
.button-light {
  background: var(--white);
  color: var(--black);
}

/* ================================================================
   6. SECCIONES Y PESTAÑAS DE TÍTULO
   ================================================================ */
.band {
  border-top: var(--line);
  position: relative;
  padding: 78px 0 88px;
}
.section-tab {
  position: absolute;
  top: 0;
  transform: translateY(-100%);
  font-size: 1.15rem;
  line-height: 1.4;
  font-weight: 800;
  padding: 10px 20px;
  border: var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: inherit;
}
.section-tab span {
  margin-right: 10px;
}

/* ================================================================
   7. SOBRE MÍ
   ================================================================ */
.about {
  background: var(--gray);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: center;
}
.about-copy h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
  margin-bottom: 26px;
}
.about-copy p {
  margin-bottom: 18px;
  max-width: 54ch;
}
.about-copy .button {
  margin-top: 12px;
}
.portrait-area {
  justify-self: center;
  text-align: center;
}
.portrait {
  width: 340px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 4px solid black;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 9px 9px 0 var(--forest);
  background: var(--white);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.portrait-note {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 24px;
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 42px 0 0;
}
.about-tags li {
  background: var(--paper);
  border: 2px solid black;
  border-radius: 5px;
  padding: 7px 17px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ================================================================
   8. PROYECTOS
   ================================================================ */
.work {
  background: var(--paper);
}
.section-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.section-intro p {
  font-weight: 700;
  font-size: 1.25rem;
}
.section-intro > span {
  font-size: 0.9rem;
  color: var(--muted);
}
.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 7px 7px 0 black;
  margin-bottom: 32px;
}
.project:last-child {
  margin-bottom: 0;
}
.project-copy {
  padding: 36px;
}
.project-context {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--forest);
  flex-shrink: 0;
}
.project h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 3.3vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin-bottom: 20px;
}
.project-subtitle {
  display: block;
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 600;
  margin-top: 10px;
}
.project-copy > p:not(.project-context) {
  color: #3c423e;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.stack {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 22px 0;
}
.stack li {
  border: 1px solid #a7ada9;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 600;
}
.text-link {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
}
.text-link span {
  margin-left: 8px;
}
.project-preview {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 28px;
  border-right: var(--line);
}
.project-preview > img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.preview-finance {
  background: var(--forest);
}
/* Libro compacto: ambas páginas se despliegan dentro de la tarjeta. */
.capture-book {
  width: 100%;
  min-width: 0;
}
.capture-book summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  border-radius: 4px;
}
.capture-book summary::-webkit-details-marker {
  display: none;
}
.capture-book summary:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 8px;
}
.book-pages {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 270px;
  margin: 0 auto;
  padding: 8px;
}
.book-page {
  grid-area: 1 / 1;
  min-width: 0;
  background: var(--paper);
  border: 2px solid var(--black);
  border-radius: 3px 8px 8px 3px;
  box-shadow: 5px 5px 0 #0006;
  overflow: hidden;
  transform: rotate(4deg) translate(5px, -5px);
  transition: transform 220ms ease;
}
.book-page:first-child {
  z-index: 1;
  transform: rotate(-3deg);
}
.book-page img {
  display: block;
  width: 100%;
  height: auto;
}
.book-caption {
  display: block;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
.book-action {
  display: block;
  margin-top: 18px;
  color: var(--white);
  text-align: center;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.book-action-close,
.capture-book[open] .book-action-open {
  display: none;
}
.capture-book[open] .book-action-close {
  display: block;
}
.capture-book[open] .book-pages {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.capture-book[open] .book-page {
  grid-area: auto;
  transform: none;
}
.capture-book[open] .book-page:first-child {
  border-radius: 8px 3px 3px 8px;
}
@media (prefers-reduced-motion: reduce) {
  .book-page {
    transition: none;
  }
}

/* Ilustración de Gestión de Eventos */
.preview-events {
  background: var(--gray);
}
.event-demo {
  border: 2px solid black;
  background: white;
  padding: 24px;
  width: 92%;
  box-shadow: 7px 7px 0 var(--forest);
  transform: rotate(2deg);
}
.event-demo > span {
  font-size: 0.75rem;
  font-weight: 700;
}
.event-demo > strong {
  display: block;
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin: 24px 0;
}
.event-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.event-steps span {
  font-size: 0.6rem;
  border: 1px solid;
  padding: 4px 7px;
  border-radius: 3px;
}
.event-steps span:last-child {
  background: var(--forest);
  color: white;
}
/* Ilustración de ElGordo IA (terminal) */
.preview-gordo {
  background: #b9c4be;
}
.terminal-demo {
  background: #000;
  color: white;
  border: 2px solid black;
  border-radius: 8px;
  width: 100%;
  overflow: hidden;
  box-shadow: 7px 7px 0 #6f8276;
  transform: rotate(-2deg);
}
.terminal-bar {
  display: flex;
  justify-content: space-between;
  padding: 12px 15px;
  background: #272d29;
  font-size: 0.7rem;
}
.terminal-body {
  padding: 22px;
  font-family: monospace;
}
.terminal-body > span {
  color: #b9c4be;
  font-size: 0.8rem;
}
.terminal-body strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
  margin: 18px 0;
}
.terminal-body p {
  font-size: 0.67rem;
  color: #d6ded9;
}
.terminal-gate {
  margin-top: 20px;
  font-size: 0.7rem;
  color: #b9c4be;
}
.terminal-gate span {
  color: white;
}

/* Ilustración de Origo (chat con el agente) */
.preview-origo {
  background: var(--gray);
}
.origo-demo {
  background: #000;
  color: white;
  border: 2px solid black;
  border-radius: 8px;
  width: 100%;
  overflow: hidden;
  box-shadow: 7px 7px 0 var(--forest);
  transform: rotate(2deg);
}
.origo-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  background: #111412;
  border-bottom: 1px solid #2a302c;
}
.origo-bar > span {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.origo-mark {
  width: 18px;
  height: 18px;
  color: white;
}
.origo-chat {
  display: grid;
  gap: 10px;
  padding: 18px;
}
.origo-msg {
  max-width: 85%;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.72rem;
  line-height: 1.45;
}
.origo-msg.me {
  justify-self: end;
  background: var(--forest);
}
.origo-msg.bot {
  justify-self: start;
  background: #1c211e;
  color: #d6ded9;
}
.origo-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 18px 18px;
}
.origo-tabs span {
  font-size: 0.6rem;
  border: 1px solid #4a544e;
  color: #b9c4be;
  padding: 4px 7px;
  border-radius: 999px;
}

/* Ilustración de Atlify (recorrido pantalla → endpoint → tabla) */
.preview-atlify {
  background: var(--paper);
}
.atlify-demo {
  background: var(--forest);
  color: white;
  border: 2px solid black;
  border-radius: 8px;
  width: 100%;
  overflow: hidden;
  box-shadow: 7px 7px 0 var(--black);
  transform: rotate(-2deg);
}
.atlify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid #ffffff33;
}
.atlify-head > span:first-child {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.atlify-badge {
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: 1px solid #ffffff66;
  padding: 3px 7px;
  border-radius: 999px;
}
.atlify-path {
  list-style: none;
  margin: 0;
  padding: 16px 18px 18px;
  display: grid;
  gap: 8px;
}
.atlify-path li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: #ffffff14;
  border: 1px solid #ffffff2b;
  border-radius: 6px;
}
.atlify-num {
  font-family: var(--display);
  font-size: 0.95rem;
}
.atlify-body {
  display: grid;
  gap: 3px;
}
.atlify-body strong {
  font-size: 0.72rem;
}
.atlify-body em {
  font-style: normal;
  font-family: monospace;
  font-size: 0.6rem;
  color: #cfe0d8;
}

/* ================================================================
   9. HABILIDADES
   ================================================================ */
.toolbox {
  background: var(--forest);
  color: white;
  padding-bottom: 100px;
}
.toolbox .section-tab {
  color: white;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}
.skills-grid h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.skills-grid p {
  font-size: 0.95rem;
  color: #e2e8e4;
  line-height: 1.9;
}
.skills-grid > div {
  border-top: 2px solid #7d998a;
  padding-top: 20px;
}

/* ================================================================
   10. EXPERIENCIA Y FORMACIÓN
   ================================================================ */
.experience {
  background: var(--paper);
}
.experience-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 85px;
}
.column-title,
.education > h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}
.job + .job {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #bcbfba;
}
.date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.job h4 {
  font-size: 1.25rem;
  line-height: 1.4;
}
.job-role {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 8px 0 12px;
}
.job > p:last-child {
  font-size: 0.95rem;
  color: #3c423e;
}
.education {
  background: var(--gray);
  border: var(--line);
  border-radius: 8px;
  padding: 30px;
  align-self: start;
  box-shadow: 6px 6px 0 black;
}
.education > div {
  margin-bottom: 24px;
}
.education h4 {
  font-size: 1rem;
}
.education p {
  font-size: 0.9rem;
  margin-top: 5px;
}

/* ================================================================
   11. CONTACTO (pie negro)
   ================================================================ */
.contact {
  background: var(--black);
  color: white;
  padding: 72px 0 28px;
  border-top: var(--line);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 85px;
  align-items: center;
}
.contact h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.3rem, 4.5vw, 3.7rem);
  line-height: 1.1;
  letter-spacing: -0.05em;
}
.contact-grid p {
  color: #d0d2cf;
  margin-bottom: 24px;
}
.contact .button {
  box-shadow: 4px 4px 0 #8da295;
  border-color: #fff;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-top: 1px solid #555;
  margin-top: 64px;
  padding-top: 24px;
  font-size: 0.8rem;
}
.footer-bottom > div {
  display: flex;
  gap: 24px;
}
.footer-bottom > span {
  color: #b9bcb9;
}

/* ================================================================
   12. PANTALLAS GRANDES, TABLET Y CELULAR
   ================================================================ */
@media (min-width: 1500px) {
  h1 {
    font-size: 8.3rem;
  }
}
/* Tablet */
@media (max-width: 1000px) {
  .wrap {
    width: calc(100% - 56px);
  }
  .about-grid {
    gap: 40px;
  }
  .portrait {
    width: 290px;
  }
  .project-copy {
    padding: 26px;
  }
  .project-preview {
    padding-inline: 20px;
  }
  .experience-grid,
  .contact-grid {
    gap: 40px;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .event-demo > strong {
    font-size: 2rem;
  }
  .terminal-body {
    padding: 16px;
  }
}
/* Celular */
@media (max-width: 700px) {
  .wrap {
    width: calc(100% - 36px);
  }
  .site-header {
    height: auto;
    min-height: 94px;
    flex-wrap: wrap;
    gap: 14px;
    padding-block: 18px;
  }
  .mark {
    font-size: 2.2rem;
  }
  nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  nav a,
  .nav-contact {
    font-size: 0.8rem;
  }
  .hero {
    padding-top: 28px;
    padding-bottom: 90px;
  }
  .intro {
    font-size: 0.85rem;
  }
  .intro span:last-child {
    font-size: 0.68rem;
  }
  .nameplate {
    padding: 16px 19px;
    border-radius: 10px;
    box-shadow: 6px 6px 0 black;
  }
  .nameplate-top,
  .nameplate-bottom {
    font-size: 0.68rem;
  }
  .nameplate-bottom span:last-child {
    display: none;
  }
  h1 {
    font-size: clamp(2.5rem, 10.8vw, 4.7rem);
    letter-spacing: -0.06em;
    padding: 32px 0;
  }
  .hero-bottom {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 30px;
    gap: 20px;
  }
  .hero-bottom p {
    font-size: 1.2rem;
  }
  .button {
    font-size: 0.9rem;
  }
  .band {
    padding: 52px 0 84px;
  }
  .section-tab {
    font-size: 0.95rem;
    padding: 9px 14px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .portrait-area {
    grid-row: 1;
  }
  .portrait {
    width: 230px;
  }
  .portrait-note {
    margin-top: 19px;
  }
  .about-copy h3 {
    font-size: 2rem;
  }
  .about-tags {
    margin-top: 30px;
    gap: 8px;
  }
  .about-tags li {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
  .section-intro {
    display: block;
  }
  .section-intro p {
    font-size: 1.1rem;
  }
  .section-intro > span {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
  }
  .project {
    grid-template-columns: 1fr;
  }
  .project-preview {
    min-height: 310px;
    border-right: 0;
    border-bottom: var(--line);
    padding: 28px 32px;
  }
  .event-demo,
  .terminal-demo,
  .origo-demo,
  .atlify-demo {
    max-width: 350px;
  }
  .project-copy {
    padding: 25px;
  }
  .project h3 {
    font-size: 2rem;
  }
  .project-context {
    font-size: 0.73rem;
  }
  .skills-grid {
    gap: 24px;
  }
  .skills-grid h3 {
    font-size: 1.05rem;
  }
  .skills-grid p {
    font-size: 0.85rem;
  }
  .experience-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .education {
    padding: 24px;
  }
  .contact {
    padding: 48px 0 24px;
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-top: 40px;
  }
  .contact h2 {
    font-size: 2.6rem;
  }
}
/* Usuarios que pidieron menos animaciones en su sistema */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button {
    transition: none;
  }
}
/* Cada pestaña de título toma el color de fondo de su sección */
.about .section-tab {
  background: var(--gray);
}
.work .section-tab,
.experience .section-tab {
  background: var(--paper);
}
.toolbox .section-tab {
  background: var(--forest);
}
