/* ============================================
   Miguel Ángel Fernández — Portfolio
   Cinematic + Interactive (A + D)
   ============================================ */

:root {
  /* Paleta principal */
  --bg:         #f5efe4;
  --bg-2:       #ebe3d3;
  --bg-3:       #ddd0b8;
  --ink:        #1a1208;
  --ink-2:      #3d2f1f;
  --ink-3:      #6b5a47;
  --ink-4:      #8b7a65;
  --line:       rgba(26, 18, 8, 0.12);
  --line-soft:  rgba(26, 18, 8, 0.06);

  /* Acentos */
  --gold:       #c08720;
  --gold-2:     #a06f15;
  --gold-deep:  #7a5510;
  --terra:      #c04a1a;
  --terra-deep: #8c2f0a;

  /* Sección oscura */
  --dark:       #1a1208;
  --dark-2:     #261c0e;
  --dark-line:  rgba(245, 239, 228, 0.15);
  --dark-ink:   #f5efe4;
  --dark-ink-3: #a89880;

  --serif: "Instrument Serif", "Cormorant Garamond", "Times New Roman", serif;
  --sans:  "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(20px, 4vw, 64px);
  --maxw: 1480px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
}

/* Hide cursor on desktop only */
@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; cursor: none; }
button { font: inherit; cursor: none; border: 0; background: 0; color: inherit; }

::selection { background: var(--gold); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.italic-serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.gold { color: var(--gold); }

/* ============================================
   CURSOR PERSONALIZADO
   ============================================ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  transition: width 0.15s ease, height 0.15s ease, background 0.15s ease;
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(192, 135, 32, 0.5);
  border-radius: 50%;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  transform: translate(-50%, -50%);
}
.cursor-ring.hover {
  width: 64px;
  height: 64px;
  border-color: var(--gold);
  background: rgba(192, 135, 32, 0.08);
}
.cursor-dot.hover {
  width: 10px;
  height: 10px;
}

/* ============================================
   SCROLL PROGRESS
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--gold);
  z-index: 100;
  transition: width 0.1s ease;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  background: rgba(245, 239, 228, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: padding 0.3s ease, background 0.3s ease;
}
.nav.scrolled {
  padding: 14px var(--pad);
  background: rgba(245, 239, 228, 0.95);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-logo:hover .logo-mark {
  transform: rotate(-360deg);
}
.logo-text {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 400;
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--bg);
  transition: border-color 0.2s, background 0.2s;
}
.nav-cta:hover {
  border-color: var(--gold);
  background: rgba(192, 135, 32, 0.06);
}
.pulse {
  width: 7px;
  height: 7px;
  background: #2da155;
  border-radius: 50%;
  position: relative;
}
.pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid #2da155;
  border-radius: 50%;
  opacity: 0.6;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px var(--pad) 60px;
  overflow: hidden;
}

.hero-bg-decor {
  position: absolute;
  top: 50%; right: -20%;
  width: 800px; height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 135, 32, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "eyebrow  photo"
    "title    photo"
    "tagline  photo"
    "actions  photo";
  gap: 24px 60px;
  align-items: start;
}

.hero-eyebrow {
  grid-area: eyebrow;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eb-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--ink-4);
}

.hero-title {
  grid-area: title;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.title-line {
  display: block;
  overflow: hidden;
}
.word {
  display: inline-block;
  margin-right: 0.2em;
}
.word.italic-serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.word.gold { color: var(--gold); }
.dot-end {
  color: var(--gold);
  font-family: var(--serif);
}

.hero-side {
  grid-area: photo;
  position: relative;
  height: 100%;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
}

.hero-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-3);
  box-shadow:
    0 20px 60px rgba(26, 18, 8, 0.15),
    0 8px 20px rgba(26, 18, 8, 0.08);
  transform-style: preserve-3d;
  will-change: transform;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: contrast(1.05) saturate(0.9) brightness(0.98);
}

/* Tratamiento duotono cálido sobre la foto */
.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(192, 135, 32, 0.08) 0%,
    transparent 30%,
    transparent 70%,
    rgba(26, 18, 8, 0.18) 100%);
  pointer-events: none;
}

