/* ==========================================================================
   Brincalia Studio — estilos
   ========================================================================== */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --night: #0a1240;
  --night-2: #121c5c;
  --night-3: #1a2878;
  --blue: #2f5cf2;
  --blue-bright: #4f7cff;
  --yellow: #ffc83d;
  --yellow-soft: #ffe08a;
  --paper: #f6f8ff;
  --mist: #e6ecff;
  --ink: #0d1433;
  --ink-soft: #4a5277;
  --white: #fff;

  --font-display: "Fredoka", ui-rounded, "Segoe UI Rounded", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(80px, 12vw, 160px);
  --radius: 24px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0;
}
h2 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.75rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); line-height: 1.2; }
p { margin: 0; }
em { font-style: normal; color: var(--blue); }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--yellow);
  color: var(--night);
  font-weight: 800;
  border-radius: 999px;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 3px;
  border-radius: 3px;
  background: var(--yellow);
}

/* ---------- Marca ---------- */
.brand {
  position: relative;
  display: inline-grid;
  justify-items: center;
  text-decoration: none;
  color: var(--white);
  line-height: 1;
  padding-top: 20px;
}
.brand-swoosh {
  position: absolute;
  top: -6px; left: -6px;
  width: calc(100% + 10px);
  height: auto;
  color: var(--yellow);
  pointer-events: none;
}
.brand-star { fill: var(--yellow); }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -.01em;
  text-shadow: 0 2px 0 rgba(10, 18, 64, .35);
}
.brand-sub {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .5em;
  margin-top: 2px;
  margin-right: -.5em;
  text-transform: uppercase;
}

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), height .4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(10, 18, 64, .92);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header.is-scrolled { background: rgba(10, 18, 64, .8); backdrop-filter: blur(14px) saturate(1.3); }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav a {
  position: relative;
  display: block;
  padding: 10px 18px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  border-radius: 999px;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 18px; height: 3px;
  border-radius: 3px;
  background: var(--yellow);
  transform: translateX(-50%) scaleX(0);
  transition: transform .3s var(--ease);
}
.site-nav a:hover { background: rgba(255, 255, 255, .1); }
.site-nav a[aria-current="true"]::after { transform: translateX(-50%) scaleX(1); }

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: var(--white);
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  position: absolute;
  left: 50%;
  width: 20px; height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle-bars { top: 50%; transform: translate(-50%, -50%); }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; transform: translateX(-50%); }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translate(-50%, 7px) rotate(45deg); background: var(--white); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translate(-50%, -7px) rotate(-45deg); background: var(--white); }

@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .brand-word { font-size: 1.65rem; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: radial-gradient(120% 80% at 80% 0%, var(--night-3), var(--night) 60%);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility 0s linear .35s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
  .site-nav ul { flex-direction: column; align-items: center; gap: 8px; }
  .site-nav a { font-size: 2rem; padding: 12px 28px; }
  .site-nav a::after { bottom: 6px; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Botones ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s;
}
.button svg { width: 22px; height: 22px; transition: transform .3s var(--ease); }
.button:hover svg { transform: translateX(4px); }
.button-primary {
  background: var(--yellow);
  color: var(--night);
  box-shadow: 0 10px 30px -10px rgba(255, 200, 61, .8), inset 0 -3px 0 rgba(0, 0, 0, .1);
}
.button-primary:hover { transform: translateY(-2px); background: var(--yellow-soft); }
.button-primary:active { transform: translateY(0); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(640px, 100svh, 980px);
  display: flex;
  align-items: center;
  color: var(--white);
  background: var(--night);
  isolation: isolate;
  overflow: hidden;
}
.hero-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-scene svg { width: 100%; height: 100%; }
.hero-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 11, 46, .7) 0, rgba(6, 11, 46, 0) 150px),
    linear-gradient(90deg, rgba(6, 11, 46, .78) 0%, rgba(6, 11, 46, .45) 32%, rgba(6, 11, 46, 0) 56%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 88%);
  pointer-events: none;
}
.hero-content {
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 180px;
}
.hero-title {
  max-width: 11ch;
  font-size: clamp(2.8rem, 1.2rem + 5.4vw, 6rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.02em;
  text-shadow: 0 4px 30px rgba(6, 11, 46, .4);
}
.hero-accent {
  position: relative;
  display: inline-block;
  color: var(--yellow);
}
.hero-accent svg {
  position: absolute;
  left: 2%; bottom: -.18em;
  width: 96%;
  height: auto;
  color: var(--yellow);
  opacity: .9;
}
.hero-lead {
  max-width: 34ch;
  margin: 32px 0 40px;
  font-size: clamp(1.1rem, 1rem + .45vw, 1.35rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, .92);
}

/* Animaciones de la escena */
.layer { transform: translate3d(var(--px, 0), var(--py, 0), 0); transition: transform .9s var(--ease); }
.bot-float { animation: float 6s ease-in-out infinite; }
.bot-arm { transform-box: fill-box; transform-origin: 10% 90%; animation: wave 4s ease-in-out infinite; }
.bot-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.bot-tip { animation: glow 2.6s ease-in-out infinite; }
.bot-scarf { transform-box: fill-box; transform-origin: 100% 30%; animation: scarf 3s ease-in-out infinite; }
.flag { transform-box: fill-box; transform-origin: 0 50%; animation: flag 2.4s ease-in-out infinite; }
.water { stroke: none; animation: water 1.4s linear infinite; }
.orbit { stroke-dasharray: 520 220; animation: orbit 8s linear infinite; }
.sparkles use { transform-box: fill-box; transform-origin: center; animation: twinkle 3.2s ease-in-out infinite; }
.sparkles use:nth-child(2) { animation-delay: .8s; }
.sparkles use:nth-child(3) { animation-delay: 1.6s; }
.sparkles use:nth-child(4) { animation-delay: 2.1s; }
.sparkles use:nth-child(5) { animation-delay: 1.1s; }
.emblem-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 66px;
  fill: var(--night);
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-14deg); } 80% { transform: rotate(6deg); } 90% { transform: rotate(-10deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes scarf { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(6deg) scaleX(1.04); } }
@keyframes flag { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(.9); } }
@keyframes water { from { opacity: .95; } 50% { opacity: .75; } to { opacity: .95; } }
@keyframes orbit { to { stroke-dashoffset: -740; } }
@keyframes twinkle { 0%, 100% { transform: scale(.4); opacity: .3; } 50% { transform: scale(1); opacity: 1; } }

