/* Andreu Isern. Estilo basado en Dala (Refero): negro, escala y una constelación. */
:root {
  --void: #0d0d0d;
  --bone: #efebe4;
  --ash: #a09a91;
  --silver: #c9c4ba;
  --iris: #c9875a;
  --iris-hover: #d89a70;
  --on-iris: #120a05;
  --saffron: #d59a6e;

  --font: "Hanken Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --r: 24px;
  --out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--void); color: var(--bone); font-family: var(--font); font-size: 18px; line-height: 1.5; font-weight: 300; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, figure, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--saffron); color: var(--void); }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; border-radius: 6px; }

.sky { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }
.wrap { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; background: var(--bone); color: var(--void); border-radius: var(--r); font-weight: 400; }
.skip:focus { top: 12px; }

/* Tipos */
.hero__title { font-weight: 400; font-size: clamp(54px, 7.9vw, 113px); line-height: 1.02; letter-spacing: -.04em; text-wrap: balance; }
.h1 { font-weight: 400; font-size: clamp(46px, 5.6vw, 78px); line-height: 1.05; letter-spacing: -.04em; text-wrap: balance; }
.h2 { font-weight: 400; font-size: clamp(38px, 4.2vw, 60px); line-height: 1.08; letter-spacing: -.04em; text-wrap: balance; }
.h3 { font-weight: 400; font-size: clamp(27px, 2.6vw, 36px); line-height: 1.2; letter-spacing: -.03em; }
.body { max-width: 30em; font-size: clamp(18px, 1.4vw, 20px); text-wrap: pretty; text-shadow: 0 0 14px var(--void), 0 0 2px var(--void); }
.label { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: .025em; text-transform: uppercase; color: var(--saffron); text-shadow: 0 0 10px var(--void); }
@media (max-resolution: 1.5dppx) { body { font-weight: 400; } }