.hero-photo-badge {
  position: absolute;
  top: -28px; right: -28px;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: 50%;
  z-index: 2;
}
.badge-rotate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: rotateBadge 20s linear infinite;
}
@keyframes rotateBadge {
  to { transform: rotate(360deg); }
}
.badge-arrow {
  position: relative;
  z-index: 1;
  font-size: 22px;
  color: var(--gold);
}

.photo-tag {
  position: absolute;
  left: -56px;
  top: 50%;
  transform: rotate(-90deg) translateX(50%);
  transform-origin: left center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.hero-tagline {
  grid-area: tagline;
  max-width: 540px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-2);
  font-weight: 300;
  margin-top: 12px;
}
.hero-tagline strong { color: var(--ink); font-weight: 500; }
.hero-tagline em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.hero-actions {
  grid-area: actions;
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--gold);
  color: var(--ink);
  transform: translateY(-2px);
}
.btn-arrow {
  display: inline-flex;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: transform 0.3s;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
  background: var(--ink);
  color: var(--gold);
}
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.hero-bottom {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 80px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}
.hero-meta {
  display: flex;
  gap: 56px;
}
.hero-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.meta-val {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
}
.scroll-cue {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (max-width: 980px) {
  .hero-content {
    grid-template-columns: 1fr;
    grid-template-areas:
      "eyebrow"
      "photo"
      "title"
      "tagline"
      "actions";
  }
  .hero-side { min-height: auto; }
  .hero-photo-wrap { max-width: 360px; margin: 0 auto; }
  .hero-bottom { flex-direction: column; align-items: start; }
  .hero-meta { gap: 32px; flex-wrap: wrap; }
}

/* ============================================
   MARQUEE
   ============================================ */
.marquee {
  background: var(--ink);
  color: var(--bg);
  padding: 26px 0;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  animation: marquee 32s linear infinite;
}
.m-item {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.m-item.italic-serif {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 32px;
}
.m-dot {
  color: var(--gold);
  font-size: 8px;
  opacity: 0.7;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   SECTION GENERAL
   ============================================ */
.section {
  position: relative;
  padding: 120px 0;
}

.section-head {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  margin-bottom: 80px;
  align-items: end;
}
.section-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}
.section-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.section-lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-3);
  max-width: 540px;
}

@media (max-width: 880px) {
  .section { padding: 80px 0; }
  .section-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 48px; }
}

/* ============================================
   PROJECTS
   ============================================ */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(192, 135, 32, 0.4);
}

.project-visual {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: linear-gradient(135deg, #0d1117 0%, #1a0d28 50%, #0d2018 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(192, 135, 32, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 135, 32, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}
.project-visual-2 {
  background: linear-gradient(135deg, #f5efe4 0%, #ddd0b8 100%);
}
.project-visual-2::before {
  background-image:
    linear-gradient(rgba(26, 18, 8, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 18, 8, 0.08) 1px, transparent 1px);
}

/* Visual con imagen real */
.project-visual-img {
  background: var(--ink);
  padding: 0;
}
.project-visual-img::before { display: none; }
.project-visual-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card:hover .project-visual-img img {
  transform: scale(1.04);
}

.project-visual-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.aetheria-mark {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(192, 135, 32, 0.4);
}
.aetheria-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.4);
  margin-top: 8px;
}
.web-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 80px;
  color: var(--ink);
}
.web-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}
.visual-glow {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 135, 32, 0.2) 0%, transparent 70%);
  top: -50px; right: -50px;
  pointer-events: none;
}

.project-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.project-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  width: fit-content;
}
.project-name {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.project-meta {
  display: flex;
  gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.project-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.project-meta span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.project-meta strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
}
.project-desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-3);
}
.project-desc strong { color: var(--ink); font-weight: 500; }
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-stack span {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--bg);
}
.project-index {
  position: absolute;
  top: 32px; right: 36px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-4);
  opacity: 0.6;
}

@media (max-width: 880px) {
  .project-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .project-name { font-size: 28px; }
}

/* ============================================
   TRAYECTORIA (dark)
   ============================================ */
.section-dark {
  background: var(--dark);
  color: var(--dark-ink);
}
.section-dark .section-num { color: var(--gold); }
.section-dark .section-title { color: var(--dark-ink); }
.section-dark .section-lead { color: var(--dark-ink-3); }

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

