/* ============================================================
   Martín Jiménez — Arte Paramétrico
   Design system · light museum (MALBA / MoMA reference)
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Coolvetica";
  src: url("../assets/fonts/coolvetica.otf") format("opentype");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Coolvetica Cond";
  src: url("../assets/fonts/coolvetica-condensed.otf") format("opentype");
  font-weight: 400; font-display: swap;
}

:root {
  /* Gallery-neutral palette — no warmth, no beige */
  --paper:   #F4F4F2;
  --paper-2: #ECECEA;
  --ink:     #16161A;
  --ink-2:   #5B5B60;
  --muted:   #8A8A8E;
  --line:    rgba(20, 20, 24, 0.12);
  --line-2:  rgba(20, 20, 24, 0.06);
  --accent:  #16161A;        /* monochrome; emphasis via weight/space, not color */

  --display: "Coolvetica", "Arial Narrow", sans-serif;
  --cond:    "Coolvetica Cond", "Coolvetica", sans-serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: clamp(1.25rem, 4.5vw, 5rem);
  --maxw: 1600px;
  --gap: clamp(6rem, 12vw, 11rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-weight: 400; line-height: 1.65;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

/* ---------- Type scale ---------- */
.display {
  font-family: var(--display); font-weight: 400;
  line-height: 0.92; letter-spacing: 0.005em;
}
.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 500;
}
.lede { font-size: clamp(1.15rem, 2.1vw, 1.7rem); line-height: 1.45; font-weight: 300; }

/* custom cursor: hide native cursor only when the custom one is active */
body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor [data-cursor] { cursor: none; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
section { position: relative; }
.divline { height: 1px; background: var(--line); margin-inline: var(--pad); }

/* ---------- Cursor ---------- */
/* Dark on the light interface; switches to white over images/media */
.cursor { position: fixed; top: 0; left: 0; z-index: 2000; pointer-events: none;
  transition: opacity .25s ease; }
.cursor__dot, .cursor__ring, .cursor__label { position: absolute; top: 0; left: 0;
  transform: translate(-50%, -50%); will-change: transform; }
.cursor__dot, .cursor__ring { border-radius: 50%; }
.cursor__dot  { width: 6px; height: 6px; background: var(--ink); transition: opacity .25s ease; }
.cursor.view .cursor__dot { opacity: 0; }   /* hide the dot so it doesn't cover the "Ver" label */
.cursor__ring { width: 34px; height: 34px; border: 1px solid var(--ink);
  opacity: .7; transition: width .4s var(--ease), height .4s var(--ease),
  opacity .4s var(--ease), background .4s var(--ease), border-color .3s ease; }
.cursor.hover .cursor__ring { width: 58px; height: 58px; opacity: 1; }
.cursor.view  .cursor__ring { width: 96px; height: 96px; opacity: 1;
  background: rgba(22,22,26,.06); }
.cursor.view  .cursor__label { opacity: 1; }
.cursor__label { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink); opacity: 0; transition: opacity .3s; }
/* over an image / media → white cursor */
.cursor.on-media .cursor__dot  { background: #fff; }
.cursor.on-media .cursor__ring { border-color: #fff; }
.cursor.on-media.view .cursor__ring { background: rgba(255,255,255,.16); }
.cursor.on-media .cursor__label { color: #fff; }
.cursor.on-media { filter: drop-shadow(0 0 1.6px rgba(0,0,0,.28)); }
.cursor.hidden { opacity: 0; }
@media (hover: none) { .cursor { display: none; } }

/* ---------- Header ---------- */
.head {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1.1rem, 2vw, 1.7rem) var(--pad);
  transition: background .5s var(--ease), padding .5s var(--ease), box-shadow .5s var(--ease);
}
/* solid bg on scroll — NO backdrop-filter (it creates a containing block
   that traps the fixed mobile-nav overlay and scatters its links) */
.head.scrolled { background: var(--paper); padding-block: .9rem; box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: clamp(.6rem, 1.1vw, 1rem); }
.brand__txt { font-family: var(--display); font-size: 1.4rem; letter-spacing: .01em; line-height: 1; }
.brand__txt span { display: block; font-family: var(--sans); font-size: .58rem;
  letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2); margin-top: .3rem; font-weight: 500; }
.brand__logo { height: clamp(2.2rem, 2.6vw, 2.7rem); width: auto; display: block; }
.nav { display: flex; gap: clamp(1.4rem, 2.4vw, 2.8rem); align-items: center; }
.nav a { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; position: relative; padding: .3rem 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--ink); }
.menu-btn { display: none; background: none; border: none; color: inherit;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 820px) {
  .nav { position: fixed; inset: 0; flex-direction: column; justify-content: center;
    gap: 2rem; background: var(--paper); transform: translateY(-100%);
    transition: transform .6s var(--ease); }
  .nav.open { transform: translateY(0) !important; }
  .nav a { font-size: 1.6rem; font-family: var(--display); letter-spacing: 0; text-transform: none; }
  .menu-btn { display: block; z-index: 101; }
}

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: grid; align-items: end;
  padding: 0 var(--pad) clamp(3rem, 7vw, 6rem); }
