/* =============================================================
   Diego Andrade — Portafolio
   Sistema de diseño · CSS modular
   1. Tokens        6. Nav          11. Sobre mí     16. Reveal
   2. Reset/base    7. Hero         12. Servicios    17. Cursor
   3. Tipografía    8. Marquee      13. Tecnologías  18. Responsive
   4. Layout        9. Proyectos    14. Contacto     19. A11y / motion
   5. Botones      10. Caso estudio 15. Footer
   ============================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Color */
  --bg:            #080808;
  --bg-elev:       #0e0e0e;
  --bg-elev-2:     #141414;
  --line:          rgba(255, 255, 255, .09);
  --line-strong:   rgba(255, 255, 255, .18);
  --text:          #ededed;
  --text-muted:    #949494;
  --text-dim:      #6a6a6a;
  --accent:        #d7b26d;
  --accent-ink:    #0b0b0b;
  --accent-soft:   rgba(215, 178, 109, .12);

  /* Tipografía */
  --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Espaciado */
  --gutter:   clamp(20px, 4.5vw, 72px);
  --maxw:     1440px;
  --section:  clamp(88px, 11vw, 168px);
  --grid-gap: clamp(16px, 2vw, 32px);

  /* Motion */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --dur:       .55s;
  --nav-h:     76px;
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(15px, .35vw + 14px, 17px);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 13px/1 var(--font-mono);
  letter-spacing: .06em;
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Textura sutil de retícula sobre el fondo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: clamp(60px, 8vw, 120px) clamp(60px, 8vw, 120px);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* ---------- 3. TIPOGRAFÍA ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: .86;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(10px, .55vw, 11.5px);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}
.eyebrow--plain::before { display: none; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(48px, 6vw, 88px);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: .94;
  letter-spacing: -.04em;
  margin-top: 20px;
}

.section-sub {
  color: var(--text-muted);
  font-size: clamp(15px, 1.1vw, 17px);
  max-width: 48ch;
  padding-bottom: 8px;
}

.lede {
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--text);
  letter-spacing: -.01em;
}

.muted { color: var(--text-muted); }
.mono  { font-family: var(--font-mono); }

/* ---------- 4. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.section { padding-block: var(--section); position: relative; }
.section + .section { border-top: 1px solid var(--line); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- 5. BOTONES ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 30px;
  min-height: 52px;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  transition: color .4s var(--ease), border-color .4s var(--ease), transform .4s var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform .5s var(--ease-out);
}
.btn:hover, .btn:focus-visible {
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn:hover::after, .btn:focus-visible::after { transform: translateY(0); }
.btn:active { transform: translateY(1px); }

.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); }
.btn--primary::after { background: var(--text); }
.btn--primary:hover, .btn--primary:focus-visible { color: var(--accent-ink); border-color: var(--text); }

.btn--sm { padding: 11px 20px; min-height: 42px; font-size: 11px; }

.btn__arrow { transition: transform .4s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* Enlace con subrayado animado */
.link-u {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-u::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.link-u:hover::after, .link-u:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* Chips de tecnología */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- 6. NAV ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
  z-index: 120;
  will-change: transform;
}

.nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: transform .5s var(--ease), background-color .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(8, 8, 8, .72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.brand span { color: var(--accent); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 40px);
}
.nav__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  transition: color .35s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__cta { display: inline-flex; }

.nav__toggle {
  display: none;
  width: 46px; height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.nav__toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--text);
  position: relative;
  transition: background .3s var(--ease);
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px; height: 1.5px;
  background: var(--text);
  transition: transform .4s var(--ease-out);
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after  { top: 6px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  padding: calc(var(--nav-h) + 40px) var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity .45s var(--ease), transform .45s var(--ease-out), visibility .45s;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; transform: none; }

.nav-overlay__list { display: flex; flex-direction: column; gap: 4px; }
.nav-overlay__list a {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.15;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.nav-overlay__list i {
  font: 500 11px/1 var(--font-mono);
  color: var(--accent);
  font-style: normal;
}
.nav-overlay__foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .05em;
}

