/* ==========================================================================
   Maria Paulina — Portfolio
   Estética: plateado / gris claro, vidrio translúcido, acento esmeralda.
   ========================================================================== */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #e3e4e2;
  --bg-2: #d6d8d5;
  --light: rgba(255, 255, 255, 0.85);
  --text: #121413;
  --text-2: #3c403e;
  --muted: #6c716e;
  --line: rgba(18, 20, 19, 0.12);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow: 0 30px 60px -30px rgba(20, 30, 25, 0.28);
  --accent: #0b6b4f;
  --accent-2: #0f8a66;
  --accent-soft: rgba(11, 107, 79, 0.1);
  --on-accent: #ffffff;
  --btn: #111312;
  --on-btn: #ffffff;
  --card-bg: linear-gradient(160deg, rgba(255,255,255,0.75), rgba(232,234,231,0.45));

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --radius: 28px;
  --radius-sm: 16px;
  --max: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0d0c;
  --bg-2: #121513;
  --light: rgba(120, 140, 130, 0.16);
  --text: #eceeed;
  --text-2: #c3c8c5;
  --muted: #8f9692;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(22, 26, 24, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  --accent: #3cc293;
  --accent-2: #5fd6ab;
  --accent-soft: rgba(60, 194, 147, 0.12);
  --on-accent: #06120d;
  --btn: #eceeed;
  --on-btn: #0b0d0c;
  --card-bg: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .5s var(--ease), color .5s var(--ease);
  overflow-x: hidden;
}
/* Luz ambiental: haces diagonales suaves, como luz entrando por una ventana */
body::before {
  content: "";
  position: fixed; inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%, var(--light), transparent 70%),
    radial-gradient(45% 40% at 92% 85%, var(--light), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 140px, rgba(255,255,255,0.10) 140px 260px, transparent 260px 420px),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  filter: blur(18px);
  transition: opacity .5s;
}
[data-theme="dark"] body::before { opacity: .9; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 48px, var(--max)); margin-inline: auto; }
.serif { font-family: var(--serif); font-weight: 400; }
.italic { font-style: italic; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Vidrio ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.35);
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  width: min(100% - 32px, var(--max));
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px 14px 26px;
  border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 10px 40px -20px rgba(0,0,0,0.25);
  transition: padding .4s var(--ease), background .5s;
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-name { font-family: var(--serif); font-style: italic; font-size: 25px; line-height: 1; letter-spacing: -0.01em; }
.brand-role { font-size: 14px; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { font-size: 15px; white-space: nowrap; color: var(--text-2); padding: 8px 12px; border-radius: 10px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--accent-soft); }
.nav-tools { display: flex; align-items: center; gap: 6px; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.chip-btn {
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em; color: var(--text-2);
  transition: background .2s, color .2s;
}
.chip-btn:hover { background: var(--accent-soft); color: var(--text); }
.lang-toggle span { opacity: .45; transition: opacity .2s; }
.lang-toggle span.on { opacity: 1; color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-btn { display: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 26px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  background: var(--btn); color: var(--on-btn);
  box-shadow: 0 18px 30px -14px rgba(0,0,0,0.45);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 24px 36px -14px rgba(0,0,0,0.5); }
.btn.ghost { background: var(--glass); color: var(--text); border: 1px solid var(--glass-border); box-shadow: none; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn svg { width: 18px; height: 18px; flex: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; padding-bottom: 3px; border-bottom: 1px solid currentColor; transition: gap .3s var(--ease), color .2s; }
.link-arrow:hover { gap: 14px; color: var(--accent); }

/* ---------- Encabezados de sección (estilo Austin) ---------- */
.section { padding: 120px 0; position: relative; }
.eyebrow { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.section-head { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 72px; }
.section-head::before, .section-head::after { content: ""; height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--muted)); opacity: .6; }
.section-head::after { transform: scaleX(-1); }
.section-head h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 30px; color: var(--text-2); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 100px 0 96px; position: relative; }
.hero-inner { display: grid; justify-items: center; gap: 8px; }
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, min(11vw, 15svh), 168px); line-height: 0.9; letter-spacing: -0.025em;
}
.hero h1 .sub { display: block; font-style: italic; color: var(--muted); font-size: 0.42em; letter-spacing: -0.01em; margin-top: min(18px, 2svh); }
.hero h1 .sub em { color: var(--accent); font-style: italic; }
.hero-object {
  width: min(520px, 86vw); height: min(380px, 64vw, 36svh); margin: 0 auto min(14px, 1.5svh);
  --poster-color: transparent; background: transparent;
}
.hero-object::part(default-progress-bar) { display: none; }
.hero h1, .contact h2.big, .about h3, .feature h3, .p-title, .p-sub { text-wrap: balance; }
.hero p.lead { max-width: 560px; margin: 8px auto 0; font-size: 18px; color: var(--text-2); }
.scroll-cue { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.scroll-cue i { width: 1px; height: 40px; background: linear-gradient(var(--muted), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Pantallas de poca altura (portátiles con escalado de Windows al 125–150%) */
@media (max-height: 780px) and (min-width: 600px) {
  .hero { padding: 96px 0 70px; }
  .hero-object { height: min(380px, 64vw, 31svh); }
  .hero h1 { font-size: clamp(52px, min(11vw, 14svh), 168px); }
  .hero p.lead { font-size: 16px; max-width: 520px; margin-top: 4px; }
  .scroll-cue { bottom: 16px; gap: 6px; }
  .scroll-cue i { height: 28px; }
}

/* ---------- Proyectos destacados: scroll horizontal (estructura tipo theeugene) ---------- */
/* La altura de .hscroll la define el JS (una pantalla por proyecto). */
.hscroll { position: relative; height: 500svh; }
.hscroll-sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; padding: 112px 0 28px;
}
.hscroll .section-head { margin: 0; flex: none; }
.hscroll-viewport { flex: 1; min-height: 0; position: relative; }
.hscroll-track { display: flex; height: 100%; will-change: transform; transition: transform 1s cubic-bezier(0.65, 0, 0.35, 1); }
.slide { flex: 0 0 100vw; width: 100vw; height: 100%; display: flex; align-items: center; justify-content: center; }
/* El texto y la imagen del proyecto que entra aparecen con un leve desfase */
.slide .feature-text, .slide .feature-media { transition: opacity .7s var(--ease) .35s, transform .9s var(--ease) .3s; }
.slide:not(.on) .feature-text { opacity: 0; transform: translateX(40px); }
.slide:not(.on) .feature-media { opacity: .4; transform: scale(.96); }
.hbar i { transition: transform .8s var(--ease); }
.slide .feature { width: min(100% - 48px, var(--max)); }
.hscroll .feature { min-height: 0; padding: 0; }
.hscroll .feature-media { max-height: calc(100svh - 250px); width: 100%; margin-left: auto; }
.hscroll .feature-media img.main { transition: opacity .8s var(--ease); }
.hprogress { flex: none; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.hbar { position: relative; width: 120px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.hbar i { position: absolute; inset: 0; background: var(--text); transform-origin: left; transform: scaleX(0); }
.hcount { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.hcount b { color: var(--text); font-weight: 500; }

/* Celular / tablet táctil: carrusel que se desliza con el dedo, con imán en cada proyecto */
.hscroll.swipe { height: auto; }
.hscroll.swipe .hscroll-sticky { position: relative; height: auto; overflow: visible; padding: 84px 0 36px; }
.hscroll.swipe .section-head { margin-bottom: 8px; }
.hscroll.swipe .hscroll-viewport {
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.hscroll.swipe .hscroll-viewport::-webkit-scrollbar { display: none; }
.hscroll.swipe .hscroll-track { transform: none !important; transition: none; height: auto; }
.hscroll.swipe .slide { flex: 0 0 100%; width: 100%; height: auto; padding: 24px 0 18px; scroll-snap-align: center; scroll-snap-stop: always; }
.hscroll.swipe .slide .feature-text, .hscroll.swipe .slide .feature-media { opacity: 1; transform: none; }
.hscroll.swipe .feature-media { max-height: none; }
.hscroll.swipe .feature-media img.main { transform: none; }
.hhint { display: none; margin-left: auto; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.hscroll.swipe .hhint { display: inline; }
.hscroll.swipe .hprogress { margin-top: 22px; }

/* Sin animación (o si el usuario la reduce): vuelve a lista vertical */
.hscroll.static { height: auto; }
.hscroll.static .hscroll-sticky { position: relative; height: auto; overflow: visible; padding: 120px 0; }
.hscroll.static .section-head { margin-bottom: 40px; }
.hscroll.static .hscroll-track { flex-direction: column; transform: none !important; }
.hscroll.static .slide { width: 100%; flex: none; height: auto; padding: 30px 0; }
.hscroll.static .hprogress { display: none; }
.hscroll.static .feature-media { max-height: none; }

.featured-list { display: grid; gap: 40px; }
.feature {
  display: grid; grid-template-columns: 5fr 7fr; align-items: center; gap: clamp(32px, 6vw, 96px);
  min-height: 80vh; padding: 40px 0;
}
.feature-meta { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.feature-meta .num { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent); }
.feature h3 { margin: 14px 0 18px; font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 5.6vw, 84px); line-height: .95; letter-spacing: -0.02em; }
.feature p { margin: 0 0 30px; font-size: 19px; line-height: 1.55; color: var(--text-2); max-width: 470px; }
.feature-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: -10px 0 30px; }
.tag { font-size: 12.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: var(--glass); }
.feature-media {
  position: relative; display: block; aspect-ratio: 4 / 3.3; border-radius: var(--radius); overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  isolation: isolate;
}
.feature-media::after { /* reflejo de vidrio */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,0.35) 0%, transparent 32%, transparent 70%, rgba(255,255,255,0.12) 100%);
  mix-blend-mode: soft-light;
}
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6%; transition: transform 1.2s var(--ease), opacity .8s var(--ease); will-change: transform; }
.feature-media img.alt { opacity: 0; }
.feature-media:hover img.main { transform: scale(1.05); opacity: 0; }
.feature-media:hover img.alt { opacity: 1; transform: scale(1.03); }
.feature-media .open {
  position: absolute; z-index: 3; right: 20px; bottom: 20px; height: 44px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500;
  background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transform: translateY(10px); opacity: 0; transition: all .5s var(--ease);
}
.feature-media:hover .open { transform: none; opacity: 1; }

/* ---------- Galería ---------- */
.gallery-intro { text-align: center; max-width: 620px; margin: -40px auto 40px; color: var(--text-2); }
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; }
.filter { height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14px; color: var(--text-2); border: 1px solid var(--line); background: var(--glass); transition: all .25s; }
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter.on { background: var(--btn); color: var(--on-btn); border-color: transparent; }
.filter sup { font-size: 10px; margin-left: 3px; opacity: .6; }
.masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tile {
  display: block; width: 100%; margin: 0; text-align: left; aspect-ratio: 1 / 1;
  border-radius: 20px; overflow: hidden; position: relative;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), opacity .4s;
}
.tile img { width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: transform 1s var(--ease); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tile:hover img { transform: scale(1.04); }
.tile figcaption { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 13px; background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; transform: translateY(8px); transition: all .4s var(--ease); }
.tile:hover figcaption, .tile:focus-visible figcaption { opacity: 1; transform: none; }
.tile figcaption span { color: var(--muted); }
.tile.hide { display: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(10, 12, 11, 0.55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-card { width: min(980px, 100%); max-height: calc(100svh - 48px); display: grid; grid-template-rows: 1fr auto; border-radius: var(--radius); overflow: hidden; background: var(--bg); border: 1px solid var(--glass-border); transform: scale(.97); transition: transform .5s var(--ease); }
.lightbox.open .lb-card { transform: none; }
.lb-img { min-height: 0; display: grid; place-items: center; background: var(--card-bg); }
.lb-img img { max-height: calc(100svh - 160px); width: auto; object-fit: contain; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-top: 1px solid var(--line); }
.lb-bar h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.lb-bar p { margin: 0; font-size: 13px; color: var(--muted); }
.lb-nav { display: flex; gap: 6px; }
.round { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); transition: background .2s; }
.round:hover { background: var(--accent-soft); }
.round svg { width: 18px; height: 18px; }

/* ---------- Sobre mí ---------- */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.portrait { position: sticky; top: 120px; aspect-ratio: 4 / 5; max-height: calc(100svh - 150px); min-height: 240px; border-radius: var(--radius); overflow: hidden; background: var(--card-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow); display: grid; place-items: center; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.portrait .initials { font-family: var(--serif); font-style: italic; font-size: 140px; color: var(--muted); opacity: .5; }
.portrait .note { position: absolute; bottom: 16px; left: 16px; right: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.about h3 { margin: 0 0 28px; font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.015em; }
.about h3 em { color: var(--accent); }
.about p { color: var(--text-2); font-size: 18px; margin: 0 0 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px 0; }
.stat { padding: 22px; border-radius: var(--radius-sm); }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; margin-bottom: 8px; }
.stat span { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }
.about .tools-title, .tools-title { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; font-weight: 500; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.tools .tag { font-size: 14px; padding: 8px 14px; }
.cv-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Contacto ---------- */
.contact { text-align: center; padding-bottom: 80px; }
.contact h2.big { margin: 0 auto 20px; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, min(9vw, 17svh), 140px); line-height: .92; letter-spacing: -0.03em; }
.contact h2.big em { color: var(--accent); }
.contact p { max-width: 540px; margin: 0 auto 44px; color: var(--text-2); font-size: 18px; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 980px; margin: 0 auto; }
.contact-card { padding: 28px; border-radius: var(--radius-sm); text-align: left; display: grid; gap: 22px; transition: transform .4s var(--ease), border-color .3s; }
.contact-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.contact-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.contact-card .ic svg { width: 22px; height: 22px; }
.contact-card b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.contact-card span { font-size: 14px; color: var(--muted); word-break: break-word; }

footer { padding: 30px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Página de proyecto ---------- */
.p-hero { padding: clamp(100px, 18svh, 150px) 0 40px; display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-bottom: 40px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); transition: all .25s; }
.back:hover { color: var(--text); border-color: var(--muted); gap: 12px; }
.back svg { width: 16px; height: 16px; }
.p-title { margin: 14px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, min(9vw, 15svh), 132px); line-height: .9; letter-spacing: -0.03em; }
.p-sub { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.4vw, 32px); color: var(--muted); margin: 18px 0 0; max-width: 780px; line-height: 1.25; }
/* Imagen principal: sin tarjeta de fondo, flotando junto al texto (como el anillo del inicio) */
.p-cover { width: 100%; aspect-ratio: 16 / 11; max-height: min(520px, calc(100svh - 220px)); display: grid; place-items: center; }
.p-cover img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.45); filter: drop-shadow(0 30px 30px rgba(0,0,0,.12)); }
.p-overview { display: grid; grid-template-columns: minmax(0, 820px); gap: clamp(32px, 6vw, 96px); padding: 80px 0 40px; }
.p-overview p { font-size: 20px; line-height: 1.6; color: var(--text-2); margin: 0 0 18px; }
.p-facts { display: grid; gap: 0; border-top: 1px solid var(--line); align-self: start; }
.p-facts div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.p-facts dt { color: var(--muted); }
.p-facts dd { margin: 0; }
.p-block { padding: 70px 0; border-top: 1px solid var(--line); }
.p-block-head { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); margin-bottom: 44px; }
.p-block-head .eyebrow { display: block; margin-bottom: 12px; color: var(--accent); }
.p-block-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 4.4vw, 60px); line-height: 1; letter-spacing: -0.015em; }
.p-block-head p { margin: 0; font-size: 18px; color: var(--text-2); align-self: end; }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 820px; }
.p-grid figure, .p-wide { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--card-bg); border: 1px solid var(--glass-border); }
.p-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; padding: 6%; }
.p-wide { max-width: 820px; }
.p-wide img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
figcaption.cap { padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.viewer { position: relative; height: min(680px, 75svh); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.viewer model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.viewer .hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); pointer-events: none; }
.viewer .finishes { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.finish { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; transition: transform .2s, border-color .2s; }
.finish:hover { transform: scale(1.1); }
.finish.on { border-color: var(--accent); }
.p-next { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: 90px 0 120px; border-top: 1px solid var(--line); }
.p-next h3 { margin: 10px 0 24px; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 5vw, 72px); line-height: .95; }