.tl-item {
  display: grid;
  grid-template-columns: 200px 1px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--dark-line);
  transition: background 0.3s;
}
.tl-item:hover {
  background: rgba(192, 135, 32, 0.04);
  padding-left: 16px;
  padding-right: 16px;
  margin-left: -16px;
  margin-right: -16px;
}
.tl-item:first-child {
  padding-top: 0;
}
.tl-item:last-child {
  border-bottom: 1px solid var(--dark-line);
}

.tl-year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.tl-line {
  background: var(--dark-line);
  width: 1px;
}
.tl-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tl-role {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  color: var(--dark-ink);
}
.tl-role .italic-serif { color: var(--gold); }
.tl-company {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--dark-ink-3);
}
.tl-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dark-ink-3);
  max-width: 640px;
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tl-tags span {
  padding: 4px 10px;
  border: 1px solid var(--dark-line);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dark-ink-3);
}

.edu-block {
  margin-top: 80px;
}
.edu-block .section-num { display: block; margin-bottom: 24px; }
.edu-card {
  padding: 40px;
  background: rgba(192, 135, 32, 0.06);
  border: 1px solid rgba(192, 135, 32, 0.2);
  border-radius: 8px;
  max-width: 800px;
}
.edu-year {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.edu-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
  color: var(--dark-ink);
}
.edu-card p {
  color: var(--dark-ink-3);
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 880px) {
  .tl-item { grid-template-columns: 1fr; gap: 12px; }
  .tl-line { display: none; }
  .tl-item:hover { padding-left: 0; padding-right: 0; margin: 0; }
}

/* ============================================
   STACK
   ============================================ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stack-col {
  position: relative;
  padding: 32px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s;
}
.stack-col:hover {
  transform: translateY(-6px);
  border-color: rgba(192, 135, 32, 0.4);
}
.stack-num {
  position: absolute;
  top: 16px; right: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-4);
  opacity: 0.5;
}
.stack-col h4 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.stack-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stack-col li {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stack-col li:last-child { border-bottom: none; }
.stack-col li.dim {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  font-style: italic;
}

@media (max-width: 980px) {
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .stack-grid { grid-template-columns: 1fr; }
}

/* ============================================
   CONTACTO / CHAT
   ============================================ */
.section-accent {
  background: var(--bg-2);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: start;
}

#chat-root {
  width: 100%;
}

.chat-frame {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: 0 12px 40px rgba(26, 18, 8, 0.08);
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.chat-head .left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-head .avatar {
  width: 38px;
  height: 38px;
  background: var(--ink);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
}
.chat-head .name {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}
.chat-head .sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.chat-head .right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2da155;
}
.chat-head .right::before {
  content: '';
  width: 6px; height: 6px;
  background: #2da155;
  border-radius: 50%;
}

.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.bubble.bot {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bubble.user {
  background: var(--ink);
  color: var(--bg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.typing span {
  width: 6px; height: 6px;
  background: var(--ink-3);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.chip {
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-2);
  background: var(--bg);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.chip:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(192, 135, 32, 0.05);
}
.chip:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  border-radius: 100px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.chat-input input:focus {
  border-color: var(--gold);
}
.chat-input input::placeholder { color: var(--ink-4); }
.chat-send {
  width: 40px; height: 40px;
  background: var(--ink);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.chat-send:hover:not(:disabled) {
  background: var(--gold);
  color: var(--ink);
  transform: scale(1.05);
}
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aside-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.3s, transform 0.3s;
}
.aside-link:hover {
  border-color: var(--gold);
  transform: translateX(4px);
}
.aside-link .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.aside-link .v {
  font-size: 15px;
  color: var(--ink);
  grid-column: 1;
}
.aside-link .v.italic-serif {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
}
.aside-link .arrow {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 18px;
  color: var(--gold);
  transition: transform 0.3s;
}
.aside-link:hover .arrow { transform: translateX(4px); }

.link-gold {
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  transition: opacity 0.2s;
}
.link-gold:hover { opacity: 0.8; }

@media (max-width: 880px) {
  .contact-layout { grid-template-columns: 1fr; }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 80px 0 40px;
  overflow: hidden;
}
.footer-mega {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(60px, 14vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--bg);
  margin-bottom: 60px;
  white-space: nowrap;
  overflow: hidden;
}
.footer-mega .italic-serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: -0.02em;
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(245, 239, 228, 0.1);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(245, 239, 228, 0.6);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--gold); }
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 880px) {
  .footer-meta { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
