@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/assets/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #f4f4f4;
  --ink: #000;
  --muted: #666;
  --gutter: 80px;
  --edge: max(var(--gutter), calc((100% - 1440px) / 2 + var(--gutter)));
  --radius: 16px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --text: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.6 var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Tipografía */
.display { font: 700 72px/1.2 var(--display); }
.sub { font: 500 40px/1.4 var(--display); }
.heading { font: 500 40px/1.4 var(--display); }
.lead { font: 500 24px/1.4 var(--text); }
.small { font: 500 18px/1.4 var(--display); }
.prose { white-space: pre-line; }
a.inline { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.inline:hover, a.plain:hover { opacity: .6; }
a.plain { transition: opacity .2s; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 24px var(--edge); width: 100%; background: var(--bg); transition: transform .35s var(--ease); }
.site-header.is-hidden { transform: translateY(-100%); }
.logo { width: 58px; color: #272727; justify-self: start; }
.main-nav ul { display: flex; gap: 40px; }
.main-nav a, .footer-nav a { font: 500 18px/1.4 var(--display); }
.lang { justify-self: end; display: flex; gap: 6px; font: 500 16px/1.4 var(--display); color: var(--muted); }
.lang a:hover { color: var(--ink); }
.lang a[aria-current] { color: var(--ink); pointer-events: none; }
.burger { display: none; }

.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.roll > span { display: block; transition: transform .3s var(--ease); }
.roll::after { content: attr(data-text); position: absolute; left: 0; top: 100%; transition: transform .3s var(--ease); white-space: nowrap; }
a:hover > .roll > span, a:hover > .roll::after { transform: translateY(-100%); }

/* Secciones */
.hero { padding-top: 112px; display: grid; gap: 24px; }
.stack { display: grid; gap: 40px; padding-top: 120px; max-width: 1120px; }
.stack-about { padding-top: 24px; }
.hero-about { padding-top: 112px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; padding-top: 190px; padding-bottom: 120px; }
.work-top .grid { padding-top: 112px; }
.card { display: block; }
.media { display: block; overflow: hidden; border-radius: var(--radius); background: #dcdde3; }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card .media { aspect-ratio: 540 / 509; }
.card:hover .media img { transform: scale(1.04); }
.card-type { display: block; margin-top: 24px; font: 500 18px/1.4 var(--display); color: var(--muted); }
.card-name { display: block; margin-top: 8px; font: 500 24px/1.4 var(--text); }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 16px 32px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 18px/1.4 var(--display); transition: transform .25s var(--ease), box-shadow .25s; }
.btn:hover { transform: translateY(-2px); }
.btn-light { background: var(--bg); color: var(--ink); box-shadow: 0 1px 12px rgba(255, 255, 255, .25); }
.arrow { width: 16px; height: 16px; fill: currentColor; flex: none; transition: transform .25s var(--ease); }
a:hover > .arrow { transform: translate(2px, -2px); }

/* Sobre mí */
.about-row { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 16px; padding-top: 120px; }
.label { font: 500 16px/1.6 var(--text); }
.job + .job { margin-top: 72px; }
.job .small { margin-top: 16px; }
.bullets { margin-top: 16px; padding-left: 20px; list-style: disc; }
.skills { font: 500 24px/1.4 var(--display); }
.cv { padding: 120px 0; }

/* Contacto */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; padding-top: 112px; padding-bottom: 120px; align-items: end; }
.contact-list { display: grid; gap: 40px; margin-top: 56px; }
.contact-list dt, .case-meta dt { color: var(--muted); }
.contact-list dd { margin-top: 12px; font: 500 18px/1.4 var(--display); }
.contact-social li + li { margin-top: 16px; }
.contact-social a, .footer-social a { display: flex; align-items: center; justify-content: space-between; gap: 24px; font: 500 18px/1.4 var(--display); }

/* Proyecto */
.case-head { padding-top: 112px; }
.case-meta { display: flex; gap: 96px; }
.case-meta dd { margin-top: 8px; font: 500 18px/1.4 var(--display); }
.case-title { max-width: 800px; margin-top: 80px; }
.case-body { display: grid; gap: 48px; padding: 120px 0; max-width: 1120px; }
.case-body > .heading { margin-top: 72px; }
.case-body > .shot-hero + .heading { margin-top: 32px; }
.shot .media { aspect-ratio: 2048 / 1237; }
.shot-hero .media { aspect-ratio: 1120 / 820; }

/* 404 */
.notfound { display: grid; justify-items: start; gap: 32px; padding: 112px 0 120px; }

/* Pie */
.site-footer { background: #000; color: var(--bg); display: grid; grid-template-columns: 1fr auto 208px; gap: 64px 152px; align-items: start; padding: 80px var(--edge); margin-top: auto; }
.site-footer .btn { justify-self: start; }
.footer-nav li + li { margin-top: 16px; }
.footer-social li + li { margin-top: 16px; }

/* Animaciones de entrada: solo con JS y sin preferencia de movimiento reducido */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateX(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .reveal .media img { transform: scale(1.12); }
  .js .reveal.is-in .media img { transform: none; }
  .js .card.is-in:hover .media img { transform: scale(1.04); }
  .js .split .ch { display: inline-block; opacity: 0; transform: translateY(.35em); animation: rise .55s var(--ease) forwards; animation-delay: calc(var(--i) * 18ms); }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
.split .word { display: inline-block; white-space: nowrap; }

@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .site-footer { grid-template-columns: 1fr auto auto; gap: 40px 64px; }
}

@media (max-width: 809px) {
  :root { --gutter: 16px; --radius: 14px; }
  .display { font-size: 32px; line-height: 1.2; }
  .sub, .heading { font-size: 26px; line-height: 1.4; }
  .lead, .card-name, .skills { font-size: 20px; }
  .btn { font-size: 18px; }

  .site-header { grid-template-columns: 1fr auto auto; gap: 12px; padding: 16px var(--gutter); }
  .burger { display: grid; place-content: center; gap: 6px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; z-index: 2; }
  .burger span { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .25s var(--ease); }
  .burger { gap: 4px; }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { transform: scaleX(0); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .lang { z-index: 2; }
  .logo { z-index: 2; position: relative; }
  .main-nav { position: fixed; inset: 0; padding: 104px var(--gutter) 40px; background: var(--bg); visibility: hidden; opacity: 0; transition: opacity .2s, visibility .2s; }
  .main-nav.is-open { visibility: visible; opacity: 1; }
  .main-nav ul { flex-direction: column; gap: 24px; }
  .main-nav a { font-size: 32px; font-weight: 700; }
  .menu-open { overflow: hidden; }

  .hero, .hero-about { padding-top: 56px; gap: 16px; }
  .stack { padding-top: 64px; gap: 32px; }
  .stack-about { padding-top: 24px; }
  .grid { grid-template-columns: minmax(0, 1fr); padding-top: 96px; padding-bottom: 64px; }
  .work-top .grid { padding-top: 56px; }
  .card .media { aspect-ratio: 343 / 223; }
  .card-type { margin-top: 16px; }

  .about-row { grid-template-columns: minmax(0, 1fr); padding-top: 64px; }
  .job + .job { margin-top: 48px; }
  .cv { padding: 64px 0; }

  .contact { grid-template-columns: minmax(0, 1fr); padding-top: 56px; padding-bottom: 64px; }
  .contact-list { margin-top: 40px; gap: 32px; }

  .case-head { padding-top: 40px; }
  .case-meta { gap: 56px; }
  .case-title { margin-top: 40px; }
  .case-body { padding: 56px 0; gap: 24px; }
  .case-body > .heading { margin-top: 32px; }
  .case-body > .shot-hero + .heading { margin-top: 16px; }

  .site-footer { grid-template-columns: 1fr 1fr; padding: 56px var(--gutter); }
  .site-footer .btn { grid-column: 1 / -1; }
}
