/* ==========================================================================
   IACO Construcciones — Design tokens
   ========================================================================== */
:root {
  /* Brand colors (Manual de Marca IACO) */
  --primary: #0c64b1; /* Ocean Deep */
  --primary-dark: #084a82;
  --primary-light: #4a90d8;
  --primary-tint-08: rgba(12, 100, 177, 0.08);
  --primary-tint-14: rgba(12, 100, 177, 0.14);
  --ink: #191a1c; /* Carbon Black */
  --paper: #ffffff;

  /* Semantic neutrals derived from Carbon Black */
  --text: var(--ink);
  --text-soft: #4b4d50;
  --text-muted: #686a6e;
  --surface: #ffffff;
  --surface-soft: #f4f5f6;
  --surface-dark: #15161a;
  --surface-dark-soft: #202329;
  --border: rgba(25, 26, 28, 0.1);
  --border-dark: rgba(255, 255, 255, 0.12);

  /* Type */
  --font:
    "Archivo", "Segoe UI", system-ui, -apple-system, Helvetica, Arial,
    sans-serif;
  --fs-display: clamp(2.6rem, 4.2vw + 1.2rem, 5.4rem);
  --fs-h2: clamp(2rem, 2vw + 1.4rem, 3.1rem);
  --fs-h3: clamp(1.25rem, 0.6vw + 1.1rem, 1.6rem);
  --fs-lead: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Spacing (4/8 rhythm) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --section-pad: clamp(4rem, 8vw, 8rem);

  /* Layout */
  --container: 1240px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.5s;
  --dur-slow: 0.9s;

  --header-h: 84px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}
body.nav-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
h1,
h2,
h3,
h4,
p,
blockquote,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.08;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
}

.container {
  width: min(100% - 2 * clamp(1.25rem, 5vw, 3rem), var(--container));
  margin-inline: auto;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: var(--space-4);
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ==========================================================================
   Scroll progress bar
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 900;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 800;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition:
    height var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.site-header.is-scrolled {
  height: 64px;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.9);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: var(--space-3);
}
.logo__img {
  height: 46px;
  width: auto;
  transition: height var(--dur-fast) var(--ease);
}
.is-scrolled .logo__img {
  height: 38px;
}
.logo--footer .logo__img {
  height: 56px;
}
.logo__img--reversed {
  filter: brightness(0) invert(1);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__link {
  position: relative;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-soft);
  padding: var(--space-2) 0;
  transition: color var(--dur-fast) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  transition: right var(--dur-med) var(--ease);
}
.nav__link:hover {
  color: var(--ink);
}
.nav__link:hover::after {
  right: 0;
}
.nav__link.is-active {
  color: var(--ink);
}
.nav__link.is-active::after {
  right: 0;
}

.header__cta {
  flex-shrink: 0;
  margin-right: var(--space-3);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--ink);
  margin-inline: auto;
  transition:
    transform var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 790;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-8) clamp(1.25rem, 5vw, 3rem);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  transition:
    transform var(--dur-med) var(--ease),
    opacity var(--dur-med) var(--ease),
    visibility var(--dur-med);
}
.mobile-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.site-header.is-scrolled + .mobile-nav { top: 64px; }
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.mobile-nav .nav__link {
  font-size: 1.3rem;
  color: var(--ink);
}

@media (max-width: 860px) {
  .header__inner .nav {
    display: none;
  }
  .header__inner { gap: var(--space-2); }
  .header__inner .logo { margin-left: 0; }
  .header__inner .logo__img { height: 34px; }
  .site-header.is-scrolled .logo__img { height: 32px; }
  .header__inner .header__cta {
    flex: 0 1 180px;
    min-width: 0;
    min-height: 44px;
    margin-right: 0;
    padding: 0.5em 0.6em;
    font-size: 0.75rem;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
  .header__cta span { min-width: 0; }
  .header__cta svg { flex-shrink: 0; }
  .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition:
    transform var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--primary);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.btn--ghost {
  border-color: var(--border);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn--sm {
  padding: 0.6em 1.3em;
  font-size: 0.875rem;
}
.btn--block {
  width: 100%;
}

/* ==========================================================================
   Type helpers
   ========================================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.eyebrow--light {
  color: var(--primary-light);
}
.eyebrow--light::before {
  background: var(--primary-light);
}

.section {
  padding-block: var(--section-pad);
}
.section--dark {
  background: var(--surface-dark);
  color: var(--paper);
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  flex-wrap: wrap;
}
.section__title {
  font-size: var(--fs-h2);
  max-width: 18ch;
}
.section__lead {
  font-size: var(--fs-lead);
  color: var(--text-soft);
  max-width: 42ch;
}
.section--dark .section__lead {
  color: rgba(255, 255, 255, 0.68);
}

/* ==========================================================================
   Media placeholder frame (for future real photos)
   ========================================================================== */
.media-frame {
  --rot: 155deg;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 5;
  background: linear-gradient(
    var(--rot),
    var(--primary) 0%,
    var(--primary-dark) 65%,
    var(--ink) 130%
  );
  color: rgba(255, 255, 255, 0.35);
  transition:
    box-shadow var(--dur-med) var(--ease),
    background var(--dur-med) var(--ease);
}
.media-frame__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}
.media-frame__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}
.media-frame__corner.tl {
  top: 16px;
  left: 16px;
  border-right: none;
  border-bottom: none;
}
.media-frame__corner.br {
  bottom: 16px;
  right: 16px;
  border-left: none;
  border-top: none;
}
.media-frame__label {
  position: absolute;
  inset: auto var(--space-4) var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
  background: var(--ink);
  color: var(--paper);
}
.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(25, 26, 28, 0.8) 0%,
    rgba(25, 26, 28, 0.5) 45%,
    rgba(25, 26, 28, 0.85) 100%
  );
}
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 60% 40%, black 10%, transparent 72%);
}
.hero__blueprint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.16);
  z-index: 2;
}
.hero__blueprint .bp-line path {
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
}
.hero__inner {
  position: relative;
  z-index: 3;
  padding-block: var(--space-16);
}
.hero__title {
  font-size: var(--fs-display);
  max-width: 18ch;
}
.hero .eyebrow { color: var(--primary-light); }
.hero .eyebrow::before { background: var(--primary-light); }
.hero__title em {
  font-style: normal;
  color: var(--primary-light);
}
.reveal-line {
  display: block;
  overflow: hidden;
}
.reveal-line > span {
  display: block;
}
.js .reveal-line > span { transform: translateY(110%); }
.hero__lead {
  margin-top: var(--space-6);
  max-width: 46ch;
  font-size: var(--fs-lead);
  color: rgba(255, 255, 255, 0.72);
}
.hero__actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.hero .btn--ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--paper);
}
.hero .btn--ghost:hover {
  border-color: var(--paper);
}

