/* ============================================================
   SAMUEL TORO — PORTFOLIO
   Dark, refined, minimal. DM Sans + DM Mono.
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --surface2:  #161616;
  --border:    rgba(255,255,255,0.04);
  --border-md: rgba(255,255,255,0.08);
  --gray-100:  #f0f0f0;
  --gray-200:  #c8c8c8;
  --gray-300:  #9a9a9a;
  --gray-400:  #666666;
  --gray-500:  #444444;
  --accent:    #ffffff;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;
  --container: 1100px;
  --nav-h:     64px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--gray-200);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ---- Noise ---- */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ---- Container ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 1.5rem;
}
@media (min-width: 640px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 4rem; } }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  backdrop-filter: blur(0);
  animation: blurIn 0.6s 0.1s ease-out both;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

/* Logo */
.logo { display: flex; align-items: center; }
.logo-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: #f0f0f0;
  letter-spacing: -0.01em;
  text-shadow: 0 0 28px rgba(255,255,255,0.1), 0 1px 12px rgba(0,0,0,0.3);
  transition: color 0.3s, text-shadow 0.3s;
}
.logo:hover .logo-text { color: var(--gray-100); }

/* Nav links */
.nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
  color: var(--gray-300);
}
@media (min-width: 640px) { .nav-links { display: flex; } }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--gray-300);
  padding: 0.5rem;
  margin: -0.5rem;
  border-radius: 0.375rem;
  transition: color 0.2s, transform 0.15s;
  user-select: none;
}
.nav-link:hover  { color: var(--gray-100); }
.nav-link:active { transform: scale(0.96); }
.nav-link--active { color: var(--gray-100); }

/* Hamburger */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  color: var(--gray-300);
}
@media (min-width: 640px) { .menu-btn { display: none; } }
.menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #0a0a0a;
  padding: 1rem 1.5rem 2rem;
  z-index: 40;
  border-bottom: 1px solid var(--border-md);
}
.mobile-menu.is-open { display: block; }

.menu-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--gray-300);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.menu-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--gray-100);
  transform: scale(1.1) rotate(90deg);
}

.mobile-menu-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-100);
  margin-bottom: 1.5rem;
}
.mobile-menu ul { display: flex; flex-direction: column; gap: 1.25rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--nav-h) - 80px);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  gap: 0;
}

@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
}

/* Photo */
.hero-photo {
  flex-shrink: 0;
  width: 100%;
  max-width: 340px;
  order: 1;
  animation: fadeIn 0.8s 0.2s ease-out both;
  pointer-events: none;
  user-select: none;
}
@media (min-width: 1024px) {
  .hero-photo {
    order: 2;
    width: 46%;
    max-width: none;
    transform: translateX(-6%);
  }
}

/* Photo wrapper with bottom fade */
.photo-wrap {
  position: relative;
  display: block;
  line-height: 0;
}
.photo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 95%);
  mask-image:        linear-gradient(to bottom, black 0%, black 55%, transparent 95%);
}

/* Extra soft glow underneath the photo for depth */
.photo-fade {
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 40%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}

/* Text */
.hero-content {
  flex: 1;
  z-index: 1;
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-5%);
}
@media (min-width: 1024px) {
  .hero-content {
    order: 1;
    align-items: flex-start;
    transform: translateY(-12%);
  }
}

/* Title */
.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 600;
  color: var(--gray-100);
  line-height: 1.05;
  letter-spacing: -0.03em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em;
  margin-bottom: 0;
}

.word { display: inline-flex; overflow: hidden; }
.word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  animation: letterIn 0.5s ease-out both;
}

/* stagger per-word via --d */
.word:nth-child(1) span:nth-child(1)  { animation-delay: calc(0.35s + 0 * 0.04s); }
.word:nth-child(1) span:nth-child(2)  { animation-delay: calc(0.35s + 1 * 0.04s); }
.word:nth-child(1) span:nth-child(3)  { animation-delay: calc(0.35s + 2 * 0.04s); }
.word:nth-child(1) span:nth-child(4)  { animation-delay: calc(0.35s + 3 * 0.04s); }
.word:nth-child(1) span:nth-child(5)  { animation-delay: calc(0.35s + 4 * 0.04s); }
.word:nth-child(1) span:nth-child(6)  { animation-delay: calc(0.35s + 5 * 0.04s); }
.word:nth-child(2) span:nth-child(1)  { animation-delay: calc(0.35s + 7 * 0.04s); }
.word:nth-child(2) span:nth-child(2)  { animation-delay: calc(0.35s + 8 * 0.04s); }
.word:nth-child(2) span:nth-child(3)  { animation-delay: calc(0.35s + 9 * 0.04s); }
.word:nth-child(2) span:nth-child(4)  { animation-delay: calc(0.35s + 10 * 0.04s); }

/* Body */
.hero-body {
  margin-top: 1.25rem;
  max-width: 440px;
}
@media (min-width: 1024px) { .hero-body { margin-top: 1.75rem; } }

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 400;
  color: rgba(160,160,160,0.8);
  line-height: 1.65;
  letter-spacing: -0.01em;
}
.highlight { color: var(--gray-200); font-weight: 500; }

/* CTA */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--gray-200);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  transition: background 0.3s, border-color 0.3s, color 0.25s, transform 0.15s;
  user-select: none;
  width: 100%;
}
@media (min-width: 1024px) { .cta-btn { width: auto; } }
.cta-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
  color: var(--gray-100);
}
.cta-btn:active { transform: scale(0.98); }

