/* ==========================================================================
   SecuencIA — Estudio Audiovisual
   Design tokens: #1a1a1a (base) · #ffffff · #0052ff (accent) · #8a8a93 (muted)
   Type: Inter (display + body), JetBrains Mono (timecodes / labels)
   ========================================================================== */

:root {
  --c-bg: #1a1a1a;
  --c-bg-deep: #131313;
  --c-bg-raised: #212121;
  --c-white: #ffffff;
  --c-blue: #0052ff;
  --c-blue-soft: #3d76ff;
  --c-grey: #8a8a93;
  --c-line: rgba(255, 255, 255, 0.08);
  --c-line-strong: rgba(255, 255, 255, 0.14);

  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --container: 1180px;
  --gutter: clamp(24px, 6vw, 96px);
  --section-pad: clamp(72px, 12vw, 160px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-white);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--c-blue); color: var(--c-white); }

.accent { color: var(--c-blue); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Layout helpers ---------- */
.section {
  padding: var(--section-pad) var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
}
.section--alt {
  max-width: none;
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.section--alt > * { max-width: var(--container); margin-left: auto; margin-right: auto; }
.section--alt { padding-left: var(--gutter); padding-right: var(--gutter); }

.h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.15;
  max-width: 780px;
  margin-bottom: 48px;
}

.frame-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-grey);
  margin-bottom: 20px;
}
.frame-label span {
  color: var(--c-blue);
  font-weight: 500;
}
.frame-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-line-strong);
  margin-left: 8px;
  max-width: 120px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--c-blue);
  color: var(--c-white);
  box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.5);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 82, 255, 0.65);
}
.btn--ghost {
  background: transparent;
  color: var(--c-white);
  border-color: var(--c-line-strong);
}
.btn--ghost:hover {
  border-color: var(--c-white);
  transform: translateY(-2px);
}
.btn--lg { padding: 18px 40px; font-size: 16px; }

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}
body:not(.is-loading) .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.loader__mark { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.loader__bar {
  width: 160px;
  height: 2px;
  background: var(--c-line-strong);
  overflow: hidden;
  border-radius: 2px;
}
.loader__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--c-blue);
  animation: loaderFill 1.1s var(--ease) forwards 0.15s;
}
@keyframes loaderFill { to { width: 100%; } }
.loader__code {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c-grey);
}

body.is-loading { overflow: hidden; }

/* ==========================================================================
   Scroll progress "scrub" bar
   ========================================================================== */
.scrub {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: 3px;
  pointer-events: none;
}
.scrub__track { position: relative; width: 100%; height: 100%; }
.scrub__fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  width: 0%;
  background: var(--c-blue);
}
.scrub__head {
  position: absolute;
  top: 50%; left: 0%;
  width: 8px; height: 8px;
  background: var(--c-white);
  border: 2px solid var(--c-blue);
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: box-shadow 0.2s ease;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.nav {
  position: fixed;
  top: 3px; left: 0; right: 0;
  z-index: 400;
  padding: 22px var(--gutter);
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(26, 26, 26, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--c-line);
}
.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav__links a:not(.nav__cta) { color: var(--c-grey); transition: color 0.25s ease; position: relative; }
.nav__links a:not(.nav__cta):hover { color: var(--c-white); }
.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--c-blue);
  transition: width 0.3s var(--ease);
}
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
  background: var(--c-blue);
  color: var(--c-white);
  padding: 9px 20px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(0, 82, 255, 0.6); }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  z-index: 401;
}
.nav__burger span {
  width: 22px; height: 2px;
  background: var(--c-white);
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px var(--gutter) 100px;
  overflow: hidden;
  text-align: center;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.hero__grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
}
.hero__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, var(--c-bg) 92%);
}
.hero__content { position: relative; z-index: 2; width: min(100%, 960px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--c-grey);
  margin-bottom: 28px;
  padding: 8px 16px;
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
}
.eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-blue);
  box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 82, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 82, 255, 0); }
}

.hero__title {
  /* Fit both nowrap lines inside the content box at every viewport */
  font-size: clamp(18px, calc((100vw - 2 * var(--gutter)) / 20), 52px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 26px;
  width: 100%;
}
.hero__title-line {
  display: block;
  white-space: nowrap;
}
.hero__subtitle {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--c-grey);
  max-width: 620px;
  margin: 0 auto 42px;
}
.hero__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero__timecode {
  position: absolute;
  bottom: 28px; left: var(--gutter);
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-grey);
  z-index: 2;
}
.hero__timecode span:first-child {
  color: var(--c-blue);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.scroll-cue {
  position: absolute;
  bottom: 28px; right: var(--gutter);
  width: 26px; height: 42px;
  border: 1px solid var(--c-line-strong);
  border-radius: 14px;
  background: none;
  z-index: 2;
}
.scroll-cue span {
  display: block;
  width: 4px; height: 4px;
  background: var(--c-blue);
  border-radius: 50%;
  margin: 7px auto 0;
  animation: scrollCue 1.8s infinite;
}
@keyframes scrollCue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   About
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.about__text p {
  color: var(--c-grey);
  margin-top: 18px;
  font-size: 16px;
  max-width: 480px;
}
.about__pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--c-line);
  border: 1px solid var(--c-line);
}
.pillar {
  background: var(--c-bg);
  padding: 28px 24px;
  transition: background 0.3s ease;
}
.pillar:hover { background: var(--c-bg-raised); }
.pillar__index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-blue);
  display: block;
  margin-bottom: 14px;
}
.pillar h3 { font-size: 16px; margin-bottom: 8px; }
.pillar p { color: var(--c-grey); font-size: 14px; line-height: 1.55; }

