/* ── Tokens ── */
:root { --bg:#FFFFFF; --text:#1A1A1A; --text2:#666; --border:rgba(0,0,0,.12); --orange:#E8651A; --nav-h:64px; --r:10px; --t:.3s ease; }
[data-theme="dark"] { --bg:#3A3A38; --text:#F5F5F3; --text2:#AAA; --border:rgba(255,255,255,.12); }

/* ── Reset ── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; }
body { font-family:'Clash Grotesk',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; transition:background var(--t),color var(--t); }
a { color:inherit; text-decoration:none; }
img { display:block; width:100%; }

/* ── Splash ── */
#splash { position:fixed; inset:0; z-index:999; background:linear-gradient(160deg,#E8651A 0%,#F09040 45%,#FAAF60 100%); display:flex; align-items:center; justify-content:center; transition:opacity .7s ease; }
#splash.fade-out { opacity:0; pointer-events:none; }
#splash.hidden { display:none; }
.splash-logo { display:flex; align-items:center; justify-content:center; }
#curlPath { fill:transparent; stroke:white; stroke-width:1.5; stroke-dasharray:1000; stroke-dashoffset:1000; transition:stroke-dashoffset 1.4s cubic-bezier(.4,0,.2,1), fill .4s ease 1.3s; }
#curlPath.drawn { stroke-dashoffset:0; fill:white; }

/* ── Hero ── */
.hero { position:relative; background:url('../img/hero-bg-day.svg') center center / cover no-repeat; min-height:100vh; display:flex; flex-direction:column; padding-top:var(--nav-h); }
[data-theme="dark"] .hero { background:url('../img/hero-bg-night.svg') center center / cover no-repeat; }

/* ── Nav: fixed transparent + blend mode ── */
.hero-nav { position:fixed; top:0; left:0; right:0; z-index:200; height:var(--nav-h); display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:0 32px; background:transparent; }
.hero-nav .nav-logo { justify-self:start; }
.nav-logo-img { width:160px; height:auto; mix-blend-mode:difference; display:block; }
.hero-nav-links { justify-self:center; display:flex; gap:32px; }
.hero-nav-links a { font-size:14px; font-weight:500; color:white; position:relative; mix-blend-mode:difference; }
.hero-nav-links a .label-default { display:inline; transition:opacity .2s; }
.hero-nav-links a .label-hover { font-family:'Carattere',serif; font-size:18px; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); opacity:0; transition:opacity .2s; white-space:nowrap; }
.hero-nav-links a:hover .label-default { opacity:0; }
.hero-nav-links a:hover .label-hover { opacity:1; }
.hero-nav-right { justify-self:end; display:flex; align-items:center; gap:14px; mix-blend-mode:difference; }
.lang-switch { display:flex; align-items:center; gap:2px; }
.lang-switch button { background:none; border:none; cursor:pointer; font-family:inherit; font-size:12px; font-weight:600; color:white; padding:2px 4px; }
.lang-switch .sep { color:rgba(255,255,255,.5); font-size:10px; }
.toggle-btn { background:none; border:none; cursor:pointer; color:white; font-size:18px; display:flex; align-items:center; padding:4px; }
.page-nav .toggle-btn { color:var(--text); }

/* Sun/moon: ONE at a time via data-theme */
.hero-nav .icon-sun  { display:none; }
.hero-nav .icon-moon { display:block; }
[data-theme="dark"] .hero-nav .icon-sun  { display:block; }
[data-theme="dark"] .hero-nav .icon-moon { display:none; }

/* Page nav (projects/about when using .page-nav class) */
.page-nav .ti-sun  { display:none; }
.page-nav .ti-moon { display:inline; }
[data-theme="dark"] .page-nav .ti-sun  { display:inline; }
[data-theme="dark"] .page-nav .ti-moon { display:none; }

.burger { display:none; background:none; border:none; cursor:pointer; flex-direction:column; gap:5px; padding:4px; }
.burger span { display:block; width:22px; height:2px; background:white; border-radius:2px; }
.mobile-menu { display:none; position:fixed; inset:0; top:var(--nav-h); background:rgba(255,255,255,.55); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); z-index:150; flex-direction:column; align-items:center; justify-content:center; gap:40px; }
[data-theme="dark"] .mobile-menu { background:rgba(58,58,56,.65); }
.mobile-menu.open { display:flex; }
.mobile-menu a { font-family:'Clash Grotesk',sans-serif; font-size:32px; font-weight:500; color:var(--text); }

