/* kori. — base común a todas las páginas: tipografías, colores, cabecera, botones y pie. */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("/assets/fonts/newsreader-latin.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 300 600; font-display: swap;
  src: url("/assets/fonts/newsreader-latin-italic.woff2") format("woff2"); }

:root {
  --ink: #100906;          /* casi negro cálido */
  --ink-2: #3b3530;
  --ink-3: #8a837b;
  --cream: #fffdf8;        /* fondo */
  --stone: #e5e3df;        /* cabecera y bloques suaves */
  --stone-2: #d9d9d6;
  --green: #2e7040;        /* único acento */
  --green-light: #8fbf9a;  /* el acento sobre fondo oscuro */
  --line: rgba(16, 9, 6, .16);
  --line-dark: rgba(255, 253, 248, .16);
  --sans: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(20px, 5.6vw, 128px);
  --head: clamp(100px, 8.4vw, 134px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans); font-size: 1rem; line-height: 1.7; font-weight: 400;
  color: var(--ink); background: var(--cream);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
::selection { background: var(--green); color: var(--cream); }
.wrap { width: 100%; padding: 0 var(--gutter); }

/* ---------- Tipografía ---------- */
.caps { text-transform: uppercase; letter-spacing: .14em; }
.eyebrow { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; color: var(--ink-3); }
.t-xl { font-size: clamp(2.5rem, 5.8vw, 7.5rem); font-weight: 300; line-height: 1.02; text-transform: uppercase; letter-spacing: .04em; }
.t-l  { font-size: clamp(2rem, 3.9vw, 5rem); font-weight: 300; line-height: 1.06; text-transform: uppercase; letter-spacing: .05em; }
.t-m  { font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 400; line-height: 1.25; text-transform: uppercase; letter-spacing: .1em; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; text-transform: none; }
.serif em, em.g { font-style: italic; color: var(--green); }
.lead { font-family: var(--serif); font-size: clamp(1.25rem, 1.6vw, 1.875rem); line-height: 1.45; color: var(--ink-2); }
.green { color: var(--green); }

/* ---------- Botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .9em; height: 52px; padding: 0 28px;
  background: var(--ink); color: var(--cream);
  font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em;
  transition: background-color .3s, color .3s;
}
.btn:hover { background: var(--green); }
.btn.light { background: var(--cream); color: var(--ink); }
.btn.light:hover { background: var(--green); color: var(--cream); }
.more { display: inline-flex; align-items: center; gap: .8em; font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; }
.chev { display: inline-block; width: .45em; height: .45em; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .35s var(--ease); }
a:hover > .chev, button:hover > .chev { transform: translateX(4px) rotate(45deg); }

/* ---------- Cabecera ---------- */
.head { position: fixed; inset: 0 0 auto 0; z-index: 50; background: var(--stone); padding-top: env(safe-area-inset-top); transition: box-shadow .3s; }
.head.scrolled { box-shadow: 0 1px 0 var(--line); }
.head-inner { position: relative; display: flex; align-items: center; justify-content: space-between; height: var(--head); transition: height .4s var(--ease); }
.head.scrolled .head-inner { height: 84px; }
body.mega-open .head .head-inner { height: var(--head); }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; transition: opacity .25s; }
.brand img { height: clamp(32px, 2.6vw, 40px); width: auto; transition: height .4s var(--ease); }
.brand small { font-size: .75rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); transition: opacity .3s; white-space: nowrap; }
.head.scrolled .brand img { height: 30px; }
.head.scrolled .brand small { opacity: 0; height: 0; margin-top: -8px; overflow: hidden; }
.menu { display: flex; align-items: center; gap: clamp(24px, 2.4vw, 40px); }
.menu .top { font-size: clamp(.875rem, .95vw, .9375rem); font-weight: 400; text-transform: uppercase; letter-spacing: .1em; position: relative; padding: 8px 0; }
.menu .top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.menu .top:hover::after, .menu .top[aria-current]::after, .menu .top[aria-expanded="true"]::after { transform: scaleX(1); transform-origin: left; }
.lang { display: flex; align-items: center; gap: 10px; font-size: .8125rem; font-weight: 500; letter-spacing: .14em; }
.menu .lang { padding-left: clamp(16px, 2vw, 28px); border-left: 1px solid var(--line); }
.lang button { opacity: .45; transition: opacity .2s; padding: 4px 0; }
.lang button[aria-pressed="true"] { opacity: 1; }