/* Celulares muy angostos (≤ 380 px): menú más compacto para que todo quepa */
@media (max-width: 380px) {
  .nav.nav { padding: 8px 6px 8px 14px; }
  .nav .brand-name { font-size: 20px; }
  .nav .nav-tools { gap: 2px; margin-left: 6px; padding-left: 6px; }
  .nav .chip-btn { min-width: 32px; padding: 0 6px; }
}

/* En celular no se muestra la foto de "Sobre mí" */
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) { .portrait { display: none; } }

/* ---------- Pantallas muy bajitas (celular horizontal) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .nav { top: 8px; padding-top: 8px; padding-bottom: 8px; }
  .hero { min-height: 0; padding: 76px 0 28px; }
  .hero-object { height: 30svh; margin-bottom: 4px; }
  .hero h1 { font-size: clamp(36px, 13svh, 64px); }
  .hero h1 .sub { margin-top: 6px; }
  .hero p.lead { font-size: 14px; max-width: 520px; }
  .scroll-cue { position: static; transform: none; margin: 14px auto 0; }
  .scroll-cue i { display: none; }

  .hscroll-sticky { padding: 66px 0 8px; }
  .hscroll .section-head h2 { font-size: 18px; }
  .hscroll .feature { grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
  .hscroll .feature-text { order: 0; }
  .hscroll .feature-media { aspect-ratio: auto; height: calc(100svh - 140px); max-height: none; }
  .hscroll .feature-meta { font-size: 12px; }
  .hscroll .feature h3 { font-size: clamp(26px, 8svh, 36px); margin: 2px 0 6px; }
  .hscroll .feature p { font-size: 13.5px; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hscroll .link-arrow { font-size: 14px; }
  .hscroll .feature-tags { display: none; }
  .hprogress { font-size: 12px; }

  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .portrait { max-height: calc(100svh - 100px); }
  .viewer { height: calc(100svh - 90px); }
}


/* Proyectos reales */
.p-cover { position: relative; }
.p-cover img { position: absolute; inset: 0; }
.p-cover.is-real { aspect-ratio: 1 / 1; max-height: min(560px, calc(100svh - 170px)); }
.p-cover.is-real img { transform: none; }
.p-wide img { object-fit: contain; padding: 4%; }
.p-wide.is-photo img { object-fit: cover; padding: 0; aspect-ratio: auto; height: auto; }
.p-overview { align-items: start; }
.p-meta { margin: 8px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; max-width: 820px; }
.p-meta div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; font-size: 15px; }
.p-meta dt { color: var(--muted); }
.p-meta dd { margin: 0; color: var(--text-2); }
@media (max-width: 600px) { .p-meta div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Animaciones de entrada ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .feature, .about-grid, .p-overview, .p-block-head, .p-next, .p-hero { grid-template-columns: 1fr; }
  .p-cover { max-height: 42svh; margin-top: 28px; }
  .p-cover img { transform: scale(1.15); }
  .feature { min-height: 0; padding: 30px 0 50px; }
  .feature-text { order: 2; }
  .hscroll-sticky { padding: 92px 0 22px; }
  .hscroll .feature { gap: 22px; }
  .hscroll .feature-media { aspect-ratio: 4 / 3; max-height: 38svh; }
  .hscroll .feature h3 { font-size: clamp(38px, 10vw, 56px); margin: 8px 0 10px; }
  .hscroll .feature p { font-size: 16px; margin-bottom: 16px; }
  .hscroll .feature-tags { display: none; }
  .portrait { position: relative; top: 0; max-width: 420px; }
  .contact-cards { max-width: 760px; }
}
@media (max-width: 1100px) { .brand-role { display: none; } }
@media (max-width: 900px) {
  .brand-role { display: none; }
  .menu-btn { display: inline-flex; }
  .nav-links { position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 10px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: all .3s var(--ease); }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 14px 16px; font-size: 17px; }
  .nav-tools { margin-left: auto; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 32px, var(--max)); }
  .section { padding: 44px 0; }
  .section-head { margin-bottom: 32px; }
  .hscroll.swipe .hscroll-sticky { padding: 44px 0 28px; }
  .hscroll.swipe .section-head { margin-bottom: 0; }
  .gallery-intro { margin: -8px auto 24px; }
  .filters { margin-bottom: 28px; }
  .contact { padding-bottom: 56px; }
  /* Contacto en celular: las 3 opciones en una fila, compactas */
  .contact-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .contact-card { padding: 16px 8px 14px; gap: 10px; justify-items: center; text-align: center; border-radius: 14px; }
  .contact-card .ic { width: 40px; height: 40px; border-radius: 12px; }
  .contact-card .ic svg { width: 20px; height: 20px; }
  .contact-card b { font-size: 19px; }
  .contact-card div span { display: none; }
  .nav { padding: 10px 10px 10px 18px; top: 12px; }
  .brand-name { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 14px; } .stat b { font-size: 32px; }
  .masonry { grid-template-columns: 1fr 1fr; gap: 12px; } .tile { border-radius: 14px; }
  .p-grid { grid-template-columns: 1fr; }
  .p-facts div { grid-template-columns: 110px 1fr; }
  .section-head::before, .section-head::after { width: 36px; }
}

