/* ============================================================
   MATIAS FONTENLA — CASE STUDIES
   case-study.css  |  v2.0
   ============================================================ */

:root {
  --yellow:       #f7eb71;
  --black:        #0A0A0A;
  --white:        #F7F5F0;
  --gray:         #1A1A1A;
  --mid:          #2E2E2E;
  --accent:       #FF3C3C;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

/* ── PAGE TRANSITION OVERLAY ─────────────────────────────── */
.page-transition {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--yellow);
  transform: translateX(-100%);
  pointer-events: none;
}
.page-transition.enter  { animation: slideIn  .5s var(--ease-out) forwards; }
.page-transition.exit   { animation: slideOut .5s var(--ease-out) forwards; }
@keyframes slideIn  { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(100%); } }

/* ── SCROLL PROGRESS ─────────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: rgba(245,230,66,.15); z-index: 200;
}
.scroll-progress-fill {
  height: 100%; background: var(--yellow);
  transform-origin: left; transform: scaleX(0);
  transition: transform .1s linear;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(247,245,240,.07);
  transition: border-color .3s;
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 4rem; max-width: 1200px; margin: 0 auto;
}
.brand {
  text-decoration: none;
  font-family: var(--font-display); font-size: 1.8rem;
  color: var(--yellow); letter-spacing: .05em;
  transition: opacity .2s;
  position: relative;
}
.brand::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 1px; background: var(--yellow);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.brand:hover { opacity: .8; }
.brand:hover::after { transform: scaleX(1); }
.back-link {
  color: var(--white); text-decoration: none;
  font-family: var(--font-mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em;
  opacity: .7; display: flex; align-items: center; gap: .5rem;
  transition: opacity .2s, color .2s, transform .25s var(--ease-out);
}
.back-link::before { content: '←'; transition: transform .25s; }
.back-link:hover { opacity: 1; color: var(--yellow); transform: translateX(-3px); }

/* ── HERO SECTION ────────────────────────────────────────── */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid rgba(247,245,240,.08);
  background: radial-gradient(ellipse 70% 60% at 80% 25%, rgba(245,230,66,.07) 0%, transparent 70%), var(--black);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -60px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255,255,255,.012) 60px, rgba(255,255,255,.012) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,.012) 60px, rgba(255,255,255,.012) 61px);
  animation: heroBgShift 20s ease-in-out infinite alternate;
  will-change: transform;
}
.hero > * {
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .hero {
    min-height: 80vh !important;
  }
  }
@keyframes heroBgShift {
  to { transform: translate3d(30px, 30px, 0); }
}

.eyebrow {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--yellow); margin-bottom: 1rem;
  opacity: 0; transform: translateY(12px);
  animation: fadeUp .7s .2s var(--ease-out) forwards;
  display: flex; align-items: center; gap: .7rem;
}
.eyebrow::before { content: ''; display: block; width: 28px; height: 1px; background: var(--yellow); }

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  line-height: .95; letter-spacing: .02em; margin-bottom: 1.5rem;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp .85s .35s var(--ease-out) forwards;
}
.hero-desc {
  max-width: 780px; color: rgba(247,245,240,.7); font-size: 1.02rem;
  margin-bottom: 2.5rem;
  opacity: 0; transform: translateY(14px);
  animation: fadeUp .7s .5s var(--ease-out) forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── KPI ROW ─────────────────────────────────────────────── */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
  opacity: 0; transform: translateY(16px);
  animation: fadeUp .7s .65s var(--ease-out) forwards;
}
.kpi {
  background: var(--gray);
  border: 1px solid rgba(245,230,66,.15); padding: 1.2rem;
  position: relative; overflow: hidden;
  transition: border-color .3s, transform .35s var(--ease-out);
}
.kpi:hover { border-color: rgba(245,230,66,.4); transform: translateY(-3px); }
/* shimmer */
.kpi::before {
  content: '';
  position: absolute; top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.03), transparent);
  transition: left .6s var(--ease-out);
}
.kpi:hover::before { left: 140%; }
.kpi-value {
  font-family: var(--font-display); color: var(--yellow);
  font-size: 2.2rem; line-height: 1;
}
.kpi-label {
  font-family: var(--font-mono); font-size: .62rem;
  text-transform: uppercase; letter-spacing: .1em;
  opacity: .65; margin-top: .35rem;
}

/* ── CONTAINER ───────────────────────────────────────────── */
.container { width: min(1140px, 92%); margin: 0 auto; }

/* ── SECTIONS ────────────────────────────────────────────── */
section { padding: 4rem 0; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 1.4rem;
  letter-spacing: .02em; line-height: 1;
}
.section-title span { color: var(--yellow); }