/* el menú desplegable: la cabecera crece hasta ocupar la pantalla, como en un índice */
.close-mega { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 6px 10px 0; font-size: .875rem; font-weight: 400; line-height: 1.4; text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; overflow: visible; opacity: 0; visibility: hidden; transition: opacity .25s; }
.close-mega .x { position: relative; flex: none; width: 20px; height: 20px; }
.close-mega .x::before, .close-mega .x::after { content: ""; position: absolute; left: -1px; right: -1px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.close-mega .x::after { transform: rotate(-45deg); }
.mega { display: none; }
body.mega-open { overflow: hidden; }
body.mega-open .head { bottom: 0; box-shadow: none; }
body.mega-open .brand { opacity: 0; visibility: hidden; }
body.mega-open .close-mega { opacity: 1; visibility: visible; }
body.mega-open .mega { display: block; height: calc(100% - var(--head)); overflow-y: auto; padding-top: clamp(24px, 5vh, 56px); padding-bottom: 48px; animation: megaIn .45s var(--ease); }
@keyframes megaIn { from { opacity: 0; transform: translateY(-8px); } }
.mega-panel { display: grid; grid-template-columns: max-content 1fr; gap: clamp(32px, 6vw, 120px); }
.mega-panel[hidden] { display: none; }
.mega-panel.solo { grid-template-columns: 1fr; }
.mega-l, .mega-sub { list-style: none; }
.mega-l a { display: flex; align-items: center; justify-content: space-between; gap: 40px; white-space: nowrap; padding: 10px 0; font-size: clamp(1.5rem, 2.4vw, 2.25rem); font-weight: 300; text-transform: uppercase; letter-spacing: .07em; line-height: 1.25; transition: color .25s; }
.mega-l a.mail { text-transform: none; letter-spacing: .02em; }
.mega-l a:hover, .mega-l a.on { color: var(--green); }
.mega-panel.solo .mega-l a { justify-content: flex-start; }
.mega-l .arr { width: 30px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .4s var(--ease); }
.mega-l a:hover .arr, .mega-l a.on .arr { opacity: 1; transform: none; }
.mega-r { border-left: 1px solid var(--line); padding-left: clamp(24px, 4vw, 64px); min-height: 100%; }
.mega-sub { animation: megaIn .4s var(--ease); }
.mega-sub[hidden] { display: none; }
.mega-sub p { font-family: var(--serif); font-size: clamp(1.25rem, 1.7vw, 1.875rem); line-height: 1.45; color: var(--ink-2); max-width: 32ch; }
.mega-sub .more { margin-top: 28px; }
.mega-sub .more:hover { color: var(--green); }

/* menú móvil */
.burger { display: none; width: 44px; height: 44px; position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: transform .4s var(--ease); }
.burger span:nth-child(1) { top: 17px; } .burger span:nth-child(2) { top: 25px; }
body.mnav-open .burger span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
body.mnav-open .burger span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
.mnav { display: none; }
@media (max-width: 900px) {
  :root { --head: 72px; }
  .brand img { height: 24px; }
  .brand small { display: none; }
  .menu, .close-mega, .mega { display: none !important; }
  .burger { display: block; margin-right: -10px; }
  body.mnav-open { overflow: hidden; }
  body.mnav-open .head { bottom: 0; box-shadow: none; }
  body.mnav-open .mnav { display: block; height: calc(100% - var(--head)); overflow-y: auto; padding: 16px 0 48px; animation: megaIn .4s var(--ease); }
  .mnav details, .mnav .m-top { border-bottom: 1px solid var(--line); }
  .mnav summary, .mnav .m-top { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font-size: 1.375rem; font-weight: 300; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }
  .mnav summary::-webkit-details-marker { display: none; }
  .mnav .plus { position: relative; width: 16px; height: 16px; }
  .mnav .plus::before, .mnav .plus::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.25px; background: currentColor; }
  .mnav .plus::after { transform: rotate(90deg); transition: transform .35s var(--ease); }
  .mnav details[open] .plus::after { transform: none; }
  .mnav ul { list-style: none; padding: 0 0 16px; }
  .mnav li a { display: block; padding: 9px 0; font-size: .875rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); }
  .mnav .lang { margin-top: 28px; font-size: .875rem; }
}

/* ---------- Banner de cabecera de página, con foto ---------- */
.banner { position: relative; margin-top: var(--head); min-height: clamp(380px, 56vh, 620px); display: flex; align-items: flex-end; background: var(--ink); color: var(--cream); overflow: hidden; }
.banner .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16, 9, 6, .82) 0%, rgba(16, 9, 6, .55) 45%, rgba(16, 9, 6, .12) 100%), linear-gradient(0deg, rgba(16, 9, 6, .45), transparent 50%); }
.banner .wrap { position: relative; z-index: 1; padding-top: 64px; padding-bottom: clamp(44px, 7vh, 84px); }
.banner .eyebrow { color: rgba(255, 253, 248, .7); margin-bottom: 18px; }
.banner .lead { color: rgba(255, 253, 248, .86); margin-top: 22px; max-width: 50ch; }