/* ============================================================
   EXPERIENCE PAGE
   ============================================================ */
.exp-page {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  animation: blurInDown 0.5s 0.1s ease-out both;
}

.exp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .exp-layout {
    grid-template-columns: 240px 1fr;
    gap: 2.5rem;
    align-items: start;
  }
}

/* Sidebar */
.exp-sidebar-sticky {
  position: static;
}
@media (min-width: 1024px) {
  .exp-sidebar-sticky {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
  }
}

.exp-heading {
  font-size: 2rem;
  font-weight: 600;
  color: var(--gray-200);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.exp-subhead {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--gray-400);
  line-height: 1.5;
  word-spacing: -0.1em;
  max-width: 220px;
}

/* Timeline nav */
.timeline-nav {
  display: none;
  margin-top: 2.25rem;
}
@media (min-width: 1024px) { .timeline-nav { display: block; } }

.timeline-nav ul { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3px;
  cursor: pointer;
  position: relative;
  padding-block: 1.375rem;
  text-decoration: none;
}
.timeline-item::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: -0.875rem -1.25rem;
}

.timeline-bar {
  height: 3px;
  width: 40px;
  border-radius: 9999px;
  background: var(--gray-500);
  transition: width 0.3s ease, background 0.3s ease;
}
.timeline-item--active .timeline-bar,
.timeline-item:hover .timeline-bar {
  width: 52px;
  background: var(--gray-300);
}

.timeline-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-400);
  opacity: 0.35;
  transition: opacity 0.2s, color 0.2s;
  white-space: nowrap;
}
.timeline-item--active .timeline-label,
.timeline-item:hover .timeline-label {
  color: var(--gray-200);
  opacity: 1;
}

.timeline-spacer {
  height: 8px;
  padding-block: 0;
}
.timeline-spacer::before,
.timeline-spacer::after {
  content: '';
  display: block;
  height: 3px;
  width: 32px;
  border-radius: 9999px;
  background: var(--surface2);
  margin-block: 2px;
}

/* Cards */
.exp-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.exp-card    { scroll-margin-top: calc(var(--nav-h) + 1.25rem); }
.edu-section { scroll-margin-top: calc(var(--nav-h) + 1.25rem); }

.exp-card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
  transition: border-color 0.25s, background 0.25s;
}
@media (min-width: 640px) { .exp-card { padding: 1.5rem; } }
.exp-card:hover {
  border-color: var(--border-md);
  background: var(--surface2);
}

.exp-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}
.exp-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-200);
  line-height: 1;
  flex-shrink: 0;
}
.exp-card-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(160,160,160,0.75);
  line-height: 1;
  text-align: right;
}

.exp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  height: 1rem;
}
.exp-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(160,160,160,0.75);
  line-height: 1;
}
.exp-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(200,200,200,0.7);
  transition: color 0.2s, transform 0.15s;
  padding: 0.5rem;
  margin: -0.5rem;
  border-radius: 0.25rem;
}
.exp-link:hover  { color: var(--gray-100); }
.exp-link:active { transform: scale(0.96); }

/* Tags */
.exp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gray-400);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  letter-spacing: 0.01em;
  transition: color 0.2s, background 0.2s;
}
.exp-card:hover .tag {
  color: var(--gray-300);
  background: rgba(255,255,255,0.06);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  margin-top: 2.5rem;
  animation: blurIn 0.5s 0.5s ease-out both;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    text-align: left;
  }
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(160,160,160,0.6);
  order: 2;
}
@media (min-width: 640px) { .footer-copy { order: 1; } }

.footer-social {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  order: 1;
}
@media (min-width: 640px) { .footer-social { order: 2; } }

.social-icon {
  display: block;
  color: var(--gray-400);
  padding: 0.5rem;
  margin: -0.5rem;
  border-radius: 0.25rem;
  transition: color 0.25s, transform 0.2s;
}
.social-icon:hover  { color: var(--gray-100); transform: translateY(-2px) scale(1.05); }
.social-icon:active { transform: scale(0.97); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes letterIn {
  from { opacity: 0; transform: translateY(110%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blurIn {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}
@keyframes blurInDown {
  from { opacity: 0; filter: blur(6px); transform: translateY(-8px); }
  to   { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.anim-up  { animation: slideUp  0.6s 0.65s ease-out both; }
.anim-footer { animation: blurIn 0.5s 0.5s ease-out both; }

/* ============================================================
   SCROLL-AWARE timeline active state
   ============================================================ */
/* handled by JS */

/* ============================================================
   EXPERIENCE CARD — description, bullets & impact
   ============================================================ */
.exp-card-desc {
  font-size: 0.875rem;
  color: rgba(160,160,160,0.7);
  line-height: 1.6;
  margin-bottom: 0.875rem;
}

.exp-card-list {
  margin-bottom: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.exp-card-list li {
  font-size: 0.8125rem;
  color: rgba(160,160,160,0.65);
  line-height: 1.55;
  padding-left: 1.125rem;
  position: relative;
}
.exp-card-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
}

.exp-card-impact {
  font-size: 0.8125rem;
  color: rgba(200,200,200,0.65);
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(255,255,255,0.1);
  padding: 0.625rem 0.875rem;
  border-radius: 0 0.375rem 0.375rem 0;
  margin-bottom: 1rem;
  line-height: 1.55;
}
.exp-card-impact strong {
  color: var(--gray-400);
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   EDUCATION SECTION
   ============================================================ */
.edu-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.edu-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-300);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.edu-cards {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.edu-card {
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.25rem;
  transition: border-color 0.25s, background 0.25s;
}
.edu-card:hover {
  border-color: var(--border-md);
  background: var(--surface2);
}

.edu-card-school {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-200);
  margin-bottom: 0.25rem;
}

.edu-card-degree {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(160,160,160,0.75);
  line-height: 1.4;
  margin-bottom: 0.375rem;
}

.edu-card-period {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gray-500);
}
.edu-card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.edu-card-header-info { flex: 1; min-width: 0; }
.edu-card-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border-md);
  background: var(--surface2);
  overflow: hidden;
}
.edu-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.3rem;
  display: block;
}

/* ============================================================
   EXP CARD — logo + header layout override
   ============================================================ */
.exp-card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  margin-bottom: 0.875rem;
}
.exp-card-header-info {
  flex: 1;
  min-width: 0;
}
.exp-card-role {
  margin-top: 0.25rem;
  text-align: left;
}
.exp-card-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 0.625rem;
  border: 1px solid var(--border-md);
  background: var(--surface2);
  overflow: hidden;
}
.exp-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.375rem;
  display: block;
}