/* ---------- 7. HERO ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + clamp(40px, 7vw, 90px));
  padding-bottom: clamp(40px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}

/* Composición abstracta: halo + líneas de arquitectura digital */
.hero__glow {
  position: absolute;
  top: -20%; right: -10%;
  width: min(900px, 90vw);
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 50%, rgba(215,178,109,.10), transparent 62%);
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 23vw, 330px);
  gap: clamp(28px, 4vw, 72px);
  align-items: end;
  width: 100%;
}

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: clamp(24px, 3.5vw, 44px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 4vw, 52px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(215,178,109,.5);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(215,178,109,.45); }
  70%  { box-shadow: 0 0 0 9px rgba(215,178,109,0); }
  100% { box-shadow: 0 0 0 0 rgba(215,178,109,0); }
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.2rem, 13.5vw, 12rem);
  line-height: .84;
  letter-spacing: -.05em;
  text-transform: uppercase;
  margin-bottom: clamp(22px, 3vw, 38px);
}
.hero__title span { display: block; }
.hero__title .is-outline { padding-left: .09em; }

/* Contorno solo donde el navegador lo soporta: nunca deja el texto invisible */
@supports (-webkit-text-stroke: 1px #000) {
  .hero__title .is-outline {
    color: transparent;
    -webkit-text-stroke: max(1px, .012em) rgba(215, 178, 109, .62);
  }
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(11px, .95vw, 13px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: clamp(22px, 3vw, 34px);
  margin-bottom: clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
}
.hero__role b { color: var(--text); font-weight: 500; }

.hero__claim {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.5vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: -.025em;
  max-width: 22ch;
  margin-bottom: 20px;
}
.hero__claim em { font-style: normal; color: var(--accent); }

.hero__text {
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: clamp(28px, 3.5vw, 40px);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portrait {
  position: relative;
  border: 1px solid var(--line);
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}
.portrait::before, .portrait::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
}
.portrait::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.portrait::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(.95);
  transition: filter .7s var(--ease);
}
.portrait:hover img { filter: grayscale(.15) contrast(1.03) brightness(1); }

.hero__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-dim);
  display: grid;
  gap: 6px;
}
.hero__meta b { color: var(--text-muted); font-weight: 400; }

.hero__stack {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: clamp(28px, 4vw, 48px);
  margin-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
.hero__stack .eyebrow { margin-right: 8px; }


/* ---------- 8. MARQUEE ---------- */
.marquee {
  border-block: 1px solid var(--line);
  padding-block: clamp(16px, 2vw, 24px);
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: var(--bg);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding-right: clamp(28px, 4vw, 56px);
}
.marquee__item {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
}
.marquee__item::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .75;
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ---------- 9. PROYECTOS ---------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 80px) var(--grid-gap);
}

.project { grid-column: span 12; }
.project--md { grid-column: span 6; }
.project--lg { grid-column: span 8; }
.project--sm { grid-column: span 4; }

.project__link {
  display: block;
  position: relative;
  height: 100%;
}

.project__media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  aspect-ratio: 16 / 10;
}
.project--feature .project__media { aspect-ratio: 21 / 9; }

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.005);
  transition: transform 1.1s var(--ease-out), filter .7s var(--ease);
  filter: saturate(.88) contrast(1.02) brightness(.9);
}
.project__link:hover .project__media img,
.project__link:focus-visible .project__media img {
  transform: scale(1.05);
  filter: saturate(1) contrast(1) brightness(1);
}

.project__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,8,8,.35) 0%, rgba(8,8,8,0) 35%, rgba(8,8,8,.55) 100%);
  opacity: .85;
  transition: opacity .6s var(--ease);
  pointer-events: none;
}
.project__link:hover .project__media::after { opacity: .5; }

.project__index {
  position: absolute;
  top: 16px; left: 18px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--accent);
  mix-blend-mode: normal;
}

.project__open {
  position: absolute;
  right: 16px; bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(8,8,8,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s var(--ease), transform .45s var(--ease-out), background-color .35s var(--ease), color .35s var(--ease);
}
.project__link:hover .project__open,
.project__link:focus-visible .project__open { opacity: 1; transform: none; }
.project__link:hover .project__open { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.project__body { padding-top: 22px; }

.project__cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

.project__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  transition: color .35s var(--ease);
}
.project--feature .project__title { font-size: clamp(2.2rem, 5.2vw, 4.4rem); }
.project--sm .project__title { font-size: clamp(1.4rem, 2vw, 1.9rem); }
.project__link:hover .project__title { color: var(--accent); }

.project__title svg {
  width: .5em; height: .5em;
  flex: none;
  transition: transform .45s var(--ease-out);
}
.project__link:hover .project__title svg { transform: translate(4px, -4px); }

.project__desc {
  color: var(--text-muted);
  margin-top: 14px;
  max-width: 62ch;
  font-size: clamp(14px, 1vw, 16px);
}
.project--feature .project__desc { font-size: clamp(15px, 1.15vw, 18px); max-width: 68ch; }
.project--sm .project__desc { font-size: 14px; }

.project__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.project--feature .project__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 56px);
  align-items: start;
  padding-top: 26px;
}

