/* —— Intro Neora → DocuFlow —— */
.brand-intro {
  --intro-cyan: #00AEEF;
  --intro-cyan-deep: #0082C6;
  --intro-neora-ink: #2D3136;
  --intro-blue: #0B5FFF;
  --intro-mid: #3B82F6;
  --intro-light: #7CC4F4;
  --intro-night: #06091A;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, #142048 0%, var(--intro-night) 55%, #03050f 100%);
  color: #fff;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.7s;
}

.brand-intro.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.brand-intro.is-standalone {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.brand-intro.is-standalone.is-done {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modo embebido: hero / espacio visual */
.brand-intro-skip.is-hidden {
  display: none !important;
}

.brand-intro.is-embedded {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  min-height: 0;
}

.brand-intro.is-embedded.is-done {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.brand-intro.is-embedded .brand-intro-skip {
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.65rem;
}

.brand-intro.is-embedded .brand-intro-stage {
  width: min(92%, 28rem);
  min-height: 8rem;
  padding: 1rem;
}

.brand-intro.is-embedded .intro-neora-mark {
  max-width: min(70%, 16rem);
}

.brand-intro.is-embedded .intro-core {
  min-width: min(72%, 18rem);
  min-height: 3.5rem;
}

.brand-intro.is-embedded .intro-code {
  font-size: clamp(0.62rem, 1.8vw, 0.82rem);
  min-height: 3.6em;
}

.brand-intro.is-embedded .intro-df-mark-wrap {
  width: clamp(3.4rem, 10vw, 5rem);
  height: clamp(4.4rem, 13vw, 6.5rem);
}

.brand-intro.is-embedded .intro-df-name {
  font-size: clamp(1.35rem, 3.5vw, 2rem);
}

.brand-intro.is-embedded .intro-df-tag {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
}

.brand-intro.is-embedded .brand-intro-glow {
  width: 16rem;
  height: 16rem;
}

.brand-intro.is-embedded[data-phase="code"] .intro-bracket {
  width: clamp(1.6rem, 4vw, 2.4rem);
}

.brand-intro-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  animation: introGridIn 1.2s ease both;
}

.brand-intro-glow {
  position: absolute;
  width: 28rem;
  height: 28rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(11, 95, 255, 0.35), transparent 68%);
  filter: blur(20px);
  opacity: 0;
  transition: opacity 0.8s ease, transform 1.2s ease;
}

.brand-intro[data-phase="code"] .intro-neora,
.brand-intro[data-phase="reveal"] .intro-neora {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.brand-intro[data-phase="code"] .intro-bracket,
.brand-intro[data-phase="reveal"] .intro-bracket {
  width: clamp(2.4rem, 6vw, 3.4rem);
}

.brand-intro[data-phase="reveal"] .intro-bracket--l {
  animation: introBracketIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-intro[data-phase="reveal"] .intro-bracket--r {
  animation: introBracketIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.brand-intro.is-embedded[data-phase="code"] .intro-bracket,
.brand-intro.is-embedded[data-phase="reveal"] .intro-bracket {
  width: clamp(1.6rem, 4vw, 2.4rem);
}

.brand-intro[data-phase="code"] .brand-intro-glow,
.brand-intro[data-phase="reveal"] .brand-intro-glow,
.brand-intro[data-phase="morph"] .brand-intro-glow,
.brand-intro[data-phase="docuflow"] .brand-intro-glow {
  opacity: 1;
}

.brand-intro[data-phase="reveal"] .brand-intro-glow {
  transform: scale(1.2);
  background: radial-gradient(circle, rgba(0, 174, 239, 0.38), rgba(11, 95, 255, 0.2), transparent 70%);
}

.brand-intro[data-phase="reveal"] .intro-code {
  opacity: 1;
  transform: none;
  font-size: clamp(0.72rem, 2vw, 0.98rem);
  line-height: 1.65;
  text-align: left;
}

.brand-intro.is-embedded[data-phase="reveal"] .intro-code {
  font-size: clamp(0.58rem, 1.55vw, 0.78rem);
  line-height: 1.55;
}

.brand-intro[data-phase="reveal"] .intro-core {
  min-width: min(78vw, 34rem);
}

.brand-intro.is-embedded[data-phase="reveal"] .intro-core {
  min-width: min(88%, 22rem);
}

.intro-code .tok-cmt {
  color: #64748b;
  font-style: italic;
}

.intro-code .tok-reveal {
  display: inline;
  font-family: Sora, Inter, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.05em;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.intro-code .tok-reveal--punch {
  font-weight: 700;
  font-size: 1.12em;
  background: linear-gradient(90deg, #ffffff 0%, #7CC4F4 42%, #0B5FFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(11, 95, 255, 0.35));
  animation: introPunchIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes introPunchIn {
  from { opacity: 0.35; letter-spacing: 0.04em; filter: blur(4px) drop-shadow(0 0 0 transparent); }
  to { opacity: 1; letter-spacing: -0.02em; filter: blur(0) drop-shadow(0 0 18px rgba(11, 95, 255, 0.35)); }
}

.brand-intro[data-phase="morph"] .brand-intro-glow {
  transform: scale(1.35);
  background: radial-gradient(circle, rgba(0, 174, 239, 0.4), rgba(11, 95, 255, 0.22), transparent 70%);
}

.brand-intro-skip {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.9);
  font: 500 0.75rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  border-radius: 9999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.brand-intro-skip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(124, 196, 244, 0.45);
  color: #fff;
}

.brand-intro-stage {
  position: relative;
  width: min(92vw, 44rem);
  min-height: 12rem;
  display: grid;
  place-items: center;
}

.intro-neora,
.intro-docuflow {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.55s ease;
}

.intro-neora {
  opacity: 0;
  transform: scale(0.92);
  filter: blur(8px);
}

.brand-intro[data-phase="brackets"] .intro-neora,
.brand-intro[data-phase="code"] .intro-neora {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.brand-intro[data-phase="morph"] .intro-neora {
  opacity: 0;
  transform: scale(1.08) translateY(-0.5rem);
  filter: blur(12px);
}

.brand-intro[data-phase="docuflow"] .intro-neora,
.brand-intro[data-phase="hold"] .intro-neora {
  opacity: 0;
  pointer-events: none;
}

.intro-bracket {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  color: var(--intro-cyan);
  filter: drop-shadow(0 0 18px rgba(0, 174, 239, 0.45));
  opacity: 0;
  transform: translateY(0.4rem) scale(0.92);
  transition: width 0.35s ease;
}

.brand-intro[data-phase="code"] .intro-bracket {
  width: clamp(2.4rem, 6vw, 3.4rem);
}

.brand-intro[data-phase="code"] .intro-bracket--l {
  animation: introBracketIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-intro[data-phase="code"] .intro-bracket--r {
  animation: introBracketIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.intro-bracket svg {
  width: 100%;
  height: auto;
  display: block;
}

.intro-core {
  position: relative;
  min-width: min(70vw, 28rem);
  min-height: 4.5rem;
  display: grid;
  place-items: center;
}

.brand-intro.is-preload {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.intro-neora-mark {
  grid-area: 1 / 1;
  max-width: min(72vw, 26rem);
  width: 100%;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.45s ease, filter 0.45s ease;
  filter: drop-shadow(0 0 22px rgba(0, 174, 239, 0.28));
}

.intro-neora-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.brand-intro[data-phase="code"] .intro-neora-mark,
.brand-intro[data-phase="reveal"] .intro-neora-mark,
.brand-intro[data-phase="morph"] .intro-neora-mark {
  opacity: 0;
  transform: scale(0.94);
  filter: blur(8px);
  pointer-events: none;
}

.intro-code {
  grid-area: 1 / 1;
  margin: 0;
  padding: 0.35rem 0.25rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(0.78rem, 2.1vw, 1.05rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  width: 100%;
  opacity: 0;
  transform: translateY(0.35rem);
  min-height: 4.2em;
}

.brand-intro[data-phase="code"] .intro-code {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s ease 0.05s, transform 0.35s ease 0.05s;
}

.intro-code .tok-kw { color: #7DD3F5; }
.intro-code .tok-fn { color: #00AEEF; }
.intro-code .tok-str { color: #5BC7F0; }
.intro-code .tok-pun { color: #94a3b8; }
.intro-code .tok-bool { color: #0082C6; }

.intro-cursor {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  color: var(--intro-cyan);
  animation: introBlink 0.85s steps(1) infinite;
  text-shadow: 0 0 10px rgba(0, 174, 239, 0.8);
}

.intro-cursor.is-hidden {
  display: none;
}

.intro-docuflow {
  flex-direction: column;
  gap: 1.1rem;
  opacity: 0;
  transform: scale(0.82);
  filter: blur(10px);
}

.brand-intro[data-phase="docuflow"] .intro-docuflow,
.brand-intro[data-phase="hold"] .intro-docuflow {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.intro-df-mark-wrap {
  position: relative;
  width: clamp(4.5rem, 12vw, 6.5rem);
  height: clamp(5.8rem, 15vw, 8.5rem);
}

.intro-df-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(11, 95, 255, 0.55));
  animation: introMarkSettle 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-df-ring {
  position: absolute;
  inset: -18%;
  border-radius: 9999px;
  border: 1px solid rgba(124, 196, 244, 0.25);
  opacity: 0;
  transform: scale(0.7);
}

.brand-intro[data-phase="docuflow"] .intro-df-ring,
.brand-intro[data-phase="hold"] .intro-df-ring {
  animation: introRing 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.intro-df-name {
  font-family: Sora, Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #fff 0%, #7CC4F4 45%, #0B5FFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(0.6rem);
}

.brand-intro[data-phase="docuflow"] .intro-df-name,
.brand-intro[data-phase="hold"] .intro-df-name {
  animation: introFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.intro-df-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
  opacity: 0;
  transform: translateY(0.45rem);
}

.brand-intro[data-phase="docuflow"] .intro-df-tag,
.brand-intro[data-phase="hold"] .intro-df-tag {
  animation: introFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}

.brand-intro-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.55), rgba(34, 211, 238, 0.25) 28%, transparent 62%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.brand-intro[data-phase="morph"] .brand-intro-flash {
  animation: introFlash 0.75s ease-out both;
}

.brand-intro-scan {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  top: 50%;
  background: linear-gradient(90deg, transparent, var(--intro-cyan), var(--intro-cyan-deep), transparent);
  opacity: 0;
  filter: blur(0.5px);
  box-shadow: 0 0 24px rgba(0, 174, 239, 0.65);
}

.brand-intro[data-phase="morph"] .brand-intro-scan {
  animation: introScan 0.7s ease-in-out both;
}

@keyframes introGridIn {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 0.35; transform: scale(1); }
}

@keyframes introBracketIn {
  from { opacity: 0; transform: translateY(0.55rem) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes introBlink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes introFlash {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes introScan {
  0% { opacity: 0; transform: translateY(-4rem) scaleX(0.4); }
  40% { opacity: 1; transform: translateY(0) scaleX(1); }
  100% { opacity: 0; transform: translateY(4rem) scaleX(0.45); }
}

@keyframes introMarkSettle {
  from { opacity: 0; transform: scale(0.6) rotate(-8deg); filter: drop-shadow(0 0 40px rgba(34, 211, 238, 0.8)); }
  to { opacity: 1; transform: scale(1) rotate(0); filter: drop-shadow(0 0 28px rgba(11, 95, 255, 0.55)); }
}

@keyframes introRing {
  from { opacity: 0; transform: scale(0.65); }
  50% { opacity: 0.8; }
  to { opacity: 0; transform: scale(1.25); }
}

@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(0.6rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-intro *,
  .brand-intro *::before,
  .brand-intro *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