/* ── Hero heading ── */
.hero-content { flex:1; display:flex; align-items:center; justify-content:center; padding:40px 5% 100px; }
.hero-h1 { font-size:clamp(28px,5vw,64px); font-weight:500; color:white; line-height:1.15; text-align:center; max-width:860px; }
.curly-link { display:inline-block; position:relative; color:white; text-decoration:none; cursor:pointer; }
.curly-text { font-family:'Carattere',serif; font-style:italic; font-size:1.05em; display:inline-block; transition:opacity .2s; }
.curly-link:hover .curly-text { opacity:0; }
.curly-oval-wrap { position:absolute; top:50%; left:50%; transform:translate(-65%,-45%); width:220%; pointer-events:none; opacity:0; transition:opacity .25s; }
.curly-oval-wrap img { width:100%; height:auto; }
.curly-link:hover .curly-oval-wrap { opacity:1; }

/* ── Scallop: inline SVG ── */
.scallop { position:absolute; bottom:0; left:0; right:0; line-height:0; }
.scallop svg { display:block; width:100%; }
.scallop .scallop-night { display:none; }
[data-theme="dark"] .scallop .scallop-day   { display:none; }
[data-theme="dark"] .scallop .scallop-night { display:block; }

/* ── Featured grid ── */
.featured-section { padding:48px 32px 40px; }
.featured-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:40px; }
.featured-grid .project-item:nth-child(1),
.featured-grid .project-item:nth-child(4) { grid-column:1 / -1; }
.featured-grid .project-item { margin-bottom:0; }
.featured-grid .project-item img { width:100%; height:auto; }

/* ── Project items ── */
.project-item { cursor:pointer; overflow:hidden; border-radius:var(--r); position:relative; break-inside:avoid; margin-bottom:12px; }
.project-item img { transition:transform .4s ease; border-radius:var(--r); }
.project-item:hover img { transform:scale(1.03); }
.project-item .overlay { position:absolute; inset:0; background:rgba(0,0,0,0); border-radius:var(--r); transition:background .3s; display:flex; align-items:flex-end; padding:16px; }
.project-item:hover .overlay { background:rgba(0,0,0,.25); }
.project-item .proj-name { color:white; font-size:13px; font-weight:500; opacity:0; transform:translateY(6px); transition:opacity .25s,transform .25s; }
.project-item:hover .proj-name { opacity:1; transform:translateY(0); }

/* ── BUTTONS: definitive system ─────────────────────────────
   4 images per button: default-day, hover-day, default-night, hover-night
   Only ONE is visible at any time.
────────────────────────────────────────────────────────────── */
.see-all-wrap, .view-portfolio-row { text-align:right; }
.see-all-wrap { text-align:center; }

.btn-see-all {
  background:none; border:none; cursor:pointer; padding:0;
  display:inline-flex; align-items:center;
}

/* Hide ALL button images by default */
.btn-see-all .btn-state-default,
.btn-see-all .btn-state-hover { display:none; }

/* ── LIGHT MODE ── */
.btn-see-all .btn-state-default.btn-day { display:block; }  /* day default visible */
.btn-see-all:hover .btn-state-default.btn-day { display:none; }   /* hide on hover */
.btn-see-all:hover .btn-state-hover.btn-day   { display:block; }  /* show hover */

/* ── DARK MODE ── */
[data-theme="dark"] .btn-see-all .btn-state-default.btn-day,
[data-theme="dark"] .btn-see-all:hover .btn-state-hover.btn-day { display:none; }
[data-theme="dark"] .btn-see-all .btn-state-default.btn-night { display:block; }
[data-theme="dark"] .btn-see-all:hover .btn-state-default.btn-night { display:none; }
[data-theme="dark"] .btn-see-all:hover .btn-state-hover.btn-night   { display:block; }