/* Botón y enlaces */
.btn { display: inline-flex; align-items: center; min-height: 45px; padding: 12px 18px; border-radius: 24px; background: var(--iris); color: var(--on-iris); font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: .025em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: background-color 160ms ease-out, transform 120ms ease-out; }
.btn:active { transform: scale(.97); }
.link { color: var(--saffron); font-weight: 400; text-underline-offset: 4px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
@media (hover: hover) {
  .btn:hover { background: var(--iris-hover); }
  .link:hover { color: var(--bone); }
}

/* Nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 16px var(--gutter); transition: transform 300ms var(--out), background-color 200ms ease-out; }
.nav.is-solid { background: var(--void); }
.nav.is-away { transform: translateY(-100%); }
.nav:focus-within { transform: none; }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; min-height: 44px; font-size: 20px; font-weight: 400; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.nav__brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ash); font-size: 14px; font-weight: 600; letter-spacing: .025em; text-transform: uppercase; text-decoration: none; transition: color 140ms ease-out; }
@media (hover: hover) { .nav__links a:hover { color: var(--bone); } }

/* Héroe */
.hero { min-height: 100svh; display: flex; align-items: center; padding-block: 110px 56px; }
.hero__in { display: flex; flex-direction: column; gap: 28px; }
.hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hero__copy .btn { margin-top: 10px; }
.line { display: block; overflow: clip; padding-bottom: .12em; margin-bottom: -.12em; white-space: nowrap; }
.line > span { display: block; }
.js .line > span { transform: translateY(112%); transition: transform 1100ms var(--out); }
.js .is-ready .line > span { transform: none; }
.js .line:nth-child(2) > span { transition-delay: 90ms; }
.js .hero__copy { opacity: 0; transition: opacity 900ms ease-out 350ms; }
.js .is-ready .hero__copy { opacity: 1; }

/* Ruido */
.noise { padding-block: 16vh; }
.noise__stack { display: flex; flex-direction: column; gap: 40vh; }
.noise__line { max-width: 15em; font-weight: 400; font-size: clamp(38px, 5.6vw, 78px); line-height: 1.08; letter-spacing: -.04em; text-wrap: balance; text-shadow: 0 0 24px var(--void), 0 0 4px var(--void); }
.can-pin .noise { padding-block: 0; height: 210vh; }
.can-pin .noise__pin { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.can-pin .noise__stack { display: grid; }
.can-pin .noise__line { grid-area: 1 / 1; opacity: 0; will-change: opacity, transform; }

/* Oficio */
.craft__row { min-height: 80svh; display: flex; align-items: center; padding-block: 8vh; }
.craft__text { display: flex; flex-direction: column; gap: 18px; max-width: 34rem; }
.craft__text .label { margin-top: 4px; }
.craft__note { padding-block: 0 10vh; color: var(--ash); font-size: 15px; font-weight: 400; }
.craft__note p + p { margin-top: 6px; }

/* Trabajo */
.work { padding-block: 12vh 8vh; }
.work__intro { margin-top: 16px; color: var(--silver); }
.work__list:empty { display: none; }
/* Con cinco proyectos, dos por fila: el primero, a todo el ancho */
.work__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(56px, 7vw, 96px) clamp(24px, 4vw, 56px); margin-top: clamp(48px, 6vw, 80px); }
.project { display: flex; flex-direction: column; gap: 22px; }
.project:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.project__media { display: block; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--void); }
.project__media img, .project__media canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
a.project__media img { transition: transform 700ms var(--out); }
@media (hover: hover) { a.project__media:hover img { transform: scale(1.02); } }
.project__text { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
.project__title { font-weight: 400; font-size: clamp(30px, 3vw, 44px); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.project__desc { color: var(--silver); }
.project__meta { color: var(--ash); font-size: 14px; font-weight: 400; }
.project.is-soon .label { color: var(--ash); }
.work__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; margin-top: clamp(56px, 8vw, 110px); }

/* Formulario */
.form { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 40rem; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form__field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.form__field span { color: var(--silver); font-size: 14px; font-weight: 600; letter-spacing: .025em; text-transform: uppercase; }
.form input, .form select, .form textarea { width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid #3a3733; border-radius: 14px; background: #161514; color: var(--bone); font: inherit; font-size: 17px; font-weight: 400; }
.form textarea { resize: vertical; min-height: 120px; }
.form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ash) 50%), linear-gradient(135deg, var(--ash) 50%, transparent 50%); background-position: right 20px center, right 14px center; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { border-color: var(--saffron); outline-offset: 2px; }
.form .btn { align-self: flex-start; border: 0; cursor: pointer; }
.form__have { margin: 0; padding: 0; border: 0; }
.form__have legend { padding: 0; margin-bottom: 8px; color: var(--silver); font-size: 14px; font-weight: 600; letter-spacing: .025em; text-transform: uppercase; }
.form__have legend em { margin-left: 6px; color: var(--ash); font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }
.form__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.form__chip { position: relative; display: inline-flex; }
.form__chip input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.form__chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid #3a3733; border-radius: 24px; background: #161514; color: var(--silver); font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; transition: border-color 140ms ease-out, color 140ms ease-out, background-color 140ms ease-out; }
.form__chip input:checked + span { border-color: var(--saffron); background: #24180f; color: var(--bone); }
.form__chip input:focus-visible + span { outline: 2px solid var(--saffron); outline-offset: 2px; }
@media (hover: hover) { .form__chip:hover span { color: var(--bone); } }
.form__error { color: #f0a58a; font-size: 15px; font-weight: 400; }
.form.is-tried :is(input, select, textarea):invalid { border-color: #f0a58a; }
.form.is-tried .form__field:has(:invalid) > span::after { content: " · Falta"; color: #f0a58a; text-transform: none; letter-spacing: 0; font-weight: 400; }
.form__hint { color: var(--ash); font-size: 14px; font-weight: 400; }

/* Pasos */
.steps { padding-block: 14vh; }
.steps__list { display: flex; flex-direction: column; gap: 44px; margin-top: 56px; max-width: 36rem; }
.steps__list li { display: flex; flex-direction: column; gap: 8px; }
.steps .body { color: var(--silver); }

/* Silencio */
.quiet { min-height: 50svh; display: flex; align-items: center; }
.quiet__line { font-size: clamp(27px, 2.6vw, 36px); font-weight: 300; letter-spacing: -.02em; text-align: center; }

/* Persona: el pico */
.person { position: relative; }
.person__in { display: flex; }
.person__text { display: flex; flex-direction: column; gap: 16px; max-width: 34rem; padding-block: 16vh; }
.can-pin .person { height: 190vh; }
.can-pin .person__pin { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.can-pin .person__text { padding-block: 0; opacity: 0; transform: translateY(18px); transition: opacity 500ms ease-out, transform 700ms var(--out); }
.can-pin .person.is-formed .person__text { opacity: 1; transform: none; }

.more { padding-block: 14vh; }
.more__in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.more__photo { border-radius: var(--r); overflow: hidden; aspect-ratio: 6 / 5; }
.more__photo img { width: 100%; height: 100%; object-fit: cover; }
.more__text { display: flex; flex-direction: column; gap: 18px; }

/* Cierre */
.end { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 16vh 28px; }
.end__in { display: flex; flex-direction: column; gap: 28px; margin-block: auto; }
.end__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
/* Contacto: círculos finos como los de la constelación; un triángulo de cobre gira alrededor */
.end__contact { display: flex; flex-wrap: wrap; gap: 20px 28px; margin-top: 14px; }
.end__contact li { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.orb { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid #4a4540; border-radius: 50%; color: var(--bone); transition: border-color 220ms ease-out, color 220ms ease-out, background-color 220ms ease-out, transform 120ms ease-out; }
.orb svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.orb svg .fill { fill: currentColor; stroke: none; }
.orb__trail { position: absolute; inset: -1px; border-radius: 50%; transform: rotate(-35deg); transition: transform 1200ms var(--out); pointer-events: none; }
.orb__trail::before { content: ""; position: absolute; top: -4px; left: 50%; width: 9px; height: 8px; margin-left: -4.5px; background: var(--saffron); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.orb__cap { color: var(--ash); font-size: 13px; font-weight: 600; letter-spacing: .025em; text-transform: uppercase; }
.orb:active { transform: scale(.96); }
.orb:focus-visible { outline-offset: 4px; border-radius: 50%; }
@media (hover: hover) {
  .orb:hover { border-color: var(--saffron); color: var(--saffron); background: rgba(201, 135, 90, .08); }
  .orb:hover .orb__trail { transform: rotate(325deg); }
}
.end__legal { margin-top: 48px; color: var(--ash); font-size: 14px; font-weight: 400; }
.end__legal a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (hover: hover) { .end__legal a:hover { color: var(--bone); } }

/* Páginas legales: mismo lienzo, sin constelación */
.legal { max-width: calc(46rem + 2 * var(--gutter)); margin-inline: 0; padding-block: 140px 96px; }
.legal .h1 { margin-top: 14px; }
.legal__date { margin-top: 14px; color: var(--ash); font-size: 14px; font-weight: 400; }
.legal .h3 { margin-top: 56px; }
.legal p, .legal ul { margin-top: 16px; color: var(--silver); text-wrap: pretty; }
.legal ul li + li { margin-top: 6px; }
.legal__back { padding-top: 40px; }

/* Aparición */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 800ms ease-out, transform 900ms var(--out); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Móvil: la figura arriba, el texto debajo */
@media (max-width: 860px) {
  .nav { gap: 12px; padding-block: 10px; }
  .nav__links { display: none; }
  .nav__brand { font-size: 18px; }
  .nav .btn { min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .hero { align-items: flex-end; padding-bottom: 36px; }
  /* La figura se queda arriba y el texto fijo en la mitad de abajo mientras dura cada forma */
  .craft__row { min-height: 130svh; align-items: stretch; padding-block: 0; }
  .craft__row > .wrap { display: flex; flex-direction: column; }
  .craft__text { position: sticky; top: 54svh; margin-bottom: 6vh; }
  /* En móvil las figuras pasan por detrás del texto: un fondo del color del lienzo lo mantiene legible */
  .craft__text, .craft__note p, .end__copy > .body, .form { margin-inline: -16px; padding: 16px; border-radius: var(--r); background: rgba(13, 13, 13, .86); }
  .craft__note p:first-child { padding-bottom: 6px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .craft__note p + p { margin-top: 0; padding-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
  .form { width: calc(100% + 32px); }
  .form__row { grid-template-columns: minmax(0, 1fr); }
  .work__list, .project:first-child, .more__in { grid-template-columns: minmax(0, 1fr); }
  .project:first-child { display: flex; }
  .can-pin .person__pin { align-items: flex-end; padding-bottom: 7vh; }
  .end { justify-content: flex-end; }
  .end__in { margin-block: 32vh 0; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 14.4vw; }
}

/* En móviles muy estrechos el nombre no cabe junto al botón: queda la foto */
@media (max-width: 359px) {
  .nav__brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .line > span, .js .hero__copy, .can-pin .person__text { opacity: 1; transform: none; transition: none; }
  .orb__trail { transition: none; }
}
