/* ---------- Sitio DEIT ---------- */
@property --spin {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.site {
    --bg: #0d1117;
    --surface: rgba(140, 155, 255, 0.05);
    --surface-strong: rgba(22, 28, 44, 0.72);
    --line: rgba(160, 175, 255, 0.14);
    --text: #e8edf5;
    --muted: #97a3b6;
    --indigo: #6366f1;
    --teal: #2ee6c5;
    --grad: linear-gradient(115deg, var(--indigo), #3b82f6 45%, var(--teal));
    --glow: 0 0 24px rgba(46, 230, 197, 0.25);
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(99, 102, 241, 0.22), transparent 70%),
        radial-gradient(700px 500px at -10% 30%, rgba(46, 230, 197, 0.10), transparent 70%),
        var(--bg);
    color: var(--text);
    font: 400 1.0625rem/1.65 "IBM Plex Sans", system-ui, sans-serif;
}

.site[data-theme="light"] {
    --bg: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-strong: rgba(255, 255, 255, 0.85);
    --line: rgba(30, 41, 80, 0.13);
    --text: #111a2e;
    --muted: #4c5870;
    --indigo: #4146d8;
    --teal: #0b8a77;
    --glow: 0 0 20px rgba(65, 70, 216, 0.18);
}

body { margin: 0; background: #0d1117; }
.site *, .site *::before, .site *::after { box-sizing: border-box; }
.site a { color: inherit; }
.site :focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

.site h1, .site h2, .site h3 { font-family: Sora, system-ui, sans-serif; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
.site p { margin: 0; }

/* Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
    font: 600 0.95rem/1 Sora, system-ui, sans-serif; text-decoration: none; cursor: pointer;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.site .btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(46, 230, 197, 0.4); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--teal); }
.btn-sm { padding: 0.6rem 1rem; font-size: 0.85rem; }

/* Navbar */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.3rem Sora, sans-serif; letter-spacing: 0.08em; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links > a:not(.btn) { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.nav-links > a:not(.btn):hover { color: var(--text); }
.theme-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; margin: auto; background: var(--text); position: relative; transition: transform .2s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 68px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 16px 1.25rem;
        background: var(--bg); border-bottom: 1px solid var(--line);
    }
    .nav-links.open { display: flex; }
    .nav-links > a:not(.btn) { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
    .theme-btn { margin: 1rem 0; }
}

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 700; max-width: 14ch; }
.site .lead { margin-top: 1.4rem; font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.stage { position: relative; height: 440px; perspective: 1300px; }
.floor {
    position: absolute; inset: auto -30% -10% -30%; height: 70%;
    background:
        repeating-linear-gradient(90deg, rgba(99, 102, 241, .22) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(0deg, rgba(46, 230, 197, .16) 0 1px, transparent 1px 48px);
    transform: rotateX(72deg); transform-origin: bottom;
    mask-image: radial-gradient(closest-side, #000 30%, transparent);
}
.deck {
    position: absolute; left: 50%; top: 46%; width: 310px; height: 250px;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) rotateX(16deg) rotateY(-26deg) rotateZ(3deg);
    animation: drift 9s ease-in-out infinite;
}
@keyframes drift {
    50% { transform: translate(-50%, -54%) rotateX(19deg) rotateY(-21deg) rotateZ(2deg); }
}
.sheet {
    position: absolute; inset: 0; padding: 1.1rem 1.2rem; border-radius: 18px;
    background: var(--surface-strong); border: 1px solid var(--line);
    backdrop-filter: blur(10px); font-size: 0.78rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}
.sheet-back { transform: translate3d(70px, -90px, -140px); opacity: .6; }
.sheet-mid { transform: translate3d(36px, -46px, -70px); opacity: .8; }
.sheet-front { border-color: rgba(46, 230, 197, 0.45); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.25); }
.site .sheet-title { font: 600 0.9rem Sora, sans-serif; margin-bottom: 0.7rem; }
.sheet-row { display: flex; justify-content: space-between; gap: 0.8rem; color: var(--muted); padding: 0.18rem 0; white-space: nowrap; }
.sheet-row b { color: var(--text); font-weight: 500; }
.sheet-row.total { margin-top: 0.4rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.sheet-row.total b { font: 700 1rem Sora, sans-serif; }
.lines { display: grid; gap: 7px; margin: 0.8rem 0; }
.lines i { height: 7px; border-radius: 4px; background: var(--line); }
.lines i:nth-child(2) { width: 80%; }
.lines i:nth-child(3) { width: 60%; }
.spark { display: flex; align-items: end; gap: 6px; height: 60px; margin-top: 0.8rem; }
.spark i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--grad); opacity: .7; }
.seal {
    position: absolute; right: -26px; bottom: -48px; display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.9rem; border-radius: 14px; border: 1.5px solid var(--teal);
    background: color-mix(in srgb, var(--bg) 85%, transparent); color: var(--teal);
    font: 600 0.78rem/1.2 Sora, sans-serif; transform: translateZ(40px) rotate(-6deg);
    box-shadow: 0 0 30px rgba(46, 230, 197, 0.35);
    animation: stamp .5s cubic-bezier(.2, 1.4, .4, 1) 1.1s both;
}
.seal small { font-weight: 500; opacity: .8; }
.seal-check { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #06231f; font-size: 0.95rem; }
@keyframes stamp {
    from { opacity: 0; transform: translateZ(140px) rotate(-18deg) scale(1.6); }
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .stage { height: 360px; }
    .deck { width: 300px; height: 230px; left: 46%; }
}

/* Secciones */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
#inicio, #productos, #modulos, #contacto { scroll-margin-top: 68px; }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; }
.site .section-lead { margin-top: 0.8rem; color: var(--muted); max-width: 60ch; }

.tag {
    display: inline-block; align-self: flex-start; padding: 0.3rem 0.75rem; border-radius: 999px;
    font: 600 0.78rem Sora, sans-serif; color: var(--teal);
    background: rgba(46, 230, 197, 0.08); border: 1px solid rgba(46, 230, 197, 0.35);
    box-shadow: 0 0 14px rgba(46, 230, 197, 0.18);
}
.tag-sm { font-size: 0.7rem; padding: 0.2rem 0.6rem; margin-bottom: 0.7rem; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-top: 2.6rem; }
.product-card {
    position: relative; display: flex; flex-direction: column; gap: 0.9rem;
    padding: 1.8rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
    backdrop-filter: blur(8px); transition: transform .3s;
}
/* Borde holográfico que gira al pasar el cursor */
.product-card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: conic-gradient(from var(--spin), transparent 0 55%, var(--indigo), var(--teal), transparent 95%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .3s;
}
.product-card:hover, .product-card:focus-within { transform: translateY(-6px); }
.product-card:hover::before, .product-card:focus-within::before { opacity: 1; animation: spin 3s linear infinite; }
@keyframes spin { to { --spin: 360deg; } }
.product-card h3 { font-size: 1.5rem; }
.product-card p { color: var(--muted); }
.site .product-card .meta { font-size: 0.88rem; margin-top: auto; }
.site .card-link { font-weight: 500; color: var(--teal); text-underline-offset: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 2rem 0 1.8rem; }
.filters button {
    padding: 0.6rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    color: var(--muted); font: 500 0.9rem Sora, sans-serif; cursor: pointer;
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }

.product-intro { max-width: 75ch; margin-bottom: 2rem; color: var(--muted); }
.highlights { margin: 1.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.highlights li { padding-left: 1.4rem; position: relative; }
.highlights li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 8px; height: 8px; border-radius: 2px; background: var(--grad); transform: rotate(45deg); }

.module-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.module-list li { padding: 1.5rem; background: var(--bg); animation: appear .35s ease both; }
.module-list h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; }
.module-list p { color: var(--muted); font-size: 0.95rem; }
@keyframes appear { from { opacity: 0; } }

/* Contacto */
.contact-box {
    display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4rem); align-items: start;
    padding: clamp(2rem, 5vw, 3.5rem); border-radius: 28px;
    background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 80px rgba(99, 102, 241, 0.15);
}
.contact-intro .highlights { margin-top: 1.8rem; color: var(--muted); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font: 500 0.88rem Sora, sans-serif; }
.optional { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
    width: 100%; padding: 0.75rem 1rem; border-radius: 12px; border: 1px solid var(--line);
    background: var(--surface-strong); color: var(--text); font: inherit; font-size: 1rem;
    transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(46, 230, 197, 0.18); }
.field [aria-invalid="true"] { border-color: #f87171; }
.site .field-error { min-height: 1.3em; font-size: 0.82rem; color: #f87171; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.4rem; }
.form-actions .btn:active { transform: scale(.96); }
.form-actions .btn:disabled { opacity: .7; cursor: wait; }
.form-msg.error { color: #f87171; }
.contact-done { display: grid; justify-items: start; gap: 0.8rem; align-self: center; animation: appear .4s ease both; }
.contact-done .seal-check { width: 48px; height: 48px; font-size: 1.4rem; box-shadow: 0 0 30px rgba(46, 230, 197, 0.45); }
.contact-done h3 { font-size: 1.5rem; }
.contact-done p { color: var(--muted); }
@media (max-width: 900px) { .contact-box { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .contact-form { grid-template-columns: 1fr; } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; }
.site .footer-grid p { margin-top: 0.8rem; max-width: 32ch; }
.footer nav { display: flex; flex-direction: column; gap: 0.5rem; }
.footer h2 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.footer nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.footer nav a:hover { color: var(--text); }
.site .copy { margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.88rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
    .site *, .site *::before { animation: none !important; transition: none !important; }
}
