/* ==================================================
   VARIABLES
================================================== */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;

  --text: #1c202a;
  --text-soft: #626873;
  --text-faint: #7b818b;

  --line: #e8e8e5;
  --line-strong: #dedfdd;

  --dark: #1c202a;

  --blue: #eaf3fa;
  --purple: #f0ecf8;
  --green: #e9f4ec;

  --content: 1160px;
  --project-content: 1040px;
}


/* ==================================================
   BASE
================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;

  color: var(--text);
  background: var(--bg);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: #dcebf7;
}

.is-hidden {
  display: none !important;
}


/* ==================================================
   HEADER
================================================== */

.site-header {
  position: relative;
  z-index: 20;

  height: 76px;

  display: flex;
  align-items: center;

  border-bottom: 1px solid rgba(232, 232, 229, 0.92);

  background: rgba(251, 251, 250, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  width: min(var(--content), calc(100% - 48px));

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: #20242d;

  font-size: 19px;
  font-weight: 720;

  letter-spacing: -0.025em;
}

.nav {
  display: flex;
  align-items: center;

  gap: 32px;

  color: #535964;

  font-size: 14px;
}

.nav > a:not(.youtube-link) {
  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}

.nav > a:not(.youtube-link):hover {
  color: #171b24;

  text-shadow: 0 0 0.01px currentColor;
}

.youtube-link {
  min-height: 38px;

  padding: 0 17px;

  display: inline-flex;
  align-items: center;

  gap: 7px;

  border: 1px solid #e0e1e2;
  border-radius: 999px;

  background: #fff;

  color: #2b3039;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.youtube-link:hover {
  background: #f6f6f5;
  border-color: #d3d4d5;

  transform: translateY(-1px);
}

.youtube-mini-icon {
  font-size: 7px;
}


/* ==================================================
   HERO
================================================== */

.hero {
  position: relative;

  min-height: 720px;

  padding: 88px 24px 112px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  width: 100%;
  max-width: 760px;

  text-align: center;

  transform: translateY(-14px);
}

.eyebrow {
  margin-bottom: 29px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 9px;

  color: #737a84;

  font-size: 10px;
  font-weight: 650;

  letter-spacing: 0.17em;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;

  flex: 0 0 auto;

  border-radius: 50%;

  background: #d5ebfb;

  box-shadow:
    0 0 0 4px rgba(213, 235, 251, 0.22),
    0 0 13px rgba(177, 219, 250, 0.36);
}

.hero h1 {
  margin: 0;

  color: #1b1f29;

  font-size: clamp(54px, 5.4vw, 72px);
  font-weight: 760;

  line-height: 0.98;

  letter-spacing: -0.057em;
}

.hero h1 em {
  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-style: italic;
  font-weight: 400;

  letter-spacing: -0.045em;
}

.hero-description {
  max-width: 625px;

  margin: 31px auto 0;

  color: var(--text-soft);

  font-size: 16.5px;
  font-weight: 400;

  line-height: 1.68;
}

.hero-actions {
  margin-top: 29px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 11px;
}

.button {
  min-height: 48px;

  padding: 0 23px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 10px;

  border-radius: 999px;

  font-size: 14px;
  font-weight: 650;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--dark);

  box-shadow: 0 4px 12px rgba(28, 32, 42, 0.08);
}

.button-primary:hover {
  background: #282d38;

  box-shadow: 0 6px 18px rgba(28, 32, 42, 0.12);
}

.button-secondary {
  color: #2c313a;
  background: #fff;

  border: 1px solid #e1e2e3;
}

.button-secondary:hover {
  background: #f6f6f5;
  border-color: #d7d8d9;
}

.button-arrow {
  font-size: 15px;
  transform: translateY(-1px);
}

.youtube-button-icon {
  font-size: 8px;
}

.scroll-cue {
  position: absolute;

  left: 50%;
  bottom: 27px;

  width: 1px;
  height: 25px;

  overflow: hidden;

  background: #e1e2df;

  transform: translateX(-50%);
}

.scroll-cue span {
  display: block;

  width: 100%;
  height: 8px;

  background: #aeb2b8;

  animation: scrollCue 2.2s ease-in-out infinite;
}

@keyframes scrollCue {
  0% {
    transform: translateY(-9px);
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    transform: translateY(25px);
    opacity: 0;
  }
}


/* ==================================================
   PROYECTOS
================================================== */

.projects-section {
  width: min(var(--content), calc(100% - 48px));

  margin: 0 auto;

  padding: 0 0 118px;

  border-top: 1px solid var(--line);
}

.projects-heading {
  padding-top: 33px;
  margin-bottom: 53px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.section-label {
  margin: 0 0 10px;

  color: var(--text-faint);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.18em;
}

.projects-heading h2,
.about-copy h2 {
  margin: 0;

  font-size: 35px;
  font-weight: 745;

  letter-spacing: -0.044em;
}

.projects-heading h2 em,
.about-copy h2 em {
  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-style: italic;
  font-weight: 400;
}

.projects-count {
  margin: 0 0 3px;

  color: #7a8089;

  font-size: 13px;
}


/* ==================================================
   TARJETAS
================================================== */

.projects-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 28px;
}

.project-card {
  max-width: 558px;

  overflow: hidden;

  background: var(--surface);

  border: 1px solid var(--line);
  border-radius: 20px;

  box-shadow:
    0 2px 4px rgba(20, 20, 20, 0.018),
    0 12px 30px rgba(20, 20, 20, 0.024);

  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.project-card:hover {
  transform: translateY(-2px);

  border-color: #dedfdd;

  box-shadow:
    0 3px 8px rgba(20, 20, 20, 0.03),
    0 16px 38px rgba(20, 20, 20, 0.04);
}

.project-image {
  height: 310px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  color: #969b9f;

  font-size: 13px;
}

.project-placeholder {
  position: relative;

  flex-direction: column;

  gap: 5px;

  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.7), transparent 30%),
    linear-gradient(135deg, #ecece8, #dedfdb);
}

.project-placeholder::before {
  content: "";

  position: absolute;

  inset: 22px;

  border: 1px solid rgba(120, 125, 128, 0.12);
  border-radius: 14px;
}

.placeholder-kicker {
  position: relative;
  z-index: 1;

  color: #969b9f;

  font-size: 8px;
  font-weight: 700;

  letter-spacing: 0.17em;
}

.placeholder-title {
  position: relative;
  z-index: 1;

  color: #6f757b;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 19px;
  font-style: italic;
}

.project-image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  transition: transform 0.35s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.018);
}

.project-content {
  padding: 25px 27px 24px;
}

.project-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}

.project-title-row h3 {
  margin: 0;

  font-size: 19px;
  font-weight: 700;

  letter-spacing: -0.024em;
}