/* ── Projects page nav ── */
.page-nav { position:fixed; top:0; left:0; right:0; z-index:200; height:var(--nav-h); display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:0 32px; background:transparent; border-bottom:1px solid var(--border); mix-blend-mode:difference; }
.page-nav .nav-logo { justify-self:start; }
.page-nav .nav-logo-img { mix-blend-mode:normal; }
.page-nav .nav-links { justify-self:center; display:flex; gap:32px; }
.page-nav .nav-links a { font-size:14px; font-weight:500; color:white; position:relative; mix-blend-mode:normal; }
.page-nav .nav-links a .label-default { display:inline; transition:opacity .2s; }
.page-nav .nav-links a .label-hover { font-family:'Carattere',serif; font-size:18px; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); opacity:0; transition:opacity .2s; white-space:nowrap; color:white; }
.page-nav .nav-links a:hover .label-default { opacity:0; }
.page-nav .nav-links a:hover .label-hover { opacity:1; }
.page-nav .nav-right { justify-self:end; display:flex; align-items:center; gap:14px; }
.page-nav .lang-switch button { color:white; }
.page-nav .toggle-btn { color:white; }
.page-nav .burger span { background:white; }
.page-nav .icon-sun  { display:none; }
.page-nav .icon-moon { display:block; }
[data-theme="dark"] .page-nav .icon-sun  { display:block; }
[data-theme="dark"] .page-nav .icon-moon { display:none; }
.projects-section { padding:calc(var(--nav-h) + 24px) 32px 80px; }
[data-theme="dark"] .projects-section { background:#3A3A38; }
.projects-grid { position:relative; min-height:200px; }
.projects-grid .project-item { position:absolute; margin-bottom:0; }

/* ── Footer ── */
footer { border-top:1px solid var(--border); padding:20px 32px; display:flex; align-items:center; justify-content:space-between; }
.f-email { font-size:13px; color:var(--text2); }
.social-icons { display:flex; gap:20px; }
.social-icons a { color:var(--text2); font-size:18px; transition:color var(--t); display:flex; align-items:center; }
.social-icons a:hover { color:var(--text); }

/* ── Modal ── */
/* modal rules consolidated below at line ~433 */

/* ── About ── */
.about-scroll-container { position:relative; }
.about-intro-sticky { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:var(--nav-h) 5% 40px; text-align:center; background:var(--bg); z-index:10; overflow-y:auto; }
/* ── Intro text block (heading + quote, centered) ── */
.intro-text-block { text-align:center; margin-bottom:40px; }
.curly-heading-svg { width:100%; max-width:min(480px, 55vw); height:auto; display:block; margin:0 auto 20px; }
[data-theme="dark"] .curly-heading-svg { filter: invert(1); }
.about-intro-quote { max-width:520px; font-size:15px; color:var(--text2); line-height:1.7; margin:0 auto; }

/* ── Intro photos strip ── */
.intro-photos { width:100%; max-width:900px; margin:0 auto; }
.curly-photos-img { width:100%; height:auto; display:block; border-radius:12px; }
.intro-photos-mobile { display:none; flex-direction:column; gap:0; width:100%; }
.curly-def-img { width:100%; height:auto; display:block; }
.about-photo-wrap {
  position:relative; max-width:340px; margin:0 auto;
  cursor:pointer; line-height:0;
  /* no overflow:hidden — lets CTA extend outside bounds */
}
/* No hover — click only */
.about-photo-default { display:block; width:100%; vertical-align:top; }
.about-photo-fun { display:none; }
.scroll-hint { margin-top:24px; display:flex; flex-direction:column; align-items:center; gap:8px; color:var(--text2); font-size:12px; letter-spacing:.08em; transition:opacity .5s; }
.scroll-hint.hidden { opacity:0; pointer-events:none; }
.scroll-hint .chevron { animation:bounce 1.6s infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }
.about-cv-section { padding:calc(var(--nav-h) + 40px) 4% 80px; position:relative; }
.about-cv-grid { display:grid; grid-template-columns:260px 320px 180px 1fr; gap:40px; align-items:start; max-width:1200px; margin:0 auto; }
.cv-col-photo { display:flex; justify-content:center; align-items:flex-start; padding-top:0; }
.cv-col-photo .about-photo-wrap { max-width:100%; width:100%; max-height:560px; overflow:visible; }
/* heading inside grid (legacy, kept for compat) */
.cv-heading { font-size:clamp(16px,1.8vw,22px); font-weight:500; line-height:1.2; margin-bottom:18px; border:1.5px solid var(--text); border-radius:12px; padding:10px 14px; display:inline-block; white-space:nowrap; }
/* heading always visible above grid */
/* wrapper aligns heading with grid content */
.cv-heading-wrap { max-width:1200px; margin:0 auto 28px; padding:0; }
.cv-heading-always { font-size:clamp(16px,1.8vw,22px); font-weight:500; line-height:1.2; border:1.5px solid var(--text); border-radius:12px; padding:10px 14px; display:inline-block; white-space:nowrap; }

/* ── Fun panel (click mode) ─────────────────────────────── */
/* ── Fun panel — fade transition ────────────────────────── */

/* Grid fades — stays in flow to keep section height */
.about-cv-grid {
  transition: opacity .5s ease;
}
.about-cv-section.fun-mode .about-cv-grid {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Fun panel: overlays grid absolutely so section height doesn't change */
.cv-fun-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--nav-h) + 50px);
  padding-bottom: 60px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .5s ease;
}
.about-cv-section.fun-mode .cv-fun-panel {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Fun images */
.cv-fun-panel .fun-img {
  display: none;
  width: 54vw;
  max-width: 720px;
  height: auto;
  cursor: pointer;
  clip-path: inset(8% 0 0 0);
}

/* View portfolio: absolute bottom:120px en ambos modos */
.about-cv-section .view-portfolio-row {
  position: absolute;
  bottom: 120px;
  right: 4%;
  border-top: none;
  padding: 0;
  margin: 0;
}
.about-cv-section.fun-mode .view-portfolio-row {
  z-index: 5;
}
/* Default: EN light visible, rest hidden */
.cv-fun-panel .fun-en.theme-light { display: block; }
.cv-fun-panel .fun-en.theme-dark  { display: none; }
.cv-fun-panel .fun-es.theme-light { display: none; }
.cv-fun-panel .fun-es.theme-dark  { display: none; }
/* Dark mode: swap EN to dark version */
[data-theme="dark"] .cv-fun-panel .fun-en.theme-light { display: none; }
[data-theme="dark"] .cv-fun-panel .fun-en.theme-dark  { display: block; }
/* ES versions handled by updateFunLang() JS — CSS just controls light/dark swap */
[data-theme="dark"] .cv-fun-panel .fun-es.theme-dark  { display: block; }
[data-theme="dark"] .cv-fun-panel .fun-es.theme-light { display: none; }


/* ── Click CTA on photo ─────────────────────────────────── */
.about-photo-wrap { position:relative; }
.cv-click-cta {
  position:absolute; bottom:12px; right:-40px;
  opacity:0; transition:opacity .6s ease;
  pointer-events:none;
}
.cv-click-cta.visible { opacity:1; pointer-events:auto; }
/* All CTA images hidden by default */
.cta-img { width:80px; height:auto; display:none; }

/* Light mode, EN (default) */
.cta-img.cta-en.cta-light { display:block; }

/* Dark mode: swap to white version */
[data-theme="dark"] .cta-img.cta-en.cta-light { display:none; }
[data-theme="dark"] .cta-img.cta-en.cta-dark  { display:block; }
[data-theme="dark"] .cta-img.cta-es.cta-dark  { display:block; }
[data-theme="dark"] .cta-img.cta-es.cta-light { display:none; }
.cv-body { font-size:13.5px; color:var(--text2); line-height:1.75; margin-bottom:14px; }
.highlight { color:var(--orange); font-weight:500; }
.cv-pill { display:inline-flex; align-items:center; border:1.5px solid var(--text); border-radius:999px; padding:5px 16px; font-size:13px; font-weight:500; margin-bottom:10px; }
.cv-skills { font-size:13px; color:var(--text2); line-height:1.9; }
.cv-prog-icons { display:flex; gap:10px; margin-top:8px; }
.cv-prog-icons img { width:34px; height:34px; border-radius:8px; object-fit:contain; }
.cv-info-block { margin-bottom:24px; }

/* ── Language rows with dot-tipped line ─────────────────── */
.lang-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text);
}
.lang-name  { white-space: nowrap; }
.lang-level { white-space: nowrap; color: var(--text2); }
.lang-line  {
  flex: 1;
  position: relative;
  height: 1px;
  background: var(--text);
  opacity: .35;
}
.lang-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
  opacity: 1;
}
.cv-info-label { display:inline-flex; align-items:center; border:1.5px solid var(--text); border-radius:999px; padding:4px 14px; font-size:12px; font-weight:500; margin-bottom:10px; }
.cv-info-body { font-size:12.5px; color:var(--text2); line-height:1.8; }
.cv-info-body strong { color:var(--text); font-weight:600; display:block; }
.cv-info-row { display:flex; align-items:center; gap:8px; margin-bottom:4px; font-size:12.5px; color:var(--text2); }
.cv-info-row::before { content:''; display:block; width:28px; height:1px; background:var(--text2); flex-shrink:0; }
.exp-title { font-size:12px; font-weight:600; color:var(--orange); margin-bottom:4px; display:block; text-decoration:none; }
.exp-title:hover { text-decoration:underline; }
.exp-body { font-size:11.5px; color:var(--text2); line-height:1.7; margin-bottom:14px; }
.view-portfolio-row { display:flex; justify-content:flex-end; padding:20px 4%; }
.about-cv-section .view-portfolio-row { border-top: none; } /* no line in about page */