/* ============================================================
   PROJECTS PAGE
   ============================================================ */
.proj-page {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  animation: blurInDown 0.5s 0.1s ease-out both;
}
.proj-header {
  margin-bottom: 2rem;
}
.proj-heading {
  font-size: 2rem;
  font-weight: 600;
  color: var(--gray-200);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.proj-subhead {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--gray-400);
  line-height: 1.5;
}
.proj-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .proj-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.proj-card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s;
}
.proj-card:hover {
  border-color: var(--border-md);
  background: var(--surface2);
}
.proj-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  margin: 0;
  display: block;
  position: relative;
}
.proj-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82) saturate(0.8);
  transform: scale(1.01);
  transition: filter 0.5s ease, transform 0.5s ease;
}
.proj-card:hover .proj-card-img img {
  filter: brightness(1.04) saturate(1.08);
  transform: scale(1.06);
}
.proj-card-body {
  padding: 1.25rem;
}
@media (min-width: 640px) {
  .proj-card-body { padding: 1.5rem; }
}
.proj-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gray-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.proj-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-200);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 0.625rem;
}
.proj-card-desc {
  font-size: 0.875rem;
  color: rgba(160,160,160,0.7);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.proj-card-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-300);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-md);
  background: rgba(255,255,255,0.03);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.proj-link:hover {
  color: var(--gray-100);
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
}
.proj-link--muted {
  color: var(--gray-500);
  border-color: var(--border);
  pointer-events: none;
}
.proj-card-credentials {
  margin-top: 0.875rem;
  padding: 0.75rem 0.875rem;
  background: rgba(255,255,255,0.032);
  border: 1px solid rgba(255,255,255,0.085);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cred-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.cred-fields {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cred-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cred-key {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--gray-400);
  letter-spacing: 0.04em;
}

.cred-val {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: rgba(210,210,210,0.94);
  background: rgba(255,255,255,0.065);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 0.18rem 0.55rem;
  border-radius: 0.3rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.cred-sep {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gray-500);
  line-height: 1;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.proj-card-img img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  cursor: zoom-out;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox-img {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 0.875rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255,255,255,0.06);
  transform: scale(0.93);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}
.lightbox.is-open .lightbox-img {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: var(--gray-300);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  transform: scale(1.08);
}

/* ============================================================
   VISUAL ENHANCEMENTS — glow · gradients · micro-interactions
   ============================================================ */

/* ---- Shared glow tokens ---- */
:root {
  --glow-sm:          0 0 14px rgba(255,255,255,0.06);
  --glow-md:          0 0 28px rgba(255,255,255,0.08), 0 0 56px rgba(255,255,255,0.03);
  --card-shadow:      0 2px 16px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.03) inset;
  --card-shadow-hover:0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.07),
                      0 1px 0 rgba(255,255,255,0.07) inset;
}

/* ---- Header: backdrop blur on scroll (class toggled by JS) ---- */
.header {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
}
.header.is-scrolled {
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgba(255,255,255,0.07);
}

/* ---- Logo: soft glow on hover ---- */
.logo:hover .logo-text {
  color: var(--gray-100);
  text-shadow: 0 0 20px rgba(255,255,255,0.18);
}

/* ---- Nav links: underline slide micro-interaction ---- */
.nav-link {
  position: relative;
  transition: color 0.2s, transform 0.15s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0.5rem;
  right: 0.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover::after,
.nav-link--active::after { transform: scaleX(1); }

/* ---- Hero: ambient glow blobs ---- */
.hero { position: relative; }
.hero::before {
  content: '';
  position: absolute;
  top: 5%;
  right: 8%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.022) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 12%;
  left: 0%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,0.014) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-content,
.hero-photo { position: relative; z-index: 1; }

/* ---- Hero title: solid white + glow (background-clip: text dropped — unreliable with overflow:hidden on .word) ---- */
.hero-title {
  color: #f2f2f2;
  background: none;
  -webkit-text-fill-color: unset;
  text-shadow:
    0 0 40px rgba(255,255,255,0.12),
    0 2px 24px rgba(0,0,0,0.35);
}

/* ---- CTA button: glow on hover ---- */
.cta-btn {
  transition: background 0.3s, border-color 0.3s, color 0.25s,
              transform 0.15s, box-shadow 0.3s;
}
.cta-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.26);
  color: var(--gray-100);
  box-shadow: 0 0 22px rgba(255,255,255,0.07),
              0 0 44px rgba(255,255,255,0.03),
              inset 0 1px 0 rgba(255,255,255,0.1);
}

