/* Marina M. Delgado · estilos
   Paleta A (gris cálido) + composición C (nombre centrado, fotos alrededor). */

@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-style: normal; font-display: swap; src: url(../fonts/CormorantGaramond-Light.woff) format("woff"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-style: italic; font-display: swap; src: url(../fonts/CormorantGaramond-LightItalic.woff) format("woff"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/CormorantGaramond-Regular.woff) format("woff"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/HankenGrotesk-Regular.woff) format("woff"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/HankenGrotesk-Medium.woff) format("woff"); }

:root {
	--bg: #F3F1EE;
	--bg-2: #D9D4CC;
	--ink: #161514;
	--stone: #6E6A64;
	--line: #D9D4CC;
	--serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gutter: clamp(20px, 4vw, 64px);
	--section: clamp(80px, 12vw, 180px);
	--max: 1440px;
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* Etiquetas pequeñas */
.site-nav a, .hero-tag, .hero-cta, .tab, .project-year, .ba-label, .side-link, .field > span, .site-foot, .legal-back, .legal-date {
	font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- Cabecera ---------- */
.site-head {
	position: fixed; inset: 0 0 auto; z-index: 20;
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 22px var(--gutter);
	transition: background .3s, padding .3s;
}
.site-head.scrolled { background: color-mix(in srgb, var(--bg) 92%, transparent); padding-block: 14px; backdrop-filter: blur(6px); }
.site-name { font: 300 22px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.site-nav { display: flex; gap: 32px; }
.site-nav a { text-decoration: none; padding-block: 4px; border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav a:hover { border-color: var(--ink); }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; margin-right: -10px; cursor: pointer; position: relative; }
.menu-lines, .menu-lines::before { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--ink); content: ""; transition: transform .3s; }
.menu-lines { top: 18px; }
.menu-lines::before { left: 0; right: 0; top: 7px; }
.menu-btn[aria-expanded="true"] .menu-lines { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(-7px) rotate(-90deg); }

/* ---------- Portada ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1100px; overflow: hidden; }
.hero-photo { position: absolute; left: var(--x); top: var(--y); width: var(--w); will-change: transform; }
.hero-photo img { width: 100%; }
.hero-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 2; pointer-events: none; padding-inline: var(--gutter); }
.hero-name { margin: 0; font: 300 clamp(56px, 9vw, 156px)/.9 var(--serif); letter-spacing: -.025em; white-space: nowrap; }
.hero-tag { margin: 22px 0 0; color: var(--stone); }
.hero-cta { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); z-index: 3; text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid var(--ink); }

/* Entrada suave al cargar */
@media (prefers-reduced-motion: no-preference) {
	.hero-name, .hero-tag { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both; }
	.hero-tag { animation-delay: .15s; }
	.hero-photo img { animation: fade 1.4s ease both; }
	.hero-photo:nth-child(2n) img { animation-delay: .2s; }
	.hero-photo:nth-child(3n) img { animation-delay: .35s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Secciones ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--gutter) 0; scroll-margin-top: 40px; }
.title { margin: 0 0 clamp(36px, 5vw, 72px); font: 300 clamp(44px, 6.4vw, 96px)/1 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.title-italic { font-style: italic; }

/* Sobre mí */
.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
.about-photo { justify-self: end; }
.about-photo img { width: clamp(220px, 26vw, 400px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.about-text { max-width: 58ch; }
.about-text .title { margin-bottom: clamp(24px, 3vw, 40px); }
.about-text p { margin: 0 0 1.1em; font-size: 17px; line-height: 1.75; }
.about-text .about-lead { font: 300 clamp(24px, 2.4vw, 32px)/1.3 var(--serif); margin-bottom: .9em; }

/* Proyectos */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); align-items: start; }
.project { all: unset; cursor: pointer; display: grid; gap: 16px; min-width: 0; }
.project:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }
.project-img { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.project:hover .project-img img { transform: scale(1.03); }
.project-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.project-title { font: 300 clamp(26px, 2.6vw, 38px)/1.1 var(--serif); }
.project-year { color: var(--stone); font-variant-numeric: tabular-nums; }

/* Retoque */
.tabs { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: -24px 0 clamp(32px, 4vw, 56px); }
.tab { background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--stone); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
[hidden] { display: none !important; }
.panel { display: grid; gap: clamp(72px, 10vw, 150px); --h: min(62vh, 580px); }
.row { display: flex; justify-content: center; align-items: flex-start; gap: clamp(28px, 4vw, 64px); }
.row-ba, .row.has-cap { flex-wrap: wrap; row-gap: 14px; }
.row-cap { flex: 0 0 100%; margin: 0; text-align: center; font-size: 12px; line-height: 1.6; color: var(--stone); }
.grid-item { flex: 0 1 auto; min-width: 0; }
.grid-item img, .ba-before { width: auto; height: auto; max-width: 100%; max-height: var(--h); }
.ba { position: relative; flex: 0 1 auto; min-width: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; background: var(--bg-2); }
.ba img { pointer-events: none; }
.ba-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--p)); }
.ba-after img { width: 100%; height: 100%; object-fit: cover; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; touch-action: pan-y; }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--p); width: 1px; background: var(--bg); z-index: 2; pointer-events: none; }
.ba-knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg); }
.ba-knob::before, .ba-knob::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; border: solid var(--ink); border-width: 1px 1px 0 0; }
.ba-knob::before { left: 12px; transform: translateY(-50%) rotate(-135deg); }
.ba-knob::after { right: 12px; transform: translateY(-50%) rotate(45deg); }
.ba-range:focus-visible ~ .ba-line .ba-knob { outline: 1px solid var(--ink); outline-offset: 3px; }
.ba-label { position: absolute; bottom: 14px; z-index: 2; padding: 4px 8px; background: color-mix(in srgb, var(--bg) 85%, transparent); font-size: 11px; pointer-events: none; }
.ba-l { left: 14px; }
.ba-r { right: 14px; }
.grid-item { all: unset; display: block; cursor: zoom-in; flex: 0 1 auto; min-width: 0; }
.grid-item img { transition: opacity .3s; }
.grid-item:hover img { opacity: .9; }
.grid-item:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* Contacto */
.contact { padding-bottom: var(--section); }
.contact .title { margin-bottom: 16px; }
.contact-intro { margin: 0 0 clamp(40px, 5vw, 72px); font: 300 clamp(22px, 2vw, 28px)/1.3 var(--serif); color: var(--stone); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.form { display: grid; gap: 28px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--stone); font-size: 11px; }
.field input, .field textarea { width: 100%; border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 8px 0; font: 400 17px/1.5 var(--sans); color: var(--ink); border-radius: 0; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-width: 2px; padding-bottom: 7px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--ink); flex: none; }
.form-legal { margin: -12px 0 0; font-size: 12px; line-height: 1.6; color: var(--stone); max-width: 60ch; }
.send { justify-self: start; background: var(--ink); color: var(--bg); border: 0; padding: 18px 40px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: opacity .2s; }
.send:hover { opacity: .85; }
.contact-side { display: grid; }
.side-link { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .3s; overflow-wrap: anywhere; }
.side-link:first-child { border-top: 1px solid var(--line); }
.side-link:hover { padding-left: 8px; }
.notice { margin: -32px 0 40px; padding: 16px 20px; background: var(--bg-2); max-width: 70ch; }
.notice-error { background: #EBD9D3; }

/* Pie */
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding: 28px var(--gutter); border-top: 1px solid var(--line); color: var(--stone); font-size: 11px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ---------- Galería a pantalla completa ---------- */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.lightbox[open] { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; }
.lightbox::backdrop { background: var(--bg); }
.lb-fig { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; gap: 12px; padding: 56px 0 20px; min-width: 0; min-height: 0; }
.lb-img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); touch-action: pan-y; }
.lb-cap { text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); font-variant-numeric: tabular-nums; }
.lb-text { overflow-y: auto; max-width: 62ch; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); min-height: 0; padding: 8px 20px; display: grid; gap: 1.1em; text-align: center; -webkit-mask-image: linear-gradient(transparent, #000 16px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(transparent, #000 16px, #000 calc(100% - 24px), transparent); }
.lb-text p { margin: 0; font: 300 clamp(18px, 1.55vw, 23px)/1.5 var(--serif); }
.lb-text .lb-text-title { font: 400 12px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--stone); margin-bottom: .6em; }
.lb-prev, .lb-next, .lb-close { background: none; border: 0; cursor: pointer; font-size: 22px; width: 56px; height: 56px; justify-self: center; }
.lb-close { position: absolute; top: 8px; right: 12px; font-size: 32px; font-weight: 300; z-index: 2; }