/* Tarjeta CTA dentro de la retícula */
.project-cta {
  grid-column: span 4;
  border: 1px solid var(--line);
  padding: clamp(24px, 2.4vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 100%;
  background: linear-gradient(160deg, rgba(215,178,109,.06), transparent 60%);
  transition: border-color .4s var(--ease);
}
.project-cta:hover { border-color: var(--line-strong); }
.project-cta__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin-top: 14px;
}
.project-cta p { color: var(--text-muted); font-size: 14.5px; margin-top: 12px; }

/* ---------- 10. CASO DE ESTUDIO (modal) ---------- */
.cases-source { display: none; }
html:not(.js) .cases-source { display: block; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
}
.modal.is-open { visibility: visible; pointer-events: auto; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }

.modal__panel {
  position: relative;
  width: min(940px, 100%);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .6s var(--ease-out);
  -webkit-overflow-scrolling: touch;
}
.modal.is-open .modal__panel { transform: none; }

.modal__close {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px clamp(20px, 3vw, 40px);
  width: 100%;
  justify-content: flex-end;
  background: linear-gradient(180deg, var(--bg) 60%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color .3s var(--ease);
}
.modal__close:hover { color: var(--accent); }
.modal__close svg { width: 14px; height: 14px; }

.case { padding: 0 clamp(20px, 3.4vw, 56px) clamp(56px, 7vw, 96px); }

.case__hero { margin-bottom: clamp(28px, 4vw, 44px); }
.case__cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.case__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: .95;
  letter-spacing: -.04em;
  text-transform: uppercase;
  margin: 14px 0 20px;
}
.case__shot {
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.case__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.case__block { padding-block: clamp(22px, 2.6vw, 32px); border-top: 1px solid var(--line); }
.case__block h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.case__block p { color: var(--text-muted); max-width: 68ch; }
.case__block p + p { margin-top: 12px; }

.case__list { display: grid; gap: 10px; }
.case__list li {
  display: flex;
  gap: 14px;
  color: var(--text-muted);
  font-size: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.case__list li::before {
  content: attr(data-n);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex: none;
  padding-top: 4px;
}

.case__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: clamp(28px, 3.5vw, 44px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line);
}
.case__url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}

/* ---------- 11. SOBRE MÍ ---------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 90px);
  align-items: start;
}

.about__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: .9;
  letter-spacing: -.045em;
  text-transform: uppercase;
  margin-top: 18px;
}
.about__title em { font-style: normal; color: var(--accent); }

.about__statements { display: grid; gap: 0; margin-bottom: 34px; }
.about__statements li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding-block: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: clamp(15px, 1.15vw, 17.5px);
}
.about__statements li b {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--accent);
}
.about__statements li strong { color: var(--text); font-weight: 500; }

.about__closing {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  max-width: 20ch;
}
.about__closing span { color: var(--text-dim); display: block; }

/* ---------- 12. SERVICIOS ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border-top: 1px solid var(--line);
}
.service {
  padding: clamp(30px, 3.2vw, 46px) clamp(22px, 2.4vw, 34px);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: background-color .5s var(--ease);
}
.service:hover { background: var(--bg-elev); }
.service::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease-out);
}
.service:hover::after { transform: scaleX(1); }

.service__n {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--text-dim);
}
.service__icon {
  width: 34px; height: 34px;
  margin: 22px 0 20px;
  color: var(--accent);
}
.service__icon svg { width: 100%; height: 100%; }
.service h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.7vw, 1.6rem);
  letter-spacing: -.025em;
  margin-bottom: 10px;
}
.service p { color: var(--text-muted); font-size: 14.5px; }

/* ---------- 13. TECNOLOGÍAS ---------- */
.tech {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.tech__group {
  padding: clamp(26px, 3vw, 40px) clamp(20px, 2.2vw, 32px);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.tech__group h3 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.tech__list { display: flex; flex-wrap: wrap; gap: 6px 0; }
.tech__list li {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.3vw, 1.28rem);
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--text-muted);
  transition: color .3s var(--ease);
}
.tech__list li:hover { color: var(--text); }
.tech__list li:not(:last-child)::after {
  content: '·';
  color: var(--text-dim);
  margin-inline: 10px;
}