/* ---- Exp heading: solid color ---- */
.exp-heading {
  color: var(--gray-100);
  background: none;
  -webkit-text-fill-color: unset;
}

/* ---- Exp cards: lift + glow ---- */
.exp-card {
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s, background 0.3s,
              transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.35s;
  will-change: transform;
}
.exp-card:hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--surface2);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}
.exp-card:hover .exp-card-title { color: var(--gray-100); }

/* ---- Exp card logo: border glow on card hover ---- */
.exp-card:hover .exp-card-logo {
  border-color: rgba(255,255,255,0.13);
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* ---- Impact callout: glowing left border ---- */
.exp-card-impact {
  border-left-color: rgba(255,255,255,0.2);
  box-shadow: -4px 0 18px rgba(255,255,255,0.03),
              inset 0 0 28px rgba(255,255,255,0.01);
}

/* ---- Timeline bar: active glow pulse ---- */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255,255,255,0.22), 0 0 14px rgba(255,255,255,0.08); }
  50%       { box-shadow: 0 0 12px rgba(255,255,255,0.35), 0 0 26px rgba(255,255,255,0.14); }
}
.timeline-item--active .timeline-bar {
  background: var(--gray-200);
  animation: glowPulse 2.8s ease-in-out infinite;
}

/* ---- Tags: bounce lift on hover ---- */
.tag {
  transition: color 0.2s, background 0.2s, border-color 0.2s,
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tag:hover {
  color: var(--gray-100) !important;
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.14) !important;
  transform: translateY(-1px);
}

/* ---- Exp link: glow on hover ---- */
.exp-link {
  transition: color 0.2s, transform 0.15s, filter 0.2s;
}
.exp-link:hover {
  color: var(--gray-100);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.15));
}

/* ---- Social icons: glow on hover ---- */
.social-icon {
  transition: color 0.25s, transform 0.2s, filter 0.25s;
}
.social-icon:hover {
  color: var(--gray-100);
  transform: translateY(-3px) scale(1.08);
  filter: drop-shadow(0 0 7px rgba(255,255,255,0.22));
}

/* ---- Project page heading: solid color ---- */
.proj-heading {
  color: var(--gray-100);
  background: none;
  -webkit-text-fill-color: unset;
}

/* ---- Proj cards: lift + glow ---- */
.proj-card {
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s, background 0.3s,
              transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.35s;
  will-change: transform;
}
.proj-card:hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--surface2);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}
.proj-card:hover .proj-card-title { color: var(--gray-100); }

/* ---- Proj card image: viñeta por defecto, desaparece en hover ---- */
.proj-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(0,0,0,0.32) 100%);
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.proj-card:hover .proj-card-img::after { opacity: 0; }

/* ---- Proj links: glow on hover ---- */
.proj-link {
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.25s;
}
.proj-link:hover {
  color: var(--gray-100);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 14px rgba(255,255,255,0.06);
}

/* ---- Edu cards: lift on hover ---- */
.edu-card {
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s,
              transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.edu-card:hover {
  border-color: rgba(255,255,255,0.09);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
}

/* ---- Footer border: slightly brighter ---- */
.footer-inner { border-top-color: rgba(255,255,255,0.06); }

/* ---- Contenedor flex de los dos CTAs ---- */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  margin-top: 2rem;
}
.hero-ctas .cta-btn { margin-top: 0; width: auto; flex: 1; }

/* ---- WhatsApp CTA secundario ---- */
.cta-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(187, 247, 208, 0.2);
  background: rgba(187, 247, 208, 0.04);
  color: #bbf7d0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  transition: background 0.3s, border-color 0.3s, color 0.25s,
              transform 0.15s, box-shadow 0.3s;
  flex: 1;
  text-decoration: none;
  user-select: none;
}
.cta-whatsapp:hover {
  background: rgba(187, 247, 208, 0.09);
  border-color: rgba(187, 247, 208, 0.38);
  color: #dcfce7;
  box-shadow: 0 0 18px rgba(187, 247, 208, 0.1), 0 0 36px rgba(187, 247, 208, 0.05);
}
.cta-whatsapp:active { transform: scale(0.98); }

/* Neutraliza el offset vertical del hero-content */
.hero-content { transform: translateY(0); }
@media (min-width: 1024px) {
  .hero-content { transform: translateY(0); }
}

/* ============================================================
   PREMIUM UPGRADE — scroll-reveal · polish · interactions
   ============================================================ */

/* ---- Scroll-reveal keyframe ---- */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(24px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0);   }
}

/* Cards start invisible; JS observer adds .is-visible */
.exp-card, .proj-card, .edu-card { opacity: 0; }

.exp-card.is-visible,
.proj-card.is-visible,
.edu-card.is-visible {
  animation: revealUp 0.72s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms) both;
}

/* Fallback for no-JS or reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .exp-card, .proj-card, .edu-card { opacity: 1; }
  .exp-card.is-visible,
  .proj-card.is-visible,
  .edu-card.is-visible { animation: none; }
}

/* ---- Exp card: more breathing room ---- */
.exp-card { padding: 1.25rem; }
@media (min-width: 640px) { .exp-card { padding: 2rem; } }
.exp-cards { gap: 1.5rem; }

