/* ========================================================
   DALTORA AI SOLUTIONS · Sistema Editorial + Acto Oscuro
   ======================================================== */

:root {
    --bg: #F6F4EE;
    --bg2: #FFFFFF;
    --bg3: #ECE9E1;
    --ink: #14201E;
    --mute: #5C6966;
    --faint: #98A39F;
    --teal: #0F766E;
    --teal-deep: #0B5E58;
    --teal-soft: rgba(15, 118, 110, 0.10);
    --teal-glow: rgba(15, 118, 110, 0.26);
    --line: rgba(20, 32, 30, 0.10);
    --line2: rgba(20, 32, 30, 0.18);

    --dip: #0A1413;
    --dip-ink: #E7EFEC;
    --dip-mute: #86958F;
    --dip-teal: #3CCFBB;
    --dip-teal-hover: #63dccb;
    --dip-line: rgba(231, 239, 236, 0.10);

    --sans: 'Archivo', system-ui, -apple-system, sans-serif;
    --ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }

html {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    overflow-x: clip;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ================= CURSOR PERSONALIZADO ================= */
@media (pointer: fine) {
    body.custom-cursor-ready,
    body.custom-cursor-ready a,
    body.custom-cursor-ready button,
    body.custom-cursor-ready input[type="range"] {
        cursor: none;
    }
}

.cur-dot,
.cur-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate3d(-100px, -100px, 0);
    transition: opacity .25s ease, width .25s var(--ease-out), height .25s var(--ease-out), border-color .25s ease, background-color .25s ease;
    opacity: 0;
}

.cur-dot {
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    background: var(--teal);
}

.cur-ring {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid rgba(15, 118, 110, 0.45);
}

.cur-ring.hover {
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    background: rgba(15, 118, 110, 0.08);
    border-color: var(--teal);
}

body.cursor-dark .cur-dot { background: var(--dip-teal); }
body.cursor-dark .cur-ring { border-color: rgba(60, 207, 187, 0.55); }
body.cursor-dark .cur-ring.hover { background: rgba(60, 207, 187, 0.12); border-color: var(--dip-teal); }

@media (pointer: coarse), (max-width: 900px) {
    .cur-dot, .cur-ring { display: none !important; }
}

/* ================= NAVBAR ADAPTATIVA ================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 14px 20px;
    pointer-events: none;
}

.nav-in {
    pointer-events: auto;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: max-width .5s var(--ease-out), background-color .35s ease, border-color .35s ease, box-shadow .35s ease, padding .35s ease, color .3s ease;
}

.nav.scrolled .nav-in {
    max-width: 880px;
    padding: 8px 10px 8px 18px;
    background-color: rgba(246, 244, 238, 0.74);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-color: var(--line);
    box-shadow: 0 12px 40px -12px rgba(20, 32, 30, 0.12);
}

.nav.nav-dark .nav-in { color: var(--dip-ink); }
.nav.scrolled.nav-dark .nav-in {
    background-color: rgba(10, 20, 19, 0.62);
    border-color: var(--dip-line);
    box-shadow: 0 14px 44px -10px rgba(0, 0, 0, 0.55);
}

.nav-links a {
    position: relative;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    opacity: .78;
    transition: opacity .2s ease;
    padding: 4px 0;
    text-decoration: none;
}
.nav-links a:hover { opacity: 1; }
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .3s var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); }

/* ================= BOTONES PILL (.eb) ================= */
.eb {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 6px 6px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -.01em;
    transition: transform .2s var(--ease-out), background-color .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease;
    text-decoration: none;
    white-space: nowrap;
}
.eb:active { transform: scale(.97); }
.eb-i {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s var(--ease-out), background-color .25s ease;
    flex-shrink: 0;
}
.eb:hover .eb-i { transform: translate(2px, -1px) scale(1.06); }

