/* ===========================================
   BUMAPP — DESIGN SYSTEM
   White/near-black structure carries the page; a small
   curated accent palette (cyan/violet/teal/amber) gives
   each section its own bit of color instead of a single
   monochrome tint everywhere. Motion is real, not just
   in the hero: tilt, parallax, and a cursor-reactive glow
   run throughout.
   =========================================== */

:root {
    --ink: #0b0f19;
    --ink-soft: #55606f;
    --navy: #0d2b4e;
    --navy-deep: #081221;
    --navy-light: #153e6b;
    --sky: #0bb4e8;
    --sky-rgb: 11, 180, 232;
    --sky-soft: #eaf7fc;
    --moss: #16794f;
    --moss-soft: #e8f5ee;
    --bg: #ffffff;
    --subtle: #f5f6f8;
    --border: rgba(11, 15, 25, 0.10);
    --border-dark: rgba(255, 255, 255, 0.14);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

    /* Accent cycle — used sparingly (icons, badges, glows),
       never for body text or backgrounds. */
    --accent-1: #0bb4e8;   /* cyan   */
    --accent-1-rgb: 11, 180, 232;
    --accent-2: #7c5cff;   /* violet */
    --accent-2-rgb: 124, 92, 255;
    --accent-3: #14b8a6;   /* teal   */
    --accent-3-rgb: 20, 184, 166;
    --accent-4: #f5a524;   /* amber  */
    --accent-4-rgb: 245, 165, 36;
}

/* ===========================================
   ACCENT UTILITIES — cycled per card index
   =========================================== */

.icon-box.accent-1 { background: rgba(var(--accent-1-rgb), 0.12); border-color: rgba(var(--accent-1-rgb), 0.3); }
.icon-box.accent-2 { background: rgba(var(--accent-2-rgb), 0.12); border-color: rgba(var(--accent-2-rgb), 0.3); }
.icon-box.accent-3 { background: rgba(var(--accent-3-rgb), 0.12); border-color: rgba(var(--accent-3-rgb), 0.3); }
.icon-box.accent-4 { background: rgba(var(--accent-4-rgb), 0.12); border-color: rgba(var(--accent-4-rgb), 0.3); }

.icon-box.accent-1 svg { color: var(--accent-1); }
.icon-box.accent-2 svg { color: var(--accent-2); }
.icon-box.accent-3 svg { color: var(--accent-3); }
.icon-box.accent-4 svg { color: var(--accent-4); }

.card:hover .icon-box.accent-1 { background: var(--accent-1); border-color: var(--accent-1); }
.card:hover .icon-box.accent-2 { background: var(--accent-2); border-color: var(--accent-2); }
.card:hover .icon-box.accent-3 { background: var(--accent-3); border-color: var(--accent-3); }
.card:hover .icon-box.accent-4 { background: var(--accent-4); border-color: var(--accent-4); }
.card:hover .icon-box[class*="accent-"] svg { color: white; }

.badge-num.accent-1 { background: var(--accent-1); }
.badge-num.accent-2 { background: var(--accent-2); }
.badge-num.accent-3 { background: var(--accent-3); }
.badge-num.accent-4 { background: var(--accent-4); }

/* ===========================================
   ACCESSIBILITY — visible focus, skip link, touch targets
   (per Vercel Web Interface Guidelines + WCAG)
   =========================================== */

*:focus-visible {
    outline: 2px solid var(--sky);
    outline-offset: 2px;
    border-radius: 2px;
}

a, button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    z-index: 100;
    background: var(--ink);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 160ms var(--ease-out);
}

.skip-link:focus {
    top: 12px;
}

/* ===========================================
   TYPOGRAPHY
   =========================================== */