.project-year {
  padding-top: 2px;

  color: #7a8088;

  font-size: 11px;
}

.project-description {
  margin: 10px 0 18px;

  color: #727781;

  font-size: 13.5px;

  line-height: 1.58;
}

.project-footer {
  padding-top: 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-top: 1px solid #ededeb;
}

.tags {
  display: flex;

  gap: 7px;

  flex-wrap: wrap;
}

.tag {
  padding: 6px 11px;

  border-radius: 999px;

  color: #4e5660;

  font-size: 10px;
  font-weight: 650;
}

.tag-blue {
  background: var(--blue);
}

.tag-purple {
  background: var(--purple);
}

.tag-green {
  background: var(--green);
}

.project-link {
  white-space: nowrap;

  color: #2b3039;

  font-size: 13px;
  font-weight: 650;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.project-link:hover {
  opacity: 0.62;
}

.empty-state {
  padding: 50px;

  border: 1px solid var(--line);
  border-radius: 20px;

  color: var(--text-soft);
  background: #fff;
}

.empty-state span {
  display: block;
  margin-bottom: 6px;

  color: var(--text);
  font-weight: 700;
}

.empty-state p {
  margin: 0;
}


/* ==================================================
   SOBRE MI
================================================== */

.about-section {
  width: min(var(--content), calc(100% - 48px));

  margin: 0 auto;

  padding: 108px 0 116px;

  border-top: 1px solid var(--line);
}

.about-layout {
  display: grid;

  grid-template-columns: 195px 1fr;

  gap: 40px;
}

.about-layout > .section-label {
  margin-top: 8px;
}

.about-copy {
  max-width: 680px;
}

.about-copy h2 {
  font-size: 39px;
  line-height: 1.08;
}

.about-copy > p {
  max-width: 610px;

  margin: 24px 0 0;

  color: #666c76;

  font-size: 15.5px;

  line-height: 1.72;
}


/* ==================================================
   FOOTER
================================================== */

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-main {
  width: min(var(--content), calc(100% - 48px));

  margin: 0 auto;

  padding: 48px 0 40px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-brand strong {
  font-size: 14px;
}

.footer-brand p {
  margin: 7px 0 0;

  color: #7a7f89;

  font-size: 13px;
}

.footer-nav {
  display: flex;

  gap: 25px;

  color: #686e77;

  font-size: 13px;
}

.footer-nav a {
  transition: color 0.18s ease;
}

.footer-nav a:hover {
  color: #171b24;
}

.footer-bottom {
  width: min(var(--content), calc(100% - 48px));

  margin: 0 auto;

  padding: 15px 0 21px;

  border-top: 1px solid #eeeeec;

  color: #81868e;

  font-size: 11px;
}


/* ==================================================
   PÁGINA DE PROYECTO
================================================== */

.project-page {
  width: min(var(--project-content), calc(100% - 48px));

  margin: 0 auto;

  padding: 56px 0 112px;
}

.project-header {
  margin-bottom: 37px;
}

.back-link {
  display: inline-block;

  margin-bottom: 37px;

  color: #737984;

  font-size: 13px;

  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

.back-link:hover {
  color: var(--text);
  transform: translateX(-2px);
}

.project-meta {
  margin-bottom: 20px;

  display: flex;
  align-items: center;

  gap: 14px;

  color: #7b818a;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.18em;
}

.meta-line,
.title-line {
  flex: 1;

  height: 1px;

  background: #e4e4e2;
}

.project-header h1 {
  margin: 0 0 20px;

  font-size: 50px;
  font-weight: 755;

  line-height: 1.04;

  letter-spacing: -0.047em;
}

.project-tags {
  display: flex;
  gap: 7px;
}

.project-main-image {
  width: 100%;

  aspect-ratio: 16 / 9;

  margin-bottom: 68px;

  overflow: hidden;

  border-radius: 20px;
}

.placeholder-image,
.gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.72), transparent 30%),
    linear-gradient(135deg, #ecece8, #dedfdb);

  color: #969b9f;

  font-size: 13px;
}

.placeholder-image > div {
  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 6px;
}

.project-cover-image {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}

.project-intro-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 64px;

  margin-bottom: 70px;
}

.project-section-title {
  margin-bottom: 22px;

  display: flex;
  align-items: center;

  gap: 12px;

  color: #7a8089;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.18em;

  white-space: nowrap;
}

.project-story p {
  margin: 0 0 17px;

  color: #505661;

  font-size: 15.5px;

  line-height: 1.72;
}


/* Vídeo centrado verticalmente respecto al texto de "El proyecto" */
.project-video {
  display: flex;
  align-items: center;
}

#project-video-container {
  width: 100%;
}

.video-placeholder {
  position: relative;

  aspect-ratio: 16 / 9;

  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 18px;

  background:
    linear-gradient(135deg, #dcddda, #c9cbc8);

  transition: transform 0.2s ease;
}

a.video-placeholder:hover {
  transform: translateY(-2px);
}


.video-thumbnail {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  display: block;
  object-fit: cover;

  transition: transform 0.28s ease;
}

.video-overlay {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.06);

  transition: background 0.2s ease;
}

.video-youtube-card .play-button,
.video-youtube-card .video-label {
  z-index: 2;
}

a.video-youtube-card:hover .video-thumbnail {
  transform: scale(1.015);
}

a.video-youtube-card:hover .video-overlay {
  background: rgba(0, 0, 0, 0.11);
}

.video-unavailable {
  opacity: 0.78;
}

.play-button {
  width: 54px;
  height: 54px;

  padding-left: 3px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #fff;

  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);

  font-size: 14px;
}

.video-label {
  position: absolute;

  left: 16px;
  bottom: 15px;

  padding: 7px 11px;

  border-radius: 999px;

  background: #fff;

  color: #3c4149;

  font-size: 10px;
  font-weight: 650;
}

.project-block {
  margin-bottom: 70px;
}

.download-list {
  overflow: hidden;

  border: 1px solid #e7e7e5;
  border-radius: 18px;

  background: #fff;
}

.download-item {
  min-height: 84px;

  padding: 16px 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid #ededeb;

  transition: background 0.18s ease;
}

.download-item:last-child {
  border-bottom: 0;
}

a.download-item:hover {
  background: #fafaf8;
}

.download-item.is-disabled {
  cursor: default;
  opacity: 0.72;
}

.download-left {
  display: flex;
  align-items: center;

  gap: 15px;
}

.file-type {
  width: 50px;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #e8f2fa;

  color: #53616d;

  font-size: 9px;
  font-weight: 750;
}

.download-left strong {
  display: block;

  margin-bottom: 4px;

  font-size: 13px;
}