/* ---------- Proyectos reales: fotos, videos y textos ---------- */
.p-cover.is-photo { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--glass-border); }
.p-cover.is-photo img { object-fit: cover; width: 100%; height: 100%; filter: none; }
.feature-media.is-photo img { object-fit: cover; padding: 0; }
.p-grid figure.is-photo img, .p-grid figure.is-video video { width: 100%; aspect-ratio: 1 / 1; display: block; }
.p-grid figure.is-photo img { object-fit: contain; padding: 0; background: #ebe8e3; }
.p-grid figure.is-video video { object-fit: cover; background: #6a6a6a; }
.p-wide video { width: 100%; display: block; }
.p-wide.is-wide { max-width: none; }
.p-wide.is-wide img { aspect-ratio: auto; height: auto; }
.p-text { padding-bottom: 0; }
.p-text > * { max-width: 820px; }
.p-text .eyebrow { display: block; margin-bottom: 12px; color: var(--accent); }
.p-text h2 { margin: 0 0 18px; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.2vw, 56px); line-height: 1; letter-spacing: -0.015em; }
.p-text p { margin: 0; font-size: 19px; line-height: 1.6; color: var(--text-2); }
.p-text + .p-block { border-top: 0; padding-top: 36px; }
@media (max-width: 980px) { .p-cover.is-photo { max-width: 460px; aspect-ratio: 4 / 5; max-height: none; } }
.finish-orig { position: relative; }
.finish-orig::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.finishes { gap: 6px; }

.feature-media img.alt.is-photo { object-fit: cover; padding: 0; }
.finish[hidden] { display: none; }
.finish { flex: none; width: 26px; height: 26px; padding: 0; border: 0 !important; border-radius: 50%; background-clip: border-box; margin: 2px; }
.finish.on { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 4px var(--accent); }
.p-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.p-tags .tag { font-size: 13.5px; padding: 7px 14px; }
.p-grid.is-fill figure.is-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.p-wide.is-narrow { max-width: 520px; }
/* Encabezado de proyecto: la pieza alineada con el título y los chips, menos espacio debajo */
.p-hero { align-items: end; padding-bottom: 0; }
.p-hero .p-cover.is-real { margin-bottom: -40px; }
.p-overview { padding-top: 56px; }
@media (max-width: 980px) { .p-hero { align-items: start; } .p-hero .p-cover.is-real { margin-bottom: 0; } .p-overview { padding-top: 40px; } }
@media (min-width: 981px) { .p-hero .p-cover.is-real img { top: var(--shift, 0px); } }
.p-grid.is-row { max-width: none; }
.p-grid.is-row figure.is-photo img { aspect-ratio: auto; height: auto; object-fit: initial; }
@media (max-width: 600px) { .p-grid.is-row { grid-template-columns: 1fr !important; } }
/* Encabezado de proyecto: mismo espacio entre la barra superior y el contenido en todos los proyectos */
@media (min-width: 981px) {
  .p-hero { align-items: start; padding-top: 128px; }
  .p-hero-text { align-self: start; }
  .p-hero .p-cover.is-real { align-self: center; margin-bottom: 0; max-height: min(460px, calc(100svh - 240px)); }
  .p-hero .p-cover.is-real img { top: 0; }
}