h1, h2, h3, h4,
.font-display {
    font-family: 'Space Grotesk', Inter, sans-serif;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.font-mono-num {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

/* ===========================================
   SECTION BACKGROUNDS — flat, no texture
   =========================================== */

.bg-section-navy {
    background: var(--navy);
}

.bg-section-navy--deep {
    background: var(--navy-deep);
}

.bg-section-light {
    background: var(--bg);
}

.bg-section-subtle {
    background: var(--subtle);
}

/* Cursor-reactive glow on dark sections — the JS updates
   --spot-x/--spot-y on pointermove; this stays inert (and
   just sits at its default position) otherwise. */
.spotlight-section {
    position: relative;
    isolation: isolate;
}

.spotlight-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(560px circle at var(--spot-x, 50%) var(--spot-y, 15%), rgba(var(--accent-1-rgb), 0.14), transparent 60%);
}

/* Color blobs behind the Nosotros photo — replaces a flat frame
   with something that has real depth and a little color. */
.blob-decoration {
    position: absolute;
    border-radius: 9999px;
    filter: blur(40px);
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
}

.blob-decoration--1 {
    width: 220px;
    height: 220px;
    top: -40px;
    left: -40px;
    background: var(--accent-1);
}

.blob-decoration--2 {
    width: 180px;
    height: 180px;
    bottom: -30px;
    right: -30px;
    background: var(--accent-2);
}

/* legacy hooks — neutralized, no decorative texture */
.bg-ledger-grid,
.bg-ledger-grid--light {
    background-image: none;
}

/* ===========================================
   DIVIDER — a short solid rule, not a motif
   =========================================== */

.divider-ticket {
    width: 32px;
    height: 2px;
    margin: 20px auto;
    background: var(--sky);
    border-radius: 1px;
}

/* ===========================================
   BADGES — quiet pill, dot + label, one accent
   =========================================== */

.badge-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-dark);
    color: rgba(255, 255, 255, 0.82);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 6px;
}

.badge-line::before {
    content: '';
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sky);
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(var(--sky-rgb), 0.55);
    animation: badgePulse 2.4s ease-out infinite;
}

@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--sky-rgb), 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(var(--sky-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--sky-rgb), 0); }
}

.badge-line--light {
    color: var(--ink-soft);
    border-color: var(--border);
}

@media (prefers-reduced-motion: reduce) {
    .badge-line::before {
        animation: none;
    }
}

/* Status chip — flat, functional, the kind a real
   invoicing product actually renders for "accepted". */
.chip-success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--moss-soft);
    color: var(--moss);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn-primary {
    display: inline-block;
    background: var(--sky);
    color: var(--ink);
    padding: 13px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid var(--sky);
    transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
    box-shadow: 0 0 0 rgba(var(--sky-rgb), 0);
}

.btn-primary:hover {
    background: #29c2f0;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px -6px rgba(var(--sky-rgb), 0.55);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: none;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: inherit;
    padding: 12px 27px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.btn-secondary:hover {
    border-color: var(--ink-soft);
    background: var(--subtle);
}

.bg-section-navy .btn-secondary,
.bg-section-navy--deep .btn-secondary {
    border-color: var(--border-dark);
}

.bg-section-navy .btn-secondary:hover,
.bg-section-navy--deep .btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.btn-modern-primary { }
.btn-modern-secondary { }

/* ===========================================
   CARDS — flat, hairline border, minimal shadow
   =========================================== */

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
    transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), border-color 160ms var(--ease-out);
    box-shadow: 0 1px 2px rgba(11, 15, 25, 0.04);
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(11, 15, 25, 0.18);
    box-shadow: 0 8px 24px rgba(11, 15, 25, 0.08);
}

/* Tilt-enabled cards get their transform from JS (attachTilt) while
   hovered — the translateY above still covers the instant before the
   first mousemove fires, so there's no flash of static state. */
.tilt-card {
    will-change: transform;
}

.tilt-card:hover {
    box-shadow: 0 20px 40px rgba(11, 15, 25, 0.14);
}

/* Touch devices never fire hover/tilt — give cards a press response
   instead, so tapping still feels acknowledged. */
@media (hover: none) {
    .card:active {
        transform: scale(0.98);
        transition: transform 100ms var(--ease-out);
    }
}

.card--dark {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    color: white;
    box-shadow: none;
}

.card--dark:hover {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@property --border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* Two background layers instead of a z-index/pseudo trick: the inner
   one is clipped to the padding-box (solid ink fill), the outer one to
   the border-box (the animated gradient) — so the gradient can only
   ever show through the border's own width, never wash over the card. */
.card-pricing-featured {
    position: relative;
    border-width: 3px;
    border-style: solid;
    border-color: transparent;
    background:
        linear-gradient(var(--ink), var(--ink)) padding-box,
        conic-gradient(from var(--border-angle), var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1)) border-box;
    color: white;
    box-shadow: 0 12px 28px rgba(11, 15, 25, 0.18);
    animation: rotateBorderAngle 5s linear infinite;
}

@keyframes rotateBorderAngle {
    to { --border-angle: 360deg; }
}