.download-left small {
  color: #8a8f97;
  font-size: 11px;
}

.download-icon {
  color: #777d86;
  font-size: 18px;
}

.components-list {
  border-top: 1px solid #e7e7e5;
}

.component-row {
  min-height: 59px;

  display: grid;
  grid-template-columns: 45px 1fr 1fr;

  align-items: center;

  border-bottom: 1px solid #e7e7e5;

  font-size: 13px;
}

.component-number {
  color: #777d87;
}

.component-row > span:last-child {
  text-align: right;
  color: #777d87;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 24px;
}

.gallery-placeholder {
  aspect-ratio: 3 / 2;
  border-radius: 18px;
}

.gallery-item {
  margin: 0;

  aspect-ratio: 3 / 2;

  overflow: hidden;

  border-radius: 18px;

  background: #ecece8;
}

.gallery-item img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}

.next-project {
  min-height: 132px;

  margin-top: 85px;

  padding: 28px 34px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border: 1px solid #e7e7e5;
  border-radius: 20px;

  background: #fff;

  box-shadow: 0 15px 40px rgba(20, 20, 20, 0.035);
}

.next-project.is-disabled {
  pointer-events: none;
  opacity: 0.72;
}

.next-project > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-project span:first-child {
  color: #7a808a;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.16em;
}

.next-project strong {
  font-size: 19px;
}

.next-arrow {
  width: 50px;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  color: #fff;
  background: var(--dark);

  font-size: 20px;
}

.project-error {
  min-height: 520px;
}

.project-error h1 {
  margin: 0 0 14px;

  font-size: 50px;

  letter-spacing: -0.04em;
}

.project-error > p:not(.section-label) {
  max-width: 520px;

  margin: 0 0 28px;

  color: var(--text-soft);
  line-height: 1.65;
}


/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 750px) {

  .project-video {
    display: block;
  }

}

@media (max-width: 750px) {

  .header-inner {
    width: calc(100% - 32px);
  }

  .nav {
    gap: 15px;
  }

  .nav a:not(.youtube-link) {
    display: none;
  }

  .site-header {
    height: 70px;
  }


  .hero {
    min-height: 640px;
    padding: 72px 22px 92px;
  }

  .hero-content {
    transform: none;
  }

  .eyebrow {
    max-width: 300px;

    margin-left: auto;
    margin-right: auto;

    line-height: 1.5;
  }

  .hero h1 {
    font-size: 51px;
  }

  .hero-description {
    max-width: 430px;
    font-size: 15px;
  }

  .hero-actions {
    flex-wrap: wrap;
  }


  .projects-section {
    width: calc(100% - 32px);
  }

  .projects-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

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

  .project-card {
    max-width: none;
  }

  .project-image {
    height: 275px;
  }

  .project-footer {
    flex-direction: column;
    align-items: flex-start;
  }


  .about-section {
    width: calc(100% - 32px);
    padding: 88px 0 95px;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .about-layout > .section-label {
    margin-top: 0;
  }

  .about-copy h2 {
    font-size: 35px;
  }


  .footer-main {
    width: calc(100% - 32px);
    flex-direction: column;
    gap: 28px;
  }

  .footer-bottom {
    width: calc(100% - 32px);
  }


  .project-page {
    width: calc(100% - 32px);
    padding-top: 40px;
  }

  .project-header h1 {
    font-size: 40px;
  }

  .project-main-image {
    margin-bottom: 45px;
  }

  .project-intro-grid {
    grid-template-columns: 1fr;
    gap: 45px;
  }

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

  .component-row {
    grid-template-columns: 36px 1fr;
  }

  .component-row > span:last-child {
    display: none;
  }

}


/* ==================================================
   V4 — ESCALA VISUAL LIGERAMENTE MAYOR
   Ajuste final para mejorar legibilidad sin perder minimalismo.
================================================== */

.project-link {
  font-size: 12px;
}

.footer-brand p,
.footer-nav {
  font-size: 12px;
}

.project-section-title,
.project-meta {
  font-size: 10px;
}

.video-label {
  font-size: 11px;
}

@media (max-width: 750px) {
  .project-description {
    font-size: 13.5px;
  }

  .project-section-title,
  .project-meta {
    font-size: 9.5px;
  }
}


/* ==================================================
   V5 — TEXTOS PEQUEÑOS MÁS LEGIBLES
   Ajustes solicitados sin alterar la composición general.
================================================== */

/* Texto superior del hero */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.165em;
  gap: 10px;
}

.eyebrow-dot {
  width: 9px;
  height: 9px;
}


/* Etiquetas de sección: PROYECTOS, SOBRE MÍ, etc. */
.section-label {
  font-size: 12px;
  letter-spacing: 0.17em;
}


/* Píldoras de categorías */
.tag {
  padding: 7px 13px;
  font-size: 11.5px;
}


/* Cabeceras internas de las páginas de proyecto */
.project-section-title,
.project-meta {
  font-size: 12px;
  letter-spacing: 0.16em;
  gap: 13px;
}


/* Mantener líneas finas pese al aumento de texto */
.project-section-title .title-line,
.project-meta .meta-line {
  height: 1px;
}


/* Ajuste móvil proporcional */
@media (max-width: 750px) {

  .eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.15em;
  }

  .section-label {
    font-size: 11px;
  }

  .tag {
    padding: 6px 11px;
    font-size: 10.5px;
  }

  .project-section-title,
  .project-meta {
    font-size: 10.5px;
    letter-spacing: 0.145em;
  }

}


/* ==================================================
   V6 — LOGO + FAVICON
================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 36px;
  height: 36px;

  display: block;
  flex: 0 0 auto;

  object-fit: contain;
}

@media (max-width: 750px) {

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

}


/* ==================================================
   V8 — ALINEACIÓN Y TAMAÑO DE CABECERAS INTERNAS
================================================== */

/*
  EL PROYECTO · EL VÍDEO · YOUTUBE
  RECURSOS DESCARGABLES · X ARCHIVOS
  LISTA DE COMPONENTES · X PIEZAS
  GALERÍA
*/

.project-section-title {
  min-height: 18px;

  display: flex;
  align-items: center;

  gap: 14px;

  font-size: 13px;
  line-height: 1;

  letter-spacing: 0.155em;
}

/* Todos los textos ocupan exactamente la misma altura visual */
.project-section-title > span:not(.title-line) {
  display: inline-flex;
  align-items: center;

  height: 18px;

  line-height: 18px;
}

/* La línea queda matemáticamente centrada respecto al texto */
.project-section-title .title-line {
  align-self: center;

  height: 1px;

  margin: 0;
}

