/* Juan Rios Photographer
   Concept: near-black room, photographs are the only loud thing. Light display
   weights, hairline structure, one pale accent. Motion is short and ease-out. */
:root {
  --bg: #0a0a0b;
  --surface: #111315;
  --fg: #e8ebec;
  --muted: #929b9e;
  --line: #1d2123;
  --edge: #5b6568;
  --accent: #aec4cc;
  --err: #f0a39a;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --f-display: "Outfit", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 2px;
  color-scheme: dark;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1320px; margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.h1 { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(2rem, 3.8vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.lead { margin: 20px 0 0; max-width: 54ch; font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); font-weight: 300; color: var(--muted); text-wrap: pretty; }
.label { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.note { margin: 48px 0 0; font-size: 0.875rem; color: var(--muted); }

/* ---------- header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { font-family: var(--f-display); font-weight: 300; font-size: 1rem; letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--muted); }
.nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav a { position: relative; text-decoration: none; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-block: 8px; transition: color 0.2s ease; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease-out); }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.lang { display: flex; gap: 2px; }
.lang button { background: none; border: 0; border-radius: var(--r); padding: 6px 9px; font-size: 0.78rem; letter-spacing: 0.12em; color: var(--muted); cursor: pointer; transition: color 0.2s ease, transform 0.15s ease; }
.lang button[aria-pressed="true"] { color: var(--fg); }
.lang button:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--fg); }
  .nav a:not([aria-current="page"]):hover::after { transform: scaleX(1); }
  .lang button:hover { color: var(--fg); }
}
@media (max-width: 760px) {
  .top .wrap { row-gap: 0; }
  .nav { order: 3; width: 100%; justify-content: space-between; padding-bottom: 6px; }
  .brand { letter-spacing: 0.12em; font-size: 0.875rem; }
  .nav { gap: 10px; }
  .nav a { font-size: 0.72rem; letter-spacing: 0.08em; }
  .top .wrap { column-gap: 12px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; gap: 10px;
  padding: 14px 28px; border-radius: var(--r); border: 1px solid var(--fg); background: var(--fg); color: var(--bg);
  text-decoration: none; cursor: pointer; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  transition: transform 0.16s ease-out, background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--edge); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent); border-color: var(--accent); }
  .btn.ghost:hover { background: transparent; border-color: var(--fg); }
}

/* ---------- photo placeholders ---------- */
.ph {
  position: absolute; inset: 0; display: block; overflow: hidden;
  background:
    radial-gradient(58% 52% at var(--gx, 62%) var(--gy, 38%), var(--glow) 0%, transparent 72%),
    radial-gradient(90% 70% at 18% 92%, color-mix(in srgb, var(--glow) 30%, transparent) 0%, transparent 70%),
    linear-gradient(170deg, var(--base), var(--deep));
}
.ph::after { content: attr(data-label); position: absolute; left: 12px; bottom: 10px; font-size: 0.72rem; letter-spacing: 0.06em; color: rgb(255 255 255 / 0.6); }
.shot { position: relative; overflow: hidden; background: var(--surface); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vf {
  position: absolute; inset: -8px; pointer-events: none; opacity: 0; transition: opacity 0.22s ease;
  background:
    linear-gradient(var(--fg), var(--fg)) top left / 14px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) top left / 1px 14px no-repeat,
    linear-gradient(var(--fg), var(--fg)) top right / 14px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) top right / 1px 14px no-repeat,
    linear-gradient(var(--fg), var(--fg)) bottom left / 14px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) bottom left / 1px 14px no-repeat,
    linear-gradient(var(--fg), var(--fg)) bottom right / 14px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) bottom right / 1px 14px no-repeat;
}