.card-pricing-featured:hover {
    box-shadow: 0 16px 36px rgba(11, 15, 25, 0.24);
}

@media (prefers-reduced-motion: reduce) {
    .card-pricing-featured {
        animation: none;
    }
}

.card-modern {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 32px;
    color: white;
    transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.card-modern:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
}

.glassmorphism-hover { }

/* ===========================================
   ICON BOXES — flat tint
   =========================================== */

.icon-box {
    width: 44px;
    height: 44px;
    background: var(--sky-soft);
    border: 1px solid rgba(63, 169, 224, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-section-navy .icon-box,
.bg-section-navy--deep .icon-box {
    background: rgba(63, 169, 224, 0.12);
    border-color: rgba(63, 169, 224, 0.25);
}

.card:hover .icon-box {
    background: var(--sky);
    border-color: var(--sky);
}

.card:hover .icon-box svg {
    color: white;
    stroke: white;
}

.bg-section-navy .card:hover .icon-box,
.bg-section-navy--deep .card:hover .icon-box {
    background: var(--sky);
    border-color: var(--sky);
}

/* Document-type tag — real DTE names, not decoration */
.dte-tag {
    display: inline-block;
    padding: 5px 10px;
    background: var(--subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-soft);
}

/* ===========================================
   HERO — WebGL network backdrop
   =========================================== */

#hero-canvas {
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 900ms var(--ease-out);
}

#hero-canvas.is-ready {
    opacity: 1;
}

/* ===========================================
   HERO — flat invoice UI card, not a paper prop
   =========================================== */

.factura-mock {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(11, 15, 25, 0.10);
    color: var(--ink);
    overflow: hidden;
    transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.factura-mock:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px rgba(11, 15, 25, 0.16);
}

.factura-mock__header {
    background: var(--ink);
    color: white;
    padding: 18px 24px;
}

.factura-mock__body {
    padding: 22px 24px;
}

.factura-mock__row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--subtle);
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.factura-mock__row:last-of-type {
    border-bottom: none;
}

.factura-mock__total {
    display: flex;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink);
}

.factura-mock__seal {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dotted var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.factura-mock__seal span:first-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    opacity: 0.7;
}

.factura-mock__seal span:last-child {
    font-size: 0.68rem;
    color: var(--ink-soft);
}

/* ===========================================
   ANIMATIONS — short, entrance-only
   =========================================== */

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slideUp {
    animation: slideUp 450ms var(--ease-out) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll-reveal: hidden until it enters the viewport, then
   settles in once. Transition (not keyframes) so a fast
   scroll that re-triggers doesn't restart from zero. */
.section-fade {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 550ms var(--ease-out), transform 550ms var(--ease-out);
}

.section-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Per-card stagger, gated by the parent section's own reveal —
   not by mount time, since cards mount off-screen (right after
   the JSON fetch) long before the section scrolls into view. */
.card-reveal {
    --reveal-y: 14px;
    opacity: 0;
    transform: translateY(var(--reveal-y));
    transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out);
}

.section-fade.is-visible .card-reveal {
    --reveal-y: 0px;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .section-fade {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .card-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===========================================
   NAVIGATION
   =========================================== */

nav a, #desktop-menu a, #mobile-menu a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 160ms ease;
    font-size: 0.9rem;
}

nav a::after, #desktop-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--sky);
    transition: width 200ms var(--ease-out);
}

nav a:hover::after, #desktop-menu a:hover::after {
    width: 100%;
}

nav a:hover, #desktop-menu a:hover {
    color: var(--ink);
}

#mobile-menu a:hover {
    color: var(--sky);
}

.navbar-blur {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

/* ===========================================
   FORM ELEMENTS
   =========================================== */

.input-line {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-line:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px var(--sky-soft);
}

/* ===========================================
   FOOTER
   =========================================== */

footer {
    background: var(--navy-deep);
    border-top: 1px solid var(--border-dark);
}

/* ===========================================
   RESPONSIVE
   =========================================== */

/* Decorative elements (blobs, canvas, negative-margin image bleeds)
   sit near the viewport edge by design. Without this, one of them
   escaping by even a few px widens the layout viewport on mobile —
   which drags the fixed header along with it. */
html, body {
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .card {
        padding: 24px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

@media print {
    .navbar-blur,
    #mobile-menu-button {
        display: none;
    }
}