@media (max-width: 760px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-scene { position: relative; order: 2; inset: auto; aspect-ratio: 16 / 11; margin-top: -24px; }
  .hero-scene svg { position: absolute; inset: 0; }
  .hero-scene::after { background: linear-gradient(180deg, var(--night) 0%, rgba(10, 18, 64, 0) 22%); }
  .hero-content { order: 1; padding-bottom: 20px; background: linear-gradient(180deg, #060b2e, var(--night)); }
  .hero-scene svg { transform: none; }
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--section-y); position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(48px, 7vw, 88px); }
.lead {
  font-size: clamp(1.2rem, 1.05rem + .6vw, 1.55rem);
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
}

/* El estudio */
.studio { padding-top: clamp(40px, 6vw, 80px); }
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.studio-head h2 { max-width: 12ch; }
.studio-body { display: grid; gap: 24px; color: var(--ink-soft); padding-top: 8px; }
.process {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  list-style: none;
  margin: clamp(24px, 4vw, 48px) 0 0;
  padding: 0;
  border-top: 1px solid rgba(13, 20, 51, .12);
}
.process li {
  display: grid;
  gap: 6px;
  padding: 28px 24px 0 0;
  position: relative;
}
.process li::before {
  content: "";
  position: absolute;
  top: -5px; left: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px var(--paper);
}
.process-num { font-family: var(--font-display); font-weight: 500; color: var(--blue); font-size: .95rem; }
.process strong { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; }
.process li > span:last-child { color: var(--ink-soft); font-size: .98rem; }

/* Qué hacemos */
.services {
  background:
    radial-gradient(60% 50% at 100% 0%, rgba(79, 124, 255, .14), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(255, 200, 61, .14), transparent 70%),
    var(--white);
  border-radius: clamp(32px, 5vw, 64px) clamp(32px, 5vw, 64px) 0 0;
}
.areas {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  margin: 0; padding: 0;
  column-gap: clamp(32px, 6vw, 96px);
}
.area {
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 28px;
  row-gap: 10px;
  align-items: start;
  padding-block: 40px;
  border-top: 1px solid rgba(13, 20, 51, .1);
}
.area-art {
  grid-row: 1 / span 2;
  width: 150px;
  height: auto;
  transition: transform .6s var(--ease);
}
.area:hover .area-art { transform: translateY(-6px) rotate(-3deg); }
.area h3 { align-self: end; padding-top: 18px; }
.area p { color: var(--ink-soft); max-width: 36ch; }

/* Filosofía */
.philosophy {
  background:
    radial-gradient(70% 60% at 85% 10%, rgba(47, 92, 242, .45), transparent 70%),
    radial-gradient(40% 50% at 10% 90%, rgba(255, 200, 61, .12), transparent 70%),
    var(--night);
  color: var(--white);
  overflow: hidden;
}
.philosophy::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 32% 68%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 56% 18%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 74% 82%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 90% 40%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 44% 44%, rgba(255,255,255,.4), transparent);
  pointer-events: none;
}
.philosophy .eyebrow { color: var(--yellow); }
.philosophy em { color: var(--yellow); }
.values {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 4vw, 64px);
  list-style: none;
  margin: 0; padding: 0;
}
.values li { display: grid; gap: 16px; align-content: start; }
.value-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 3rem + 5vw, 7.5rem);
  line-height: .9;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 200, 61, .85);
  margin-bottom: 8px;
}
.values p { color: rgba(255, 255, 255, .75); max-width: 32ch; }