/* ---------- home: wheel ---------- */
.stage { position: relative; height: clamp(580px, calc(100dvh - 76px), 960px); overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; outline-offset: -4px; }
/* bosque visto desde arriba: se funde con el negro arriba y abajo */
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 1;
  inset: 0;
  background: url("img/banner-bosque-aereo.webp") center / cover no-repeat;
  filter: brightness(0.82);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 70%, transparent 100%);
}
.stage.drag { cursor: grabbing; }
.copy { position: absolute; left: 50%; width: min(92%, 560px); transform: translate(-50%, -50%); text-align: center; display: grid; justify-items: center; gap: 28px; z-index: 2; }
.copy::before { content: ""; position: absolute; inset: -56px -110px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgb(10 10 11 / 0.5), rgb(10 10 11 / 0.2) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); }
.copy h1 { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.15; letter-spacing: -0.02em; max-width: 18ch; text-wrap: balance; }
.tile { position: absolute; left: 0; top: 0; width: var(--tw, 120px); height: var(--th, 150px); will-change: transform, opacity; display: block; text-decoration: none; }
.tile .pop { display: block; width: 100%; height: 100%; transition: transform 0.24s var(--ease-out); }
.tile .face { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: var(--r); background: var(--surface); }
.tile .tcap { position: absolute; inset: auto 0 0 0; padding: 28px 12px 11px; font-size: 0.8rem; letter-spacing: 0.04em; background: linear-gradient(to top, rgb(0 0 0 / 0.72), transparent); opacity: 0; transform: translateY(6px); transition: opacity 0.22s ease, transform 0.26s var(--ease-out); }
.tile:focus-visible .tcap { opacity: 1; transform: none; }
.tile:focus-visible { outline-offset: 5px; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .pop { transform: scale(1.06); }
  .tile:hover .tcap { opacity: 1; transform: none; }
}

/* ---------- pages ---------- */
main.page { padding-block: clamp(40px, 6vw, 88px) clamp(64px, 9vw, 128px); }
.head { margin-bottom: clamp(36px, 5vw, 64px); }

/* portfolio grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(20px, 3vw, 40px); align-items: start; }
.card { display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.card .shot { aspect-ratio: 4 / 5; margin-bottom: 14px; }
.card .shot .ph, .card .shot img { transition: transform 0.7s var(--ease-out); }
.cname { font-family: var(--f-display); font-weight: 300; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.2; }
.csci { font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.cn { font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.06em; margin-top: 2px; }
@media (hover: hover) and (pointer: fine) {
  .card:hover .vf, .card:focus-visible .vf { opacity: 0.9; }
  .card:hover .shot .ph, .card:hover .shot img { transform: scale(1.025); }
}
.card:focus-visible .vf { opacity: 0.9; }
@media (min-width: 981px) { .card:nth-child(3n + 2) { margin-top: 64px; } }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* species page */
.back { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: clamp(24px, 4vw, 48px); padding-block: 6px; transition: color 0.2s ease; }
.back span { display: inline-block; transition: transform 0.25s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--fg); } .back:hover span { transform: translateX(-4px); } }
.ave { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.info { position: sticky; top: 96px; display: grid; gap: 28px; min-width: 0; }
.info .sci { margin: 10px 0 0; font-style: italic; font-size: 1.125rem; color: var(--muted); }
.info .en { margin: 2px 0 0; font-size: 0.9375rem; color: var(--muted); }
.juan { margin: 0; color: var(--fg); font-weight: 300; font-size: 1.0625rem; line-height: 1.7; max-width: 50ch; text-wrap: pretty; }
.juan.empty { color: var(--muted); font-style: italic; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { margin: 0 0 4px; }
.facts dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; }
.facts .wide { grid-column: 1 / -1; }
.facts .todo { color: var(--muted); font-style: italic; }
.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); align-items: start; }
.mosaic .big { grid-column: 1 / -1; }
.pic { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; position: relative; }
.pic .shot { display: block; width: 100%; }
.pic .shot .ph, .pic .shot img { transition: transform 0.6s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .pic:hover .vf { opacity: 0.9; } .pic:hover .shot .ph, .pic:hover .shot img { transform: scale(1.02); } }
.pic:focus-visible .vf { opacity: 0.9; }
.pager { display: flex; justify-content: space-between; gap: 24px; margin-top: clamp(56px, 8vw, 112px); padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.pager a.next { text-align: right; margin-left: auto; }
.pager .pn { font-family: var(--f-display); font-weight: 300; font-size: clamp(1.125rem, 2vw, 1.5rem); transition: transform 0.28s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .pager a.prev:hover .pn { transform: translateX(-4px); } .pager a.next:hover .pn { transform: translateX(4px); } }
@media (max-width: 900px) { .ave { grid-template-columns: minmax(0, 1fr); } .info { position: static; } }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(32px, 7vw, 112px); align-items: start; }
.about .portrait { aspect-ratio: 4 / 5; }
.about .big { margin: 28px 0 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(1.375rem, 2.4vw, 2rem); line-height: 1.3; letter-spacing: -0.015em; text-wrap: balance; }
.about .body { display: grid; gap: 18px; margin-top: 28px; max-width: 60ch; color: var(--muted); font-weight: 300; text-wrap: pretty; }
.about .body p { margin: 0; }
.about .go { margin-top: 36px; }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0, 1fr); } .about .portrait { max-width: 420px; } }

