/* =====================
   TOKENS & THEME
   ===================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;1,400&family=DM+Sans:wght@300;400&display=swap');

:root {
  --accent: #b8a98a;
  --transition-theme: background 0.4s, color 0.4s, border-color 0.4s;
}

[data-theme="dark"] {
  --bg: #0c0c0b;
  --bg-hover: #141412;
  --text: #e8e4dc;
  --muted: rgba(232, 228, 220, 0.45);
  --muted2: rgba(232, 228, 220, 0.22);
  --sep: rgba(255, 255, 255, 0.07);
  --sep-strong: rgba(255, 255, 255, 0.18);
}

[data-theme="light"] {
  --bg: #f7f5f0;
  --bg-hover: #eeebe3;
  --text: #1a1a18;
  --muted: rgba(26, 26, 24, 0.5);
  --muted2: rgba(26, 26, 24, 0.28);
  --sep: rgba(0, 0, 0, 0.08);
  --sep-strong: rgba(0, 0, 0, 0.2);
}


/* =====================
   RESET & BASE
   ===================== */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  transition: var(--transition-theme);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 400;
}

/* Canvas 3D hero */
#hero-canvas {
  position: absolute;
  top: 0;
  right: -20%;
  width: 60%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

#hero-canvas.loaded {
  opacity: 1;
}

@media (max-width: 640px) {
  #hero-canvas {
    width: 100%;
    opacity: 0.15;
  }
}


/* =====================
   SCROLL PROGRESS BAR
   ===================== */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}


/* =====================
   CUSTOM CURSOR
   ===================== */

#cursor-dot {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
  transition: width 0.2s, height 0.2s, top 0.2s, left 0.2s, opacity 0.2s;
}

#cursor-ring {
  position: fixed;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  will-change: transform;
  opacity: 0.5;
  transition: width 0.25s, height 0.25s, top 0.25s, left 0.25s, opacity 0.25s, border-color 0.25s;
}

#cursor-dot.expanded {
  width: 12px;
  height: 12px;
  top: -6px;
  left: -6px;
  opacity: 0.6;
}

#cursor-ring.expanded {
  width: 56px;
  height: 56px;
  top: -28px;
  left: -28px;
  opacity: 0.25;
}


/* =====================
   NAV
   ===================== */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 0.5px solid var(--sep);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  transition: var(--transition-theme);
}

.nav__logo {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  letter-spacing: 0.05em;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__links a {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--text);
}

.theme-toggle {
  width: 40px;
  height: 22px;
  border-radius: 100px;
  border: 0.5px solid var(--sep-strong);
  background: transparent;
  cursor: none;
  position: relative;
  transition: border-color 0.4s;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.35s, background 0.35s;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(18px);
}

[data-theme="light"] .theme-toggle::after {
  transform: translateX(0);
}


/* =====================
   HERO
   ===================== */

.hero {
  padding: 5rem 2rem 4.5rem;
  border-bottom: 0.5px solid var(--sep);
  position: relative;
  overflow: hidden;
}

.hero__label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__label::before {
  content: '';
  display: block;
  width: 24px;
  height: 0.5px;
  background: var(--muted2);
}

.hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(44px, 7vw, 74px);
  line-height: 1.05;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__sub {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  max-width: 340px;
  line-height: 1.85;
  margin-bottom: 2.5rem;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  border: 0.5px solid var(--sep-strong);
  padding: 10px 22px;
  border-radius: 100px;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}

.hero__cta:hover {
  background: var(--bg-hover);
  border-color: var(--text);
}

.hero__scroll {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted2);
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.hero__scroll::after {
  content: '';
  display: block;
  width: 0.5px;
  height: 36px;
  background: var(--muted2);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {

  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(1);
  }

  50% {
    opacity: 1;
    transform: scaleY(0.6);
  }
}


/* =====================
   WORK & GRID
   ===================== */

.work {
  padding: 3rem 2rem;
  border-bottom: 0.5px solid var(--sep);
}

.work__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
}