/* Contacto */
.contact {
  text-align: center;
  background: linear-gradient(180deg, var(--night) 0, var(--night-2) 100%);
  color: var(--white);
  padding-top: clamp(40px, 6vw, 80px);
}
.contact-inner {
  display: grid;
  justify-items: center;
  padding: clamp(48px, 7vw, 96px) var(--gutter);
  border-radius: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(79, 124, 255, .55), transparent 70%),
    var(--night-3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.contact .eyebrow { color: var(--yellow); }
.contact h2 { font-size: clamp(2.6rem, 1.6rem + 4vw, 5rem); }
.contact-text { margin: 20px 0 36px; max-width: 46ch; color: rgba(255, 255, 255, .8); }
.contact-email { font-family: var(--font-display); font-size: clamp(1.2rem, .9rem + 1.6vw, 2.2rem); font-weight: 500; overflow-wrap: anywhere; }
.contact-email a {
  color: var(--yellow);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .4s var(--ease);
}
.contact-email a:hover { background-size: 100% 2px; }
.pending {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, .35);
  color: rgba(255, 255, 255, .75);
}

/* Footer */
.site-footer {
  background: var(--night-2);
  color: rgba(255, 255, 255, .75);
  padding-block: 48px;
  font-size: .95rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
}
.brand-small { padding-top: 0; }
.brand-small .brand-word { font-size: 1.5rem; }
.brand-small .brand-sub { font-size: .55rem; }
.footer-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }

/* ---------- Revelado al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .areas .reveal:nth-child(2), .js .values .reveal:nth-child(2) { transition-delay: .1s; }
.js .areas .reveal:nth-child(3), .js .values .reveal:nth-child(3) { transition-delay: .2s; }
.js .areas .reveal:nth-child(4) { transition-delay: .3s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .areas { grid-template-columns: 1fr; }
  .process { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}
@media (max-width: 760px) {
  .studio-grid { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr; gap: 48px; }
  .area { grid-template-columns: 96px 1fr; column-gap: 20px; padding-block: 32px; }
  .area-art { width: 96px; }
  .area h3 { padding-top: 4px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 420px) {
  .process { grid-template-columns: 1fr; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Página legal ---------- */
.legal-page .site-header { background: var(--night); }
.legal {
  padding-top: calc(var(--header-h) + clamp(48px, 8vw, 96px));
  padding-bottom: var(--section-y);
}
.legal .container { max-width: calc(760px + var(--gutter) * 2); }
.legal h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); margin-bottom: 32px; }
.legal h2 { font-size: 1.5rem; margin: 48px 0 16px; }
.legal p, .legal li { color: var(--ink-soft); }
.legal p + p { margin-top: 12px; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.legal dt { font-weight: 800; color: var(--ink); }
.legal dd { margin: 0; color: var(--ink-soft); }
.legal .pending { color: #8a5a00; border-color: #e0b44a; background: #fff6dc; font-size: .9rem; padding: 2px 12px; }
.legal .notice { padding: 16px 20px; border-radius: 16px; background: var(--mist); margin-bottom: 32px; color: var(--ink); }
@media (max-width: 520px) { .legal dl { grid-template-columns: 1fr; gap: 4px; } .legal dd { margin-bottom: 12px; } }

.hero-scene.is-paused * { animation-play-state: paused !important; }
@media (max-width: 760px) {
  .site-nav-static { position: static; display: block; opacity: 1; visibility: visible; background: none; }
  .site-nav-static a { font-size: 1rem; padding: 10px 14px; }
}

/* 404 */
.notfound { min-height: 100svh; display: grid; place-items: center; text-align: center; color: var(--white);
  background: radial-gradient(80% 60% at 50% 0%, var(--blue), var(--night) 70%); padding: var(--gutter); }
.notfound-inner { display: grid; justify-items: center; gap: 20px; max-width: 34rem; }
.notfound h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.8rem); }
.notfound .eyebrow { color: var(--yellow); margin: 0; }
.notfound p { color: rgba(255,255,255,.8); }

/* Logotipo oficial (imagen) */
.brand { padding-top: 0; }
.brand-logo { width: 172px; height: auto; }
.brand-small .brand-logo { width: 150px; }
@media (max-width: 760px) { .brand-logo { width: 140px; } }