/* workshops */
.agenda { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: clamp(16px, 3vw, 40px); align-items: center; padding-block: 26px; border-bottom: 1px solid var(--line); }
.row:first-child { border-top: 1px solid var(--line); }
.date { display: flex; flex-direction: column; line-height: 1; }
.date b { font-family: var(--f-display); font-weight: 300; font-size: 3rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.date span { margin-top: 6px; }
.row h3 { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(1.25rem, 2vw, 1.625rem); letter-spacing: -0.01em; line-height: 1.25; }
.row .meta { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; }
.empty-box { padding: 32px; border: 1px solid var(--line); color: var(--muted); max-width: 56ch; }
.priv { margin-top: clamp(40px, 6vw, 72px); display: grid; gap: 16px; justify-items: start; max-width: 56ch; }
.priv h2 { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: 1.5rem; letter-spacing: -0.01em; }
.priv p { margin: 0; color: var(--muted); font-weight: 300; }
@media (max-width: 680px) { .row { grid-template-columns: 72px minmax(0, 1fr); } .row .btn { grid-column: 1 / -1; } .date b { font-size: 2.5rem; } }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 7vw, 112px); align-items: start; }
.alt { margin-top: 36px; display: grid; gap: 4px; font-size: 0.9375rem; color: var(--muted); }
.alt a { color: var(--fg); text-underline-offset: 4px; text-decoration-color: var(--edge); transition: text-decoration-color 0.2s ease; }
@media (hover: hover) and (pointer: fine) { .alt a:hover { text-decoration-color: var(--fg); } }
form { display: grid; gap: 22px; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-size: 0.875rem; letter-spacing: 0.02em; }
.field input, .field select, .field textarea { width: 100%; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r); padding: 13px 14px; min-height: 48px; transition: border-color 0.2s ease; }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
@media (hover: hover) and (pointer: fine) { .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); } }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--fg); }
.field[data-bad="true"] input, .field[data-bad="true"] select, .field[data-bad="true"] textarea { border-color: var(--err); }
.err { color: var(--err); font-size: 0.875rem; }
.err:empty { display: none; }
.actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.status { font-size: 0.9375rem; color: var(--muted); max-width: 44ch; }
@media (max-width: 860px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* footer */
footer { border-top: 1px solid var(--line); padding-block: 28px; }
.foot { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); }
.foot a { text-underline-offset: 4px; text-decoration-color: var(--edge); }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--fg); } }