.hero__inner { max-width: var(--maxw); margin-inline: auto; width: 100%; }
.hero__title { font-family: var(--display); font-size: clamp(3.4rem, 14vw, 14rem);
  line-height: 0.86; letter-spacing: .01em; }
.hero__title .ln { display: block; overflow: hidden; }
.hero__title .ln > span { display: block; transform: translateY(105%); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: baseline;
  margin-top: clamp(1.6rem, 3vw, 2.6rem); max-width: 60ch; }
.hero__meta p { margin: 0; color: var(--ink-2); max-width: 44ch; }
.hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero__bg canvas { width: 100%; height: 100%; opacity: .9; }

/* Hero with cover photo (home) */
.hero--cover { display: flex; align-items: flex-end; }
.hero__grid { max-width: var(--maxw); margin-inline: auto; width: 100%;
  display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.hero--cover .hero__title { font-size: clamp(3rem, 10vw, 9.5rem); }
.hero__media { margin: 0; align-self: stretch; max-height: 80vh; aspect-ratio: 4/5; overflow: hidden; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: clamp(1.8rem, 6vw, 3rem); }
  .hero__media { aspect-ratio: 16/10; max-height: 46vh; order: 2; }
}

/* ---------- Section header ---------- */
.shead { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem 2rem;
  align-items: end; padding-block: clamp(2rem, 4vw, 3.5rem); border-bottom: 1px solid var(--line); }
.shead__idx { font-size: .72rem; letter-spacing: .2em; color: var(--muted); }
.shead__title { font-family: var(--display); font-size: clamp(2rem, 6vw, 5rem); line-height: .95; }
.shead__title.grid-span { grid-column: 1 / -1; }

/* ---------- Featured / works grid ---------- */
.works { padding-block: var(--gap); }
.grid { display: grid; gap: clamp(2.5rem, 5vw, 5rem); grid-template-columns: repeat(12, 1fr); }
.figure { position: relative; overflow: hidden; background: var(--paper-2); }
.figure img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
/* parallaxed images need a frame to translate within */
.figure img, .portrait img, .hero__media img, .bleed img { will-change: transform; }
.card__meta { display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); margin-top: 1.1rem; }
.card__name { font-family: var(--display); font-size: clamp(1.4rem, 2.4vw, 2.2rem); line-height: 1; }
.card__tag { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); text-align: right; }
.card__no { font-size: .72rem; letter-spacing: .16em; color: var(--muted); }

/* span helpers */
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
@media (max-width: 900px) { .col-8,.col-7,.col-6,.col-5,.col-4 { grid-column: span 12; } }

/* aspect helpers */
.ar-portrait  { aspect-ratio: 4/5; }
.ar-landscape { aspect-ratio: 3/2; }
.ar-square    { aspect-ratio: 1/1; }
.ar-wide      { aspect-ratio: 16/9; }
.ar-tall      { aspect-ratio: 3/4; }