/* Metadatos superiores del proyecto: PROYECTO — 2026 */
.project-meta {
  min-height: 18px;

  display: flex;
  align-items: center;

  font-size: 13px;
  line-height: 1;

  letter-spacing: 0.155em;
}

.project-meta > span:not(.meta-line) {
  display: inline-flex;
  align-items: center;

  height: 18px;

  line-height: 18px;
}

.project-meta .meta-line {
  align-self: center;

  height: 1px;

  margin: 0;
}


@media (max-width: 750px) {

  .project-section-title,
  .project-meta {
    min-height: 17px;

    font-size: 11.5px;
    line-height: 1;

    letter-spacing: 0.145em;
  }

  .project-section-title > span:not(.title-line),
  .project-meta > span:not(.meta-line) {
    height: 17px;
    line-height: 17px;
  }

}


/* ==================================================
   V9 — AJUSTE ÓPTICO "EL VÍDEO"
================================================== */

/*
  El tamaño ya es correcto. Solo corregimos ópticamente la posición
  vertical de "EL VÍDEO" sin mover la línea ni "YOUTUBE".
*/
.project-video .project-section-title > span:first-child {
  transform: translateY(-2px);
}


/* ==================================================
   V10 — CORRECCIÓN DEFINITIVA DE ALINEACIÓN "EL VÍDEO"
================================================== */

/*
  La Í acentuada hace que el bloque parezca más alto y,
  en Safari/Chrome, su caja visual queda desplazada respecto
  a "EL PROYECTO" y "YOUTUBE".

  Igualamos ópticamente la línea base desplazando SOLO "EL VÍDEO"
  4 px hacia abajo. La línea horizontal y "YOUTUBE" no se mueven.
*/
.project-video .project-section-title > span:first-child {
  transform: translateY(4px);
}


/* ==================================================
   V11 — CABECERA HORIZONTAL SIMÉTRICA DEL BLOQUE PROYECTO/VÍDEO
================================================== */

/*
  Antes "EL PROYECTO" y "EL VÍDEO / YOUTUBE" vivían en dos
  contenedores distintos. El gap de las dos columnas hacía que
  "EL VÍDEO" quedase desplazado horizontalmente.

  Ahora los cinco elementos forman UNA sola fila:
  EL PROYECTO — línea — EL VÍDEO — línea — YOUTUBE

  Las dos líneas usan 1fr, por lo que tienen exactamente el mismo
  peso y "EL VÍDEO" queda centrado entre ellas.
*/

.project-intro-section {
  margin-bottom: 70px;
}

.project-intro-heading {
  min-height: 18px;

  margin-bottom: 22px;

  display: grid;
  grid-template-columns: max-content minmax(20px, 1fr) max-content minmax(20px, 1fr) max-content;
  align-items: center;

  column-gap: 14px;

  color: #7a8089;

  font-size: 13px;
  font-weight: 700;
  line-height: 1;

  letter-spacing: 0.155em;
  white-space: nowrap;
}

.project-intro-heading > span:not(.title-line) {
  display: inline-flex;
  align-items: center;

  height: 18px;
  line-height: 18px;

  transform: none !important;
}

.project-intro-heading .title-line {
  width: 100%;
  height: 1px;
  margin: 0;

  background: #e4e4e2;
}

/* Quitamos el margen inferior del grid porque ahora lo controla la sección */
.project-intro-grid {
  margin-bottom: 0;
}

/* Anula los antiguos retoques ópticos de "EL VÍDEO" */
.project-video .project-section-title > span:first-child {
  transform: none !important;
}

@media (max-width: 750px) {

  .project-intro-heading {
    min-height: 17px;

    column-gap: 9px;

    font-size: 10.5px;
    letter-spacing: 0.12em;
  }

  .project-intro-heading > span:not(.title-line) {
    height: 17px;
    line-height: 17px;
  }

}


/* ==================================================
   V15 — LISTA DE COMPONENTES CON ENLACES
================================================== */

.component-row {
  grid-template-columns:
    45px minmax(0, 1.8fr) minmax(120px, 0.75fr) auto;

  column-gap: 24px;
}

.component-name {
  min-width: 0;
}

.component-role {
  color: #777d87;
}

.component-link {
  white-space: nowrap;

  color: #2b3039;

  font-size: 12px;
  font-weight: 650;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.component-link:hover {
  opacity: 0.62;
}

.component-link-disabled {
  color: #9a9ea5;
  font-weight: 500;
}

@media (max-width: 750px) {

  .component-row {
    grid-template-columns:
      34px minmax(0, 1fr) auto;

    column-gap: 12px;

    padding: 12px 0;
  }

  .component-role {
    display: none;
  }

  .component-link {
    font-size: 11px;
  }

}


/* ==================================================
   V16 — ICONOS EN LA LISTA DE COMPONENTES
================================================== */

.component-row {
  align-items: center;
}

.component-main {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 14px;
}

.component-icon {
  width: 28px;
  height: 28px;

  display: block;
  flex: 0 0 auto;

  object-fit: contain;
}

.component-icon-fallback {
  width: 28px;
  height: 28px;

  flex: 0 0 auto;

  border-radius: 8px;
  background: #f1f1ef;
}

.component-name {
  line-height: 1.35;
}

@media (max-width: 750px) {

  .component-main {
    gap: 10px;
  }

  .component-icon,
  .component-icon-fallback {
    width: 24px;
    height: 24px;
  }

}


/* ==================================================
   V17 — MINIATURAS REALES DE COMPONENTES
================================================== */

.component-main {
  gap: 16px;
}

.component-icon {
  width: 46px;
  height: 46px;

  display: block;
  flex: 0 0 auto;

  object-fit: cover;

  border-radius: 10px;
  border: 1px solid #ececea;
}

.component-icon-fallback {
  width: 46px;
  height: 46px;

  border-radius: 10px;
}

@media (max-width: 750px) {

  .component-main {
    gap: 12px;
  }

  .component-icon,
  .component-icon-fallback {
    width: 38px;
    height: 38px;
  }

}


/* ==================================================
   V19 — DIAGRAMA DE CONEXIÓN
================================================== */

.wiring-diagram-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 30px;
  align-items: start;
}

.wiring-diagram-figure {
  display: block;
  overflow: hidden;

  border: 1px solid #e9e9e6;
  border-radius: 22px;
  background: #ffffff;
}

.wiring-diagram-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.wiring-diagram-copy h3 {
  margin: 0 0 14px;

  color: #222733;

  font-size: 26px;
  line-height: 1.15;
}

.wiring-diagram-copy p {
  margin: 0 0 18px;

  color: #666d78;
  line-height: 1.75;
}

.wiring-diagram-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  margin-bottom: 16px;
}