/* ── Nav on-content (homepage scrolled) ── */
.hero-nav.on-content .hero-nav-right, .hero-nav.on-content .hero-nav-right *, .hero-nav.on-content .hero-nav-links a, .hero-nav.on-content .nav-logo-img { mix-blend-mode:normal !important; }
.hero-nav.on-content .hero-nav-right, .hero-nav.on-content .hero-nav-right * { color:var(--text) !important; }
.hero-nav.on-content .hero-nav-links a { color:var(--text) !important; }
.hero-nav.on-content .toggle-btn { color:var(--text) !important; }
.hero-nav.on-content .lang-switch .sep { color:var(--border) !important; }
/* ── About page: nav always on-content (no hero to scroll past) ── */
.about-page .hero-nav .hero-nav-links a,
.about-page .hero-nav .hero-nav-right,
.about-page .hero-nav .hero-nav-right * { mix-blend-mode:normal !important; color:var(--text) !important; }
.about-page .hero-nav .lang-switch button { color:var(--text) !important; }
.about-page .hero-nav .lang-switch .sep { color:var(--border) !important; }
.about-page .hero-nav .toggle-btn { color:var(--text) !important; }
.about-page .hero-nav .nav-logo-img { mix-blend-mode:normal !important; }
/* ── About page intro ─────────────────────────────────── */
.about-scroll-container { min-height:100vh; }
.about-intro-sticky { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:var(--nav-h) 5% 40px; text-align:center; background:var(--bg); z-index:10; overflow-y:auto; }
.about-intro-heading { margin-bottom:24px; }
.intro-text-block { text-align:center; margin-bottom:40px; }
.curly-heading-svg { width:100%; max-width:min(480px, 55vw); height:auto; display:block; margin:0 auto 20px; }
[data-theme="dark"] .curly-heading-svg { filter: invert(1); }
.about-intro-quote { max-width:520px; font-size:15px; color:var(--text2); line-height:1.7; margin:0 auto; }
.intro-photos { width:100%; max-width:900px; margin:0 auto; }
.curly-photos-img { width:100%; height:auto; display:block; border-radius:12px; }
.scroll-hint { display:flex; flex-direction:column; align-items:center; gap:8px; font-size:12px; color:var(--text2); margin-top:24px; }
.scroll-hint.hidden { opacity:0; }
.chevron { font-size:18px; }

