/* ═══════════════════════════════════════════════════════════════
   IGNACIO FLORIDO — Portfolio CSS
   Aesthetic: Editorial minimalism. Senior. Confident.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Palette — dark */
  --bg:         #07090f;
  --bg-2:       #0d1117;
  --surface:    rgba(255,255,255,0.035);
  --surface-2:  rgba(255,255,255,0.055);
  --surface-3:  rgba(255,255,255,0.08);
  --border:     rgba(255,255,255,0.07);
  --border-2:   rgba(255,255,255,0.12);
  --text:       #e2e8f4;
  --text-2:     #94a3bf;
  --accent:     #5cc8db;
  --accent-dim: rgba(92,200,219,0.12);
  --accent-glow:rgba(92,200,219,0.08);
  --shadow:     0 24px 64px rgba(0,0,0,0.30);

  /* Typography */
  /*  --font-display: "Bricolage Grotesque", system-ui, sans-serif; */
  --font-display: "Cabin", sans-serif;
  --font-body:    "DM Sans", system-ui, sans-serif;
  --h1:    clamp(2.4rem, 4.2vw, 3.6rem);
  --h2:    clamp(1.5rem, 2.6vw, 2.1rem);
  --body:  0.96rem;
  --small: 0.86rem;
  --micro: 0.72rem;

  /* Layout */
  --container: 1140px;
  --radius:    20px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Motion */
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
  --speed: 0.5s;
}

/* ── Light theme ── */
[data-theme="light"] {
  --bg:         #f5f7fb;
  --bg-2:       #ffffff;
  --surface:    rgba(15,23,42,0.028);
  --surface-2:  rgba(15,23,42,0.048);
  --surface-3:  rgba(15,23,42,0.07);
  --border:     rgba(15,23,42,0.07);
  --border-2:   rgba(15,23,42,0.12);
  --text:       #0f172a;
  --text-2:     #4b5c78;
  --accent:     #0891b2;
  --accent-dim: rgba(8,145,178,0.08);
  --accent-glow:rgba(8,145,178,0.05);
  --shadow:     0 20px 50px rgba(15,23,42,0.07);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  letter-spacing: -0.008em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  font-weight: 700;
}
strong { font-weight: 600; color: var(--text); }
.aside-photo {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  margin-bottom: 1.2rem;
}
/* ── Container ── */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.4rem;
}