.wiring-diagram-note {
  padding: 14px 16px;

  border: 1px solid #ecebe8;
  border-radius: 16px;
  background: #faf9f7;

  color: #7a8089;
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 950px) {

  .wiring-diagram-card {
    grid-template-columns: 1fr;
    gap: 22px;
  }

}

@media (max-width: 750px) {

  .wiring-diagram-copy h3 {
    font-size: 22px;
  }

  .wiring-diagram-note {
    font-size: 13px;
  }

}


/* ==================================================
   V20 — TABLA DE CONEXIONES CONSULTABLE EN WEB
================================================== */

.wiring-table-download {
  display: inline-flex;
  align-items: center;

  margin-top: 2px;

  color: #2b3039;

  font-size: 13px;
  font-weight: 650;

  transition: opacity 0.18s ease;
}

.wiring-table-download:hover {
  opacity: 0.62;
}

.wiring-table-wrap {
  margin-top: 30px;

  overflow: hidden;

  border: 1px solid #e7e7e5;
  border-radius: 20px;
  background: #ffffff;
}

.wiring-table-toolbar {
  min-height: 72px;

  padding: 16px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid #ededeb;
}

.wiring-table-toolbar > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.wiring-table-kicker {
  color: #7a8089;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.16em;
}

.wiring-table-toolbar strong {
  color: #282d36;

  font-size: 13px;
}

.wiring-table-hint {
  color: #92969d;

  font-size: 11px;
}

.wiring-table-scroll {
  overflow-x: auto;

  -webkit-overflow-scrolling: touch;
}

.wiring-table {
  width: 100%;
  min-width: 980px;

  border-collapse: collapse;

  font-size: 12.5px;
}

.wiring-table th,
.wiring-table td {
  padding: 15px 18px;

  text-align: left;
  vertical-align: middle;

  border-bottom: 1px solid #efefed;
}

.wiring-table th {
  position: sticky;
  top: 0;

  color: #6f7580;
  background: #fafaf8;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wiring-table tbody tr:last-child td {
  border-bottom: 0;
}

.wiring-table tbody tr {
  transition: background 0.15s ease;
}

.wiring-table tbody tr:hover {
  background: #fbfbf9;
}

.wiring-table code {
  padding: 4px 7px;

  border-radius: 7px;

  color: #3f4650;
  background: #f2f2ef;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: 11.5px;
}

@media (max-width: 750px) {

  .wiring-table-wrap {
    margin-top: 24px;
    border-radius: 16px;
  }

  .wiring-table-toolbar {
    align-items: flex-start;
    flex-direction: column;

    gap: 7px;

    padding: 15px 16px;
  }

  .wiring-table-hint {
    font-size: 10px;
  }

}


/* ==================================================
   V22 — VISTA DE TABLA DE CONEXIONES
================================================== */

.connection-page {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 100px;
}

.connection-page-header {
  max-width: 760px;
  margin-bottom: 38px;
}

.connection-page-header h1 {
  margin: 0;

  color: #1c202a;

  font-size: 48px;
  line-height: 1.04;
  font-weight: 755;

  letter-spacing: -0.045em;
}

.connection-page-header > p:not(.section-label) {
  max-width: 680px;

  margin: 20px 0 0;

  color: #666d78;

  font-size: 15px;
  line-height: 1.7;
}

.connection-page-actions {
  margin-top: 24px;

  display: flex;
  flex-wrap: wrap;

  gap: 12px;
}

.connection-table-card {
  overflow: hidden;

  border: 1px solid #e5e6e3;
  border-radius: 20px;

  background: #ffffff;

  box-shadow:
    0 10px 32px rgba(20, 20, 20, 0.025);
}

.connection-table-summary {
  min-height: 62px;

  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid #ececea;

  color: #7b818b;

  font-size: 11px;
}

.connection-table-summary span:first-child {
  font-weight: 700;
  letter-spacing: 0.16em;
}

.connection-table-scroll {
  overflow-x: auto;

  -webkit-overflow-scrolling: touch;
}

.connection-table {
  width: 100%;
  min-width: 1050px;

  border-collapse: collapse;

  font-size: 13px;
}

.connection-table th,
.connection-table td {
  padding: 16px 18px;

  text-align: left;
  vertical-align: middle;

  border-bottom: 1px solid #efefed;
}

.connection-table th {
  color: #6d747e;
  background: #fafaf8;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.connection-table tbody tr:last-child td {
  border-bottom: 0;
}

.connection-table tbody tr:nth-child(even) {
  background: #fdfdfb;
}

.connection-table tbody tr:hover {
  background: #f8f8f5;
}

.connection-table td:first-child,
.connection-table td:nth-child(3) {
  font-weight: 620;
  color: #343943;
}

.connection-table code {
  padding: 5px 8px;

  border-radius: 8px;

  color: #3d4550;
  background: #f0f1ee;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: 12px;
}

@media (max-width: 750px) {

  .connection-page {
    width: calc(100% - 32px);

    padding-top: 38px;
  }

  .connection-page-header h1 {
    font-size: 39px;
  }

  .connection-table-summary {
    padding: 13px 16px;

    align-items: flex-start;
    flex-direction: column;

    gap: 5px;
  }

}


/* ==================================================
   V23 — RECURSOS: PREVISUALIZAR + DESCARGAR
================================================== */

.download-list {
  overflow: hidden;

  border: 1px solid #e5e6e3;
  border-radius: 18px;

  background: #ffffff;
}

.download-item {
  min-height: 82px;

  padding: 14px 18px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;

  gap: 24px;

  border-bottom: 1px solid #ededeb;
}



.download-item:not(.is-disabled):hover {
  background: #fbfbf9;
}

.download-left {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 15px;
}

.download-copy {
  min-width: 0;
}

.download-copy strong {
  display: block;

  margin-bottom: 4px;

  color: #2b3039;

  font-size: 13px;
  line-height: 1.35;
}

.download-copy small {
  display: block;

  color: #858b94;

  font-size: 11px;
  line-height: 1.4;
}

.download-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 9px;
}