.work__title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
}

.work__count {
  font-size: 12px;
  color: var(--muted2);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--sep);
}


/* =====================
   CARDS + TILT
   ===================== */

.card {
  background: var(--bg);
  transition: background 0.25s, transform 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.card:hover {
  background: var(--bg-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.card--featured {
  grid-column: span 2;
}

.card__link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem;
  min-height: 160px;
  position: relative;
  height: 100%;
}

.card--featured .card__link {
  min-height: 200px;
}

.card__num {
  font-size: 11px;
  color: var(--muted2);
  display: block;
  margin-bottom: auto;
}

.card__info {
  margin-top: auto;
}

.card__cat {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.card__name {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  color: var(--text);
  transition: color 0.2s;
}

.card:hover .card__name {
  color: var(--accent);
}

.card__arrow {
  position: absolute;
  right: 1.75rem;
  bottom: 1.75rem;
  font-size: 18px;
  color: var(--accent);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.25s, transform 0.25s;
}

.card:hover .card__arrow {
  opacity: 1;
  transform: translate(0, 0);
}


.card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.08;
  transition: opacity 0.3s ease;
}

.card:hover .card__thumb {
  opacity: 0.5;
}

.card__link {
  position: relative;
  /* asegúrate de que ya lo tiene */
}


/* =====================
   SCROLL REVEAL
   ===================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* =====================
   ABOUT
   ===================== */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 0.5px solid var(--sep);
}

.about__left {
  padding: 3rem 2rem;
  border-right: 0.5px solid var(--sep);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about__right {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 0.75rem;
}

.about__title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  line-height: 1.2;
}

.about__body {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.85;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills li {
  font-size: 12px;
  padding: 4px 14px;
  border: 0.5px solid var(--sep-strong);
  border-radius: 100px;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}

.skills li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.about__email {
  display: block;
  font-size: 14px;
  color: var(--accent);
  margin-top: 0.5rem;
  transition: opacity 0.2s;
}

.about__email:hover {
  opacity: 0.7;
}


/* =====================
   FOOTER
   ===================== */

.footer {
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: 12px;
  color: var(--muted2);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--text);
}


/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 640px) {

  #cursor-dot,
  #cursor-ring {
    display: none;
  }

  .nav {
    padding: 1.25rem;
  }

  .nav__links {
    display: none;
  }

  .hero {
    padding: 3rem 1.25rem 3.5rem;
  }

  .hero__scroll {
    display: none;
  }

  #hero-canvas {
    display: none;
  }

  .work {
    padding: 2rem 1.25rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card--featured {
    grid-column: span 1;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about__left {
    border-right: none;
    border-bottom: 0.5px solid var(--sep);
    padding: 2rem 1.25rem;
  }

  .about__right {
    padding: 2rem 1.25rem;
  }

  .footer {
    padding: 1.25rem;
  }
}





/* Text Marquee */

.marquee-wrap {
  border-top: 0.5px solid var(--sep);
  border-bottom: 0.5px solid var(--sep);
  padding: 0.65rem 0;
  overflow: hidden;
}

.marquee {
  display: flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: marquee 18s linear infinite;
}

.marquee span {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted2);
}

.marquee__dot {
  color: var(--accent) !important;
  font-size: 8px;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}



.stack {
  position: relative;
  padding: 2rem;
}

.stack__card {
  position: sticky;
  top: calc(80px + var(--i) * 16px);
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-hover);
  border: 0.5px solid var(--sep);
  transition: box-shadow 0.3s;
  will-change: transform;
}

.stack__card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.stack__link {
  display: block;
  position: relative;
}

.stack__img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.stack__card:hover .stack__img {
  transform: scale(1.03);
}

.stack__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}

.stack__num {
  font-size: 11px;
  color: var(--muted2);
  flex-shrink: 0;
}

.stack__cat {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.stack__name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
}

.stack__arrow {
  font-size: 20px;
  color: var(--muted2);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}

.stack__card:hover .stack__arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}