.hero__stats {
  position: relative;
  z-index: 3;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: var(--space-8);
}
.hero__stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.stat__num {
  font-size: clamp(1.8rem, 2vw + 1rem, 2.6rem);
  font-weight: 800;
  color: var(--primary-light);
}
.stat__label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}
.stat__pending { font-size: 1rem; color: rgba(255, 255, 255, 0.72); }

.hero__scroll {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
}
.hero__scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--paper);
  animation: scrollDot 1.8s infinite var(--ease);
}
@keyframes scrollDot {
  0% {
    opacity: 1;
    top: 8px;
  }
  70% {
    opacity: 0;
    top: 20px;
  }
  100% {
    opacity: 0;
    top: 8px;
  }
}

@media (max-width: 720px) {
  .hero__stats-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: var(--space-8);
  }
  .hero__scroll {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }
}

/* ==========================================================================
   About / Nosotros
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-16);
  align-items: start;
}
.about__media {
  position: sticky;
  top: calc(var(--header-h) + var(--space-8));
}
/* La foto anterior permanece opaca debajo del fundido para evitar blancos. */
.about-slideshow { aspect-ratio: 4 / 5; }
.about-slideshow__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 3s ease-in-out;
}
.about-slideshow__image.is-active { opacity: 1; z-index: 1; }
.about-slideshow__image.is-entering { opacity: 1; z-index: 2; }
.about-slideshow .media-frame__corner { z-index: 3; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .about-slideshow__image { transition: none; }
}
.about__content h2 {
  font-size: var(--fs-h2);
  max-width: 16ch;
  margin-bottom: var(--space-6);
}
.about__content p {
  color: var(--text-soft);
  max-width: 60ch;
}
.about__content p + p {
  margin-top: var(--space-4);
}

.pull-quote {
  margin-block: var(--space-12);
  padding-left: var(--space-6);
  border-left: 3px solid var(--primary);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.pull-quote cite {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.promise__num {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--space-2);
}
.promise h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-2);
}
.promise p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .about {
    grid-template-columns: 1fr;
  }
  .about__media {
    position: static;
    max-width: 380px;
  }
  .promise-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* ==========================================================================
   Services
   ========================================================================== */
.services {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-8);
}
.section--dark .section__title { margin-bottom: var(--space-6); }
.service {
  display: grid;
  grid-template-columns: 1fr 2.4fr 1.4fr;
  gap: var(--space-8);
  align-items: center;
  padding-block: var(--space-8);
  border-top: 1px solid var(--border-dark);
  transition: background var(--dur-med) var(--ease);
}
.services .service:last-child {
  border-bottom: 1px solid var(--border-dark);
}
.service:hover {
  background: rgba(255, 255, 255, 0.03);
}
.service__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.service__num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-light);
}
.service h3 {
  font-size: var(--fs-h3);
}
.service p {
  color: rgba(255, 255, 255, 0.65);
  max-width: 46ch;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-start;
}
.tag-list li {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4em 0.9em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 900px) {
  .service {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ==========================================================================
   Projects
   ========================================================================== */
.project-card__tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint-08);
  padding: 0.3em 0.8em;
  border-radius: 999px;
}
.project-card__meta {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}
.project-card__meta li {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.project-card__meta strong {
  color: var(--text-soft);
  font-weight: 600;
  margin-right: 0.3em;
}

/* --- Tree + preview explorer --- */
.projects-explorer {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: var(--space-16);
  align-items: start;
}

.projects-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--space-3);
  margin-right: calc(var(--space-3) * -1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.projects-tree::-webkit-scrollbar {
  width: 6px;
}
.projects-tree::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.tree-group {
  border-bottom: 1px solid var(--border);
}
.tree-group:last-child {
  border-bottom: none;
}

.tree-group__title {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding-block: var(--space-3);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.tree-group__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.tree-group__label {
  flex: 1;
  text-align: left;
}
.tree-group__count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 0.15em 0.6em;
}
.tree-group__chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease);
}
.tree-group.is-open .tree-group__chevron {
  transform: rotate(180deg);
}
.tree-group.is-open .tree-group__title {
  color: var(--primary);
}
.tree-group.is-open .tree-group__dot {
  background: var(--primary);
}