.resource-action {
  min-height: 35px;

  padding: 0 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;

  white-space: nowrap;

  font-size: 11px;
  font-weight: 650;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.resource-action:hover {
  transform: translateY(-1px);
}

.resource-action-preview {
  color: #343a44;
  background: #ffffff;

  border: 1px solid #dedfdd;
}

.resource-action-preview:hover {
  background: #f6f6f4;
  border-color: #d0d1cf;
}

.resource-action-download {
  color: #ffffff;
  background: #1c202a;

  border: 1px solid #1c202a;
}

.resource-action-download:hover {
  background: #292e39;
  border-color: #292e39;
}

.resource-coming-soon {
  color: #989da5;

  font-size: 11px;
}

/* Página independiente de la tabla: refuerzo visual */
.connection-table-card {
  border-color: #e3e4e1;
}

.connection-table {
  table-layout: auto;
}

.connection-table th {
  white-space: nowrap;
}

.connection-table td {
  line-height: 1.45;
}

.connection-table td:nth-child(1) {
  min-width: 190px;
}

.connection-table td:nth-child(2) {
  min-width: 145px;
}

.connection-table td:nth-child(3) {
  min-width: 145px;
}

.connection-table td:nth-child(4) {
  min-width: 155px;
}

.connection-table td:nth-child(5) {
  min-width: 280px;
}


@media (max-width: 750px) {

  .download-item {
    grid-template-columns: 1fr;

    gap: 12px;

    padding: 15px 16px;
  }

  .download-actions {
    justify-content: flex-start;

    padding-left: 57px;
  }

  .resource-action {
    min-height: 34px;

    font-size: 10.5px;
  }

}


/* ==================================================
   V24 — PÁRRAFOS JUSTIFICADOS
================================================== */

/*
  Los textos largos de lectura pasan a estar justificados.
  El párrafo principal de la portada se mantiene centrado.
*/

.about-copy > p,
.project-story p,
.wiring-diagram-copy p,
.connection-page-header > p:not(.section-label),
.project-error > p:not(.section-label) {
  text-align: justify;
  text-justify: inter-word;
}

/* Este es el texto que aparece en tu captura: se mantiene centrado */
.hero-description {
  text-align: center;
}

/* Microcopy breve: mejor sin justificar */
.project-description,
.footer-brand p {
  text-align: left;
}


/* ==================================================
   V29 — PREVISUALIZACIÓN DEL CÓDIGO ESP32
================================================== */

.code-page {
  width: min(1180px, calc(100% - 48px));

  margin: 0 auto;
  padding: 54px 0 100px;
}

.code-page-header {
  max-width: 780px;

  margin-bottom: 34px;
}

.code-page-header h1 {
  margin: 0;

  color: #1c202a;

  font-size: 48px;
  font-weight: 755;

  line-height: 1.04;

  letter-spacing: -0.045em;
}

.code-page-header > p:not(.section-label) {
  margin: 20px 0 0;

  color: #666d78;

  font-size: 15px;
  line-height: 1.7;

  text-align: justify;
}

.code-page-actions {
  margin-top: 24px;

  display: flex;
  flex-wrap: wrap;

  gap: 11px;
}

.code-page-actions button {
  font-family: inherit;

  cursor: pointer;
}


/* Advertencia */
.code-warning {
  margin-bottom: 32px;

  padding: 24px 26px;

  display: grid;
  grid-template-columns: 42px 1fr;

  gap: 18px;

  border: 1px solid #eadfb9;
  border-radius: 20px;

  background: #fffaf0;
}

.code-warning-icon {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  color: #815f16;
  background: #f4e5af;

  font-size: 18px;
  font-weight: 800;
}

.code-warning-copy h2 {
  margin: 2px 0 9px;

  color: #292d35;

  font-size: 20px;
  letter-spacing: -0.02em;
}

.code-warning-copy > p {
  margin: 0;

  color: #656a72;

  font-size: 13.5px;
  line-height: 1.65;
}

.code-warning-copy ul {
  margin: 16px 0;

  padding-left: 21px;

  color: #525862;

  font-size: 13px;
  line-height: 1.7;
}

.code-warning-copy li {
  margin: 7px 0;
}

.code-warning code {
  padding: 2px 6px;

  border-radius: 6px;

  color: #554d37;
  background: rgba(197, 167, 91, 0.12);

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: 12px;
}

.code-warning-final {
  font-weight: 650;
}


/* Visor */
.code-viewer-section {
  overflow: hidden;

  border: 1px solid #252936;
  border-radius: 20px;

  background: #272822;

  box-shadow: 0 14px 40px rgba(20, 20, 20, 0.08);
}

.code-viewer-toolbar {
  min-height: 52px;

  padding: 0 17px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(255,255,255,0.08);

  color: #adb0b7;
  background: #20211d;

  font-size: 11px;
}

.code-viewer-toolbar > div {
  display: flex;
  align-items: center;

  gap: 9px;
}

.code-viewer-toolbar strong {
  color: #e5e5e0;

  font-weight: 600;
}

.code-viewer-dot {
  width: 8px;
  height: 8px;

  display: inline-block;

  border-radius: 50%;

  background: #d5ebfb;
}

.code-viewer {
  max-height: 850px;

  overflow: auto;

  background: #272822;
}

.code-viewer .code-highlight {
  margin: 0;
}

.code-viewer .code-highlighttable {
  width: 100%;

  border-spacing: 0;

  background: transparent;
}

.code-viewer .linenos {
  padding: 18px 12px 18px 14px !important;

  border-right: 1px solid rgba(255,255,255,0.07);

  background: rgba(0,0,0,0.09);
}

.code-viewer .linenos pre {
  margin: 0 !important;

  color: #777b82 !important;

  font-size: 12px !important;
  line-height: 1.65 !important;
}

.code-viewer .code {
  width: 100%;
}

.code-viewer .code pre {
  margin: 0 !important;
  padding: 18px 22px !important;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace !important;

  font-size: 12.5px !important;
  line-height: 1.65 !important;

  white-space: pre !important;
}

@media (max-width: 750px) {

  .code-page {
    width: calc(100% - 32px);

    padding-top: 38px;
  }

  .code-page-header h1 {
    font-size: 38px;
  }

  .code-warning {
    grid-template-columns: 1fr;

    padding: 20px;
  }

  .code-warning-icon {
    width: 34px;
    height: 34px;
  }

  .code-viewer {
    max-height: 650px;
  }

  .code-viewer .code pre {
    font-size: 11.5px !important;
  }

}


/* ==================================================
   V30 — CRÉDITO A HOMESPAN
================================================== */

.homespan-credit {
  margin-bottom: 28px;

  padding: 17px 19px;

  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;

  gap: 16px;

  border: 1px solid #dfe8ef;
  border-radius: 17px;

  background: #f7fbfe;
}

.homespan-credit-mark {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 11px;

  color: #425565;
  background: #e6f1f8;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.05em;
}

.homespan-credit-copy {
  min-width: 0;
}

.homespan-credit-label {
  display: block;

  margin-bottom: 5px;

  color: #76838d;

  font-size: 9px;
  font-weight: 750;

  letter-spacing: 0.15em;
}

.homespan-credit-copy p {
  margin: 0;

  color: #59636d;

  font-size: 12.5px;
  line-height: 1.55;
}

.homespan-credit-copy strong {
  color: #303741;
}

.homespan-credit-link {
  white-space: nowrap;

  color: #2f3943;

  font-size: 11.5px;
  font-weight: 650;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.homespan-credit-link:hover {
  opacity: 0.62;
  transform: translateY(-1px);
}

@media (max-width: 750px) {

  .homespan-credit {
    grid-template-columns: 38px 1fr;

    padding: 16px;

    gap: 13px;
  }

  .homespan-credit-link {
    grid-column: 2;

    white-space: normal;

    line-height: 1.45;
  }

}


/* ==================================================
   V31 — FOOTER LEGAL
================================================== */

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;

  gap: 14px;
}

.footer-legal-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;

  gap: 16px;

  color: #8a8f97;

  font-size: 10.5px;
}