/* ---- Impact callout: gradient left panel ---- */
.exp-card-impact {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.045) 0%,
    rgba(255,255,255,0.012) 60%,
    transparent 100%);
  border-left: 2px solid rgba(255,255,255,0.26);
  padding: 0.875rem 1.125rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* ---- Tags: pill shape ---- */
.tag {
  border-radius: 999px;
  padding: 0.225rem 0.7rem;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}

/* ---- Projects: grid gap ---- */
.proj-grid { gap: 1.5rem; }
.proj-card { border-radius: 1.25rem; }

/* ---- Proj card body: generous padding ---- */
.proj-card-body { padding: 1.5rem; }
@media (min-width: 640px) { .proj-card-body { padding: 1.875rem; } }

/* ---- Proj card image: grid texture on empty state ---- */
.proj-card-img {
  background:
    linear-gradient(rgba(255,255,255,0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.027) 1px, transparent 1px),
    linear-gradient(145deg, #0c0c0c 0%, #171717 55%, #0c0c0c 100%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

/* Shimmer sweep on empty placeholder */
.proj-card-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 25%,
    rgba(255,255,255,0.038) 50%,
    transparent 75%
  );
  background-size: 350% 100%;
  background-position: 200% 0;
  animation: imgShimmer 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes imgShimmer {
  0%, 100% { background-position: 220% 0; }
  50%       { background-position: -120% 0; }
}

/* Hover overlay override — ya definido arriba */

/* Bigger lift + deeper shadow */
.proj-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.72),
    0 0 0 1px rgba(255,255,255,0.09),
    0 1px 0 rgba(255,255,255,0.09) inset;
}

/* Image: bigger scale + longer ease ---- */
.proj-card:hover .proj-card-img img {
  transform: scale(1.07);
  transition-duration: 0.55s;
}

/* ---- Proj eyebrow: pill badge ---- */
.proj-card-eyebrow {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.875rem;
  color: rgba(165,165,165,0.9);
}

/* ---- CTA button: shimmer sweep on hover ---- */
.cta-btn {
  position: relative;
  overflow: hidden;
  gap: 0.55rem;
}
.cta-btn svg {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cta-btn:hover svg {
  transform: translateX(2px) translateY(-2px) rotate(-5deg);
}
.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.1) 50%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-position: 220% 0;
  border-radius: inherit;
  transition: background-position 0.6s ease;
  pointer-events: none;
}
.cta-btn:hover::before { background-position: -120% 0; }

/* ---- Nav link: pill bg on hover ---- */
.nav-link:hover { background: rgba(255,255,255,0.055); }

/* ---- Header scrolled: depth shadow ---- */
.header.is-scrolled {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05),
    0 8px 40px rgba(0,0,0,0.55);
}

/* ============================================================
   TYPOGRAPHY SYSTEM — Playfair Display · Inter · DM Mono
   ============================================================ */

/* ---- Update font variables ---- */
:root {
  --font-sans:  'Plus Jakarta Sans', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  /* --font-mono unchanged */
}

/* ---- Body: Plus Jakarta Sans base ---- */
body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: #b8b8b8;
  letter-spacing: -0.005em;
}

/* ---- Hero title: Playfair Display display-weight ---- */
.hero-title {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 5.25rem);
  letter-spacing: -0.025em;
  line-height: 1.0;
}

/* ---- Hero highlight: italic serif for editorial touch ---- */
.highlight {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--gray-100);
}

/* ---- Hero description ---- */
.hero-desc {
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
  font-weight: 300;
  line-height: 1.72;
  color: rgba(175, 175, 175, 0.9);
  letter-spacing: 0.005em;
}

/* ---- Section headings: Playfair Display ---- */
.exp-heading,
.proj-heading {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---- Card titles: Playfair Display medium ---- */
.exp-card-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.proj-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

/* ---- Edu school name: Playfair Display ---- */
.edu-card-school {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

/* ---- Card descriptions & lists ---- */
.exp-card-desc,
.proj-card-desc {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.68;
  color: rgba(165, 165, 165, 0.82);
  letter-spacing: 0.003em;
}
.exp-card-list li {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.62;
  color: rgba(155, 155, 155, 0.75);
}
.exp-card-impact {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.62;
  color: rgba(180, 180, 180, 0.72);
}

/* ---- Proj eyebrow: DM Mono stays ---- */
.proj-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

/* ---- CTA button: Plus Jakarta Sans ---- */
.cta-btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

/* ---- Edu degree text ---- */
.edu-card-degree {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(155, 155, 155, 0.8);
}

/* ---- Mobile menu title: Playfair ---- */
.mobile-menu-title {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================================================
   PROJECTS REDESIGN v2 — secciones, cards premium, accordion
   ============================================================ */

/* ---- Override old flat grid — JS ahora renderiza secciones ---- */
.proj-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Sections wrapper ---- */
.proj-sections {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* ---- Section header ---- */
.proj-section-label {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.375rem;
}

.proj-section-title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-200);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.375rem;
}

.proj-section-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 1.375rem;
}

.proj-section-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 1.5rem;
}

/* ---- Section grids ---- */
.proj-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .proj-section--tools .proj-section-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .proj-section--design .proj-section-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  .proj-section--design .proj-section-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   SYSTEMS SECTION — desktop: 2 columnas para proyectos con
   imagen, ancho completo para el scraper (sin imagen)
   ============================================================ */
@media (min-width: 900px) {
  /* Grid de 2 columnas para los sistemas */
  .proj-section--systems .proj-section-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Scraper (sin imagen) ocupa el ancho completo */
  .proj-section--systems .proj-card--featured:not(.proj-card--has-image) {
    grid-column: 1 / -1;
  }

  /* EnConsume + FaceID: imagen arriba, contenido abajo (layout tipo card normal) */
  .proj-section--systems .proj-card--featured.proj-card--has-image {
    display: block;
  }

  /* Imagen: restaurar aspecto 16:9, quitando el panel lateral */
  .proj-section--systems .proj-card--featured.proj-card--has-image .proj-card-img {
    aspect-ratio: 16 / 9;
    height: auto;
    border-bottom: 1px solid var(--border);
    border-left: none;
    border-radius: 0;        /* la card maneja los bordes con overflow:hidden */
    grid-column: unset;
    grid-row: unset;
  }

  /* Body: padding un poco más compacto que el featured full-width */
  .proj-section--systems .proj-card--featured.proj-card--has-image .proj-card-body {
    padding: 1.625rem;
  }
}

/* ---- Category dot ---- */
.proj-cat-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-500);
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 0.4rem;
  position: relative;
  top: -1px;
}
.proj-cat-dot--backend { background: rgba(147, 197, 253, 0.8); box-shadow: 0 0 6px rgba(147,197,253,0.3); }
.proj-cat-dot--iot     { background: rgba(134, 239, 172, 0.8); box-shadow: 0 0 6px rgba(134,239,172,0.3); }
.proj-cat-dot--ml      { background: rgba(196, 181, 253, 0.8); box-shadow: 0 0 6px rgba(196,181,253,0.3); }
.proj-cat-dot--tool    { background: rgba(253, 224, 71,  0.75); box-shadow: 0 0 6px rgba(253,224,71,0.25); }
.proj-cat-dot--ui      { background: rgba(249, 168, 212, 0.8); box-shadow: 0 0 6px rgba(249,168,212,0.3); }

/* ---- Card meta top (eyebrow + periodo) ---- */
.proj-card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.proj-card-meta-top .proj-card-eyebrow {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
}

.proj-card-period {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--gray-500);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ---- Tagline italic ---- */
.proj-card-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9375rem;
  font-weight: 400;
  color: rgba(155, 155, 155, 0.72);
  line-height: 1.45;
  margin-top: 0.2rem;
  margin-bottom: 1.125rem;
  letter-spacing: -0.005em;
}

/* ---- Problem framing ---- */
.proj-card-problem {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.042) 0%,
    rgba(255,255,255,0.012) 55%,
    transparent 100%
  );
  border-left: 2px solid rgba(255,255,255,0.12);
  padding: 0.75rem 1rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin-bottom: 1.125rem;
}

.proj-field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.3rem;
}

.proj-card-problem p {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: rgba(155, 155, 155, 0.82);
  line-height: 1.62;
}

/* ---- Category-specific problem border ---- */
.proj-card--cat-backend .proj-card-problem { border-left-color: rgba(147, 197, 253, 0.22); }
.proj-card--cat-iot     .proj-card-problem { border-left-color: rgba(134, 239, 172, 0.22); }
.proj-card--cat-ml      .proj-card-problem { border-left-color: rgba(196, 181, 253, 0.22); }
.proj-card--cat-tool    .proj-card-problem { border-left-color: rgba(253, 224, 71,  0.2);  }
.proj-card--cat-ui      .proj-card-problem { border-left-color: rgba(249, 168, 212, 0.22); }

/* ---- Highlights list ---- */
.proj-card-highlights {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  margin-bottom: 1.125rem;
  list-style: none;
  padding: 0;
}

.proj-card-highlights li {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: rgba(150, 150, 150, 0.78);
  line-height: 1.6;
  padding-left: 1.125rem;
  position: relative;
}

.proj-card-highlights li::before {
  content: '·';
  position: absolute;
  left: 0.25rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1.35;
}

/* ---- Expand button ---- */
.proj-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: 1px solid var(--border-md);
  color: var(--gray-400);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  padding: 0.375rem 0.8rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  user-select: none;
}

.proj-expand-btn:hover {
  color: var(--gray-200);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}

.proj-expand-icon {
  flex-shrink: 0;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.proj-expand-btn[aria-expanded="true"] .proj-expand-icon {
  transform: rotate(180deg);
}

/* ---- Expand panel (CSS grid rows trick) ---- */
.proj-expand-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    opacity            0.32s ease,
    margin-top         0.42s cubic-bezier(0.16, 1, 0.3, 1),
    margin-bottom      0.42s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 0;
  margin-bottom: 0;
}

.proj-expand-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.875rem;
  margin-bottom: 0.125rem;
}

.proj-expand-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ---- Detail items inside panel ---- */
.proj-detail-item {
  background: rgba(255,255,255,0.022);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
}

.proj-detail-item .proj-field-label {
  margin-bottom: 0.3rem;
}

.proj-detail-item p {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: rgba(145, 145, 145, 0.75);
  line-height: 1.66;
}

/* ---- Card footer ---- */
.proj-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 1.25rem;
  padding-top: 1.125rem;
  border-top: 1px solid var(--border);
}

.proj-card-footer .proj-card-links {
  margin-top: 0;
}

/* ---- Featured card: layout 2-col (imagen derecha) en desktop ---- */
@media (min-width: 900px) {
  .proj-card--featured.proj-card--has-image {
    display: grid;
    grid-template-columns: 1fr 360px;
    align-items: stretch;
  }

  .proj-card--featured.proj-card--has-image .proj-card-img {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: unset;
    height: 100%;
    border-bottom: none;
    border-left: 1px solid var(--border);
    border-radius: 0 1.25rem 1.25rem 0;
  }

  .proj-card--featured.proj-card--has-image .proj-card-body {
    grid-column: 1;
    grid-row: 1;
  }
}

/* ---- Featured card body: padding más generoso ---- */
.proj-card--featured .proj-card-body {
  padding: 1.75rem;
}

@media (min-width: 640px) {
  .proj-card--featured .proj-card-body {
    padding: 2rem 2.25rem;
  }
}

/* ---- Featured card hover: lift más pronunciado ---- */
.proj-card--featured:hover {
  transform: translateY(-5px);
}

/* ---- Standard card: title tamaño ajustado ---- */
.proj-card--standard .proj-card-title {
  font-size: 1.0625rem;
}

/* ---- Reducir motion ---- */
@media (prefers-reduced-motion: reduce) {
  .proj-expand-panel,
  .proj-expand-icon { transition: none; }
}

/* ============================================================
   TAGS — fix legibilidad: sin recortes, spacing correcto
   ============================================================ */

/* Reset completo del tag para garantizar que nunca se corte */
.tag {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.3rem 0.72rem;
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.02em;
  border-radius: 999px;
  /* Compensar trailing letter-spacing en el lado derecho */
  padding-right: calc(0.72rem + 0.02em);
}

/* Container de tags: flex-wrap correcto, sin overflow clips */
.proj-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  overflow: visible;
}

/* Footer no comprime tags */
.proj-card-footer .proj-card-tags {
  overflow: visible;
  max-width: 100%;
}

/* ============================================================
   SLIDER — navegación suave multi-imagen
   ============================================================ */

/* ---- Slider container ---- */
.proj-media--slider {
  position: relative;
  overflow: hidden;
  cursor: default;
  outline: none;
}

/* Quitar shimmer del slider (::before) — mantener vignette mínima */
.proj-media--slider::before { display: none; }
.proj-media--slider::after  { display: none; }

/* ---- Track ---- */
.media-track {
  display: flex;
  height: 100%;
  transition: transform 0.54s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Cada imagen ocupa exactamente el 100% del slider */
.proj-card-img.proj-media--slider .media-img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Override regla global de scale */
  transform: none;
  filter: brightness(0.82) saturate(0.78);
  transition: filter 0.45s ease;
  cursor: zoom-in;
}

/* Hover: sólo brighten — sin scale (el track se encarga) */
.proj-card:hover .proj-card-img.proj-media--slider .media-img {
  transform: none;
  filter: brightness(1.0) saturate(0.95);
}

/* ---- Gradiente inferior para nav ---- */
.media-nav-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.proj-media--slider:hover .media-nav-gradient { opacity: 1; }

/* ---- Nav bar ---- */
.media-nav {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 4;
}

/* ---- Botones prev / next ---- */
.media-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(8,8,8,0.62);
  color: rgba(255,255,255,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  opacity: 0;
  transition:
    opacity      0.25s ease,
    background   0.2s ease,
    color        0.2s ease,
    transform    0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s ease;
}

.proj-media--slider:hover .media-btn,
.proj-media--slider:focus-within .media-btn { opacity: 1; }

.media-btn:hover {
  background: rgba(0,0,0,0.78);
  color: #fff;
  border-color: rgba(255,255,255,0.38);
  transform: scale(1.12);
}

.media-btn:active { transform: scale(0.95); }

/* En touch: botones siempre visibles con opacidad reducida */
@media (hover: none) {
  .media-btn { opacity: 0.72; }
}

/* ---- Indicadores (dots) ---- */
.media-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.media-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.32);
  cursor: pointer;
  padding: 0;
  transition:
    width      0.32s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.28s ease;
}

.media-dot.is-active {
  width: 20px;
  background: rgba(255,255,255,0.88);
}

.media-dot:hover:not(.is-active) {
  background: rgba(255,255,255,0.55);
}

/* ---- Mobile: slider en aspecto 16:9, dots + botones siempre visibles ---- */
@media (max-width: 899px) {
  .proj-media--slider { aspect-ratio: 16 / 9; }
  .proj-media--slider .media-nav-gradient { opacity: 1; }
  .media-btn { opacity: 0.72; }
  .media-dot { width: 5px; height: 5px; }
  .media-dot.is-active { width: 14px; }
}

/* ---- Single image (sin nav) — comportamiento original ---- */
.proj-card-img.proj-media--single .media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82) saturate(0.8);
  transform: scale(1.01);
  transition: filter 0.5s ease, transform 0.5s ease;
  cursor: zoom-in;
}

.proj-card:hover .proj-card-img.proj-media--single .media-img {
  filter: brightness(1.04) saturate(1.08);
  transform: scale(1.06);
}

/* ============================================================
   POLISH — shadows · backgrounds · typography · hover
   ============================================================ */

/* ---- Sombras en capas: más suaves, más profundas ---- */
:root {
  --card-shadow:
    0 1px 2px  rgba(0,0,0,0.55),
    0 4px 14px rgba(0,0,0,0.30),
    0 10px 36px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.042);
  --card-shadow-hover:
    0 2px 4px  rgba(0,0,0,0.62),
    0 8px 24px rgba(0,0,0,0.46),
    0 20px 56px rgba(0,0,0,0.24),
    0 0 0 1px rgba(255,255,255,0.072),
    inset 0 1px 0 rgba(255,255,255,0.072);
}

/* ---- Fondo gradiente sutil ---- */
.proj-card {
  background: linear-gradient(148deg, rgba(18,18,18,1) 0%, rgba(12,12,12,1) 100%);
}
.proj-card:hover {
  background: linear-gradient(148deg, rgba(22,22,22,1) 0%, rgba(15,15,15,1) 100%);
}
.proj-card--featured {
  background: linear-gradient(148deg, rgba(19,19,19,1) 0%, rgba(11,11,11,1) 100%);
}

/* ---- Tipografía: contraste mejorado ---- */
.proj-card-title          { color: rgba(240,240,240,0.96); }
.proj-card-tagline        { color: rgba(160,160,160,0.78); }
.proj-card-problem p      { color: rgba(168,168,168,0.88); }
.proj-card-highlights li  { color: rgba(158,158,158,0.86); }
.proj-detail-item p       { color: rgba(150,150,150,0.80); }
.proj-card-eyebrow        { color: rgba(155,155,155,0.88); }

/* ---- Tags en cards ---- */
.proj-card .tag {
  background: rgba(255,255,255,0.048);
  border-color: rgba(255,255,255,0.082);
  color: rgba(162,162,162,0.88);
}
.proj-card:hover .tag {
  background: rgba(255,255,255,0.068);
  border-color: rgba(255,255,255,0.112);
  color: rgba(182,182,182,0.94);
}

/* ---- Hover: borde con tinte de categoría ---- */
.proj-card--cat-backend:hover { border-color: rgba(147,197,253,0.12); }
.proj-card--cat-iot:hover     { border-color: rgba(134,239,172,0.12); }
.proj-card--cat-ml:hover      { border-color: rgba(196,181,253,0.12); }
.proj-card--cat-tool:hover    { border-color: rgba(253,224,71, 0.10); }
.proj-card--cat-ui:hover      { border-color: rgba(249,168,212,0.12); }

/* ---- Links ---- */
.proj-link:hover {
  color: rgba(240,240,240,0.95);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 16px rgba(255,255,255,0.048), 0 2px 8px rgba(0,0,0,0.3);
}

/* ---- Sección ---- */
.proj-section-title   { color: rgba(220,220,220,0.92); }
.proj-section-divider { background: rgba(255,255,255,0.06); }

/* ============================================================
   DEMO / VIDEO LINKS — mayor protagonismo visual
   ============================================================ */
.proj-link--primary {
  background: rgba(255,255,255,0.075);
  border-color: rgba(255,255,255,0.18);
  color: rgba(222,222,222,0.97);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 4px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.075);
  transition:
    color        0.22s ease,
    border-color 0.22s ease,
    background   0.22s ease,
    box-shadow   0.32s ease,
    transform    0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Shimmer sweep en hover */
.proj-link--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.11) 50%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-position: 240% 0;
  border-radius: inherit;
  transition: background-position 0.58s ease;
  pointer-events: none;
}

.proj-link--primary:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.30);
  color: rgba(242,242,242,1);
  transform: translateY(-1px);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.45),
    0 0 18px rgba(255,255,255,0.065),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.proj-link--primary:hover::before {
  background-position: -120% 0;
}

/* Flecha: salto diagonal suave en hover */
.proj-link--primary svg {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.proj-link--primary:hover svg {
  transform: translate(2px, -2px);
}

/* Links secundarios: levemente más apagados cuando hay un primario en el mismo grupo */
.proj-card-links:has(.proj-link--primary) .proj-link:not(.proj-link--primary) {
  color: var(--gray-400);
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.proj-card-links:has(.proj-link--primary) .proj-link:not(.proj-link--primary):hover {
  color: var(--gray-300);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  box-shadow: none;
}

/* ============================================================
   VIDEO CARDS — preview con autoplay hover
   ============================================================ */

/* ---- Wrapper de video ---- */
.proj-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050505;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-radius: 1.25rem 1.25rem 0 0;
}

.proj-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82) saturate(0.78);
  transition: filter 0.42s ease;
}

/* ---- Overlay con botón play ---- */
.proj-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.22);
  cursor: pointer;
  transition: background 0.3s ease, opacity 0.35s ease;
}

/* Desktop: el overlay desaparece en hover para dejar ver el video */
@media (hover: hover) {
  .proj-card--video:hover .proj-video-overlay {
    opacity: 0;
    pointer-events: none;
  }
  .proj-card--video:hover .proj-video {
    filter: brightness(0.94) saturate(0.92);
  }
}

.proj-video-overlay.is-playing {
  opacity: 0;
  pointer-events: none;
}

.proj-video-overlay:hover {
  background: rgba(0,0,0,0.14);
}

/* ---- Icono play ---- */
.proj-video-play-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.88);
  transition:
    transform    0.28s cubic-bezier(0.34,1.56,0.64,1),
    background   0.22s ease,
    border-color 0.22s ease;
}

.proj-video-overlay:hover .proj-video-play-icon {
  transform: scale(1.12);
  background: rgba(0,0,0,0.64);
  border-color: rgba(255,255,255,0.88);
}

/* ---- Cuerpo compacto de la video card ---- */
.proj-card-body--compact {
  padding: 1.25rem !important;
}

.proj-card--video .proj-card-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.proj-card--video .proj-card-tagline {
  font-size: 0.8125rem;
  margin-bottom: 0.875rem;
  color: rgba(148,148,148,0.76);
}

.proj-card-footer--compact {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  gap: 0.625rem;
}

/* ---- Hover lift suave ---- */
.proj-card--video:hover {
  transform: translateY(-4px);
}