/* lightbox */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--fg); width: 100vw; height: 100dvh; max-width: none; max-height: none; }
dialog::backdrop { background: var(--bg); }
dialog[open] { animation: lb-in 0.22s var(--ease-out); }
.lb { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lb-title { font-family: var(--f-display); font-weight: 300; font-size: 1.125rem; }
.lb-stage { position: relative; min-height: 0; display: grid; place-items: center; }
.lb-shot { position: relative; height: 100%; max-width: 100%; margin-inline: auto; transition: opacity 0.18s ease; }
.lb-shot.swap { opacity: 0; }
.lb-nav { display: flex; justify-content: center; gap: 12px; }
.arrow { width: 48px; height: 48px; border-radius: var(--r); border: 1px solid var(--edge); background: transparent; color: var(--fg); font-size: 1.125rem; cursor: pointer; transition: transform 0.16s ease-out, border-color 0.2s ease, background-color 0.2s ease; }
.arrow:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .arrow:hover { border-color: var(--fg); } }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tile-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.enter { animation: rise 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.tile .face { animation: tile-in 0.55s var(--ease-out) both; animation-delay: calc(var(--k, 0) * 50ms + 120ms); }
.copy h1 { animation: rise 0.6s var(--ease-out) 0.1s both; }
.copy .btn { animation: rise 0.6s var(--ease-out) 0.2s both; }
/* below the fold: only position shifts, so content is always visible */
.rv { transform: translateY(14px); transition: transform 0.7s var(--ease-out); }
.rv.seen { transform: none; }
@view-transition { navigation: auto; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-old(root) { animation: vt-out 0.14s ease both; }
::view-transition-new(root) { animation: vt-in 0.22s ease 0.04s both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter, .copy h1, .copy .btn { animation: none; }
  .tile .face { animation: tile-in 0.3s ease both; animation-delay: 0ms; }
  .tile .face { animation-name: fade-only; }
  @keyframes fade-only { from { opacity: 0; } to { opacity: 1; } }
  .rv { transform: none; transition: none; }
  dialog[open] { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* =====================================================================
   v3: shape system, home layers, parallax
   Shape rule: photos 22px, buttons pill, fields 12px, arrows circle.
   ===================================================================== */
:root { --r-img: 22px; --r-btn: 999px; --r-field: 12px; }
.btn, .lang button { border-radius: var(--r-btn); }
.arrow { border-radius: 50%; }
.field input, .field select, .field textarea { border-radius: var(--r-field); }
.shot, .empty-box { border-radius: var(--r-img); isolation: isolate; }
.tile .face { border-radius: 18px; }
.vf { border-radius: calc(var(--r-img) + 6px); }
.lb-shot { border-radius: var(--r-img); }

/* hover zoom uses the `scale` property so it composes with scroll parallax */
.card .shot .ph, .card .shot img, .pic .shot .ph, .pic .shot img { transition: scale 0.7s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .shot .ph, .card:hover .shot img, .pic:hover .shot .ph, .pic:hover .shot img { transform: none; scale: 1.04; }
}

/* sections on the home page */
.band { padding-block: clamp(64px, 9vw, 128px); border-top: 1px solid var(--line); }
.sec-head { margin-bottom: clamp(32px, 5vw, 56px); }
.h2 { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(16px, 2vw, 28px); align-items: start; }
.cats .card .shot { aspect-ratio: 3 / 4; }
.cdesc { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; max-width: 30ch; }
@media (min-width: 981px) { .cats .card:nth-child(even) { margin-top: 56px; } }
@media (max-width: 980px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cats { grid-template-columns: minmax(0, 1fr); } }
.more { margin: 36px 0 0; }

.juan-sec .wrap { display: grid; justify-items: center; gap: 26px; text-align: center; }
.jx-portrait { width: 132px; aspect-ratio: 4 / 5; }
.jx-text { margin: 0; width: 100%; max-width: 24ch; font-family: var(--f-display); font-weight: 300; font-size: clamp(1.5rem, 3.2vw, 2.625rem); line-height: 1.22; letter-spacing: -0.015em; text-wrap: balance; }
.jx-btn { margin-top: 6px; }

/* simple galleries */
.gal { columns: 3; column-gap: clamp(14px, 2vw, 24px); }
.gal .pic { break-inside: avoid; margin-bottom: clamp(14px, 2vw, 24px); text-align: left; }
.pcap { display: block; margin-top: 8px; font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.04em; }
@media (max-width: 900px) { .gal { columns: 2; } }
@media (max-width: 480px) { .gal { columns: 1; } }
.lb-cap { flex: 1; text-align: center; color: var(--muted); font-size: 0.9375rem; align-self: center; }
.lb-nav { align-items: center; }

/* ---------- parallax (progressive: only where scroll timelines exist) ---------- */
.orbit { position: absolute; inset: 0; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stage { view-timeline: --stage block; }
    .orbit { animation: drift-orbit linear both; animation-timeline: --stage; animation-range: exit 0% exit 100%; }
    .stage .copy { animation: drift-copy linear both; animation-timeline: --stage; animation-range: exit 0% exit 100%; }
    @keyframes drift-orbit { to { transform: translateY(-90px) scale(0.97); } }
    @keyframes drift-copy { from { transform: translate(-50%, -50%); } to { transform: translate(-50%, calc(-50% - 34px)); } }

    /* photos drift inside their rounded frames at their own pace */
    .card .shot .ph, .card .shot img, .pic .shot .ph, .pic .shot img {
      top: -9%; bottom: auto; height: 118%;
      animation: frame-par linear both; animation-timeline: view();
    }
    @keyframes frame-par { from { transform: translateY(-7%); } to { transform: translateY(7%); } }

    /* Juan block: portrait rises, lines enter from opposite sides */
    .jx-portrait { animation: jx-pop linear both; animation-timeline: view(); animation-range: entry 0% cover 38%; }
    .jx-text { animation: jx-left linear both; animation-timeline: view(); animation-range: entry 4% cover 36%; }
    .jx-btn { animation: jx-in linear both; animation-timeline: view(); animation-range: entry 10% cover 40%; }
    @keyframes jx-pop { from { opacity: 0.3; transform: translateY(70px) scale(0.8); } to { opacity: 1; transform: none; } }
    @keyframes jx-left { from { opacity: 0.35; transform: translateX(-56px); filter: blur(5px); } to { opacity: 1; transform: none; filter: blur(0); } }
    @keyframes jx-right { from { opacity: 0.35; transform: translateX(56px); filter: blur(5px); } to { opacity: 1; transform: none; filter: blur(0); } }
    @keyframes jx-in { from { opacity: 0.25; transform: translateY(32px); } to { opacity: 1; transform: none; } }
  }
}
.juan-sec { overflow-x: clip; position: relative; isolation: isolate; }
/* about (home): la foto de hojas tal cual de fondo, con fundido suave arriba y abajo */
.juan-sec::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("img/hojas-fondo.webp") center / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%);
}
/* tarjeta de vidrio oscuro con la foto, el texto y el botón */
.juan-sec .wrap {
  position: relative; z-index: 1; max-width: 760px;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 4vw, 56px);
  border-radius: var(--r-img);
  background: rgb(12 14 15 / 0.45);
  border: 1px solid rgb(232 235 236 / 0.12);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.06);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}
