:root{
  /* Layout base */
  --wrap: 72rem;
  --pad: 1.25rem;

  /* Automad Blocks layout support (recomendado) */
  --am-block-max-width: 50rem;
  --am-block-margin-top: 1.75rem;
  --am-container-padding: var(--pad);
  --am-flex-gap: 1.25rem;
  --am-flex-min-block-width: 18rem;

  /* UI */
  --bg: #ffffff;
  --fg: #0b0b0c;
  --muted: rgba(11,11,12,.68);
  --line: rgba(11,11,12,.14);
  --soft: rgba(11,11,12,.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:where(h1,h2,h3,p,li,a){ overflow-wrap:anywhere; }

a{ color:inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover{ text-decoration-thickness: .12em; }
a:focus-visible{ outline:3px solid #246bfe; outline-offset:3px; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.wrap{
  max-width:var(--wrap);
  margin:0 auto;
  padding:0 var(--pad);
}

.skip{
  position:absolute;
  left:-999px; top:auto;
  width:1px; height:1px;
  overflow:hidden;
}
.skip:focus{
  left: var(--pad);
  top: var(--pad);
  width:auto; height:auto;
  padding:.5rem .75rem;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:.75rem;
  z-index:999;
}

.topbar{
  position:sticky;
  top:0;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--line);
  z-index:20;
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  min-height:3.75rem;
}
.brand a{
  font-weight:650;
  letter-spacing:-.02em;
  text-decoration:none;
}
.nav__list{
  display:flex;
  gap:.9rem;
  padding:0;
  margin:0;
  list-style:none;
  flex-wrap:wrap;
}
.nav__link{
  font-size:.95rem;
  color:var(--muted);
  text-decoration:none;
  padding:.35rem .5rem;
  border-radius:.75rem;
  min-height:2.75rem;
  display:inline-flex;
  align-items:center;
}
.nav__link.is-active{
  color:var(--fg);
  background:var(--soft);
}
.nav__link:hover{
  color:var(--fg);
  background:var(--soft);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:2.75rem;
  padding:.5rem .75rem;
  border:1px solid var(--line);
  border-radius:999px;
  text-decoration:none;
  font-size:.95rem;
  background:transparent;
}
.btn:hover{ background:var(--soft); }
.btn--primary{ background:var(--fg); color:var(--bg); border-color:var(--fg); }
.btn--primary:hover{ background:#303034; }

.content{ padding:2.25rem 0 3rem; }

.hero{
  padding:2rem 0 1.25rem;
  border-bottom:1px solid var(--line);
  margin-bottom:2rem;
}
.hero__title{
  margin:0;
  font-size:clamp(2rem, 4vw, 3.25rem);
  line-height:1.05;
  letter-spacing:-.04em;
}
.hero__lead{
  margin:.85rem 0 0;
  max-width:50rem;
  color:var(--muted);
  font-size:1.05rem;
}
.hero__blocks{ margin-top:1.25rem; }

.pagehead{
  padding: .5rem 0 1.25rem;
}
.kicker{
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  margin:0 0 .35rem;
}
.lead{
  color:var(--muted);
  font-size:1.05rem;
}

.cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap:1rem;
  margin:1.25rem 0 2rem;
}
.card{
  border:1px solid var(--line);
  border-radius:1rem;
  overflow:hidden;
  background:#fff;
}
.card__link{ display:block; text-decoration:none; }
.card__image{ display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover; background:var(--soft); }
.card__body{ padding:1rem; }
.card__title{
  margin:0 0 .35rem;
  font-size:1.1rem;
  letter-spacing:-.02em;
}
.card__desc{
  margin:0;
  color:var(--muted);
  font-size:.98rem;
}
.card__more{ display:inline-block; margin-top:1rem; font-weight:650; }

.pagehead--portfolio{ max-width:52rem; padding-block:2.5rem; }
.portfolio-intro{ font-size:1.1rem; }
.closing-cta{ margin:4rem 0 1rem; padding:clamp(1.5rem,4vw,3rem); border-radius:1.5rem; background:var(--soft); }
.closing-cta h2{ margin-top:0; font-size:clamp(1.6rem,3vw,2.4rem); }
.portfolio-sections{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin:3rem 0; }
.portfolio-panel,.project-commercial{ padding:clamp(1.25rem,3vw,2rem); border:1px solid var(--line); border-radius:1.25rem; }
.portfolio-panel h2,.project-commercial h2{ margin-top:.25rem; }

.project-hero{ display:grid; grid-template-columns:minmax(0,.85fr) minmax(20rem,1.15fr); gap:clamp(1.5rem,5vw,4.5rem); align-items:center; padding:2rem 0 3.5rem; }
.project-hero h1{ margin:.25rem 0; font-size:clamp(2.25rem,5vw,4.5rem); line-height:1; letter-spacing:-.05em; }
.project-hero__subtitle{ margin:.6rem 0; font-size:1.2rem; font-weight:650; }
.project-status{ color:var(--muted); }
.project-hero__media,.project-gallery figure{ margin:0; }
.project-hero__media img,.project-gallery img{ display:block; width:100%; height:auto; object-fit:cover; border-radius:1rem; border:1px solid var(--line); background:var(--soft); }
.project-hero__media img{ aspect-ratio:16/9; }
figcaption{ margin-top:.5rem; color:var(--muted); font-size:.88rem; }
.media-fallback{ display:grid; place-items:center; width:100%; aspect-ratio:16/9; padding:2rem; border:1px solid var(--line); border-radius:1rem; background:var(--soft); color:var(--muted); text-align:center; }
.media-fallback--card{ aspect-ratio:4/3; border:0; border-radius:0; }
.media-fallback--gallery{ aspect-ratio:16/10; }
.project-actions{ display:flex; flex-wrap:wrap; gap:.65rem; margin-top:1.5rem; }
.project-actions .btn{ max-width:100%; }
.project-intro,.project-tech{ max-width:52rem; margin:2rem 0 3rem; }
.project-list-section{ margin:2rem 0 3rem; padding-top:2.5rem; border-top:1px solid var(--line); }
.project-list-section .project-richtext ul{ columns:2; column-gap:3rem; }
.project-commercial{ max-width:58rem; margin:3rem 0; background:var(--soft); }
.project-intro h2,.project-columns h2,.project-tech h2{ font-size:1rem; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
.project-intro__text{ font-size:clamp(1.2rem,2.4vw,1.65rem); line-height:1.45; }
.project-columns{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(1.5rem,5vw,4rem); padding:2.5rem 0; border-top:1px solid var(--line); }
.project-columns > *, .project-gallery > *, .portfolio-sections > *{ min-width:0; }
.project-columns--details{ border-bottom:1px solid var(--line); }
.project-richtext :first-child{ margin-top:0; }
.project-gallery{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin:3rem 0; }
.project-gallery figure:first-child{ grid-column:1/-1; }
.project-gallery img{ aspect-ratio:16/10; }
.project-nav{ display:flex; justify-content:space-between; gap:1rem; margin-top:4rem; padding-top:1.5rem; border-top:1px solid var(--line); }
.project-nav a{ display:flex; gap:.65rem; align-items:center; text-decoration:none; font-weight:650; }
.project-nav a:last-child{ text-align:right; margin-left:auto; }
.project-nav small{ display:block; color:var(--muted); font-weight:400; }
.tags{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  margin-top:.8rem;
}
.tag{
  font-size:.78rem;
  padding:.18rem .55rem;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  background:transparent;
}

.footer{
  padding:2rem 0 2.5rem;
}

.footer__inner{
  background:color-mix(in srgb, var(--bg) 10%, white 90%);
  border:1px solid var(--line);
  border-radius:1.5rem;
  padding:1rem 1.1rem;
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  grid-template-areas:
    "brand copy social"
    "brand links social";
  gap:.75rem 1rem;
  align-items:center;
}

.footer__brand{
  grid-area:brand;
  display:inline-flex;
  align-items:center;
}

.footer__logo{
  width:32px;
  height:32px;
  object-fit:contain;
}

.footer__copy{
  grid-area:copy;
  margin:0;
  color:var(--muted);
}

.footer__links{
  grid-area:links;
  display:flex;
  flex-wrap:wrap;
  gap:.75rem 1rem;
}

.footer__social{
  grid-area:social;
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.5rem;
}

.footer__social-link{
  width:2.6rem;
  height:2.6rem;
  border:1px solid var(--line);
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--bg) 18%, white 82%);
  transition:transform .15s ease, border-color .2s ease, background .2s ease;
}

.footer__social-link:hover,
.footer__social-link:focus-visible{
  transform:translateY(-1px);
  border-color:var(--soft);
  background:color-mix(in srgb, var(--bg) 24%, white 76%);
}

.footer__social-icon{
  width:1.05rem;
  height:1.05rem;
  display:block;
}

.muted{ color:var(--muted); margin:0; }

@media (max-width: 900px){
  .project-hero{ grid-template-columns:1fr; }
  .project-hero__copy{ max-width:44rem; }
}

@media (max-width: 720px){
  .topbar__inner{ flex-wrap:wrap; padding-block:.65rem; }
  .topbar__cta{ display:none; }
  .project-hero,.project-columns,.project-gallery,.portfolio-sections{ grid-template-columns:1fr; }
  .project-list-section .project-richtext ul{ columns:1; }
  .project-gallery figure:first-child{ grid-column:auto; }
  .project-nav{ flex-direction:column; }
  .project-nav a:last-child{ margin-left:0; text-align:left; }
  .footer__inner{
    grid-template-columns:1fr;
    grid-template-areas:
      "brand"
      "copy"
      "links"
      "social";
    justify-items:start;
  }

  .footer__social{
    justify-content:flex-start;
  }
}

@media (max-width: 380px){
  :root{ --pad:1rem; }
  .project-actions{ flex-direction:column; align-items:stretch; }
  .project-actions .btn{ width:100%; }
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}

/* Bloques: el engine añade estilos base; aquí solo damos coherencia tipográfica */
.blocks :where(h1,h2,h3){ letter-spacing:-.02em; }
.blocks :where(p,ul,ol){ color:var(--fg); }
.blocks :where(blockquote){
  margin:0;
  padding:1rem 1.1rem;
  border-left:3px solid var(--line);
  background:var(--soft);
  border-radius:.75rem;
}
