/* ==========================================================================
   Umbralis · umbralis.es
   Hoja de estilos única (home + páginas legales)
   ========================================================================== */

/* ---------- Tipografías alojadas en el propio servidor ---------- */
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/familjen-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/familjen-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/familjen-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/familjen-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Variables ---------- */
:root {
  --orange: #C2410C;
  --black: #14110E;
  --ink: #121212;
  --ground: #F5F5F2;
  --ground-2: #EAEAE5;
  --ground-3: #D4D4CC;
  --gray-1: #333330;
  --gray-2: #4A4A47;
  --gray-3: #7A7A74;
  --gray-light: #B9B9B2;
  --white: #FFFFFF;
  --sans: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1280px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--orange); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.on-dark :focus-visible, .hero :focus-visible, .nav-pill :focus-visible, .site-footer :focus-visible { outline-color: var(--white); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.u-link { border-bottom: 1px solid var(--ink); }
.u-link:hover { border-bottom-color: var(--orange); }

.skip-link { position: absolute; left: 16px; top: -80px; z-index: 200; padding: 12px 20px; background: var(--black); color: var(--white); border-radius: 999px; }
.skip-link:focus { top: 16px; color: var(--white); }

/* ---------- Navegación (píldora de cristal, fija) ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 50; height: 0; }
.nav-wrap .wrap { padding-top: 16px; padding-bottom: 16px; }
.nav-pill {
  display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between;
  padding: 8px 10px 8px 28px; border-radius: 999px;
  background: rgba(20, 17, 14, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 40px rgba(20, 17, 14, 0.25);
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--white); padding: 8px 0; }
.brand:hover { color: var(--white); }
.nav-desktop { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: center; font-size: 16px; }
.nav-desktop a { padding: 10px 0; color: var(--white); }
.nav-desktop a:hover { color: var(--gray-light); }
.nav-desktop a.nav-cta, .nav-mobile a.nav-cta { padding: 12px 24px; background: var(--orange); color: var(--white); border-radius: 999px; font-weight: 600; }
.nav-desktop a.nav-cta:hover { color: var(--white); background: #A8380A; }

.burger {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); cursor: pointer;
}
.burger svg { display: block; }
.burger .icon-close { display: none; }
.burger[aria-expanded="true"] .icon-open { display: none; }
.burger[aria-expanded="true"] .icon-close { display: block; }

.nav-mobile {
  display: none; flex-direction: column; gap: 4px; margin-top: 8px; padding: 12px 20px 20px; border-radius: 28px;
  background: rgba(20, 17, 14, 0.86);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 10px 40px rgba(20, 17, 14, 0.25); font-size: 20px;
}
.nav-mobile a { padding: 14px 0; color: var(--white); border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.nav-mobile a.nav-cta { margin-top: 12px; padding: 14px 24px; border-bottom: 0; text-align: center; }
.nav-mobile.is-open { display: flex; }

/* ---------- Hero ---------- */
.hero { background: var(--orange); color: var(--white); overflow: hidden; position: relative; isolation: isolate; }
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 85% 50%; z-index: 0;
  filter: grayscale(1) contrast(1.2); mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 28%, #000 68%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 28%, #000 68%);
}
.hero-content { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 176px 24px 0; display: flex; flex-direction: column; gap: 48px; }
.hero-eyebrow { color: var(--white); }
.hero h1 { max-width: 900px; font-size: clamp(44px, 7.2vw, 108px); line-height: 0.96; letter-spacing: -0.04em; font-weight: 600; color: var(--white); }
.hero h1 span { color: var(--black); }
.hero-bottom { display: flex; flex-wrap: wrap; gap: 32px 64px; align-items: flex-end; justify-content: space-between; }
.hero-bottom p { flex: 1 1 360px; max-width: 540px; font-size: 21px; line-height: 1.5; color: var(--white); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.btn-dark { display: inline-block; padding: 18px 32px; background: var(--black); color: var(--ground); border-radius: 999px; font-size: 18px; font-weight: 600; }
.btn-dark:hover { color: var(--white); background: #000; }
.hero-link { padding: 12px 0; font-size: 18px; color: var(--white); border-bottom: 1px solid var(--white); }
.hero-link:hover { color: var(--black); border-bottom-color: var(--black); }
.hero-wordmark {
  position: relative; width: 100%; padding: 56px 24px 0; text-align: left; white-space: nowrap; overflow: hidden;
  font-size: clamp(88px, 25vw, 380px); line-height: 0.8; letter-spacing: -0.06em; font-weight: 700; color: var(--black);
}
.marquee { position: relative; background: var(--black); color: var(--ground); overflow: hidden; font-family: var(--mono); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee-group { display: flex; align-items: center; gap: 36px; padding: 20px 18px 20px 0; white-space: nowrap; }
.marquee-group i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

@keyframes rise { 0% { opacity: 0; transform: translateY(48px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.rise   { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.rise-2 { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
.rise-3 { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; }

/* ---------- Secciones genéricas ---------- */
.section { padding: 96px 0; }
.section .wrap { display: flex; flex-direction: column; }
.h2 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 600; }
.bordered { border-top: 1px solid var(--ink); }

/* Servicios */
#servicios .wrap { gap: 64px; }
.section-head { display: flex; flex-wrap: wrap; gap: 24px 64px; justify-content: space-between; align-items: flex-end; }
#servicios .h2 { flex: 1 1 400px; }
.section-head > p { flex: 1 1 320px; max-width: 460px; font-size: 18px; line-height: 1.55; color: var(--gray-1); }
.cols { display: flex; flex-wrap: wrap; gap: 48px 40px; }
.col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; border-top: 1px solid var(--ink); padding-top: 24px; }
.col .num { font-family: var(--mono); font-size: 14px; color: var(--orange); }
.col h3 { font-size: 30px; letter-spacing: -0.02em; font-weight: 600; }
.col p { font-size: 18px; line-height: 1.55; color: var(--gray-1); }

/* Proyectos */
#proyectos { background: var(--ground-2); }
#proyectos .wrap { gap: 56px; }
#proyectos .section-head { gap: 16px 48px; }
.projects { display: flex; flex-wrap: wrap; gap: 48px 32px; }
.project { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tile { height: 360px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; }
.tile .n { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; }
.tile h3 { font-size: clamp(36px, 4.6vw, 68px); line-height: 1; letter-spacing: -0.035em; font-weight: 600; }
.tile--dark { background: var(--black); color: var(--ground); }
.tile--dark .n { color: var(--gray-light); }
.tile--light { background: var(--ground-3); color: var(--ink); }
.tile--light .n { color: var(--gray-2); }
.tile--orange { background: var(--orange); color: var(--white); }
.tile--orange .n { color: var(--white); }
.project > p { font-size: 18px; line-height: 1.5; color: var(--gray-1); }
.project > p.tags { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray-2); }
.project .btn-wrap { margin-top: 8px; }
.btn-outline {
  font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 999px; padding: 13px 24px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--ink); color: var(--ground); }

/* Proceso */
#proceso .wrap { gap: 56px; }
#proceso .h2 { max-width: 820px; }
.steps { display: flex; flex-wrap: wrap; gap: 40px 32px; }
.step { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--ink); padding-top: 20px; }
.step .num { font-family: var(--mono); font-size: 14px; color: var(--orange); }
.step h3 { font-size: 24px; letter-spacing: -0.02em; font-weight: 600; }
.step p { font-size: 17px; line-height: 1.55; color: var(--gray-1); }

/* Estudio */
#estudio { background: var(--black); color: var(--ground); }
#estudio .wrap { gap: 80px; }
.studio-intro { display: flex; flex-wrap: wrap; gap: 48px 80px; justify-content: space-between; }
.studio-intro > div { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.studio-intro > div:first-child { flex: 1 1 360px; }
.studio-intro > div:last-child { flex: 1 1 420px; }
.studio-intro .mono { color: var(--gray-light); }
.studio-intro h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 600; color: var(--ground); }
.studio-intro p { font-size: 20px; line-height: 1.6; color: #E6E6E0; }
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 48px 32px; }
.person { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.person .avatar { aspect-ratio: 1 / 1; background: #2A241E; display: flex; align-items: flex-end; justify-content: space-between; padding: 20px; }
.person .avatar span { font-size: clamp(96px, 10vw, 150px); line-height: 0.8; font-weight: 700; letter-spacing: -0.05em; color: #E6E6E0; }
.person--lead .avatar { background: var(--orange); }
.person--lead .avatar span { color: var(--white); }
.person h3 { margin-top: 8px; font-size: 24px; letter-spacing: -0.02em; font-weight: 600; color: var(--ground); }
.person .role { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: #F0A070; }
.person p:last-child { font-size: 16px; line-height: 1.55; color: #D5D5CE; }

/* Criterio */
#criterio { padding: 128px 0; }
#criterio .wrap { gap: 88px; }
#criterio .mono { color: var(--gray-2); }
.manifesto { font-size: clamp(38px, 6.6vw, 100px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 600; }
.manifesto .m1 { display: block; color: var(--gray-3); }
.manifesto .m1 s { text-decoration: line-through; text-decoration-thickness: 0.07em; text-decoration-color: var(--orange); }
.manifesto .m2 { display: block; margin-top: 0.28em; color: var(--ink); }
.manifesto .m2 span { color: var(--orange); }
.yesno { display: flex; flex-wrap: wrap; gap: 48px 64px; }
.yesno > div { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; border-top: 1px solid var(--ink); padding-top: 24px; }
.yesno > div.yes { border-top-color: var(--orange); }
.yesno .mono { color: var(--gray-2); }
.yesno .yes .mono { color: var(--orange); }
.yesno p { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.3; letter-spacing: -0.015em; font-weight: 500; color: var(--gray-2); }
.yesno .yes p { color: var(--ink); }

/* Contacto */
#contacto { background: var(--orange); color: var(--white); padding: 112px 0; }
#contacto .wrap { gap: 40px; }
#contacto h2 { max-width: 980px; font-size: clamp(40px, 6.4vw, 92px); line-height: 1; letter-spacing: -0.035em; font-weight: 600; color: var(--white); }
#contacto p { max-width: 560px; font-size: 20px; line-height: 1.55; color: var(--white); }
#contacto .btn-dark { width: fit-content; max-width: 100%; overflow-wrap: anywhere; }

/* ---------- Ventana emergente de proyecto (<dialog>) ---------- */
dialog.modal {
  width: calc(100% - 48px); max-width: 1120px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  margin: auto; padding: 20px; border: 0; border-radius: 28px; overflow-y: auto;
  background: var(--ground); color: var(--ink); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}
dialog.modal::backdrop { background: rgba(20, 17, 14, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
dialog.modal[open] { display: flex; flex-wrap: wrap; gap: 32px; }
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(20, 17, 14, 0.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--black); }
.modal-media { flex: 1 1 460px; min-width: 0; }
.modal-media img { display: block; width: 100%; height: 100%; min-height: 320px; object-fit: cover; border-radius: 16px; border: 1px solid rgba(18, 18, 18, 0.12); }
.modal-body { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding: 20px 20px 20px 4px; justify-content: center; }
.modal-num { color: var(--orange); }
.modal-body h2 { font-size: clamp(34px, 4.4vw, 60px); line-height: 1; letter-spacing: -0.035em; font-weight: 600; }
.modal-sub { font-size: 22px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 500; }
.modal-desc { font-size: 17px; line-height: 1.6; color: var(--gray-1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em; padding: 8px 14px; border: 1px solid var(--ink); border-radius: 999px; }
.modal-cta { align-self: flex-start; margin-top: 6px; padding: 16px 28px; background: var(--orange); color: var(--white); border-radius: 999px; font-size: 17px; font-weight: 600; }
.modal-cta:hover { background: #A8380A; color: var(--white); }
body.modal-open { overflow: hidden; }

/* ---------- Pie ---------- */
.site-footer { background: var(--black); color: var(--gray-light); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 15px; }
.site-footer .group { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.site-footer a { color: var(--gray-light); padding: 8px 0; }
.site-footer .group--links a { color: #E6E6E0; }
.site-footer a:hover { color: var(--white); }

/* ---------- Páginas legales ---------- */
.legal-header { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; }
.legal-header .brand { color: var(--ink); }
.legal-header .brand:hover { color: var(--orange); }
.legal-header .u-link { padding: 10px 0; font-size: 16px; }
.legal-main { max-width: var(--wrap); margin: 0 auto; padding: 56px 24px 120px; display: flex; flex-direction: column; gap: 96px; }
.legal-intro { display: flex; flex-direction: column; gap: 32px; max-width: 820px; }
.legal-intro .mono { color: var(--gray-2); }
.legal-intro h1 { font-size: clamp(44px, 7vw, 104px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 600; }
.legal-intro .updated { font-size: 18px; line-height: 1.55; color: var(--gray-1); }
.legal-toc { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 17px; }
.legal-toc a { padding: 8px 0; }
.legal-section { border-top: 1px solid var(--ink); padding-top: 40px; display: flex; flex-wrap: wrap; gap: 32px 80px; }
.legal-section > h2 { flex: 1 1 280px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 600; }
.legal-body { flex: 2 1 520px; max-width: 760px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.legal-body > div { display: flex; flex-direction: column; gap: 10px; }
.legal-body h3 { font-size: 22px; letter-spacing: -0.02em; font-weight: 600; }
.legal-body p { font-size: 17px; line-height: 1.65; color: var(--gray-1); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-desktop { display: none; }
  .burger { display: inline-flex; }
}
@media (max-width: 600px) {
  .section { padding: 72px 0; }
  #criterio { padding: 88px 0; }
  #contacto { padding: 80px 0; }
  .hero-content { padding-top: 140px; gap: 36px; }
  .hero-bottom p { font-size: 19px; }
  .tile { height: 280px; }
  dialog.modal { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 14px; border-radius: 22px; gap: 20px; }
  .modal-media { flex-basis: 100%; }
  .modal-media img { min-height: 220px; height: auto; }
  .modal-body { flex-basis: 100%; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .rise-2, .rise-3, .marquee-track { animation: none; }
}