/* ── CARDS ───────────────────────────────────────────────── */
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.card {
  background: var(--gray);
  border: 1px solid rgba(247,245,240,.07); padding: 1.6rem;
  position: relative; overflow: hidden;
  transition: border-color .3s, transform .35s var(--ease-out);
}
.card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--yellow);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease-out);
}
.card:hover { border-color: rgba(245,230,66,.2); transform: translateY(-3px); }
.card:hover::after { transform: scaleX(1); }
.card h3 {
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .12em; font-size: .68rem;
  color: var(--yellow); margin-bottom: 1rem;
}
.card p, .card li { color: rgba(247,245,240,.75); font-size: .94rem; }
.card ul { padding-left: 1.1rem; }
.card li + li { margin-top: .45rem; }

/* ── TIMELINE ────────────────────────────────────────────── */
.timeline { display: grid; gap: .9rem; }
.timeline-item {
  border-left: 2px solid rgba(245,230,66,.3);
  background: var(--gray); padding: 1.2rem 1.2rem 1.2rem 1.4rem;
  position: relative;
  transition: border-color .3s, transform .35s var(--ease-out);
}
.timeline-item::before {
  content: '';
  position: absolute; left: -5px; top: 1.4rem;
  width: 8px; height: 8px;
  background: var(--yellow); border-radius: 50%;
  transform: scale(0);
  transition: transform .35s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
}
.timeline-item:hover { border-color: var(--yellow); transform: translateX(6px); }
.timeline-item:hover::before { transform: scale(1); }
.timeline-item strong {
  font-family: var(--font-mono); font-size: .67rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--yellow); display: block; margin-bottom: .4rem;
}

/* ── GALLERY (MOCKUPS) ───────────────────────────────────── */
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.gallery-side { display: grid; gap: 1rem; grid-template-rows: 1fr 1fr; }

.mock {
  border: 1px solid rgba(247,245,240,.1);
  background: linear-gradient(135deg, #101010, #202020);
  border-radius: 8px; aspect-ratio: 16/10;
  background-size: cover !important;
  background-position: top center !important;
  position: relative; overflow: hidden;
  transition: transform .45s var(--ease-out), border-color .3s, box-shadow .4s;
}
.mock:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(245,230,66,.25);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
/* placeholder shimmer when no image */
.mock:not([style*="url"])::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 60%; height: 100%;
  background: linear-gradient(90deg,
    transparent 0, rgba(255,255,255,.03) 50%, transparent 100%);
  animation: shimmer 2.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes shimmer {
  from { transform: translateX(-120%); }
  to   { transform: translateX(300%); }
}

/* ── CTA ─────────────────────────────────────────────────── */
.cta {
  background: var(--yellow); color: var(--black);
  padding: 2.5rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.5rem; flex-wrap: wrap;
  margin: 1rem 0 4rem;
  position: relative; overflow: hidden;
}
/* animated bg lines */
.cta::before {
  content: '';
  position: absolute; inset: -60px;
  background: repeating-linear-gradient(
    -45deg, transparent 0, transparent 30px,
    rgba(0,0,0,.03) 30px, rgba(0,0,0,.03) 31px
  );
  animation: ctaStripe 6s linear infinite;
  will-change: transform;
}
@keyframes ctaStripe {
  to { transform: translate3d(60px, 0, 0); }
}
.cta h3 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1; max-width: 600px;
  position: relative; z-index: 1;
}
.btn {
  background: var(--black); color: var(--yellow);
  text-decoration: none; padding: .9rem 1.6rem;
  font-family: var(--font-mono); font-weight: 700;
  text-transform: uppercase; font-size: .72rem; letter-spacing: .1em;
  display: inline-block; position: relative; z-index: 1;
  transition: background .25s, color .25s, transform .25s, box-shadow .25s;
  overflow: hidden;
}
.btn::before {
  content: 'Hablemos';
  position: absolute; inset: 0;
  background: var(--accent);
  transform: translateX(-110%) skewX(-15deg);
  transition: transform .4s var(--ease-out);
}
.btn:hover{background:#1a1a1a ;}
.btn span { position: relative; z-index: 1; }

/* ── SCROLL REVEAL ───────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .topbar-inner { padding: 1rem 1.5rem; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .two-cols { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .gallery-side { grid-template-columns: 1fr; }
  .cta { flex-direction: column; }
  .brand{font-size: 20px;}
}
.cursor {
  width: 10px; height: 10px;
  background: var(--yellow);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .2s var(--ease-spring), height .2s var(--ease-spring),
              background .2s;
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(245,230,66,.5);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width .35s var(--ease-out), height .35s var(--ease-out),
              opacity .25s, border-color .25s;
}
body:has(a:hover) .cursor,
body:has(button:hover) .cursor { width: 18px; height: 18px; }

@media (pointer: coarse) {
  #cursor,
  #cursorRing,
  .cursor,
  .cursor-ring {
    display: none !important;
  }
}