/* ── About CV section ─────────────────────────────────── */
.about-cv-section { padding:calc(var(--nav-h) + 40px) 4% 80px; position:relative; }
.cv-heading-wrap { max-width:1200px; margin:0 auto 28px; padding:0; }
.cv-heading { font-size:clamp(16px,1.8vw,22px); font-weight:500; line-height:1.2; margin-bottom:18px; border:1.5px solid var(--text); border-radius:12px; padding:10px 14px; display:inline-block; white-space:nowrap; }
.cv-heading-always { font-size:clamp(16px,1.8vw,22px); font-weight:500; line-height:1.2; border:1.5px solid var(--text); border-radius:12px; padding:10px 14px; display:inline-block; white-space:nowrap; }
.about-cv-grid { display:grid; grid-template-columns:260px 320px 180px 1fr; gap:40px; align-items:start; max-width:1200px; margin:0 auto; }
.cv-col-bio { }
.cv-body { font-size:13.5px; color:var(--text2); line-height:1.75; margin-bottom:14px; }
.highlight { color:var(--orange); font-weight:500; }
.cv-pill { display:inline-flex; align-items:center; border:1.5px solid var(--text); border-radius:999px; padding:5px 16px; font-size:13px; font-weight:500; margin-bottom:10px; }
.cv-skills { font-size:13px; color:var(--text2); line-height:1.9; }
.cv-prog-icons { display:flex; gap:10px; margin-top:8px; }
.cv-prog-icons img { width:34px; height:34px; border-radius:8px; object-fit:contain; }
.cv-col-photo { display:flex; justify-content:center; align-items:flex-start; padding-top:0; }
.cv-col-photo .about-photo-wrap { max-width:100%; width:100%; max-height:560px; overflow:visible; }
.about-photo-wrap { position:relative; max-width:340px; margin:0 auto; cursor:pointer; line-height:0; }
.about-photo-default { display:block; width:100%; vertical-align:top; }
.about-photo-fun { display:none; }
.cv-info-block { margin-bottom:24px; }
.cv-info-label { display:inline-flex; align-items:center; border:1.5px solid var(--text); border-radius:999px; padding:4px 14px; font-size:12px; font-weight:600; margin-bottom:10px; }
.cv-info-body { font-size:13px; color:var(--text2); line-height:1.7; }
.cv-info-row { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--text2); margin-bottom:6px; }
.cv-info-row::before { content:''; display:inline-block; width:24px; height:1.5px; background:var(--text); opacity:.4; flex-shrink:0; }
.exp-title { font-size:12px; font-weight:600; color:var(--orange); margin-bottom:4px; display:block; text-decoration:none; }
.exp-title:hover { text-decoration:underline; }
.exp-body { font-size:11.5px; color:var(--text2); line-height:1.7; margin-bottom:14px; }

/* ── Language rows ────────────────────────────────────── */
.lang-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; font-size:13px; color:var(--text); }
.lang-name { white-space:nowrap; }
.lang-level { white-space:nowrap; color:var(--text2); }
.lang-line { flex:1; position:relative; height:1px; background:var(--text); opacity:.35; }
.lang-line::after { content:''; position:absolute; right:-1px; top:50%; transform:translateY(-50%); width:5px; height:5px; border-radius:50%; background:var(--text); opacity:1; }

/* ── Fun panel (duplicate removed — see above for full rules) ── */

/* ── Click CTA ────────────────────────────────────────── */
.cv-click-cta { position:absolute; bottom:12px; right:-40px; opacity:0; transition:opacity .6s ease; pointer-events:none; }
.cv-click-cta.visible { opacity:1; pointer-events:auto; }
.cta-img { width:80px; height:auto; display:none; }
.cta-img.cta-en.cta-light { display:block; }
[data-theme="dark"] .cta-img.cta-en.cta-light { display:none; }
[data-theme="dark"] .cta-img.cta-en.cta-dark  { display:block; }
[data-theme="dark"] .cta-img.cta-es.cta-dark  { display:block; }
[data-theme="dark"] .cta-img.cta-es.cta-light { display:none; }