/* sin líneas divisorias: la sección se funde con la de arriba y la de abajo */
.juan-sec, .juan-sec + .band { border-top-color: transparent; }

/* ---------- portfolio catalog rails ---------- */
.rail { margin-bottom: clamp(36px, 5vw, 64px); }
.rail-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.rail-title { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(1.375rem, 2.2vw, 1.75rem); letter-spacing: -0.01em; }
.rail-title a { text-decoration: none; color: var(--fg); }
.rail-all { margin-left: auto; font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding-block: 6px; transition: color 0.2s ease; }
.rail-wrap { position: relative; }
.track { display: flex; gap: clamp(12px, 1.6vw, 20px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 14px 0 18px; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.ritem { flex: 0 0 auto; width: clamp(210px, 24vw, 320px); scroll-snap-align: start; text-decoration: none; color: inherit; display: block; transition: transform 0.25s var(--ease-out); }
.ritem .shot { display: block; aspect-ratio: 3 / 2; }
.ritem:active { transform: scale(0.97); }
.rail-btn { position: absolute; top: 40%; z-index: 3; transition: opacity 0.2s ease, transform 0.2s var(--ease-out); }
.rb-prev { left: 8px; } .rb-next { right: 8px; }
.rail-btn:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .rail-btn { display: none; } }
@media (hover: hover) and (pointer: fine) {
  .rail-all:hover { color: var(--fg); }
  .ritem:hover .shot { scale: 1.03; }
}

/* ---------- event pages ---------- */
.rowlink { color: inherit; text-decoration: none; }
.rowlink::after { content: ""; position: absolute; inset: 0; }
.row { position: relative; }
.row .btn { position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) { .row:hover h3 { color: var(--accent); } }
.ev-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); margin-bottom: clamp(36px, 5vw, 64px); }
.ev-photos .pic { display: block; width: 100%; text-align: left; }
.ev-photos .lead-pic { grid-column: 1 / -1; }
.ev-photos .lead-pic .shot { aspect-ratio: 21 / 9; }
.ev-photos .pic:not(.lead-pic) .shot { aspect-ratio: 4 / 3; }
.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 6vw, 88px); align-items: start; }
.ev-main { display: grid; gap: clamp(32px, 4vw, 52px); }
.ev-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.ev-h { margin: 0 0 14px; font-family: var(--f-display); font-weight: 300; font-size: 1.375rem; letter-spacing: -0.01em; }
.ev-main ul, .prog { list-style: none; margin: 0; padding: 0; }
.ev-main ul li { padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-weight: 300; }
.ev-main ul li:last-child { border-bottom: 1px solid var(--line); }
.prog li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.prog li:last-child { border-bottom: 1px solid var(--line); }
.prog b { font-weight: 400; font-variant-numeric: tabular-nums; }
.prog span { color: var(--muted); font-weight: 300; }
.ev-side { position: sticky; top: 96px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-img); background: var(--surface); display: grid; gap: 20px; justify-items: start; }
.ev-side .ev-h { margin: 0; }
.facts.one { grid-template-columns: 1fr; width: 100%; }
@media (max-width: 900px) { .ev-grid { grid-template-columns: 1fr; } .ev-side { position: static; } .ev-two { grid-template-columns: 1fr; } .ev-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ev-photos .lead-pic .shot { aspect-ratio: 4 / 3; } }