/* ---------- Páginas legales ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 140px var(--gutter) 100px; }
.legal .title { font-size: clamp(40px, 6vw, 72px); margin-bottom: 12px; }
.legal-back { margin: 0 0 32px; }
.legal-back a { text-decoration: none; color: var(--stone); }
.legal-date { color: var(--stone); margin: 0 0 48px; font-size: 11px; }
.legal h2 { font: 400 26px/1.2 var(--serif); margin: 40px 0 10px; }
.legal p, .legal li, .legal td { font-size: 16px; line-height: 1.7; max-width: 65ch; }
.legal-extra { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); overflow-x: auto; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
	.hero-photo { width: calc(var(--w) * 1.25); }
}

/* ---------- Móvil ---------- */
@media (max-width: 700px) {
	.site-head { padding-block: 14px; }
	.site-name { font-size: 20px; }
	.menu-btn { display: block; }
	.site-nav { position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; align-items: center; gap: 28px; background: var(--bg); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
	.site-nav a { font: 300 40px/1 var(--serif); letter-spacing: 0; text-transform: none; }
	.site-nav.open { opacity: 1; visibility: visible; }

	.hero { min-height: 600px; }
	.hero-photo { display: none; }
	.hero-photo.on-mobile { display: block; left: var(--mx); top: var(--my); width: var(--mw); }
	.hero-name { white-space: normal; font-size: clamp(52px, 17vw, 84px); }
	.hn-1, .hn-2 { display: block; }

	.about { grid-template-columns: 1fr; }
	.about-photo { justify-self: center; }
	.about-photo img { width: min(64vw, 280px); }
	.about-text p { font-size: 16px; }
	.projects { grid-template-columns: 1fr; gap: 48px; }
	.panel { gap: 64px; --h: none; }
	.row { gap: 12px; }
	.row-2 .grid-item { flex: 1 1 0; }
	.row-2 .grid-item img { width: 100%; }
	.row-1 .grid-item { width: 80%; flex: none; }
	.row-1 .grid-item img { width: 100%; }
	.ba { flex: 0 1 100%; }
	.ba-before { width: 100%; }
	.row-cap { font-size: 11px; }
	.tabs { gap: 8px 24px; margin-top: -16px; }
	.contact-grid { grid-template-columns: 1fr; }
	.send { justify-self: stretch; }
	.lightbox[open] { grid-template-columns: 1fr; }
	.lb-prev, .lb-next { position: absolute; bottom: 8px; z-index: 2; }
	.lb-prev { left: 8px; }
	.lb-next { right: 8px; }
	.lb-fig { padding: 56px 0 64px; }
	.lb-cap { position: absolute; left: 0; right: 0; bottom: 26px; }
}