/* ── Utility ── */
.mt-lg { margin-top: 2.8rem; }

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background var(--speed) var(--ease);
}
.nav__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.9rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav__brand {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.nav__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.nav__role {
  font-size: var(--micro);
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.nav__menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav__links {
  display: flex;
  list-style: none;
  gap: 0.15rem;
}
.nav__links a {
  display: block;
  padding: 0.55rem 0.85rem;
  font-size: var(--small);
  color: var(--text-2);
  border-radius: var(--radius-xs);
  transition: color 0.2s, background 0.2s;
  font-weight: 400;
}
.nav__links a:hover,
.nav__links a.active {
  color: var(--text);
  background: var(--surface-2);
}
.nav.scrolled {
  border-bottom-color: var(--border-2);
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.8rem;
}

/* ── Toggle ── */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Theme toggle icons */
.icon-sun,
.icon-moon { transition: opacity 0.25s; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-body);
  font-size: var(--small);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
  line-height: 1.35;
}
.btn--primary {
  background: var(--accent);
  color: #031017;
  border-color: var(--accent);
}
.btn--primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(92,200,219,0.2);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}
.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s;
}
.btn--icon:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn--sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
}
.btn--full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 6rem 0 4rem;
  overflow: hidden;
}
.hero__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, var(--accent-glow), transparent),
    radial-gradient(ellipse 40% 40% at 85% 20%, rgba(99,102,241,0.05), transparent);
  pointer-events: none;
  z-index: 0;
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: start;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(92,200,219,0.15);
  border-radius: 999px;
  margin-bottom: 1.6rem;
  letter-spacing: 0.01em;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(92,200,219,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(92,200,219,0); }
  100% { box-shadow: 0 0 0 0 rgba(92,200,219,0); }
}
.hero__title {
  font-size: var(--h1);
  font-weight: 800;
  margin-bottom: 1.4rem;
  max-width: 14ch;
}
.hero__accent {
  color: var(--accent);
}
.hero__lead {
  color: var(--text-2);
  font-size: 0.98rem;
  max-width: 55ch;
  margin-bottom: 2rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ── Stat card ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.stat-card__label {
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-2);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.stat-card__title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
  line-height: 1.3;
}
.stat-card__desc {
  color: var(--text-2);
  font-size: var(--small);
  margin-bottom: 1.5rem;
}
.stat-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.stat-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}
.stat-block__number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-block__number span { color: var(--accent); }
.stat-block__label {
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.4;
}
.stat-card__focus {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}
.stat-card__focus-label {
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.stat-card__focus p {
  font-size: var(--small);
  color: var(--text-2);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.section {
  padding: 5rem 0;
  scroll-margin-top: 80px;
}
.section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section--contact {
  padding-bottom: 3rem;
}
.section__header { max-width: 620px; }
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.8rem;
}
.section__title {
  font-size: var(--h2);
  margin-bottom: 0.6rem;
  max-width: 30ch;
}
.section__subtitle {
  color: var(--text-2);
  font-size: var(--small);
  max-width: 55ch;
}

/* ═══════════════════════════════════════════════════════════════
   GRID
   ═══════════════════════════════════════════════════════════════ */
.grid {
  display: grid;
  gap: 1.2rem;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card--highlight {
  background: var(--accent-dim);
  border-color: rgba(92,200,219,0.12);
}
.card--highlight p {
  color: var(--text-2);
  font-size: var(--small);
  line-height: 1.7;
}
.card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.card__title {
  font-size: 1.08rem;
  margin-bottom: 0.6rem;
}
.card__title--lg { font-size: 1.2rem; }
.card__meta {
  color: var(--text-2);
  font-size: var(--small);
  margin-bottom: 0.6rem;
}
.card__text {
  color: var(--text-2);
  font-size: var(--small);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════════════════ */
.project {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.project:hover {
  border-color: rgba(92,200,219,0.25);
  transform: translateY(-4px);
  box-shadow: 0 28px 64px rgba(0,0,0,0.2);
}
.project__img-wrap {
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.project__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.project:hover .project__img {
  transform: scale(1.03);
}
.project__body {
  padding: 1.5rem 1.8rem 1.8rem;
}
.project__meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.project__title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.project__desc {
  color: var(--text-2);
  font-size: var(--small);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ── Mini projects ── */
.projects-extra {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.projects-extra__title {
  font-size: 1rem;
  margin-bottom: 1.2rem;
}
.mini-project {
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, transform 0.2s;
}
.mini-project:hover {
  border-color: rgba(92,200,219,0.2);
  transform: translateY(-2px);
}
.mini-project__tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.mini-project__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.mini-project__desc {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   EXPERIENCE / TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.exp__grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 3.5rem;
  align-items: start;
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline__item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2.2rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--border-2);
}
.timeline__item:last-child::before { display: none; }
.timeline__content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.4rem 1.6rem;
  transition: border-color 0.2s;
}
.timeline__content:hover {
  border-color: var(--border-2);
}
.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.timeline__company {
  font-size: 1.05rem;
  font-weight: 700;
}
.timeline__location {
  font-size: var(--small);
  color: var(--text-2);
  font-weight: 400;
}
.timeline__date {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: nowrap;
}
.timeline__role {
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.timeline__desc {
  color: var(--text-2);
  font-size: var(--small);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   STACK
   ═══════════════════════════════════════════════════════════════ */
.stack-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.stack-group__title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.stack-group__list {
  color: var(--text-2);
  font-size: var(--small);
  line-height: 1.6;
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.8rem 0;
}
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ═══════════════════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════════════════ */
.contact-panel {
  background:
    linear-gradient(135deg, var(--accent-dim), rgba(99,102,241,0.04));
  border: 1px solid rgba(92,200,219,0.12);
  border-radius: calc(var(--radius) + 4px);
  padding: 3rem;
  box-shadow: var(--shadow);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.5rem;
}
.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-2);
  font-size: var(--small);
  font-weight: 500;
  transition: color 0.2s;
}
.contact__link:hover {
  color: var(--accent);
}

/* ── Form ── */
.contact__form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  backdrop-filter: blur(8px);
}
.form { display: flex; flex-direction: column; gap: 1rem; }
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form__label {
  display: block;
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.form__input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: var(--font-body);
  font-size: var(--small);
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.form__input::placeholder { color: var(--text-2); opacity: 0.5; }
.form__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3bf' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.4rem;
  cursor: pointer;
}
textarea.form__input { resize: vertical; min-height: 120px; }

.form-feedback {
  text-align: center;
  padding: 1.4rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: var(--small);
}
.form-feedback svg { margin: 0 auto 0.8rem; }
.form-feedback--ok {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  color: #6ee7b7;
}
.form-feedback--err {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
}
[data-theme="light"] .form-feedback--ok { color: #047857; }
[data-theme="light"] .form-feedback--err { color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.6rem 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer__role {
  color: var(--text-2);
  font-size: var(--small);
}
.footer__copy {
  color: var(--text-2);
  font-size: var(--small);
}

/* ═══════════════════════════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ── Nav overlay (oculto en desktop) ── */
.nav__overlay { display: none; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__title { max-width: none; }
  .exp__grid { grid-template-columns: 1fr; gap: 2rem; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .hero { padding: 4rem 0 3rem; }
  .section { padding: 3.5rem 0; }
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .stat-card { padding: 1.5rem; }
  .contact-panel { padding: 2rem 1.4rem; }
  .stack-panel { padding: 1.6rem; }

  /* Mobile nav */
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80vw;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-2);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.6rem;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 200;
    gap: 1.8rem;
    box-shadow: -20px 0 60px rgba(0,0,0,0.3);
    -webkit-overflow-scrolling: touch;
  }
  .nav__menu.open {
    transform: translateX(0);
  }
  /* Overlay separado del menú */
  .nav__overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
    -webkit-tap-highlight-color: transparent;
  }
  .nav__overlay.visible {
    opacity: 1;
    visibility: visible;
  }
  .nav__links {
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
  }
  .nav__links a {
    font-size: 1rem;
    padding: 0.6rem 1rem;
    width: 100%;
    text-align: center;
    border-radius: var(--radius-xs);
  }
  .nav__actions {
    margin-left: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-align-items: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }
  .nav__actions .btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .nav__actions .btn--icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .hero__title { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .section__title { font-size: clamp(1.3rem, 5vw, 1.7rem); }
  .stat-card__grid { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: 1fr; }
  .projects-extra .grid--3 { grid-template-columns: 1fr; }
}