/* ============================================
   AKustom15 — App pages (/apps/<app>/)
   Same design tokens as /style.css and /terms/terms.css.
   Each page sets its own accent on <body class="app-<name>">.
   ============================================ */

:root {
    --bg-dark: #000000;
    --bg-dark-soft: #0b0b0d;
    --bg-light: #ffffff;
    --bg-light-soft: #f5f5f7;

    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --text-on-dark: #f5f5f7;
    --text-on-dark-secondary: rgba(245, 245, 247, 0.72);
    --text-on-dark-tertiary: rgba(245, 245, 247, 0.56);

    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-on-dark: #2997ff;
    --accent-soft-bg: rgba(0, 113, 227, 0.1);

    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-subtle-dark: rgba(255, 255, 255, 0.14);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-pill: 980px;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 160ms;
    --dur-base: 220ms;

    --nav-height: 60px;
    --gutter: 2rem;
}

/* Zyra: the violet of its logo */
.app-zyra {
    --accent: #6940db;
    --accent-hover: #7650e6;
    --accent-on-dark: #9b7bff;
    --accent-soft-bg: rgba(105, 64, 219, 0.1);
}

/* GlassWave: the deep blue of its wave */
.app-glasswave {
    --accent: #1d4bad;
    --accent-hover: #2558c4;
    --accent-on-dark: #7fa2f5;
    --accent-soft-bg: rgba(29, 75, 173, 0.1);
}

/* Nexo: the violet of its logo */
.app-nexo {
    --accent: #5f05db;
    --accent-hover: #6c16e8;
    --accent-on-dark: #a77bff;
    --accent-soft-bg: rgba(95, 5, 219, 0.1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.55;
    letter-spacing: -0.011em;
    overflow-x: hidden;
}

h1, h2, h3 {
    letter-spacing: -0.015em;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

section[id] {
    scroll-margin-top: calc(var(--nav-height) + 1rem + env(safe-area-inset-top));
}

/* ============================================
   NAVIGATION — same dark glass bar as the home page
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.9rem var(--gutter);
    padding-top: calc(0.9rem + env(safe-area-inset-top));
    padding-left: calc(var(--gutter) + env(safe-area-inset-left));
    padding-right: calc(var(--gutter) + env(safe-area-inset-right));
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle-dark);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-on-dark);
}

.nav-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-brand-name {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-on-dark-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--dur-fast) var(--ease-standard);
    touch-action: manipulation;
}

.nav-links .nav-cta {
    color: #ffffff;
    background: var(--accent);
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
}

@media (hover: hover) and (pointer: fine) {
    .nav-links a:hover {
        color: var(--text-on-dark);
    }
    .nav-links .nav-cta:hover {
        color: #ffffff;
        background: var(--accent-hover);
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-standard),
                border-color var(--dur-fast) var(--ease-standard),
                color var(--dur-fast) var(--ease-standard);
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-secondary {
    color: var(--accent-on-dark);
    border: 1px solid var(--border-subtle-dark);
}

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

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background: var(--accent-hover);
    }
    .btn-secondary:hover {
        border-color: rgba(255, 255, 255, 0.32);
        color: var(--text-on-dark);
    }
}

/* ============================================
   HERO
   ============================================ */
.app-hero {
    background: var(--bg-dark);
    padding: calc(var(--nav-height) + 5rem + env(safe-area-inset-top)) var(--gutter) 3.5rem;
    text-align: center;
}

.app-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.app-icon {
    width: 112px;
    height: 112px;
    border-radius: 26px;
    /* Thin ring so dark-edged icons don't dissolve into the black hero */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14),
                0 16px 40px rgba(0, 0, 0, 0.6);
    margin-bottom: 0.5rem;
}

.app-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-on-dark);
}

.app-title {
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    font-weight: 700;
    line-height: 1.04;
    color: var(--text-on-dark);
}

.app-subtitle {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    color: var(--text-on-dark-secondary);
    max-width: 620px;
    line-height: 1.55;
}

.app-hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 0.75rem;
}

.app-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 760px;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle-dark);
    list-style: none;
}

.app-stats li {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.app-stats strong {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 700;
    color: var(--text-on-dark);
    line-height: 1.1;
}

.app-stats span {
    font-size: 0.82rem;
    color: var(--text-on-dark-tertiary);
}

/* ============================================
   GALLERY — native horizontal scroll, no JS
   ============================================ */
.app-gallery {
    background: var(--bg-dark);
    padding: 0 0 5rem;
}

.app-gallery-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 0.5rem var(--gutter);
    scroll-padding-inline: var(--gutter);
}

.app-gallery-track::-webkit-scrollbar {
    display: none;
}

/* Centra las capturas cuando caben todas en la pantalla. Si no caben, los
   márgenes automáticos valen 0 y la fila se desliza desde la izquierda. */
.app-gallery-track > :first-child {
    margin-left: auto;
}

.app-gallery-track > :last-child {
    margin-right: auto;
}

.app-gallery-track figure {
    flex: 0 0 auto;
    width: min(300px, 72vw);
    scroll-snap-align: start;
}

.app-gallery-track img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle-dark);
    background: var(--bg-dark-soft);
}

.app-gallery-track figcaption {
    font-size: 0.85rem;
    color: var(--text-on-dark-tertiary);
    margin-top: 0.7rem;
    padding-left: 0.25rem;
}