/* ---------- 14. CONTACTO ---------- */
.contact { position: relative; overflow: hidden; }
.contact__glow {
  position: absolute;
  bottom: -40%; left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 120vw);
  aspect-ratio: 2 / 1;
  background: radial-gradient(ellipse at 50% 50%, rgba(215,178,109,.10), transparent 65%);
  pointer-events: none;
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: .9;
  letter-spacing: -.05em;
  text-transform: uppercase;
  margin: 22px 0 clamp(26px, 3vw, 40px);
  max-width: 16ch;
}
.contact__title em { font-style: normal; color: var(--accent); }

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.contact__lede { color: var(--text-muted); max-width: 46ch; margin-bottom: 30px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.contact__card {
  border: 1px solid var(--line);
  padding: clamp(24px, 2.6vw, 38px);
  background: linear-gradient(170deg, rgba(255,255,255,.025), transparent 70%);
}
.contact__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.contact__place { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; color: var(--text-dim); margin-top: 6px; }

.contact__list { margin-top: 26px; display: grid; }
.contact__list li { border-top: 1px solid var(--line); }
.contact__list a,
.contact__list span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
}
.contact__list b {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: none;
}
.contact__list em {
  font-style: normal;
  font-size: clamp(14px, 1.05vw, 16px);
  text-align: right;
  word-break: break-word;
  transition: color .3s var(--ease);
}
.contact__list a:hover em { color: var(--accent); }

/* ---------- 15. FOOTER ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 36px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-dim);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer__links a:hover { color: var(--text); }
.to-top { display: inline-flex; align-items: center; gap: 8px; transition: color .3s var(--ease); }
.to-top:hover { color: var(--accent); }

/* ---------- 16. REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal-mask { overflow: hidden; display: block; }
.reveal-mask > * {
  display: block;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal-mask.is-in > * { transform: none; }

/* ---------- 17. CURSOR ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 300;
  pointer-events: none;
  display: none;
  mix-blend-mode: difference;
}
.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0; left: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor__dot { width: 5px; height: 5px; background: #fff; }
.cursor__ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.55);
  transition: width .35s var(--ease-out), height .35s var(--ease-out), background-color .35s var(--ease), border-color .35s var(--ease);
}
.cursor.is-hover .cursor__ring { width: 62px; height: 62px; background: rgba(255,255,255,.12); border-color: transparent; }
.cursor.is-hidden { opacity: 0; }

@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
}

/* ---------- 18. RESPONSIVE ---------- */
@media (max-width: 1180px) {
  .project--lg { grid-column: span 12; }
  .project--sm { grid-column: span 6; }
  .project-cta { grid-column: span 6; }
}

@media (max-width: 1000px) {
  :root { --nav-h: 68px; }
  .nav__menu, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }

  .hero__inner { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero__aside {
    flex-direction: row;
    align-items: center;
    gap: 22px;
    order: -1;
    margin-bottom: 4px;
  }
  .portrait { width: clamp(120px, 30vw, 168px); flex: none; }
  .hero__title { font-size: clamp(3rem, 15vw, 7rem); }

  .section-head { grid-template-columns: minmax(0, 1fr); }
  .about__grid, .contact__grid { grid-template-columns: minmax(0, 1fr); }
  .project--feature .project__body { grid-template-columns: minmax(0, 1fr); }
  .modal__panel { width: 100%; border-left: 0; }
}

@media (max-width: 720px) {
  .project--md, .project--sm, .project-cta { grid-column: span 12; }
  .project--feature .project__media { aspect-ratio: 16 / 10; }
  .projects__grid { gap: 44px var(--grid-gap); }
  .hero__top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero__actions .btn { flex: 1 1 auto; }
  .contact__list a, .contact__list span { flex-direction: column; align-items: flex-start; gap: 4px; }
  .contact__list em { text-align: left; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .service { border-right: 0; }
  .tech__group { border-right: 0; }
}

/* ---------- 19. A11Y / MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .reveal-mask > * { transform: none; }
  .marquee__track { animation: none; }
  .cursor { display: none !important; }
}

@media print {
  body::before, .nav, .cursor, .progress, .marquee, .modal { display: none !important; }
  body { background: #fff; color: #000; }
}