/* ── View portfolio ───────────────────────────────────── */
.view-portfolio-row { display:flex; justify-content:flex-end; padding:20px 4%; }
.about-cv-section .view-portfolio-row { border-top:none; }

/* ── Crossfade zone ───────────────────────────────────── */
.crossfade-zone { position:relative; height:350vh; }
.cf-canva-layer { position:sticky; top:0; height:100vh; z-index:1; overflow:hidden; }
.cf-featured-layer { position:sticky; top:0; height:100vh; z-index:2; margin-top:-100vh; background:var(--bg); display:flex; flex-direction:column; justify-content:center; will-change:opacity; transition:opacity .05s linear; }
.cf-spacer { height:250vh; }
.cf-featured-layer .featured-section { padding:32px 32px 0; overflow-y:auto; }
.cf-featured-layer .see-all-wrap { padding:40px 0 60px; }

/* ── Canva Creator section ────────────────────────────── */
.canva-creator-section { background:#00b2ff; height:100vh; display:flex; align-items:center; padding:0 5% 80px; }
.canva-inner { max-width:1100px; margin:0 auto; width:100%; display:grid; grid-template-columns:320px 1fr; gap:72px; align-items:center; }
.canva-badge { display:flex; justify-content:center; }
.canva-badge img { width:100%; max-width:300px; height:auto; display:block; }
.canva-content { color:#fff !important; padding-left:150px; }
.canva-heading { font-size:clamp(26px,3vw,40px); font-weight:700; margin-bottom:20px; color:#fff !important; display:block !important; }
.canva-body { font-size:15px; line-height:1.8; margin-bottom:16px; font-weight:500; color:#fff !important; display:block !important; max-width:420px; }
.canva-body strong { color:#fff !important; font-weight:700; }
.canva-btn-wrap { margin-top:32px; }
.canva-pill-btn { background:transparent; border:2px solid white; border-radius:999px; padding:14px 36px; color:white; font-family:'Clash Grotesk',sans-serif; font-size:16px; font-weight:500; cursor:pointer; transition:background .2s,color .2s; }
.canva-pill-btn:hover { background:white; color:#00b2ff; }
@media (max-width:800px) { .canva-inner { grid-template-columns:1fr; gap:32px; text-align:center; padding:0 5%; } .canva-badge img { max-width:200px; margin:0 auto; } .canva-content { padding-left:0; } }

/* ── Modal ────────────────────────────────────────────── */
.modal-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.75); z-index:500; overflow-y:auto; }
.modal-backdrop.open { display:block; }
.modal-box { background:var(--bg); width:85%; max-width:1200px; margin:40px auto 80px; border-radius:12px; overflow:hidden; }
.modal-images { display:flex; flex-direction:column; gap:0; }
.modal-images img { width:100%; height:auto; display:block; }
.modal-images.modal-images-gap { gap:8px; background:white; }

/* Close button — fixed top-right, blend mode */
.modal-close-btn { display:none; position:fixed; top:20px; right:20px; z-index:601; background:none; border:none; cursor:pointer; font-size:22px; color:white; width:44px; height:44px; align-items:center; justify-content:center; border-radius:50%; mix-blend-mode:difference; transition:transform .2s; }
.modal-close-btn:hover { transform:scale(1.15); }
.modal-backdrop.open .modal-close-btn { display:flex; }

/* Modal nav arrows — fixed sides, blend mode */
.modal-nav { position:fixed; top:50%; transform:translateY(-50%); z-index:601; background:none; border:none; color:white; width:48px; height:48px; display:none; align-items:center; justify-content:center; cursor:pointer; mix-blend-mode:difference; transition:transform .2s; }
.modal-nav:hover { transform:translateY(-50%) scale(1.15); }
.modal-prev { left:20px; }
.modal-next { right:20px; }
.modal-backdrop.open .modal-nav { display:flex; }

/* ── Projects page ────────────────────────────────────── */
.projects-section { padding:calc(var(--nav-h) + 40px) 4% 60px; }
.projects-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0; align-items:start; }

/* ── Contact ──────────────────────────────────────────── */
.contact-heading { font-size:clamp(28px,4vw,48px) !important; font-weight:400 !important; color:white; letter-spacing:-0.02em !important; line-height:1.15 !important; max-width:960px; margin-bottom:56px; }

/* ── Footer ───────────────────────────────────────────── */
footer { position:fixed; bottom:0; left:0; right:0; z-index:100; border-top:1px solid var(--border); padding:20px 32px; display:flex; align-items:center; justify-content:space-between; background:transparent; mix-blend-mode:difference; }
footer * { mix-blend-mode:normal; color:white; }
.f-email { font-size:12px; }
body { padding-bottom:70px; }
body.home-page { padding-bottom:0; }
.social-icons { display:flex; gap:12px; }
.social-icons a { color:var(--text2); display:flex; align-items:center; transition:color .2s; }
.social-icons a:hover { color:var(--text); }

/* ── Mobile-only elements: hidden by default on desktop ── */
.nav-isotipo { display:none; }
.hero-h1-mobile { display:none; }
.hero-m-img { display:none; }
.scallop-mobile { display:none; width:100%; height:auto; vertical-align:bottom; }

/* ── Media queries ────────────────────────────────────── */
@media (max-width:1100px) { .about-cv-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:900px) {
  .hero-nav-links { display:none; }
  .burger { display:flex; }
  .featured-grid { grid-template-columns:1fr; }
  .featured-grid .project-item:nth-child(1), .featured-grid .project-item:nth-child(4) { grid-column:1; }
  .hero-nav { padding:0 20px; }
  .page-nav { padding:0 20px; }
}

/* ── iPad (769px – 1100px): grid 2 col, foto acotada ─── */
@media (min-width:769px) and (max-width:1100px) {
  .about-cv-grid { grid-template-columns:1fr 1fr; gap:28px; }
  .cv-col-photo .about-photo-wrap { max-width:260px; margin:0 auto; }
  .about-cv-section { padding:calc(var(--nav-h) + 28px) 4% 100px; }

  /* View portfolio: más abajo en iPad (modo normal) */
  .about-cv-section .view-portfolio-row { bottom:40px; }

  /* Fun mode en iPad: imagen grande, todo compacto */
  .cv-fun-panel { padding-top:calc(var(--nav-h) + 52px); padding-bottom:90px; justify-content:flex-start; gap:0; }
  .cv-fun-panel .fun-img { width:56vw; max-width:520px; }

  /* Fun mode: view portfolio sube justo debajo de la imagen */
  .about-cv-section.fun-mode .view-portfolio-row {
    top: calc(var(--nav-h) + 52px + 44vw + 24px);
    bottom: auto;
  }

  /* Fun mode: recorta la sección para eliminar el espacio vacío */
  .about-cv-section.fun-mode {
    max-height: calc(var(--nav-h) + 44vw + 190px);
    overflow: hidden;
  }
}

/* ── MOBILE (≤768px) ──────────────────────────────────── */
@media (max-width:768px) {

  /* hero-nav on hero: show white isotipo */
  .hero-nav .nav-full-logo { display:none; }
  .hero-nav .nav-isotipo-white { display:block; width:36px; height:36px; }
  .hero-nav .nav-isotipo-orange { display:none; }
  /* hero-nav scrolled past hero: orange on light, white on dark */
  .hero-nav.on-content .nav-isotipo-white { display:none; }
  .hero-nav.on-content .nav-isotipo-orange { display:block; width:36px; height:36px; }
  [data-theme="dark"] .hero-nav.on-content .nav-isotipo-orange { display:none; }
  [data-theme="dark"] .hero-nav.on-content .nav-isotipo-white { display:block; width:36px; height:36px; }

  /* page-nav móvil: sin blend mode para que el isotipo sea naranja real */
  .page-nav { mix-blend-mode:normal; background:var(--bg); border-bottom:1px solid var(--border); }
  .page-nav .nav-links a { color:var(--text); }
  .page-nav .lang-switch button { color:var(--text); }
  .page-nav .toggle-btn { color:var(--text); }
  .page-nav .burger span { background:var(--text); }
  .page-nav .nav-full-logo { display:none; }
  .page-nav .nav-isotipo-orange { display:block; width:36px; height:36px; mix-blend-mode:multiply; }
  .page-nav .nav-isotipo-white { display:none; }
  [data-theme="dark"] .page-nav .nav-isotipo-orange { display:none; }
  [data-theme="dark"] .page-nav .nav-isotipo-white { display:block; width:36px; height:36px; mix-blend-mode:screen; }

  /* about page uses hero-nav but is always "on-content" style */
  .about-page .hero-nav .nav-full-logo { display:none; }
  .about-page .hero-nav .nav-isotipo-orange { display:block; width:36px; height:36px; }
  .about-page .hero-nav .nav-isotipo-white { display:none; }
  [data-theme="dark"] .about-page .hero-nav .nav-isotipo-orange { display:none; }
  [data-theme="dark"] .about-page .hero-nav .nav-isotipo-white { display:block; width:36px; height:36px; }

  /* contact page: white isotipo (orange bg) */
  .contact-page .hero-nav .nav-full-logo { display:none; }
  .contact-page .hero-nav .nav-isotipo-white { display:block; width:36px; height:36px; }
  .contact-page .hero-nav .nav-isotipo-orange { display:none; }

  /* Hero heading: hide text, show SVG */
  .hero-h1 { display:none; }
  .hero-h1-mobile { display:block; width:90%; max-width:360px; }
  .hero-m-img { display:none; width:100%; }
  /* EN day (default) */
  .hero-m-img.m-en.m-day { display:block; }
  /* EN dark */
  [data-theme="dark"] .hero-m-img.m-en.m-day { display:none; }
  [data-theme="dark"] .hero-m-img.m-en.m-night { display:block; }
  /* ES day */
  [data-lang="es"] .hero-m-img.m-en.m-day { display:none; }
  [data-lang="es"] .hero-m-img.m-es.m-day { display:block; }
  /* ES dark — explicitly hide EN night too */
  [data-lang="es"][data-theme="dark"] .hero-m-img.m-en.m-night { display:none; }
  [data-lang="es"][data-theme="dark"] .hero-m-img.m-es.m-day { display:none; }
  [data-lang="es"][data-theme="dark"] .hero-m-img.m-es.m-night { display:block; }

  /* Hero layout: centrado vertical y horizontal */
  .hero { min-height:100svh; }
  .hero-content { padding:0 5% 80px; align-items:center; justify-content:center; text-align:center; }
  .hero-h1 { text-align:center; }
  .hero-h1-mobile { text-align:center; margin:0 auto; }

  /* Scallop: mobile vs desktop */
  .scallop-desktop { display:none !important; }
  /* Clip container to arch height only, img renders full-width from top */
  .scallop { height:80px; overflow:hidden; }
  .scallop-mobile-day { display:block; width:100%; height:auto; }
  [data-theme="dark"] .scallop-mobile-day { display:none; }
  [data-theme="dark"] .scallop-mobile-night { display:block; width:100%; height:auto; }

  /* Featured section */
  .featured-section { padding:24px 16px 32px; }
  .featured-grid { grid-template-columns:1fr; gap:10px; }
  .featured-grid .project-item:nth-child(1),
  .featured-grid .project-item:nth-child(4) { grid-column:1; }

  /* Projects section */
  .projects-section { padding:calc(var(--nav-h) + 16px) 12px 80px; }

  /* Canva section: stack vertically */
  .canva-creator-section { min-height:unset; height:100vh; padding:40px 5% 120px; }
  .canva-inner { grid-template-columns:1fr; gap:28px; text-align:center; }
  .canva-badge img { max-width:160px; margin:0 auto; }
  .canva-content { padding-left:0; }
  .canva-body { max-width:100%; }

  /* Crossfade zone: disable sticky effect on mobile, show sections stacked in correct order */
  .crossfade-zone { height:auto; display:flex; flex-direction:column; }
  .cf-canva-layer { position:relative; height:auto; overflow:visible; order:2; }
  .cf-featured-layer { position:relative; height:auto; margin-top:0; opacity:1 !important; pointer-events:all !important; order:1; }
  .cf-featured-layer .featured-section { padding:48px 16px 32px; }
  .cf-spacer { display:none; }

  /* About intro (pantalla curly) — misma imagen que desktop */
  .about-intro-sticky { padding:calc(var(--nav-h) + 12px) 5% 20px; gap:16px; overflow-y:auto; }
  .intro-text-block { margin-bottom:20px; }
  .curly-heading-svg { max-width:85vw; }
  .about-intro-quote { font-size:13.5px; max-width:90vw; }
  .intro-photos { max-width:100%; }
  .intro-photos-desktop { display:block; }
  .intro-photos-mobile { display:none; }
  .curly-photos-img { width:100%; max-width:100%; margin:0 auto; border-radius:16px; }
  .scroll-hint { margin-top:12px; }

  /* About page burger: fondo claro → barras negras */
  .about-page .burger span { background:var(--text); }

  /* About CV: sin fun panel ni CTA en móvil */
  .about-cv-section { padding:calc(var(--nav-h) + 20px) 5% 100px; }
  .about-cv-grid { grid-template-columns:1fr; gap:24px; }
  .cv-col-photo { order:-1; }
  .cv-col-photo .about-photo-wrap { max-width:260px; }
  .cv-click-cta { display:none !important; }
  .cv-fun-panel { display:none !important; }
  .about-cv-section .view-portfolio-row { bottom:80px; right:5%; }

  /* Footer */
  footer { padding:14px 20px; }
  .f-email { font-size:11px; }

  /* Nav: flex en móvil para alinear isotipo izq / controles der */
  .hero-nav, .page-nav { display:flex; justify-content:space-between; align-items:center; padding:0 16px; }
  .hero-nav-links, .page-nav .nav-links { display:none; }
  .hero-nav-right, .page-nav .nav-right { justify-self:unset; gap:8px; }
  .lang-switch button { font-size:11px; }

  /* Mobile menu: full screen */
  .mobile-menu { gap:32px; }
  .mobile-menu a { font-size:36px; }

  /* Modal box: full width */
  .modal-box { width:96%; margin:20px auto 60px; border-radius:8px; }
  .modal-prev { left:8px; }
  .modal-next { right:8px; }
  .modal-close-btn { top:12px; right:12px; }
}

@media (max-width:390px) {
  .hero-h1-mobile { width:95%; }
  .canva-heading { font-size:22px; }
}