/* ==========================================================================
   Services
   ========================================================================== */
.services-group { margin-top: 20px; }
.services-group + .services-group { margin-top: 64px; }
.services-group__title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-grey);
  font-weight: 600;
  margin-bottom: 24px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.card {
  background: var(--c-bg-raised);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  padding: 28px 22px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--c-line-strong);
  background: #262626;
}
.card--ia:hover { border-color: rgba(0, 82, 255, 0.45); }
.card__icon { font-size: 26px; margin-bottom: 18px; }
.card h4 { font-size: 15.5px; margin-bottom: 8px; }
.card p { font-size: 13.5px; color: var(--c-grey); line-height: 1.55; }

/* ==========================================================================
   Portfolio gallery (TikTok)
   ========================================================================== */
.section__lead {
  max-width: 34em;
  color: var(--c-grey);
  font-size: 16.5px;
  line-height: 1.55;
  margin: -8px 0 36px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 16px;
}
.gallery--tiktok .gallery__item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  background: var(--c-bg-raised);
  border: 1px solid var(--c-line);
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
}
.gallery__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19;
  background: #000;
  overflow: hidden;
}
.gallery__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.gallery__meta {
  padding: 14px 16px 16px;
}
.gallery__cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-blue-soft);
  margin-bottom: 6px;
  display: block;
}
.gallery__meta h4 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}
.gallery__credit {
  margin-top: 28px;
  font-size: 13.5px;
  color: var(--c-grey);
}
.gallery__credit a {
  color: var(--c-white);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s ease;
}
.gallery__credit a:hover { color: var(--c-blue-soft); }

/* ==========================================================================
   Timeline / Process
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 720px;
  margin-top: 8px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px; left: 27px;
  width: 1px;
  background: var(--c-line-strong);
}
.timeline__item {
  position: relative;
  display: flex;
  gap: 26px;
  padding: 22px 0;
}
.timeline__num {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 1px solid var(--c-line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--c-blue);
  z-index: 1;
}
.timeline__item h4 { font-size: 17px; margin-bottom: 6px; }
.timeline__item p { color: var(--c-grey); font-size: 14.5px; max-width: 480px; }

/* ==========================================================================
   Advantages
   ========================================================================== */
.advantages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--c-line);
  border: 1px solid var(--c-line);
}
.advantage {
  background: var(--c-bg);
  padding: 34px 28px;
  transition: background 0.3s ease;
}
.advantage:hover { background: var(--c-bg-raised); }
.advantage h4 { font-size: 16px; margin-bottom: 10px; }
.advantage h4::before { content: "—  "; color: var(--c-blue); }
.advantage p { color: var(--c-grey); font-size: 14px; line-height: 1.6; }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta {
  position: relative;
  text-align: center;
  padding: clamp(90px, 14vw, 160px) var(--gutter);
  overflow: hidden;
}
.cta__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 82, 255, 0.22), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(0, 82, 255, 0.14), transparent 50%);
}
.cta__title {
  position: relative;
  font-size: clamp(30px, 4.6vw, 52px);
  max-width: 760px;
  margin: 0 auto 18px;
  line-height: 1.1;
}
.cta__subtitle {
  position: relative;
  color: var(--c-grey);
  font-size: 17px;
  margin-bottom: 38px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 72px var(--gutter) 32px;
  border-top: 1px solid var(--c-line);
  background: var(--c-bg-deep);
}
.footer__top {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--c-line);
}
.footer__brand p { color: var(--c-grey); font-size: 13.5px; margin-top: 10px; }
.footer__col h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-grey);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer__col a, .footer__address {
  display: block;
  font-size: 14.5px;
  color: var(--c-white);
  margin-bottom: 10px;
  transition: color 0.25s ease;
}
.footer__col a:hover { color: var(--c-blue-soft); }
.footer__address { color: var(--c-grey); }
.footer__social { display: flex; flex-direction: column; }
.footer__bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-top: 28px;
  font-size: 12.5px;
  color: var(--c-grey);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Back to top
   ========================================================================== */
.to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-bg);
  border: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--c-blue); color: var(--c-white); }

/* ==========================================================================
   Responsive
   ========================================================================== */
/* ---------- Misc helpers ---------- */
.lg-only { display: inline; }

@media (max-width: 980px) {
  .about { grid-template-columns: 1fr; }
  .advantages { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .lg-only { display: none; }
  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 340px);
    height: 100vh;
    background: var(--c-bg-deep);
    border-left: 1px solid var(--c-line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 40px var(--gutter);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links a { font-size: 18px; }
  .nav__burger { display: flex; }

  .about__pillars { grid-template-columns: 1fr; }
  .advantages { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr; }
  .hero__timecode { display: none; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}