/* ---------- Statement / approach ---------- */
.statement { padding-block: clamp(3rem, 7vw, 6rem); position: relative; }
.statement .wrap { position: relative; z-index: 1; }
.statement__big { font-family: var(--display); font-size: clamp(1.9rem, 4.6vw, 4.2rem);
  line-height: 1.04; max-width: 20ch; }
.statement__big em { font-style: normal; color: var(--ink-2); }
.statement__cols { display: grid; grid-template-columns: repeat(12,1fr); gap: 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem); }
.statement__cols p { grid-column: span 4; color: var(--ink-2); max-width: 38ch; }
.statement__cols p .k { color: var(--ink); display: block; font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: .6rem; }
@media (max-width: 900px) { .statement__cols p { grid-column: span 12; } }

/* ---------- Full-bleed image ---------- */
.bleed { position: relative; }
.bleed__media { overflow: hidden; }          /* clips the parallax zoom; keeps caption clear */
.bleed img { width: 100%; aspect-ratio: 16/8; object-fit: cover; display: block; }

/* portada carousel */
.carousel { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--paper-2); }
.carousel__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.1s var(--ease); }
.carousel__slide.is-active { opacity: 1; }
.carousel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(transparent, rgba(0,0,0,.28)); pointer-events: none; z-index: 1; }
.carousel__dots { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2;
  display: flex; gap: 8px; justify-content: center; }
.carousel__dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease); }
.carousel__dot.is-active { background: #fff; transform: scale(1.35); }
.carousel__caps .cap { display: none; }
.carousel__caps .cap.is-active { display: inline; }
.bleed figcaption { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); padding: .9rem var(--pad) 0; }

