/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bone:  #edeae2;
  --ink:   #0e0e0d;
  --green: #3ad754;          /* acento de marca: subrayado de CTA, selección y foco sobre negro */
  --muted: #5f5d57;          /* texto secundario sobre hueso (≥5:1) */
  --line:  rgba(14, 14, 13, .16);
  --ph:    #e0dcd0;          /* hueco de imagen */

  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { font-weight: inherit; text-wrap: balance; }
ol, ul { list-style: none; padding: 0; }
::selection { background: var(--green); color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 10;
  padding: .6rem 1rem; background: var(--ink); color: var(--bone);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities & shared type
   ============================================================= */
.wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--gutter);
}
.wrap > * { grid-column: 1 / -1; }

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

.label {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.cta, .link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .28em;
  transition: text-underline-offset .35s var(--ease), opacity .3s var(--ease);
}
.cta { font-weight: 600; text-decoration-color: var(--green); text-decoration-thickness: 3px; }
.cta:hover, .link:hover { text-underline-offset: .5em; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem var(--gutter);
  font-size: .875rem;
}

/* =============================================================
   4. Hero
   ============================================================= */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
}
.brand { display: block; line-height: 0; }
.brand img { height: 1.25rem; width: auto; }
@media (min-width: 720px) { .brand img { height: 1.5rem; } }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem clamp(.75rem, 2.4vw, 2.25rem); font-weight: 500; font-size: .75rem; }
.nav a { text-underline-offset: .35em; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.hero .bar { flex-wrap: wrap; row-gap: 1.1rem; }
.lang { order: 2; font-weight: 700; font-size: .75rem; letter-spacing: .06em; }
.nav { order: 3; width: 100%; justify-content: space-between; }

.hero-main {
  flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) clamp(2rem, 5vw, 4rem);
}
.hero-name {
  line-height: 0;
  margin-bottom: clamp(2rem, 5vw, 4.5rem);
}
.hero-name img { width: min(100%, calc(60svh * 6)); height: auto; }
.hero-foot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 1.75rem;
  align-items: start;
}
.hero-line {
  grid-column: 1 / -1;
  font-size: clamp(1.25rem, 2.3vw, 2.125rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.025em;
  max-width: 22ch;
}
.hero-foot .cta { grid-column: 1 / -1; font-size: 1rem; justify-self: start; }
.hero-meta {
  grid-column: 1 / -1;
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Entrada del hero: solo CSS, no depende del JS */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.bar, .hero-name, .hero-line, .hero-foot .cta, .hero-meta {
  animation: rise 1.1s var(--ease) both;
}
.bar { animation-name: fade; animation-duration: 1.2s; }
.hero-name { animation-delay: .1s; animation-duration: 1.3s; }
.hero-line { animation-delay: .45s; }
.hero-foot .cta { animation-delay: .6s; }
.hero-meta { animation-delay: .75s; }

/* =============================================================
   5. Secciones
   ============================================================= */
.section { padding-block: clamp(6rem, 15vw, 14rem) 0; }
.section:last-of-type { padding-bottom: clamp(6rem, 15vw, 14rem); }

/* --- Servicios --- */
.services { border-bottom: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 0;
  padding-block: clamp(1.75rem, 3vw, 2.75rem);
  border-top: 1px solid var(--line);
}
.service-n { font-size: .8125rem; font-weight: 600; color: var(--muted); padding-top: .55em; }
.service-t {
  font-size: clamp(1.75rem, 4.2vw, 4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.service-d {
  grid-column: 2;
  margin-top: 1rem;
  max-width: 34em;
  color: var(--muted);
}

/* --- Trabajo --- */
.work { display: grid; gap: clamp(7rem, 16vw, 16rem); }
.project-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: clamp(2rem, 5vw, 4rem); }
.project-name {
  font-size: clamp(2.25rem, 7vw, 7rem);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -.035em;
  text-transform: uppercase;
}
.project-kind { font-size: .875rem; color: var(--muted); }
.project-imgs { display: grid; gap: clamp(2rem, 6vw, 6rem) clamp(2rem, 8vw, 9rem); }
.project-imgs img { width: 100%; height: auto; background: var(--ph); }

/* Retrato */
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--ph); }

/* --- Estudio --- */
.about-lead {
  font-size: clamp(1.5rem, 2.9vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.025em;
  max-width: 30em;
}
.about-body { display: grid; gap: clamp(3rem, 6vw, 5rem); margin-top: clamp(4rem, 8vw, 8rem); }
.about-portrait { max-width: 26rem; }
.method > div { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.method > div:last-child { border-bottom: 1px solid var(--line); }
.method dt { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.method dd { margin-top: .35rem; color: var(--muted); max-width: 32em; }

/* --- Contacto --- */
.section-contact { padding-top: clamp(6rem, 15vw, 14rem); }
.contact-lead {
  font-size: clamp(1.25rem, 2.3vw, 2.125rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.025em;
  max-width: 20em;
}
.contact-mail { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.cta-big {
  font-size: clamp(1.3rem, 4.6vw, 5.25rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-decoration-thickness: 5px;
}
.contact-ig { margin-top: 1.5rem; font-size: 1rem; }

/* --- Pie --- */
.footer .bar { padding-block: 2rem; font-size: .8125rem; flex-wrap: wrap; color: var(--muted); border-top: 1px solid var(--line); margin-inline: var(--gutter); padding-inline: 0; }
.footer-top:hover { color: var(--ink); }

/* =============================================================
   6. Reveal al hacer scroll (solo fade + desplazamiento corto)
   ============================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease) var(--d, 0s), transform 1s var(--ease) var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* =============================================================
   7. Responsive (mobile-first)
   ============================================================= */
@media (min-width: 540px) {
  .nav { font-size: .8125rem; }
  .lang { font-size: .8125rem; }
}

@media (min-width: 720px) {
  .hero .bar { flex-wrap: nowrap; column-gap: 2.25rem; }
  .brand { margin-right: auto; }
  .nav { order: 0; width: auto; justify-content: flex-end; font-size: .875rem; }
  .lang { order: 0; font-size: .875rem; }
  .project-imgs { grid-template-columns: 1fr 1fr; align-items: start; }
  .project-imgs figure:nth-child(even) { margin-top: clamp(3rem, 9vw, 9rem); }
  .about-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(2rem, 6vw, 6rem); align-items: start; }
  .about-portrait { max-width: none; }

  .hero-line { grid-column: 1 / 7; }
  .hero-foot .cta { grid-column: 7 / 10; align-self: end; }
  .hero-meta { grid-column: 10 / -1; align-self: end; }
}

@media (min-width: 960px) {
  .label { grid-column: 1 / 4; margin-bottom: 0; }
  .services, .about, .contact-lead, .contact-mail, .contact-ig { grid-column: 4 / -1; }
  .work { grid-column: 1 / -1; margin-top: clamp(2.5rem, 6vw, 5rem); }
  .project-head { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .about-portrait { max-width: none; }

  .contact-lead { margin-top: 0; }
}

/* =============================================================
   8. Reduced motion: solo se quita el desplazamiento, el fade se mantiene
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; }
  .bar, .hero-name, .hero-line, .hero-foot .cta, .hero-meta { animation-name: fade; }
}
