:root {
  --bg: #07090d;
  --surface: rgba(16, 22, 32, 0.72);
  --surface-strong: #101620;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f3f6fb;
  --muted: #9aa7bd;
  --cyan: #00f0ff;
  --amber: #ffb347;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  scroll-behavior: auto;
}

body {
  margin: 0;
  overflow-x: clip;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, video {
  display: block;
  max-width: 100%;
}

/* WebGL Canvas fijo */
#webgl-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

#smooth-wrapper {
  position: relative;
  z-index: 2;
}

.container {
  width: min(1240px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05070a;
  display: grid;
  place-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader__inner {
  text-align: center;
  width: min(300px, 80vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.preloader__emblem {
  position: relative;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  margin-bottom: 0.4rem;
}
.preloader__ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.preloader__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2;
}
.preloader__orbit {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 120 220;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.55));
}
.preloader__mark {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 18px rgba(0, 240, 255, 0.22));
}
.preloader__disc {
  fill: #0b0f17;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.5;
}
.preloader__r-part {
  fill: #f3f6fb;
  stroke: var(--cyan);
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .preloader__ring {
    animation: rekoOrbitSpin 1.6s linear infinite;
  }
  .preloader__orbit {
    animation: rekoOrbitDash 1.6s ease-in-out infinite;
  }
  .preloader__mark {
    animation: rekoMarkPulse 1.8s ease-in-out infinite;
  }
  .preloader__r-stem {
    animation: rekoDrawLoop 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  }
  .preloader__r-bowl {
    animation: rekoDrawLoop 1.8s cubic-bezier(0.65, 0, 0.35, 1) 0.14s infinite;
  }
  .preloader__r-leg {
    animation: rekoDrawLoop 1.8s cubic-bezier(0.65, 0, 0.35, 1) 0.28s infinite;
  }
}
@keyframes rekoOrbitSpin {
  to { transform: rotate(270deg); }
}
@keyframes rekoOrbitDash {
  0%, 100% { stroke-dasharray: 70 270; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 190 150; stroke-dashoffset: -70; }
}
@keyframes rekoMarkPulse {
  0%, 100% { transform: scale(0.96); filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.2)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.55)); }
}
@keyframes rekoDrawLoop {
  0% { fill: rgba(243, 246, 251, 0.15); stroke-dashoffset: 180; stroke: var(--cyan); }
  45% { fill: #f3f6fb; stroke-dashoffset: 0; stroke: var(--cyan); }
  75% { fill: #ffffff; stroke-dashoffset: 0; stroke: var(--amber); }
  100% { fill: rgba(243, 246, 251, 0.15); stroke-dashoffset: -180; stroke: var(--cyan); }
}
.preloader__bar {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.12);
  margin: 1rem 0 0.6rem;
  overflow: hidden;
}
.preloader__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width 0.25s ease;
}
.preloader__pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin: 0;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 40;
  background: rgba(255,255,255,0.06);
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}