.eb-primary {
    background: var(--teal);
    color: #ffffff;
    box-shadow: 0 12px 30px -8px var(--teal-glow);
}
.eb-primary:hover {
    background: var(--teal-deep);
    box-shadow: 0 16px 36px -8px rgba(15, 118, 110, 0.42);
}
.eb-primary .eb-i { background: rgba(255, 255, 255, 0.16); color: #fff; }

.eb-ghost {
    background: rgba(255, 255, 255, 0.65);
    color: var(--ink);
    border: 1px solid var(--line2);
}
.eb-ghost:hover { background: #fff; border-color: var(--ink); }
.eb-ghost .eb-i { background: var(--teal-soft); color: var(--teal); }

.eb-teal-bright {
    background: var(--dip-teal);
    color: #05201b;
    font-weight: 600;
    box-shadow: 0 12px 32px -8px rgba(60, 207, 187, 0.38);
}
.eb-teal-bright:hover { background: var(--dip-teal-hover); }
.eb-teal-bright .eb-i { background: rgba(5, 32, 27, 0.12); color: #05201b; }

.eb-sm { padding: 4px 4px 4px 15px; font-size: 13.5px; }
.eb-sm .eb-i { width: 28px; height: 28px; }

/* ================= HERO ASIMÉTRICO + ORBE ================= */
.hero-sec {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 108px 28px 28px;
    background: var(--bg);
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(46% 42% at 50% 52%, rgba(15, 118, 110, .09), transparent 70%);
    pointer-events: none;
}

#heroOrb {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 88vw);
    height: min(560px, 88vw);
    pointer-events: none;
    z-index: 1;
}

.hero-h {
    font-family: var(--sans);
    font-size: clamp(3.04rem, 4.8vw, 4.32rem);
    font-weight: 700;
    font-variation-settings: "wdth" 96;
    letter-spacing: -0.04em;
    line-height: 0.95;
    color: var(--ink);
}

.hero-h em {
    font-style: normal;
    color: var(--mute);
    font-weight: 600;
}

.display {
    font-family: var(--sans);
    font-size: clamp(2.05rem, 4.1vw, 3.5rem);
    font-weight: 600;
    font-variation-settings: "wdth" 96;
    letter-spacing: -0.038em;
    line-height: 1.02;
    text-wrap: balance;
}
.display em { font-style: normal; color: var(--mute); }
.act .display em { color: var(--dip-mute); }

.hero-reveal {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(14px);
    animation: heroReveal 1s var(--ease-out) forwards;
}
.hero-reveal-1 { animation-delay: .06s; }
.hero-reveal-2 { animation-delay: .22s; }
.hero-reveal-3 { animation-delay: .38s; }
.hero-reveal-4 { animation-delay: .52s; }

@keyframes heroReveal {
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

.hero-hint {
    width: 1px;
    height: 38px;
    background: linear-gradient(to bottom, transparent, var(--teal), transparent);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}
.hero-hint::after {
    content: "";
    position: absolute;
    left: 0;
    top: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--ink), transparent);
    animation: hint 2.2s infinite var(--ease-io);
}
@keyframes hint {
    0% { transform: translateY(0); }
    100% { transform: translateY(200%); }
}

/* ================= BEZEL (.bz) + SPOTLIGHT ================= */
.bz {
    position: relative;
    padding: 6px;
    border-radius: 32px;
    background: rgba(20, 32, 30, .035);
    border: 1px solid var(--line);
}
.bz-in {
    position: relative;
    border-radius: 26px;
    background: linear-gradient(160deg, #ffffff, #fbfaf6);
    border: 1px solid rgba(20, 32, 30, .06);
    overflow: hidden;
}
.act .bz {
    background: rgba(231, 239, 236, .04);
    border-color: var(--dip-line);
}
.act .bz-in {
    background: linear-gradient(160deg, #132422, #0d1917);
    border-color: rgba(231, 239, 236, .07);
}

[data-tilt] { --mx: 50%; --my: 50%; }
[data-tilt]::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx) var(--my), var(--teal-soft), transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    z-index: 2;
}
.act [data-tilt]::before {
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(60, 207, 187, .12), transparent 60%);
}
[data-tilt]:hover::before { opacity: 1; }

/* ================= ACTO OSCURO (.act) ================= */
.act {
    position: relative;
    background: var(--dip);
    color: var(--dip-ink);
    padding-bottom: 100px;
}

.dato-sec {
    position: relative;
    min-height: 220svh;
}
.dato-sticky {
    position: sticky;
    top: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 24px;
    overflow: hidden;
}
.dato-glow {
    position: absolute;
    width: min(860px, 96vw);
    height: min(540px, 60vh);
    background: radial-gradient(closest-side, rgba(60, 207, 187, .16), transparent 72%);
    pointer-events: none;
}
.dato-line {
    font-family: var(--sans);
    font-size: clamp(2.15rem, 5.6vw, 4.9rem);
    font-weight: 600;
    font-variation-settings: "wdth" 94;
    letter-spacing: -0.045em;
    line-height: 1.04;
    max-width: 1060px;
    text-align: center;
    position: relative;
    z-index: 2;
}
.dato-line .w {
    display: inline-block;
    opacity: .16;
    filter: blur(4px);
    transform: translateY(6px);
    transition: opacity .35s var(--ease-out), filter .35s var(--ease-out), transform .35s var(--ease-out), color .3s ease;
}
.dato-line .w.on { opacity: 1; filter: blur(0); transform: translateY(0); }
.dato-line .w.accent.on { color: var(--dip-teal); }

/* Tablero conectado #que (storytelling con zoom y cables SVG) */
.que-sec {
    position: relative;
    min-height: 180svh;
    padding: 40px 20px 80px;
}
.que-sticky {
    position: sticky;
    top: 68px;
}
.board-shell {
    transition: transform .7s var(--ease-out);
    transform-origin: center center;
}
.wires-svg path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1.3s var(--ease-out);
}
.wires-svg.drawn path { stroke-dashoffset: 0; }

/* Escáner láser OCR */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dip-teal), transparent);
    box-shadow: 0 0 12px var(--dip-teal);
    animation: scanMove 2.6s ease-in-out infinite;
}
@keyframes scanMove {
    0%, 100% { top: 12%; opacity: .35; }
    50% { top: 86%; opacity: 1; }
}

