:root {
  --bg: #000000;
  --bg-subtle: #070707;
  --card: #0c0c0c;
  --card-hover: #121212;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 158, 100, 0.35);
  
  --text-primary: #ffffff;
  --text-secondary: #a6a6a6;
  --text-dim: #737373;
  
  --accent: #ff9e64;
  
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow */
.bg-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  height: 480px;
  background: radial-gradient(circle at 50% 10%, rgba(255, 158, 100, 0.10) 0%, rgba(255, 158, 100, 0.03) 40%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Base links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #ffb98a;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Navbar */
.nav-wrapper {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav-wrapper .nav { pointer-events: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  padding-right: 8px;
  border-right: 1px solid var(--card-border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 158, 100, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 158, 100, 0.3);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 158, 100, 0.22);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* Hero */
/* Portada a pantalla completa con la tinta de fondo */
.hero-full {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: 48px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("/img/hero.webp") center / cover no-repeat;
}

.hero-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-ink.ready { opacity: 1; }

/* Con WebGL el sombreado lo hace el shader con dithering; los degradados CSS dejaban escalones */
.hero-full.has-ink::after { display: none; }

.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, var(--bg) 94%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: 120px;
  padding-bottom: 10vh;
}

.hero-inner > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-inner > *:nth-child(2) { animation-delay: 0.12s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.24s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.36s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
  .hero-bg { background-image: url("/img/hero-small.webp"); }
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 158, 100, 0.1);
  border: 1px solid rgba(255, 158, 100, 0.25);
  color: #ffc9a6;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 24px;
}

.dot-pulse {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-full h1 {
  font-size: clamp(2.8rem, 8vw, 6rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.accent-text {
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 680px;
  margin: 0 0 20px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 0 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0b0b0c;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.925rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #ffb98a;
  color: #0b0b0c;
  box-shadow: 0 4px 16px rgba(255, 158, 100, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

/* Section Header */
.section-header {
  margin-bottom: 32px;
}

.section-tag {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.section-tag::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.tag-num { color: var(--accent); }

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Projects Section */
.projects-section {
  margin-bottom: 80px;
}

/* Featured Project Hero Card (TaraTrack) */
.featured-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.featured-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 40px rgba(255, 158, 100, 0.1);
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
}

.featured-content {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 158, 100, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 158, 100, 0.25);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 14px;
}

.featured-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.featured-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.featured-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.pill-metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #ffffff;
  font-family: var(--font-mono);
}

.featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.featured-preview {
  background: #0b0b0c;
  border-left: 1px solid var(--card-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.preview-img-wrap {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  background: #111;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.preview-img-wrap:hover {
  transform: scale(1.02);
}

.preview-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.preview-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}

.thumb-btn {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.2s;
  text-align: center;
}

.thumb-btn.active, .thumb-btn:hover {
  background: rgba(255, 158, 100, 0.15);
  color: var(--accent);
  border-color: rgba(255, 158, 100, 0.4);
}

/* Secondary Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.project-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.project-top {
  margin-bottom: 20px;
}

.project-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.link-arrow:hover {
  gap: 6px;
}

/* Experience Section */
.exp-section {
  margin-bottom: 80px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -29px;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.exp-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.exp-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.exp-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.exp-company {
  color: var(--accent);
  font-weight: 500;
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.exp-list {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.exp-list li {
  margin-bottom: 6px;
}

/* Skills Section */
.skills-section {
  margin-bottom: 80px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.skill-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}

.skill-cat-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-chip {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Contact CTA */
.contact-section {
  margin-bottom: 64px;
}

.cta-card {
  background: linear-gradient(135deg, rgba(255, 158, 100, 0.08) 0%, rgba(255, 158, 100, 0) 100%), var(--card);
  border: 1px solid rgba(255, 158, 100, 0.25);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-card h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.cta-card p {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Footer */
footer {
  border-top: 1px solid var(--card-border);
  padding: 32px 0 48px;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 16px;
}

/* Modal Lightbox for Images */
.modal-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.modal-lightbox.active {
  display: flex;
}

.modal-content {
  max-width: 900px;
  width: 100%;
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-content img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-caption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
}

/* Responsive */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .featured-preview {
    border-left: none;
    border-top: 1px solid var(--card-border);
  }
  .nav-links {
    display: none;
  }
}

/* Antes inline: la CSP (style-src 'self') bloquea los atributos style */
.exp-desc { margin: 8px 0 0; color: var(--text-secondary); font-size: 0.9rem; }
.modal-sub { color: var(--text-dim); font-size: 0.8rem; }

/* Páginas sueltas (acceso, 404) */
.page-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.page-center .container { text-align: center; max-width: 540px; }
.page-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 158, 100, 0.1); border: 1px solid rgba(255, 158, 100, 0.25);
  color: #ffc9a6; font-size: 0.8rem; font-weight: 600;
  padding: 4px 12px; border-radius: 9999px; margin-bottom: 20px;
}
.page-center h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 12px; }
.page-center p { color: var(--text-secondary); margin: 0 0 28px; line-height: 1.6; }
.page-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.big-404 { font-family: var(--font-mono); font-size: 3.5rem; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.footer-tag { color: var(--text-dim); margin-right: 12px; font-family: var(--font-mono); font-size: 0.8rem; }

.page-back { display: inline-block; margin-top: 24px; color: var(--text-secondary); font-size: 0.9rem; }
.page-back:hover { color: var(--accent); }

/* Aviso legal y privacidad */
.legal { max-width: 760px; padding-top: 48px; padding-bottom: 64px; }
.legal .page-back { margin: 0 0 32px; }
.legal h2 { font-size: 1.1rem; margin: 32px 0 8px; color: var(--text-primary); }
.legal p, .legal li { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li::marker { color: var(--accent); }
.legal strong { color: var(--text-primary); }

/* Aparición suave de los bloques al hacer scroll (solo con JS activo) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-inner > * { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Scrollytelling */
.hero-inner { will-change: transform, opacity; }

.story { position: relative; height: 230vh; }

.story-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
}

.story-text {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: clamp(1.8rem, 4.4vw, 3.6rem);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.story-text em { font-style: normal; color: var(--accent); }

.js .story-text .w { color: rgba(255, 255, 255, 0.13); transition: color 0.3s ease; }
.js .story-text .w.on { color: var(--text-primary); }
.js .story-text .w.key.on { color: var(--accent); }

.timeline::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  width: 1px;
  height: calc(var(--fill, 1) * 100%);
  background: linear-gradient(180deg, var(--accent), rgba(255, 158, 100, 0.4));
  box-shadow: 0 0 8px rgba(255, 158, 100, 0.5);
}

.js .timeline-dot { background: #2a2a2b; box-shadow: none; }
.js .timeline-item.passed .timeline-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }


@media (prefers-reduced-motion: reduce) {
  .story { height: auto; }
  .story-sticky { position: static; height: auto; padding: 96px 0; }
  .js .story-text .w { color: var(--text-primary); }
  .js .story-text .w.key { color: var(--accent); }
  .js .timeline-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
}

/* ---- TaraTrack fijo con pasos ---- */
.tt-scroll { position: relative; }

.tt-card {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  gap: 40px;
  padding: 36px;
  align-items: center;
}

.tt-info .featured-summary { font-size: 0.95rem; margin-bottom: 20px; }

.tt-steps { list-style: none; margin: 0 0 24px; padding: 0; border-left: 1px solid var(--card-border); }

.tt-step { padding: 8px 0 8px 18px; position: relative; }

.tt-step::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s ease;
}

.tt-step-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.3s ease;
}

.tt-num { font-family: var(--font-mono); font-size: 0.75rem; }
.tt-step-title { font-size: 1.05rem; }

.tt-step p {
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  transition: max-height 0.45s ease, opacity 0.35s ease, margin 0.35s ease;
}

.tt-step.active::before { transform: scaleY(1); }
.tt-step.active .tt-step-btn { color: var(--text-primary); }
.tt-step.active .tt-num { color: var(--accent); }
.tt-step.active p { max-height: 6em; opacity: 1; margin-top: 6px; }

.tt-frame {
  position: relative;
  aspect-ratio: 1440 / 757;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #050505;
  cursor: zoom-in;
  box-shadow: 0 30px 80px rgba(255, 158, 100, 0.08);
}

.tt-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tt-shot.active { opacity: 1; transform: none; }

.tt-media .featured-pills { margin-top: 16px; }

@media (min-width: 901px) and (min-height: 700px) {
  .js .tt-scroll { height: 420vh; margin-top: -82px; }
  .js .tt-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    padding-top: 96px;
  }
}

@media (max-width: 900px) {
  .tt-card { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .tt-media { order: -1; }
}

/* ---- Más proyectos en horizontal ---- */
.hscroll { position: relative; margin-top: 32px; }

.hscroll-head { margin-bottom: 28px; }

.hscroll-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 0;
}

.hscroll-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

.hscroll-track .project-card {
  flex: 0 0 min(420px, 85vw);
  scroll-snap-align: start;
}

@media (min-width: 901px) and (min-height: 700px) {
  .js .hscroll-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }
  .js .hscroll-sticky {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    --edge: max(24px, calc((100vw - 1000px) / 2 + 24px));
  }
  .js .hscroll-head { padding-left: var(--edge); }
  .js .hscroll-track {
    overflow: visible;
    scroll-snap-type: none;
    will-change: transform;
    padding: 0 var(--edge);
  }
  .js .hscroll-track .project-card { flex-basis: 440px; }
}

/* ---- Cintas del stack ---- */
.marquee {
  width: 100vw;
  margin: 8px 0 48px calc(50% - 50vw);
  overflow: hidden;
  user-select: none;
}

.mq-row {
  white-space: nowrap;
  font-size: clamp(2.6rem, 8vw, 7.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  will-change: transform;
}

.mq-row span { display: inline-block; }
.mq-solid { color: var(--text-primary); }
.mq-outline { color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.45); }
.mq-accent { color: var(--accent); }

/* ---- ¿Hablamos? ---- */
.big-cta {
  text-align: center;
  font-size: clamp(3.5rem, 13vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0 0 40px;
  color: var(--text-primary);
  will-change: transform, opacity;
}

.big-cta .q { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .js .tt-scroll { height: auto; }
  .js .tt-sticky, .js .hscroll-sticky { position: static; height: auto; }
  .js .hscroll-track { overflow-x: auto; }
}

/* ---- Pulido en móvil ---- */
.nav-wrapper { transition: transform 0.35s ease, opacity 0.35s ease; }
.hscroll-hint { display: none; }

@media (max-width: 900px) {
  /* TaraTrack: título, captura, pasos y después el resto */
  .tt-info, .tt-media { display: contents; }
  .tt-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .tt-card .featured-badge { order: 1; align-self: flex-start; }
  .tt-card .featured-title { order: 2; margin: 12px 0 18px; }
  .tt-card .tt-frame { order: 3; }
  .tt-card .tt-steps { order: 4; margin: 20px 0 8px; }
  .tt-card .featured-summary { order: 5; margin: 12px 0 16px; }
  .tt-card .featured-pills { order: 6; margin: 0 0 20px; }
  .tt-card .featured-actions { order: 7; }
  .tt-step-btn { padding: 4px 0; }
}

@media (max-width: 768px) {
  /* la barra se esconde al bajar y vuelve al subir */
  .nav-wrapper.nav-hidden { transform: translateY(-120%); opacity: 0; }

  .story { height: 170vh; }
  .story-text { font-size: clamp(1.7rem, 8vw, 2.4rem); }

  /* carrusel a todo el ancho, con la siguiente tarjeta asomando */
  .hscroll-track {
    margin: 0 -24px;
    padding: 0 24px 8px;
    scroll-padding-left: 24px;
    scrollbar-width: none;
  }
  .hscroll-track::-webkit-scrollbar { display: none; }
  .hscroll-track .project-card { flex-basis: 78vw; }
  .hscroll-hint {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 14px 0 0;
  }

  .big-cta { margin-bottom: 28px; }
  .cta-card { padding: 28px 20px; }

  footer { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-links { flex-wrap: wrap; gap: 10px 18px; }
  .footer-tag { flex-basis: 100%; margin: 0; }
}