.tree-group__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-med) var(--ease);
}
.tree-group.is-open .tree-group__panel {
  grid-template-rows: 1fr;
}
.tree-group__panel ul {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--border);
  margin-left: 3px;
}
.tree-group__panel ul > li:last-child .tree-item {
  padding-bottom: var(--space-3);
}

.tree-item {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  padding-left: calc(var(--space-6) + var(--space-2));
  font-size: 0.92rem;
  color: var(--text-muted);
  position: relative;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition:
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.tree-item::before {
  content: "";
  position: absolute;
  left: -1.5px;
  top: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--border);
}
.tree-item:hover,
.tree-item:focus-visible {
  color: var(--ink);
  background: var(--primary-tint-08);
}
.tree-item.is-active {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-tint-08);
}
.tree-item.is-active::after {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.projects-preview {
  position: sticky;
  top: calc(var(--header-h) + var(--space-8));
}
.projects-preview .media-frame {
  aspect-ratio: 4 / 3;
}
.projects-preview .media-frame.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.projects-preview__body {
  margin-top: var(--space-5);
  transition: opacity var(--dur-fast) var(--ease);
}
.projects-preview__body.is-fading {
  opacity: 0;
}
.projects-preview__body h3 {
  margin-top: var(--space-2);
  font-size: var(--fs-h3);
}

@media (max-width: 900px) {
  .projects-explorer {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
  .projects-preview {
    position: static;
  }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.section--contact {
  background: var(--surface-soft);
}
.contact__intro {
  max-width: 40ch;
}
.contact__intro h2 {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-4);
}
.contact__intro > p:not(.eyebrow) {
  color: var(--text-soft);
  margin-bottom: var(--space-8);
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}
.contact-info li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-soft);
}
.contact-info svg {
  color: var(--primary);
  flex-shrink: 0;
}
.contact-info a:hover {
  color: var(--primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.7);
  padding-block: var(--space-16);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
}
.footer__claim {
  font-size: 1.1rem;
  color: var(--paper);
  font-weight: 600;
  max-width: 30ch;
}
.footer__nav {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer__nav a:hover {
  color: var(--primary-light);
}
.footer__legal {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================================
   Back to top
   ========================================================================== */
.to-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 700;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity var(--dur-med) var(--ease),
    transform var(--dur-med) var(--ease),
    background var(--dur-fast) var(--ease);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  background: var(--primary);
}

/* ==========================================================================
   Reveal-on-scroll base state (JS adds .is-visible)
   ========================================================================== */
.js .reveal-up {
  opacity: 0;
  transform: translateY(24px);
}
.js .reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal-up {
    opacity: 1;
    transform: none;
  }
  .js .reveal-line > span {
    transform: none;
  }
}

.project-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  filter: saturate(0.82) contrast(1.06) brightness(0.94);
}

.media-frame.project-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background: linear-gradient(
    135deg,
    rgba(12, 100, 177, 0.1),
    rgba(25, 26, 28, 0.08)
  );

  mix-blend-mode: multiply;
}

/* Institucional: misión, visión y forma de trabajar */
.about__direction {
  margin-block: var(--space-12);
  padding-left: var(--space-6);
  border-left: 3px solid var(--primary);
}
.about__direction h3 { font-size: 1.05rem; margin-bottom: var(--space-3); }
.about__direction h3:not(:first-child) { margin-top: var(--space-8); }
.about__content .about__mission { font-weight: 600; color: var(--ink); }
.section--approach { background: var(--paper); border-bottom: 1px solid var(--border); }
.approach__intro { max-width: 70ch; margin-top: var(--space-6); color: var(--text-soft); }
.approach__intro p + p { margin-top: var(--space-4); }
.approach__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8); margin-top: var(--space-12); }
.approach__item { border-top: 2px solid var(--primary); padding-top: var(--space-6); }
.approach__item h3 { font-size: var(--fs-h3); margin-bottom: var(--space-3); }
.approach__item p { color: var(--text-soft); }
.approach__safety { margin-top: var(--space-12); padding-left: var(--space-6); border-left: 3px solid var(--primary); font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; max-width: 50ch; }
@media (max-width: 900px) { .approach__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .approach__grid { grid-template-columns: 1fr; } }