.footer-legal-nav a,
.footer-legal-nav button {
  padding: 0;

  border: 0;
  background: none;

  color: inherit;

  font-family: inherit;
  font-size: inherit;

  cursor: pointer;

  transition: color 0.18s ease;
}

.footer-legal-nav a:hover,
.footer-legal-nav button:hover {
  color: #292e37;
}


/* ==================================================
   PÁGINAS LEGALES
================================================== */

.legal-page {
  width: min(900px, calc(100% - 48px));

  margin: 0 auto;
  padding: 52px 0 110px;
}

.legal-page-header {
  max-width: 760px;

  margin-bottom: 38px;
}

.legal-page-header h1 {
  margin: 0;

  color: #1c202a;

  font-size: 50px;
  font-weight: 755;

  line-height: 1.04;

  letter-spacing: -0.045em;
}

.legal-page-header > p:not(.section-label) {
  max-width: 690px;

  margin: 20px 0 10px;

  color: #666d78;

  font-size: 15px;
  line-height: 1.7;

  text-align: justify;
}

.legal-page-header > span {
  color: #969ba2;

  font-size: 11px;
}

.legal-notice {
  margin-bottom: 42px;

  padding: 19px 21px;

  border: 1px solid #eadfb9;
  border-radius: 17px;

  background: #fffaf0;
}

.legal-notice-blue {
  border-color: #dfe8ef;
  background: #f7fbfe;
}

.legal-notice-green {
  border-color: #dce8df;
  background: #f7fbf8;
}

.legal-notice strong {
  display: block;

  margin-bottom: 7px;

  color: #343942;

  font-size: 13px;
}

.legal-notice p {
  margin: 0;

  color: #646a73;

  font-size: 13px;
  line-height: 1.65;

  text-align: justify;
}

.legal-section {
  padding: 35px 0;

  border-top: 1px solid #e8e8e5;
}

.legal-section h2 {
  margin: 0 0 17px;

  color: #252a33;

  font-size: 22px;
  font-weight: 710;

  letter-spacing: -0.025em;
}

.legal-section p {
  margin: 0 0 15px;

  color: #5e6570;

  font-size: 14px;
  line-height: 1.75;

  text-align: justify;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-list {
  margin: 0;

  padding-left: 22px;

  color: #5e6570;

  font-size: 14px;
  line-height: 1.75;
}

.legal-list li {
  margin: 8px 0;
}

.legal-data-grid {
  margin: 0;

  display: grid;
  grid-template-columns: 1fr 1fr;

  overflow: hidden;

  border: 1px solid #e7e7e5;
  border-radius: 17px;

  background: #fff;
}

.legal-data-grid > div {
  min-height: 84px;

  padding: 17px 19px;

  border-bottom: 1px solid #ececea;
}

.legal-data-grid > div:nth-child(odd) {
  border-right: 1px solid #ececea;
}

.legal-data-grid > div:last-child,
.legal-data-grid > div:nth-last-child(2):not(.legal-data-wide) {
  border-bottom: 0;
}

.legal-data-wide {
  grid-column: 1 / -1;

  border-right: 0 !important;
  border-bottom: 0 !important;
}

.legal-data-grid dt {
  margin-bottom: 6px;

  color: #8b9097;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-data-grid dd {
  margin: 0;

  color: #343a43;

  font-size: 13px;
  line-height: 1.55;
}

.cookie-category-table {
  overflow: hidden;

  border: 1px solid #e7e7e5;
  border-radius: 17px;

  background: #fff;
}

.cookie-category-row {
  min-height: 72px;

  padding: 14px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid #ececea;
}

.cookie-category-row:last-child {
  border-bottom: 0;
}

.cookie-category-row > div {
  display: flex;
  flex-direction: column;

  gap: 4px;
}

.cookie-category-row strong {
  color: #333942;

  font-size: 13px;
}

.cookie-category-row div span {
  color: #81868e;

  font-size: 11px;
}

.cookie-status {
  padding: 6px 9px;

  border-radius: 999px;

  color: #777d85;
  background: #f0f0ee;

  font-size: 10px;
  font-weight: 650;

  white-space: nowrap;
}

.cookie-status.is-active {
  color: #486251;
  background: #e8f2eb;
}

.legal-consent-button {
  margin-top: 7px;
}


/* ==================================================
   GESTOR DE CONSENTIMIENTO
================================================== */

.consent-banner {
  position: fixed;

  left: 50%;
  bottom: 20px;
  z-index: 1000;

  width: min(1040px, calc(100% - 32px));

  padding: 18px 20px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;

  gap: 24px;

  border: 1px solid #dfe0de;
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.98);

  box-shadow:
    0 18px 55px rgba(20, 20, 20, 0.12);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  transform: translateX(-50%);
}

.consent-banner-copy strong {
  display: block;

  margin-bottom: 5px;

  color: #252a33;

  font-size: 14px;
}

.consent-banner-copy p {
  max-width: 680px;

  margin: 0;

  color: #656c76;

  font-size: 12px;
  line-height: 1.55;
}

.consent-banner-actions,
.consent-modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 9px;
}

.consent-choice,
.consent-configure {
  min-height: 40px;

  padding: 0 15px;

  border-radius: 999px;

  font-family: inherit;
  font-size: 11px;
  font-weight: 650;

  cursor: pointer;
}

.consent-choice {
  border: 1px solid #252a33;

  color: #fff;
  background: #252a33;
}

.consent-choice:hover {
  background: #343a45;
}

.consent-configure {
  border: 1px solid #d8d9d7;

  color: #353b44;
  background: #fff;
}

.consent-modal-backdrop {
  position: fixed;

  inset: 0;
  z-index: 1100;

  padding: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(19, 21, 26, 0.34);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.consent-modal {
  width: min(660px, 100%);
  max-height: min(760px, calc(100vh - 48px));

  overflow-y: auto;

  padding: 25px;

  border: 1px solid #e1e1de;
  border-radius: 22px;

  background: #fff;

  box-shadow:
    0 25px 80px rgba(20, 20, 20, 0.18);
}

.consent-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}

.consent-modal-header .section-label {
  margin-bottom: 7px;
}

.consent-modal-header h2 {
  margin: 0;

  color: #222730;

  font-size: 30px;

  letter-spacing: -0.035em;
}

.consent-close {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #e1e2df;
  border-radius: 50%;

  color: #515760;
  background: #fff;

  font-size: 22px;

  cursor: pointer;
}

.consent-modal-intro {
  margin: 18px 0 22px;

  color: #666d77;

  font-size: 13px;
  line-height: 1.65;
}

.consent-category-list {
  overflow: hidden;

  border: 1px solid #e7e7e4;
  border-radius: 17px;
}

.consent-category {
  min-height: 90px;

  padding: 15px 17px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  border-bottom: 1px solid #ececea;
}

.consent-category:last-child {
  border-bottom: 0;
}

.consent-category.is-inactive {
  background: #fbfbfa;
}

.consent-category-copy {
  min-width: 0;
}

.consent-category-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-bottom: 5px;
}

.consent-category-title strong {
  color: #343943;

  font-size: 13px;
}

.consent-category-title span {
  padding: 4px 7px;

  border-radius: 999px;

  color: #7e848b;
  background: #efefed;

  font-size: 9px;
  font-weight: 650;
}

.consent-category-copy p {
  margin: 0;

  color: #727881;

  font-size: 11.5px;
  line-height: 1.5;
}

.consent-switch {
  position: relative;

  flex: 0 0 auto;
}

.consent-switch input {
  position: absolute;

  opacity: 0;
  pointer-events: none;
}

.consent-switch span {
  position: relative;

  width: 44px;
  height: 25px;

  display: block;

  border-radius: 999px;

  background: #d8dad8;

  transition: background 0.18s ease;
}

.consent-switch span::after {
  content: "";

  position: absolute;

  top: 3px;
  left: 3px;

  width: 19px;
  height: 19px;

  border-radius: 50%;

  background: #fff;

  box-shadow: 0 1px 4px rgba(0,0,0,0.15);

  transition: transform 0.18s ease;
}

.consent-switch input:checked + span {
  background: #2f3540;
}

.consent-switch input:checked + span::after {
  transform: translateX(19px);
}

.consent-switch input:disabled + span {
  opacity: 0.6;
}

.consent-current-status {
  margin-top: 14px;

  padding: 13px 15px;

  border-radius: 14px;

  background: #f7f7f5;
}

.consent-current-status strong {
  display: block;

  margin-bottom: 4px;

  color: #414750;

  font-size: 11px;
}

.consent-current-status p {
  margin: 0;

  color: #777d86;

  font-size: 11px;
  line-height: 1.5;
}

.consent-modal-actions {
  margin-top: 18px;
}

.consent-modal-actions .button {
  border: 0;

  font-family: inherit;

  cursor: pointer;
}

.consent-policy-link {
  margin: 18px 0 0;

  color: #888d94;

  font-size: 10.5px;
  line-height: 1.5;
}

.consent-policy-link a {
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ==================================================
   RESPONSIVE LEGAL / PRIVACIDAD
================================================== */

@media (max-width: 750px) {

  .footer-right {
    align-items: flex-start;
  }

  .footer-legal-nav {
    justify-content: flex-start;

    gap: 11px 15px;
  }

  .legal-page {
    width: calc(100% - 32px);

    padding-top: 38px;
  }

  .legal-page-header h1 {
    font-size: 40px;
  }

  .legal-data-grid {
    grid-template-columns: 1fr;
  }

  .legal-data-grid > div,
  .legal-data-grid > div:nth-child(odd) {
    border-right: 0;
    border-bottom: 1px solid #ececea;
  }

  .legal-data-grid > div:last-child {
    border-bottom: 0;
  }

  .cookie-category-row {
    align-items: flex-start;
  }

  .consent-banner {
    bottom: 12px;

    grid-template-columns: 1fr;

    gap: 14px;

    padding: 17px;
  }

  .consent-banner-actions {
    align-items: stretch;

    flex-direction: column;
  }

  .consent-choice,
  .consent-configure {
    width: 100%;
  }

  .consent-modal-backdrop {
    align-items: flex-end;

    padding: 12px;
  }

  .consent-modal {
    width: 100%;
    max-height: calc(100vh - 24px);

    padding: 20px;

    border-radius: 20px;
  }

  .consent-category {
    align-items: flex-start;
  }

  .consent-modal-actions {
    align-items: stretch;

    flex-direction: column;
  }

  .consent-modal-actions > * {
    width: 100%;
  }

}


/* ==================================================
   V32 — PRIMER ARRANQUE DEL CÓDIGO
================================================== */

.code-first-start {
  margin-bottom: 28px;

  padding: 22px 24px;

  border: 1px solid #e2e4e6;
  border-radius: 20px;

  background: #fafafa;
}

.code-first-start-label {
  display: block;

  margin-bottom: 15px;

  color: #8a9097;

  font-size: 9px;
  font-weight: 750;

  letter-spacing: 0.16em;
}

.code-first-start-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 0;

  overflow: hidden;

  border: 1px solid #e7e8e9;
  border-radius: 15px;

  background: #fff;
}

.code-first-start-grid > div {
  padding: 17px 18px;
}

.code-first-start-grid > div:nth-child(odd) {
  border-right: 1px solid #ececec;
}

.code-first-start-grid > div:nth-child(-n+2) {
  border-bottom: 1px solid #ececec;
}

.code-first-start-grid strong {
  display: block;

  margin-bottom: 7px;

  color: #343a43;

  font-size: 12.5px;
}

.code-first-start-grid p {
  margin: 0;

  color: #6b727b;

  font-size: 11.5px;
  line-height: 1.6;
}

.code-first-start-grid code {
  padding: 1px 5px;

  border-radius: 5px;

  background: #f0f1f2;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: 10.5px;
}

@media (max-width: 750px) {

  .code-first-start {
    padding: 18px;
  }

  .code-first-start-grid {
    grid-template-columns: 1fr;
  }

  .code-first-start-grid > div,
  .code-first-start-grid > div:nth-child(odd),
  .code-first-start-grid > div:nth-child(-n+2) {
    border-right: 0;
    border-bottom: 1px solid #ececec;
  }

  .code-first-start-grid > div:last-child {
    border-bottom: 0;
  }

}


/* Fallback invisible para copiar código sin estilos inline (CSP-safe). */
.copy-fallback-source {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.project-noscript {
  width: min(1120px, calc(100% - 40px));
  margin: 110px auto 0;
  padding: 16px 18px;

  border: 1px solid #e4e6e8;
  border-radius: 14px;

  background: #fff;
  color: #505661;

  font-size: 14px;
  line-height: 1.6;
}