/* ---------- Selector a la izquierda, detalle a la derecha (servicios y proyectos) ---------- */
.split { display: grid; grid-template-columns: minmax(240px, 4fr) 8fr; gap: clamp(32px, 6vw, 120px); align-items: start; }
.picker { list-style: none; position: sticky; top: 124px; }
.picker button, .picker a { position: relative; display: block; width: 100%; padding: 13px 28px 13px 0; font-size: clamp(.875rem, 1vw, 1.0625rem); font-weight: 400; line-height: 1.45; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); transition: color .25s; }
.picker button::after, .picker a::after { content: ""; position: absolute; right: 0; top: 50%; width: 2px; height: 26px; margin-top: -13px; background: var(--green); transform: scaleY(0); transition: transform .4s var(--ease); }
.picker button:hover, .picker a:hover { color: var(--ink); }
.picker [aria-pressed="true"], .picker [aria-current="true"] { color: var(--ink); }
.picker [aria-pressed="true"]::after, .picker [aria-current="true"]::after { transform: none; }
.picker .sub { display: block; margin-top: 3px; font-size: .75rem; letter-spacing: .12em; color: var(--ink-3); }
.detail { min-width: 0; }
.detail.swap > * { animation: swapIn .6s var(--ease) both; }
.detail.swap > *:nth-child(2) { animation-delay: .05s; } .detail.swap > *:nth-child(3) { animation-delay: .1s; } .detail.swap > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes swapIn { from { opacity: 0; transform: translateY(14px); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { padding: 11px 16px; border: 1px solid var(--line); font-size: .6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-2); transition: border-color .25s, color .25s, background-color .25s; }
.filters button:hover { border-color: var(--ink); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
/* una "vista": en escritorio la sección ocupa justo la pantalla bajo la cabecera y el scroll se detiene en ella,
   así el selector y el detalle quedan quietos mientras se eligen opciones */
.picker-label { display: none; }
@media (min-width: 901px) {
  html:has(.view) { scroll-snap-type: y proximity; scroll-padding-top: 84px; }
  /* la vista no cambia de tamaño ni de sitio al cambiar el contenido (si no, el navegador desplaza la página para seguirlo) */
  .view { min-height: calc(100svh - 84px); display: flex; flex-direction: column; padding: clamp(28px, 5vh, 64px) 0; scroll-snap-align: start; overflow-anchor: none; }
  .view > .wrap:not(.split) { flex: 1; display: flex; flex-direction: column; }
  .view .split { flex: 1; align-items: center; }
  .view .picker { position: static; }
}
/* en móvil el selector es un desplegable: se ve la opción elegida y al tocarla se abren las demás debajo */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .picker-label { display: block; margin-bottom: 10px; }
  .picker { position: static; border: 1px solid var(--ink); background: var(--cream); }
  .picker li + li { border-top: 1px solid var(--line); }
  .picker:not(.open) li:not(:has([aria-pressed="true"])) { display: none; }
  .picker button { padding: 15px 52px 15px 16px; color: var(--ink-2); }
  .picker [aria-pressed="true"] { color: var(--ink); font-weight: 500; }
  .picker button::after { display: none; }
  .picker li:has([aria-pressed="true"]) button::before { content: ""; position: absolute; right: 20px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .35s var(--ease); }
  .picker.open li:has([aria-pressed="true"]) button::before { transform: translateY(4px) rotate(-135deg); }
  .picker .none { padding: 15px 16px; }
}

/* ---------- Pie ---------- */
.foot { padding: clamp(64px, 10vh, 104px) 0 calc(40px + env(safe-area-inset-bottom)); text-align: center; border-top: 1px solid var(--line); }
.foot img { height: 34px; width: auto; margin: 0 auto; }
.foot-nav { margin-top: 32px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; }
.foot-legal { margin-top: 22px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 0; font-size: .75rem; color: var(--ink-3); }
.foot-legal a + a::before { content: "|"; margin: 0 12px; opacity: .5; }
.foot a:hover { color: var(--green); }
.foot .copy-line { margin-top: 14px; font-size: .75rem; color: var(--ink-3); }

/* ---------- Pestaña fija de contacto ---------- */
.tab-cta { position: fixed; left: 0; bottom: 0; z-index: 40; display: inline-flex; align-items: center; gap: .9em; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--cream);
  font-size: .6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em;
  transform: translateY(100%); transition: transform .5s var(--ease), background-color .3s; }
.tab-cta.show { transform: none; }
.tab-cta:hover { background: var(--green); }

/* ---------- Aparición al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Accesibilidad ---------- */
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 12px; top: 12px; z-index: 100; width: auto; height: auto; clip: auto; padding: 10px 16px; background: var(--ink); color: var(--cream); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
  .reveal { transform: none; }
}

/* Figuras de líneas: los colores que lee el motor, en claro y en oscuro */
.fig-light { --hairline-plate: #fffdf8; --hairline-hi: #2e7040; --hairline-edge: #2a2420; --hairline-mid: #8a837b; --hairline-lo: #cfcac2; --hairline-stroke: 1; }
.fig-stone { --hairline-plate: #e5e3df; --hairline-hi: #2e7040; --hairline-edge: #2a2420; --hairline-mid: #7d766e; --hairline-lo: #c2bdb4; --hairline-stroke: 1; }
.fig-dark  { --hairline-plate: #100906; --hairline-hi: #8fbf9a; --hairline-edge: #d9d6cf; --hairline-mid: #6b645c; --hairline-lo: #3a332d; --hairline-stroke: 1; }