@keyframes pulseHub {
    0% { box-shadow: 0 0 0 0 rgba(60, 207, 187, 0.45); }
    70% { box-shadow: 0 0 0 18px rgba(60, 207, 187, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 207, 187, 0); }
}
.hub-pulse { animation: pulseHub 2.5s infinite var(--ease-out); }

/* Curva Amanecer */
.dawn-wrap {
    position: relative;
    background: var(--dip);
    padding-top: 24px;
}
.dawn-edge {
    height: 86px;
    background: var(--bg);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    box-shadow: 0 -24px 80px -10px rgba(60, 207, 187, .35);
    position: relative;
    z-index: 5;
}

/* Sliders Calculadora */
input[type="range"].es-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(231, 239, 236, .14);
    outline: none;
}
input[type="range"].es-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--dip-teal);
    border: 3px solid #0d1917;
    box-shadow: 0 0 14px rgba(60, 207, 187, .65);
    cursor: pointer;
    transition: transform .15s var(--ease-out);
}
input[type="range"].es-range::-webkit-slider-thumb:hover { transform: scale(1.18); }

/* ================= EJEMPLOS ROTATIVOS (#ejemplos) ================= */
.sx-item {
    position: relative;
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .3s ease, border-color .3s ease, opacity .3s ease;
    opacity: .62;
}
.sx-item:hover { opacity: .9; }
.sx-item.active {
    opacity: 1;
    background: #FFFFFF;
    border-color: var(--line);
    box-shadow: 0 10px 30px -12px rgba(20, 32, 30, 0.08);
}
.sx-bar {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 2px;
    background: var(--teal);
    transform-origin: left center;
    transform: scaleX(0);
    display: none;
}
.sx-item.active .sx-bar {
    display: block;
    animation: sxBar 6.5s linear forwards;
}
@keyframes sxBar {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ================= CASO REAL IPHONE 3D (#caso) ================= */
.case-sec {
    position: relative;
    background: var(--bg3);
    overflow: hidden;
}
.case-sec::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(48% 50% at 72% 48%, rgba(15, 118, 110, .13), transparent 72%);
    pointer-events: none;
}
.phone-3d-stage { perspective: 1800px; }
.phone-3d {
    transform: rotateY(-6deg) rotateX(2deg);
    transform-style: preserve-3d;
    transition: transform .6s var(--ease-out);
    box-shadow: 28px 40px 80px -20px rgba(20, 32, 30, .28), 0 0 0 1px rgba(20, 32, 30, .08);
}
.phone-3d:hover { transform: rotateY(0deg) rotateX(0deg); }
@media (max-width: 1024px) { .phone-3d { transform: none; } }

/* ================= TIMELINE HORIZONTAL (#como) ================= */
.how-sec {
    position: relative;
    height: 300svh;
}
.how-sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 88px 0 40px;
}
.how-track {
    display: flex;
    gap: 24px;
    padding: 0 max(24px, calc((100vw - 1200px) / 2));
    will-change: transform;
}
.phs { flex: 0 0 min(460px, 84vw); }
.hp-n {
    font-family: var(--sans);
    font-size: clamp(4.2rem, 7vw, 6.2rem);
    font-weight: 200;
    font-variation-settings: "wdth" 86;
    letter-spacing: -0.06em;
    line-height: 0.9;
    color: var(--teal);
    font-variant-numeric: tabular-nums;
}
.how-prog b {
    display: block;
    height: 100%;
    background: var(--teal);
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform .15s linear;
}
@media (max-width: 860px) {
    .how-sec { height: auto; }
    .how-sticky { position: relative; height: auto; padding: 64px 20px; }
    .how-track { flex-direction: column; padding: 0; transform: none !important; }
    .phs { flex: 1 1 auto; width: 100%; }
}

/* ================= UTILIDADES Y MICROANIMACIONES ================= */
.reveal-up {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
.reveal-up.in-view { opacity: 1; transform: translateY(0); }

.cc { transition: transform .25s var(--ease-out), box-shadow .25s ease; }
.cc:hover { transform: translateY(-3px); }

/* Audio waveform */
.waveform-bar { transition: height .15s ease; }
.waveform-active .waveform-bar { animation: pulseAudio 1.1s infinite ease-in-out alternate; }
.waveform-active .waveform-bar:nth-child(1) { animation-delay: .1s; }
.waveform-active .waveform-bar:nth-child(2) { animation-delay: .35s; }
.waveform-active .waveform-bar:nth-child(3) { animation-delay: .2s; }
.waveform-active .waveform-bar:nth-child(4) { animation-delay: .5s; }
.waveform-active .waveform-bar:nth-child(5) { animation-delay: .25s; }
.waveform-active .waveform-bar:nth-child(6) { animation-delay: .55s; }
@keyframes pulseAudio {
    0% { height: 4px; }
    50% { height: 22px; }
    100% { height: 9px; }
}

/* Footer CTA */
.foot-cta p {
    font-family: var(--sans);
    font-size: clamp(2.3rem, 5.4vw, 4.6rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(20, 32, 30, 0.22); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }
