/* Crealux — blanco y negro, sin terceros. */
:root {
  --black: #000;
  --white: #fff;
  --grey: #5f5f5f;      /* texto secundario sobre blanco */
  --grey-inv: #a0a0a0;  /* texto secundario sobre negro */
  --line: #000;
  --pad: clamp(20px, 4vw, 56px);
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Helvetica, Arial,
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--black); color: var(--white); }
.footer ::selection { background: var(--white); color: var(--black); }

a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.skip {
  position: absolute; left: var(--pad); top: -100px;
  background: var(--black); color: var(--white);
  padding: 10px 14px; z-index: 20; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Cabecera ---------- */
.header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.header.is-stuck { border-bottom-color: var(--line); }

.brand {
  display: inline-flex; align-items: center; gap: 14px;
  font-weight: 600; font-size: 28px; line-height: 1; letter-spacing: -0.035em;
  text-decoration: none;
}
.brand img { width: 46px; height: 46px; }

.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); font-size: 14px; }

/* Selector de idioma */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; user-select: none;
  border: 1px solid var(--line); padding: 4px 9px;
  font-size: 12px; letter-spacing: 0.06em;
  transition: background-color .2s, color .2s;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { background: var(--black); color: var(--white); }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 150px; padding: 6px 0;
  background: var(--white); border: 1px solid var(--line);
}
.lang li a {
  display: block; padding: 8px 14px; background: none;
}
.lang li a:hover { background: var(--black); color: var(--white); }
.lang li a[aria-current="true"]::after { content: "·"; float: right; font-weight: 700; }

.nav > a {
  text-decoration: none; padding: 6px 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .25s;
}
.nav > a:hover, .nav > a[aria-current="page"] { background-size: 100% 1px; }
.nav a { text-decoration: none; }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 83px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--pad) clamp(40px, 7vh, 88px);
  background: var(--white);
  overflow: hidden;
}

.hero__mark {
  position: absolute;
  width: min(92vh, 64vw);
  right: calc(min(92vh, 64vw) * -0.2);
  top: 46%;
  transform: translateY(-50%) rotate(var(--turn, 0deg));
  pointer-events: none;
}
.hero__mark img { width: 100%; animation: spin 240s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* El texto se invierte al cruzar el logo: blanco sobre negro, negro sobre blanco. */
.hero .eyebrow, .hero h1, .hero .lede { mix-blend-mode: difference; }

.eyebrow {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--white);
  margin-bottom: clamp(20px, 3vh, 32px);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.9rem, 9.2vw, 9rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.05em;
  max-width: 11ch;
}

.lede {
  color: var(--grey-inv);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.45;
  max-width: 34ch;
  margin-top: clamp(24px, 4vh, 40px);
}

/* ---------- Secciones ---------- */
.section {
  padding: clamp(72px, 13vh, 168px) var(--pad);
  border-top: 1px solid var(--line);
}

.section__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: clamp(32px, 6vh, 72px);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
}
.section__head h2 { font: inherit; letter-spacing: inherit; }
.section__head span { color: var(--grey); }

/* ---------- Proyectos ---------- */
.projects { border-top: 1px solid var(--line); }
.projects li { border-bottom: 1px solid var(--line); }

.project {
  display: grid;
  grid-template-columns: 5ch minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(26px, 4.5vh, 48px) clamp(0px, 1vw, 16px);
  margin: 0 calc(clamp(0px, 1vw, 16px) * -1);
  text-decoration: none;
  transition: background-color .25s, color .25s, padding .25s;
}
.project:hover, .project:focus-visible {
  background: var(--black); color: var(--white);
  padding-left: clamp(12px, 2vw, 32px); padding-right: clamp(12px, 2vw, 32px);
}
.project__n { font-size: 13px; color: var(--grey); font-variant-numeric: tabular-nums; }
.project__name {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 600; letter-spacing: -0.045em; line-height: 1;
}
.project__desc { color: var(--grey); max-width: 38ch; }
.project__link { font-size: 14px; white-space: nowrap; }
.project__link span { display: inline-block; transition: transform .25s; }
.project:hover .project__n,
.project:hover .project__desc,
.project:focus-visible .project__n,
.project:focus-visible .project__desc { color: var(--grey-inv); }
.project:hover .project__link span { transform: translate(3px, -3px); }

/* ---------- Empresa ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(40px, 8vw, 140px);
  align-items: start;
}
.about__text {
  font-size: clamp(1.5rem, 3.1vw, 2.75rem);
  font-weight: 500; line-height: 1.14; letter-spacing: -0.035em;
  max-width: 22ch;
}
.about__text em { font-style: normal; color: var(--grey); }

.facts { font-size: 15px; border-top: 1px solid var(--line); }
.facts div {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--grey); }
.facts dd { text-align: right; }

/* ---------- Pie ---------- */
.footer {
  background: var(--black); color: var(--white);
  padding: clamp(72px, 12vh, 140px) var(--pad) 28px;
}
.footer__label {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--grey-inv); margin-bottom: 20px;
}
.footer__mail {
  display: inline-block;
  font-size: clamp(1.9rem, 6.4vw, 6rem);
  font-weight: 600; letter-spacing: -0.05em; line-height: 1;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .35s;
  padding-bottom: 0.08em;
  overflow-wrap: anywhere;
}
.footer__mail:hover { background-size: 100% 2px; }
.footer__note { color: var(--grey-inv); max-width: 44ch; margin-top: 24px; font-size: 15px; }

.footer__legal {
  display: flex; flex-wrap: wrap; gap: 12px 40px;
  margin-top: clamp(56px, 10vh, 120px);
  padding-top: 28px; border-top: 1px solid #333;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 500;
}
.footer__legal a { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.footer__legal a:hover { text-decoration-thickness: 2px; }

.footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 40px; font-size: 13px; color: var(--grey-inv);
}

/* ---------- Páginas legales ---------- */
.doc { padding: clamp(56px, 10vh, 120px) var(--pad) clamp(72px, 12vh, 140px); max-width: 1100px; }
.doc h1 {
  font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 600;
  letter-spacing: -0.05em; line-height: 0.96;
}
.doc__date { color: var(--grey); font-size: 14px; margin-top: 20px; }
.doc__body { max-width: 62ch; margin-top: clamp(40px, 8vh, 88px); }
.doc__body h2 {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
}
.doc__body p, .doc__body ul { margin-top: 16px; }
.doc__body ul { padding-left: 1.1em; list-style: "— "; }
.doc__body li + li { margin-top: 8px; }
.doc__body a { text-underline-offset: 3px; }

/* El chino no admite el interletraje apretado del resto. */
:lang(zh) h1, :lang(zh) .about__text { letter-spacing: -0.01em; line-height: 1.12; }

/* ---------- Aparición ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0ms);
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand { font-size: 23px; gap: 10px; }
  .brand img { width: 38px; height: 38px; }
  .hero { min-height: calc(100svh - 75px); }
  .nav { gap: 14px; font-size: 13px; }
  .nav__privacy { display: none; } /* sigue visible en el pie */
  .hero__mark { width: 118vw; right: -46vw; top: 34%; }
  .project {
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
  }
  .project__n { grid-column: 1 / -1; }
  .project__name { grid-column: 1 / -1; }
  .project__desc { grid-column: 1 / -1; }
  .project__link { grid-column: 1 / -1; margin-top: 6px; }
  .about { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__mark img { animation: none; }
  .js .reveal, .js .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .project, .project__link span { transition: none; }
}