/* event banner + sections (v5) */
.ev-hero { position: relative; border-radius: var(--r-img); overflow: hidden; min-height: clamp(420px, 58vw, 600px); display: flex; align-items: flex-end; isolation: isolate; margin-bottom: clamp(48px, 7vw, 96px); }
.ev-hero > .shot { position: absolute; inset: 0; border-radius: 0; }
.ev-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(10,10,11,0.92) 0%, rgba(10,10,11,0.6) 45%, rgba(10,10,11,0.05) 100%); pointer-events: none; }
.ev-hero-in { position: relative; z-index: 2; padding: clamp(24px, 4vw, 56px); display: grid; gap: 14px; justify-items: start; max-width: 720px; }
.ev-hero-in .label { color: var(--fg); opacity: 0.85; }
.ev-hero-in .lead { margin: 0; color: #d3d9db; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.ev-chips span { padding: 7px 14px; border: 1px solid rgba(232,235,236,0.35); border-radius: 999px; font-size: 0.875rem; background: rgba(10,10,11,0.4); }
.ev-sec { margin-bottom: clamp(56px, 8vw, 112px); }
.ev-sec .sec-head { margin-bottom: clamp(24px, 3vw, 40px); }
.ev-place { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.ev-place .pic { display: block; width: 100%; }
.ev-place .shot { aspect-ratio: 4 / 3 !important; }
.ev-main ul li, .prog span { color: #c3cacd; }
@media (max-width: 600px) { .ev-place { grid-template-columns: 1fr 1fr; } }

.brand { display: inline-flex; align-items: center; letter-spacing: 0; padding-block: 2px; transition: opacity 0.2s ease, transform 0.15s ease; }
.brand img { display: block; height: 46px; width: auto; }
.brand:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .brand:hover { opacity: 0.8; } }
@media (max-width: 760px) { .brand img { height: 38px; } }

.jx-portrait { width: 148px; }
.portrait img { object-position: 50% 16%; }

/* ---------- responsive pass (mobile + tablet) ---------- */
html { -webkit-text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }
button, .btn, .arrow { touch-action: manipulation; }

/* hero wheel runs edge to edge so tiles fade out at the screen edge, not at the gutter */
.stage { margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
body { overflow-x: clip; }

/* touch devices: comfortable hit areas */
@media (pointer: coarse) {
  .nav a { padding-block: 13px; }
  .nav a::after { bottom: 8px; }
  .lang button { min-width: 44px; min-height: 44px; }
  .back { padding-block: 13px; }
  .rail-all { padding-block: 13px; }
  .foot a, .alt a { display: inline-block; padding-block: 11px; }
  .pager a { padding-block: 8px; }
}

/* tablet */
@media (max-width: 1024px) and (min-width: 761px) {
  .ev-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
  .about { gap: 40px; }
}

/* phone */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .top .wrap { min-height: 56px; padding-block: 4px; }
  .stage { height: clamp(520px, calc(100svh - 110px), 760px); }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .cats .card { margin-top: 0 !important; }
  .cats .card .shot { aspect-ratio: 4 / 5; margin-bottom: 10px; }
  .cname { font-size: 1.25rem; }
  .cdesc { display: none; }
  .gal { columns: 2; column-gap: 12px; }
  .gal .pic { margin-bottom: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .mosaic { gap: 12px; }
  .ritem { width: 62vw; max-width: 280px; }
  .rail-head { gap: 10px; flex-wrap: wrap; }
  .ev-hero { min-height: 440px; }
  .ev-hero-in { padding: 22px; gap: 12px; }
  .ev-side { padding: 22px; }
  .ev-place { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .prog li { grid-template-columns: 58px 1fr; gap: 12px; }
  .ev-sec { margin-bottom: 56px; }
  .about { gap: 28px; }
  .contact { gap: 32px; }
  .priv .btn, .more .btn, .actions .btn { width: 100%; }
  .actions { flex-direction: column; align-items: stretch; }
  .pager { gap: 12px; }
  .pager .pn { font-size: 1.0625rem; }
  .foot { flex-direction: column; align-items: flex-start; gap: 0; }
  dialog .lb, .lb { padding: 14px; }
}
@media (max-width: 360px) {
  .cats, .grid { gap: 18px 10px; }
  .ev-chips span { padding: 6px 11px; font-size: 0.8125rem; }
  .nav { gap: 6px; }
  .nav a { font-size: 0.68rem; letter-spacing: 0.06em; }
}
/* short landscape phones */
@media (max-height: 520px) and (orientation: landscape) { .stage { height: 520px; } }
@media (pointer: coarse) { .rail-title a { display: inline-block; padding-block: 9px; } }
.tile .face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- v6: menu, rails as buttons, about lines, mobile rotator ---------- */
.burger { display: none; }
.rail-all { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--edge); border-radius: var(--r-btn); color: var(--fg); letter-spacing: 0.12em; font-size: 0.75rem; text-decoration: none; transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.16s ease-out; }
.rail-all::after { content: "\2192"; font-size: 0.95rem; letter-spacing: 0; transition: transform 0.25s var(--ease-out); }
.rail-all:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .rail-all:hover { border-color: var(--fg); background: rgb(232 235 236 / 0.06); } .rail-all:hover::after { transform: translateX(3px); } }
@media (pointer: coarse) { .rail-all { padding-block: 12px; } }

/* home Juan phrase: three lines */
.jx-text { max-width: 36ch; font-size: clamp(1.375rem, 2.7vw, 2.25rem); }
.about .big { max-width: 36ch; }

@media (max-width: 900px) {
  .top .wrap { flex-wrap: nowrap; min-height: 60px; padding-block: 0; position: relative; }
  .top .brand { margin-right: auto; }
  .lang { order: 2; }
  .burger { order: 3; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; border-radius: var(--r-btn); cursor: pointer; transition: transform 0.15s ease-out; }
  .burger:active { transform: scale(0.94); }
  .burger span { display: block; width: 22px; height: 1.5px; background: var(--fg); border-radius: 2px; transition: transform 0.28s var(--ease-out); }
  .top.open .burger span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
  .top.open .burger span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }
  .nav { position: absolute; top: 100%; left: -16px; right: -16px; order: 4; width: auto; flex-direction: column; justify-content: flex-start; gap: 0; padding: 8px 16px 18px; background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.2s ease, transform 0.26s var(--ease-out), visibility 0s linear 0.26s; }
  .top.open .nav { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.26s var(--ease-out); }
  .nav a { font-family: var(--f-display); font-weight: 300; font-size: 1.5rem; letter-spacing: -0.01em; text-transform: none; color: var(--fg); padding-block: 14px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { color: var(--accent); }
  .brand img { height: 40px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { .nav, .top.open .nav { transition: none; } }

/* mobile rotator for past workshops */
@media (max-width: 760px) {
  .gal.past { columns: auto; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; overscroll-behavior-x: contain; }
  .gal.past::-webkit-scrollbar { display: none; }
  .gal.past .pic { flex: 0 0 74%; max-width: 320px; margin: 0; scroll-snap-align: start; }
  .gal.past .pic .shot { aspect-ratio: 4 / 5 !important; }
}
@media (max-width:760px){.jx-text,.about .big{max-width:none;font-size:clamp(17px,5vw,20px)}}
@media (max-width:760px){.about .big{font-size:clamp(15px,4.3vw,18px)}}

/* ---------- contacto: colibrí y hojas que se funden con el fondo ---------- */
/* Las fotos llevan el negro convertido en transparencia, así no hay bordes ni recuadros. */
.contact { position: relative; isolation: isolate; }
.cx-leaves { position: absolute; inset: -72px 0; z-index: -1; overflow: clip; pointer-events: none; }
.cx-leaves .lf { position: absolute; height: auto; opacity: 0.62; }
.lf-a { top: 0; right: 0; width: clamp(240px, 32vw, 460px); transform: rotate(8deg); }
.lf-b { bottom: 0; left: 0; width: clamp(220px, 26vw, 380px); transform: scaleX(-1) rotate(-10deg); }
.lf-c { bottom: 10%; right: 12%; width: clamp(150px, 16vw, 250px); opacity: 0.4; transform: rotate(-24deg); }
.cx-bird { margin: clamp(28px, 4vw, 48px) 0 0; width: min(100%, 560px); }
.cx-bird img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .lf-a { animation: lf-a 17s ease-in-out infinite alternate; }
  .lf-b { animation: lf-b 21s ease-in-out -6s infinite alternate; }
  .lf-c { animation: lf-c 14s ease-in-out -3s infinite alternate; }
  .cx-bird img { animation: cx-bird-in 1.4s var(--ease-out) both; }
}
@keyframes lf-a { from { transform: translate3d(0, 0, 0) rotate(8deg); } to { transform: translate3d(-10px, 16px, 0) rotate(12deg); } }
@keyframes lf-b { from { transform: translate3d(0, 0, 0) scaleX(-1) rotate(-10deg); } to { transform: translate3d(8px, -14px, 0) scaleX(-1) rotate(-6deg); } }
@keyframes lf-c { from { transform: translate3d(0, 0, 0) rotate(-24deg); } to { transform: translate3d(-12px, -10px, 0) rotate(-18deg); } }
@keyframes cx-bird-in { from { opacity: 0; transform: translateY(12px) scale(1.02); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .cx-leaves { inset: -48px 0; }
  .cx-leaves .lf { opacity: 0.4; }
  .lf-a { width: 230px; }
  .lf-b { width: 210px; }
  .lf-c { display: none; }
  .cx-bird { width: min(100%, 440px); margin-block: 8px -36px; }
}

/* ---------- hojas en los bordes (home y sobre mí) ---------- */
.has-ed { position: relative; }
.has-ed > .wrap { position: relative; z-index: 1; }
.ed { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow-x: clip; }
.ed-doc { z-index: -1; }
.ed-l { position: absolute; width: min(var(--w), 30vw); }
.ed-l img { display: block; width: 100%; height: auto; opacity: var(--o); filter: blur(var(--b)); transform: perspective(700px) scaleX(var(--m)) rotateZ(var(--r)) rotateX(var(--fx)) rotateY(var(--fy)); }
@media (max-width: 760px) { .ed-mh { display: none; } .ed-l { width: min(var(--w), 34vw); } .ed-l img { opacity: calc(var(--o) * 0.85); } }

/* ---------- hover de escritorio: botones blancos pasan a negro ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease; }
  .btn:not(.ghost):hover { background: #000; border-color: var(--fg); color: var(--fg); }
  .btn.ghost:hover { background: transparent; border-color: var(--fg); color: var(--fg); }
}

/* fondo de la sección de Juan: en pantallas angostas se encuadra hacia el arbusto de la izquierda */
@media (max-width: 760px) { .juan-sec::before { background-position: 4% center; } }


/* ---------- agenda: dos botones por fila, aviso de proximos talleres ---------- */
.row .acts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 1; }
.row .acts .btn { position: relative; z-index: 1; }
@media (max-width: 680px) { .row .acts { grid-column: 1 / -1; justify-content: stretch; } .row .acts .btn { flex: 1 1 0; } }
.empty-box p { margin: 0 0 20px; }
.ev-more { margin-top: clamp(48px, 7vw, 96px); }
.notify { max-width: 560px; padding-bottom: clamp(48px, 8vw, 112px); }
.notify form { display: grid; gap: 22px; position: relative; }
.field.check .chk { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9375rem; line-height: 1.5; color: var(--muted); cursor: pointer; }
.field.check input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: #fff; padding: 0; }
.field.check a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.field.check[data-bad="true"] .chk { color: var(--err); }

/* ---------- paginas legales y pie de pagina ---------- */
.legal { max-width: 70ch; padding-bottom: clamp(48px, 8vw, 112px); }
.legal-date { margin: 14px 0 0; color: var(--muted); font-size: 0.9375rem; }
.legal-body { margin-top: clamp(28px, 4vw, 48px); font-weight: 300; line-height: 1.7; }
.legal-body h2 { margin: 2.2em 0 0.6em; font-family: var(--f-display); font-weight: 300; font-size: 1.375rem; letter-spacing: -0.01em; }
.legal-body p, .legal-body li { color: rgb(255 255 255 / 0.82); }
.legal-body p { margin: 0 0 1em; }
.legal-body ul { margin: 0 0 1em; padding-left: 1.2em; }
.legal-body li { margin-bottom: 0.5em; }
.legal-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--edge); }
.foot { align-items: flex-start; }
.foot-copy { margin: 0; max-width: 62ch; line-height: 1.55; }
.foot-links { display: flex; gap: 6px 22px; flex-wrap: wrap; }
@media (max-width: 760px) { .foot-links { margin-top: 8px; } }