/* Header */
.site-header {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1240px, 100% - 2rem);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(10, 14, 21, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.brand img {
  border-radius: 50%;
}
.brand small {
  color: var(--cyan);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links .nav-cta {
  color: #07090d;
  background: var(--text);
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
}
.nav-links .nav-cta:hover {
  background: var(--cyan);
  color: #07090d;
}

.motion-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.motion-toggle:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* Sections */
.section {
  padding: clamp(4.5rem, 8vw, 7.5rem) 0;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}
h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.06;
}
h2 {
  font-size: clamp(2rem, 4.2vw, 3.3rem);
}
.section-head {
  margin-bottom: 2.5rem;
}
.section-sub {
  color: var(--muted);
  max-width: 60ch;
  margin: 0.85rem 0 0;
}

/* Hero (Cursor-Reactive 3D Character Stage) */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 6.5rem;
  overflow: hidden;
  background: #07090d;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}
.hero__copy {
  padding: 1.25rem 0;
}
.hero__title {
  font-size: clamp(2.5rem, 5.2vw, 4.4rem);
  margin-bottom: 1.25rem;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
.gradient-text {
  background: linear-gradient(120deg, var(--cyan), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 50ch;
  margin: 0 0 1.75rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1.45rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn--primary {
  background: linear-gradient(135deg, var(--cyan), #49c6ff);
  color: #05070a;
  box-shadow: 0 10px 30px -10px rgba(0, 240, 255, 0.55);
}
.btn--primary:hover {
  box-shadow: 0 14px 36px -6px rgba(0, 240, 255, 0.78), 0 0 0 1px rgba(255, 179, 71, 0.45);
}
.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.btn--ghost:hover {
  border-color: var(--cyan);
}
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.hero__stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text);
}
.hero__stats span {
  font-size: 0.78rem;
  color: var(--muted);
}
.hero__stage-spacer {
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.hero__state-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(7, 9, 13, 0.68);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
}
.hero__state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
#hero-state-label {
  color: var(--text);
}
.hero__state-sep {
  opacity: 0.45;
}

/* Reel & Media cards */
.reel__grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.5rem;
}
.media-card, .case-card, .ai-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.28s ease, border-color 0.28s ease;
}
.media-card:hover, .case-card:hover, .ai-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.45);
}
.media-card__frame, .case-card__media, .ai-card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0f17;
  overflow: hidden;
}
.media-card__frame video,
.case-card__media video,
.case-card__media img,
.ai-card__frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-card__badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(7, 9, 13, 0.82);
  border: 1px solid var(--cyan);
  color: var(--cyan);
}
.media-card__badge--amber {
  border-color: var(--amber);
  color: var(--amber);
}
.media-card__meta, .case-card__body, .ai-card__info {
  padding: 1.2rem 1.3rem;
}
.media-card__meta p, .case-card__body p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* 6 Flagship Cases */
.cases__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.case-card__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  display: block;
  margin-bottom: 0.35rem;
}
.case-card__body h3, .media-card__meta h3, .ai-card__info h3 {
  font-size: 1.18rem;
}

/* AI Motion Lab */
.ai-lab__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.ai-card__frame {
  aspect-ratio: 4 / 5;
}
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  border: 1px solid rgba(255, 179, 71, 0.4);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

/* About */
.about__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 3rem);
  backdrop-filter: blur(12px);
}
.about__concept {
  border-radius: 20px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  width: 100%;
}
.about__caption {
  display: block;
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}
.about__quote {
  font-size: 1.15rem;
  color: var(--text);
  border-left: 3px solid var(--cyan);
  padding-left: 1rem;
  margin: 1.25rem 0;
}
.skills-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.skills-list li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

/* Contact */
.contact__inner {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  backdrop-filter: blur(12px);
}
.contact__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.8rem 0;
}
.contact__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

/* Native Dialog Modal (modern-web-guidance) */
dialog.project-modal {
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  color: var(--text);
  width: min(860px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
}
dialog.project-modal:modal {
  overscroll-behavior: contain;
}
dialog.project-modal::backdrop {
  background: rgba(3, 5, 9, 0.82);
  backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.project-modal__box {
  padding: 1.5rem;
}
.project-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.modal-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.project-modal__media {
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.project-modal__media video,
.project-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project-modal__desc {
  color: var(--muted);
  margin: 1rem 0 0;
}

/* Responsive */
@media (max-width: 960px) {
  .hero__grid,
  .reel__grid,
  .about__grid {
    grid-template-columns: 1fr;
  }
  .cases__grid,
  .ai-lab__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero__copy {
    background: rgba(7, 9, 13, 0.64);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
  }
  .hero__stage-spacer {
    min-height: 56px;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.55rem 0.85rem;
    gap: 0.5rem;
  }
  .brand {
    font-size: 0.88rem;
    gap: 0.45rem;
    white-space: nowrap;
  }
  .brand img {
    width: 28px;
    height: 28px;
  }
  .motion-toggle {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.68rem;
    padding: 0.35rem 0.65rem;
  }
  .nav-links {
    display: none;
  }
  .cases__grid,
  .ai-lab__grid,
  .hero__stats {
    grid-template-columns: 1fr;
  }
  .hero__copy {
    padding: 1.35rem;
  }
}