/* ---------- Project detail ---------- */
.proj-hero { padding: clamp(8rem,14vh,12rem) var(--pad) 0; }
.proj-hero h1 { font-family: var(--display); font-size: clamp(2.8rem, 9vw, 8rem); line-height: .9; }
.proj-specs { display: flex; flex-wrap: wrap; gap: 1.25rem 1.75rem;
  padding-block: clamp(2rem,4vw,3rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-top: clamp(2rem,4vw,3rem); }
.proj-specs dl { flex: 1 1 0; min-width: 120px; margin: 0; }   /* equal columns, all on one row */
.proj-specs dt { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.proj-specs dd { margin: 0; font-size: .92rem; line-height: 1.35; }
@media (max-width: 760px) { .proj-specs dl { flex: 1 1 40%; min-width: 0; } }
.proj-body { padding-block: var(--gap); display: grid; grid-template-columns: repeat(12,1fr); gap: 2rem; }
.proj-body .text { grid-column: 2 / 8; }
.proj-body .text p { font-size: clamp(1.05rem,1.6vw,1.3rem); font-weight: 300; line-height: 1.55; margin: 0 0 1.4rem; }
@media (max-width: 900px) { .proj-body .text { grid-column: 1 / -1; } }
.gallery { display: grid; grid-template-columns: repeat(12,1fr); gap: clamp(1.2rem,2.5vw,2.5rem); padding-bottom: var(--gap); }

/* ---------- Next project ---------- */
.next { border-top: 1px solid var(--line); padding-block: clamp(3rem,6vw,5rem); display: block; }
.next .eyebrow { margin-bottom: .8rem; }
.next h2 { font-family: var(--display); font-size: clamp(2.5rem,8vw,7rem); line-height: .9;
  transition: transform .6s var(--ease); }
.next:hover h2 { transform: translateX(.4rem); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(12,1fr); gap: clamp(2rem,5vw,4rem); align-items: start; }
.about-grid .about-media { grid-column: span 5; display: flex; flex-direction: column; gap: clamp(1rem, 2vw, 1.4rem); }
.about-media .portrait img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; display: block; }
.about-cap { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding-top: .7rem; }
.about-grid .bio { grid-column: 7 / 13; }
.about-grid .bio p { font-size: clamp(1.05rem,1.5vw,1.25rem); font-weight: 300; margin: 0 0 1.4rem; }
/* subtle reading emphasis: medium weight + darker ink (not heavy bold) */
.bio strong, .proj-body strong, .statement__cols p strong, .lede strong { font-weight: 500; color: var(--ink); }
@media (max-width: 900px) { .about-grid .about-media, .about-grid .bio { grid-column: 1 / -1; } }

/* ---------- Exhibitions ---------- */
.exlist li { display: grid; grid-template-columns: 6rem 1fr auto; gap: 1.5rem; align-items: baseline;
  padding: clamp(1.1rem,2.4vw,1.7rem) 0; border-top: 1px solid var(--line);
  transition: padding-left .45s var(--ease); }
.exlist li:last-child { border-bottom: 1px solid var(--line); }
.exlist li:hover { padding-left: .8rem; }
.exlist .y { font-size: .8rem; letter-spacing: .1em; color: var(--muted); }
.exlist .n { font-family: var(--display); font-size: clamp(1.2rem,2.6vw,2rem); line-height: 1; }
.exlist .p { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 640px){ .exlist li { grid-template-columns: 4rem 1fr; } .exlist .p { grid-column: 2; } }

/* ---------- Contact ---------- */
.contact-big { font-family: var(--display); font-size: clamp(2.4rem,9vw,8rem); line-height: .9; display: inline-block; }
.contact-big:hover { opacity: .6; }
.contact-cols { display: grid; grid-template-columns: repeat(12,1fr); gap: 2rem; margin-top: clamp(2.5rem,5vw,4rem); }
.contact-cols .blk { grid-column: span 3; }
.contact-cols .blk h3 { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
.contact-cols .blk a, .contact-cols .blk p { color: var(--ink-2); margin: 0 0 .35rem;
  overflow-wrap: anywhere; }   /* long email never overflows its column */
.contact-cols .blk a:hover { color: var(--ink); }
@media (max-width: 760px){ .contact-cols .blk { grid-column: span 6; } }
@media (max-width: 540px){ .contact-cols .blk { grid-column: span 12; } }  /* stack on phones */

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: clamp(2.5rem,5vw,4rem) var(--pad);
  display: grid; grid-template-columns: repeat(12,1fr); gap: 1.5rem; align-items: end; }
.foot .big { grid-column: span 8; font-family: var(--display); font-size: clamp(1.6rem,4vw,3rem); line-height: 1; }
.foot .meta { grid-column: span 4; text-align: right; font-size: .76rem; color: var(--ink-2); letter-spacing: .04em; }
.foot a:hover { color: var(--ink); }
@media (max-width: 760px){ .foot .big, .foot .meta { grid-column: span 12; text-align: left; } }

/* ---------- Animations ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-img { clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease); overflow: hidden; }
.reveal-img.in { clip-path: inset(0 0 0 0); }
[data-stagger] > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------- i18n (inline bilingual, toggled) ---------- */
html[data-lang="es"] .lang-en { display: none !important; }
html[data-lang="en"] .lang-es { display: none !important; }
.langtoggle { display: inline-flex; gap: .35rem; align-items: center; background: none;
  border: none; color: inherit; font: inherit; font-size: .78rem; letter-spacing: .1em;
  position: relative; z-index: 102; }
.langtoggle .opt { opacity: .4; transition: opacity .3s; text-transform: uppercase; }
.langtoggle .opt[aria-pressed="true"] { opacity: 1; }
.langtoggle .sep { opacity: .3; }
.head__right { display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.4rem); }
@media (max-width: 820px) { .head__right { gap: 1.1rem; } }

/* ---------- Themed page transition ---------- */
.transition { position: fixed; inset: 0; z-index: 3000; pointer-events: none; }
.transition canvas { display: block; width: 100%; height: 100%; }

/* gentle cross-page entrance — opacity only (transform on body breaks position:fixed) */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body { animation: pageIn .5s var(--ease) both; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal, .hero__title .ln > span { opacity: 1 !important; transform: none !important; }
  .reveal-img { clip-path: none !important; }
  .reveal-img img { transform: none !important; }
  .cursor { display: none; }
  .hero__bg, .statement__ripple { display: none; }
  body, a, button { cursor: auto; }
}