.app-gallery-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-on-dark-tertiary);
    margin-top: 1.25rem;
}

/* 5 capturas de 300 px + 4 huecos + márgenes: a partir de aquí se ven todas */
@media (min-width: 1640px) {
    .app-gallery-hint {
        display: none;
    }
}

/* ============================================
   SECTIONS
   ============================================ */
.app-section {
    padding: 6rem var(--gutter);
}

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

.app-section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.app-section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 3rem;
}

.app-section-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.app-section-title {
    font-size: clamp(1.9rem, 4.2vw, 2.9rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.app-section-subtitle {
    font-size: 1.08rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    line-height: 1.6;
}

/* --- Feature cards --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--bg-light-soft);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
}

.app-section--soft .feature-card {
    background: var(--bg-light);
}

.feature-card .feature-emoji {
    font-size: 1.8rem;
    line-height: 1;
}

.feature-card h3 {
    font-size: 1.12rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Widget list --- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    list-style: none;
}

.widget-grid li {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: var(--bg-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.25rem;
}

.widget-grid .feature-emoji {
    font-size: 1.4rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.widget-grid strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.widget-grid span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.app-note {
    max-width: 760px;
    margin: 2rem auto 0;
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.app-note a,
.app-prose a,
.faq a {
    color: var(--accent);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .app-note a:hover,
    .app-prose a:hover,
    .faq a:hover {
        text-decoration: underline;
    }
}

/* --- Launcher chips --- */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    list-style: none;
}

.chip-list li {
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-light-soft);
    border-radius: var(--radius-pill);
    padding: 0.55rem 1.15rem;
}

.chip-list li.is-recommended {
    background: var(--accent-soft-bg);
    color: var(--accent);
    font-weight: 600;
}

/* --- Two-column split (update + privacy) --- */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.split-card {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
}

/* On a white section the cards take the soft grey, so they still stand out */
.app-section:not(.app-section--soft) .split-card {
    background: var(--bg-light-soft);
}

.split-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.5rem 0 0.9rem;
}

.split-card .split-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.app-prose p,
.app-prose li {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.app-prose ul {
    margin: 0.75rem 0 0 1.25rem;
}

.app-prose li + li {
    margin-top: 0.4rem;
}

.app-prose p + p,
.app-prose ul + p {
    margin-top: 0.9rem;
}

.app-prose strong {
    color: var(--text-primary);
    font-weight: 600;
}

.split-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 1.25rem;
    font-size: 0.95rem;
}

/* --- FAQ --- */
.faq {
    max-width: 820px;
    margin: 0 auto;
    border-top: 1px solid var(--border-subtle);
}

.faq details {
    border-bottom: 1px solid var(--border-subtle);
}

.faq summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 0.25rem;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-primary);
    touch-action: manipulation;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: '+';
    flex-shrink: 0;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-tertiary);
    transition: transform var(--dur-base) var(--ease-out);
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details > div {
    padding: 0 0.25rem 1.5rem;
}

.faq details p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq details p + p {
    margin-top: 0.75rem;
}

/* ============================================
   FINAL CTA
   ============================================ */
.app-final {
    background: var(--bg-dark);
    padding: 6rem var(--gutter);
    text-align: center;
}

.app-final-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.app-final .app-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
}

.app-final h2 {
    font-size: clamp(1.9rem, 4.2vw, 2.8rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-on-dark);
}

.app-final p {
    color: var(--text-on-dark-secondary);
    font-size: 1.05rem;
}

.app-final p a {
    color: var(--accent-on-dark);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .app-final p a:hover {
        text-decoration: underline;
    }
}

/* ============================================
   FOOTER — same as the home page
   ============================================ */
.footer {
    padding: 3rem var(--gutter);
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    text-align: center;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-subtle-dark);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.footer-brand span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-on-dark);
}

.footer-links {
    display: flex;
    gap: 0.75rem 1.75rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-on-dark-tertiary);
    text-decoration: none;
    font-size: 0.82rem;
    touch-action: manipulation;
    transition: color var(--dur-fast) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
    .footer-links a:hover {
        color: var(--text-on-dark);
    }
}

.footer-copy {
    color: var(--text-on-dark-tertiary);
    font-size: 0.78rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 980px) {
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .widget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .split {
        grid-template-columns: minmax(0, 1fr);
    }
    .app-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    :root {
        --gutter: 1rem;
    }
    .nav-links {
        gap: 1rem;
    }
    .nav-links .nav-hide-sm {
        display: none;
    }
    .app-hero {
        padding-top: calc(var(--nav-height) + 3.25rem + env(safe-area-inset-top));
    }
    .app-icon {
        width: 92px;
        height: 92px;
        border-radius: 22px;
    }
    .app-hero-cta {
        flex-direction: column;
        width: 100%;
    }
    .app-hero-cta .btn-primary,
    .app-hero-cta .btn-secondary {
        width: 100%;
    }
    .app-section,
    .app-final {
        padding-top: 4.25rem;
        padding-bottom: 4.25rem;
    }
    .app-section-header {
        margin-bottom: 2.25rem;
    }
    .feature-grid,
    .widget-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .split-card {
        padding: 1.75rem 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .btn-primary,
    .btn-secondary,
    .faq summary::after {
        transition: none;
    }
}
