/* ============================================================
   Kryden Store — design system comercial (vibrante)
   Mesma identidade do site kryden.com.br e do KrydenPages:
   tokens oklch, shell de sidebar, grade técnica fina,
   botões shadcn, cards com barra de acento. Rajdhani + Inter.
   (NÃO é o conceito "Calm" dos apps desktop.)
   ============================================================ */

:root {
    --background: oklch(0.196 0 0);
    --foreground: oklch(0.961 0 0);
    --card: oklch(0.294 0 0);
    --card-highlight: oklch(0.38 0 0);
    --secondary: oklch(0.392 0 0);
    --muted-foreground: oklch(0.71 0 0);
    --text-muted: oklch(0.478 0 0);
    --border: oklch(0.392 0 0);
    --accent: oklch(0.85 0.15 95);
    --accent-foreground: oklch(0.196 0 0);
    --black-base: oklch(0.098 0 0);

    --radius: 8px;
    --radius-md: 6px;
    --font-head: "Rajdhani", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; }

/* Grade técnica fina (igual ao site) */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(oklch(0.392 0 0 / 0.12) 1px, transparent 1px),
        linear-gradient(90deg, oklch(0.392 0 0 / 0.12) 1px, transparent 1px);
    background-size: 6px 6px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%);
    mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%);
}

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
    position: relative;
    z-index: 20;
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
    background: color-mix(in oklch, var(--card) 40%, transparent);
    backdrop-filter: blur(6px);
}
.sidebar-logo {
    height: 80px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-bottom: 1px solid color-mix(in oklch, var(--border) 40%, transparent);
}
.sidebar-logo img { height: 26px; display: block; }
.sidebar-logo .sub {
    font-family: var(--font-head); font-weight: 600; font-size: .72rem;
    letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
    border-left: 1px solid color-mix(in oklch, var(--border) 70%, transparent); padding-left: 10px;
}
.side-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side-section { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-foreground); margin: 12px 4px 6px; padding: 0 8px 8px; border-bottom: 1px solid color-mix(in oklch, var(--border) 45%, transparent); }
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: .875rem; font-weight: 500;
    color: var(--muted-foreground);
    transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: color-mix(in oklch, var(--secondary) 40%, transparent); color: var(--foreground); }
.nav-item.active { background: color-mix(in oklch, var(--secondary) 60%, transparent); color: var(--foreground); }
.nav-item .accent-bar {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 0; border-radius: 0 3px 3px 0; background: var(--accent);
    opacity: 0; transition: all .3s ease;
}
.nav-item.active .accent-bar { height: 24px; opacity: 1; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item.active svg { color: var(--accent); }
.nav-item .nav-ico { display: grid; place-items: center; width: 22px; height: 22px; flex: none; color: var(--muted-foreground); }
.nav-item .nav-ico svg { width: 19px; height: 19px; }
.nav-item:hover .nav-ico, .nav-item.active .nav-ico { color: var(--accent); }
.sidebar-bottom { padding: 12px; border-top: 1px solid color-mix(in oklch, var(--border) 40%, transparent); display: flex; flex-direction: column; gap: 4px; }
.side-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius); font-size: .875rem; font-weight: 500;
    color: var(--muted-foreground); transition: background .15s, color .15s;
}
.side-link:hover { background: color-mix(in oklch, var(--secondary) 40%, transparent); color: var(--foreground); }
.side-link svg { width: 20px; height: 20px; }
.side-cta {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius); font-size: .875rem; font-weight: 600;
    background: var(--accent); color: var(--accent-foreground);
    transition: filter .15s ease;
}
.side-cta:hover { background: color-mix(in oklch, var(--accent) 90%, var(--background)); }
.side-cta svg { width: 20px; height: 20px; }

/* ---------- Coluna principal ---------- */
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 10; }
.app-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.topbar { display: none; }

/* ---------- Botões (shadcn) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    white-space: nowrap;
    height: 40px; padding: 0 2rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body); font-weight: 600; font-size: 1rem;
    border: 1px solid transparent; cursor: pointer;
    transition: filter .15s ease, background .15s ease, transform .12s ease, border-color .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-foreground); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 90%, var(--background)); }
.btn-outline { background: transparent; border: 1px solid color-mix(in oklch, var(--border) 70%, transparent); color: color-mix(in oklch, var(--foreground) 85%, transparent); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, transparent); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, transparent); }
.btn-sm { height: 34px; padding: 0 1rem; font-size: .85rem; border-radius: var(--radius-md); }

/* ---------- Seções ---------- */
.section { padding: 6rem 1.5rem; }
.section.tight { padding: 4rem 1.5rem; }
.wrap { max-width: 72rem; margin: 0 auto; }
.wrap-sm { max-width: 56rem; margin: 0 auto; }

.sec-label { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.sec-label .ln { width: 3rem; height: 2px; background: var(--accent); }
.sec-label span { font-size: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sec-title { font-size: clamp(1.875rem, 4vw, 2.4rem); font-weight: 700; text-align: center; }
.sec-sub { color: var(--muted-foreground); text-align: center; max-width: 42rem; margin: .75rem auto 0; }
.sec-head { margin-bottom: 3rem; }

/* ---------- Hero ---------- */
.hero { max-width: 56rem; margin: 0 auto; text-align: center; padding: 6.5rem 1.5rem 4rem; }
.hero-emblem { width: 9.5rem; height: 9.5rem; margin: 0 auto 1.5rem; display: block; }
.pill {
    display: inline-flex; align-items: center; gap: .5rem;
    color: var(--accent); font-size: .875rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    background: color-mix(in oklch, var(--accent) 10%, transparent);
    padding: .5rem 1rem; border-radius: 999px;
    border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
}
.pill svg { width: 16px; height: 16px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -.02em; line-height: 1.08; margin: 1.5rem 0; }
.hero h1 .accent-line { display: block; color: var(--accent); }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted-foreground); max-width: 46rem; margin: 0 auto 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.hero .caption { font-size: .875rem; color: var(--muted-foreground); font-style: italic; }

/* ---------- Status (bolinha + texto, sem moldura) ---------- */
.status { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; color: var(--muted-foreground); }
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px color-mix(in oklch, var(--accent) 70%, transparent); }
.status.soon .dot { background: #fb923c; box-shadow: 0 0 6px color-mix(in oklch, #fb923c 70%, transparent); }

/* ---------- Linha divisória fina ---------- */
.divider { height: 1px; background: color-mix(in oklch, var(--border) 35%, transparent); }
.app-card.has-cover .divider { display: none; }

/* ---------- Grade de apps (home) — espelha os cards do site ---------- */
.app-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
.app-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 1rem;
    background: var(--card);
    border: 2px solid color-mix(in oklch, var(--border) 50%, transparent);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color .3s ease, box-shadow .3s ease, transform .2s ease;
}
.app-card:hover { border-color: var(--accent); box-shadow: 0 10px 30px color-mix(in oklch, var(--accent) 10%, transparent); }
.app-card .topbar-accent { position: absolute; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 2; transition: width .3s ease; }
.app-card:hover .topbar-accent { width: 100%; }
.app-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
/* Capa opcional: imagem como FUNDO do cabeçalho (atrás de ícone, nome e status),
   full-bleed no topo do card. Scrim escuro garante legibilidade do texto. */
.app-card.has-cover .app-card-head {
    margin: -1.5rem -1.5rem 0;
    padding: 1.4rem 1.5rem;
    background-image: linear-gradient(90deg, rgba(16,16,16,.94), rgba(16,16,16,.55)), var(--cover);
    background-size: cover; background-position: center;
    border-bottom: 1px solid color-mix(in oklch, var(--border) 45%, transparent);
}
.app-id { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.app-logo {
    flex: none; width: 52px; height: 52px; border-radius: 13px;
    display: grid; place-items: center;
    background: var(--black-base);
    box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--border) 45%, transparent);
}
.app-logo img { width: 78%; height: 78%; object-fit: contain; display: block; }
.app-id-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.app-id-text h3 { font-size: 1.15rem; font-weight: 600; margin: 0; line-height: 1.2; }
.app-id-text .app-ver { font-family: var(--font-mono); font-size: .72rem; color: var(--muted-foreground); }
.app-meta { display: flex; align-items: center; gap: .65rem; }
.app-card p { color: var(--muted-foreground); font-size: .92rem; margin: 0; line-height: 1.6; }
.app-card-foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid color-mix(in oklch, var(--border) 35%, transparent); }
/* Overlay que torna o card inteiro clicável (rumo à página do app);
   os botões do rodapé ficam acima (z-index maior) e continuam funcionais. */
.app-card .card-link { position: absolute; inset: 0; z-index: 1; }
.app-card-foot .foot-soon { font-size: .9rem; color: var(--muted-foreground); }
.app-card.locked { opacity: .8; }
.app-card.locked:hover { border-color: color-mix(in oklch, var(--border) 50%, transparent); box-shadow: none; }
.app-card.locked:hover .topbar-accent { width: 0; }

/* ---------- Detalhe do app ---------- */
.app-hero { padding: 2.5rem 1.5rem 1rem; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted-foreground); font-size: .875rem; font-weight: 500; margin-bottom: 1.75rem; transition: color .15s ease; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }
.app-hero-grid { display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap; }
.app-hero-icon {
    width: 120px; height: 120px; flex: none; border-radius: 26px;
    display: grid; place-items: center;
    background: var(--black-base);
    box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--border) 45%, transparent);
}
.app-hero-icon img { width: 76%; height: 76%; object-fit: contain; display: block; }
.app-hero-info { flex: 1; min-width: 280px; }
.app-hero-info h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: .5rem 0 .25rem; }
.app-hero-info .tagline { font-size: 1.15rem; color: var(--muted-foreground); margin: 0 0 1rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: 1.5rem; }
.meta { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted-foreground); }
.meta svg { width: 16px; height: 16px; color: var(--accent); }
.app-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.smartscreen-note { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.25rem; max-width: 42rem; font-size: .85rem; line-height: 1.55; color: var(--muted-foreground); background: color-mix(in oklch, var(--card) 55%, transparent); border: 1px solid color-mix(in oklch, var(--border) 50%, transparent); border-radius: var(--radius); padding: .85rem 1rem; }
.smartscreen-note svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.smartscreen-note b { color: color-mix(in oklch, var(--foreground) 85%, transparent); font-weight: 600; }

.app-detail { display: grid; grid-template-columns: 1fr 20rem; gap: 2rem; align-items: start; }
.detail-main .prose { color: color-mix(in oklch, var(--foreground) 88%, transparent); line-height: 1.75; margin: 0 0 1rem; }
.feature-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1.5rem; }
.feature-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: color-mix(in oklch, var(--foreground) 88%, transparent); }
.feature-list li svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 4px; }

.detail-side { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 1.5rem; }
.side-card { background: var(--card); border: 2px solid color-mix(in oklch, var(--border) 50%, transparent); border-radius: var(--radius); padding: 1.4rem; }
.side-card h3 { font-size: 1.1rem; margin: 0 0 .75rem; }
.side-ver { font-size: .9rem; color: var(--muted-foreground); margin: 0 0 1rem; }
.side-ver b { color: var(--foreground); }
.side-meta { font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted); text-align: center; margin: .75rem 0 0; }
.side-downloads { display: flex; flex-direction: column; gap: 1rem; }
.side-dl .btn { width: 100%; }
.side-dl .side-meta { margin: .4rem 0 0; }
.side-req { border-top: 1px solid color-mix(in oklch, var(--border) 40%, transparent); margin-top: 1.1rem; padding-top: 1rem; }
.side-req .req-label { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.side-req p { font-size: .88rem; color: var(--muted-foreground); margin: .4rem 0 0; line-height: 1.55; }

.changelog { display: flex; flex-direction: column; gap: 1.1rem; }
.cl-entry .cl-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .4rem; }
.cl-entry .cl-ver { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--accent); }
.cl-entry .cl-date { font-size: .75rem; color: var(--text-muted); }
.cl-entry ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.cl-entry ul li { position: relative; padding-left: 1rem; font-size: .85rem; color: var(--muted-foreground); line-height: 1.5; }
.cl-entry ul li::before { content: ""; position: absolute; left: 0; top: .55rem; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---------- CTA final ---------- */
.cta-final { text-align: center; background: color-mix(in oklch, var(--card) 60%, transparent); border: 2px solid color-mix(in oklch, var(--border) 50%, transparent); border-radius: var(--radius); padding: 3.5rem 2rem; }
.cta-final h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.cta-final p { color: var(--muted-foreground); max-width: 34rem; margin: .75rem auto 1.75rem; }

/* ---------- Footer ---------- */
.app-footer { background: color-mix(in oklch, var(--black-base) 50%, transparent); border-top: 1px solid color-mix(in oklch, var(--border) 30%, transparent); padding: 2rem 1.5rem; }
.app-footer .wrap { display: flex; flex-direction: column; gap: 1.25rem; }
.app-footer .row { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.app-footer .brand-y { font-family: var(--font-head); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.app-footer p { color: var(--muted-foreground); font-size: .9rem; margin: .35rem 0 0; }
.app-footer .socials { display: flex; gap: .6rem; }
.app-footer .socials a {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    display: grid; place-items: center;
    color: var(--muted-foreground);
    border: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
    background: color-mix(in oklch, var(--secondary) 25%, transparent);
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.app-footer .socials a:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in oklch, var(--accent) 10%, transparent); }
.app-footer .socials svg { width: 19px; height: 19px; }
.app-footer .copyright { text-align: center; color: var(--text-muted); font-size: .8rem; border-top: 1px solid color-mix(in oklch, var(--border) 30%, transparent); padding-top: 1.25rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .topbar {
        display: flex; align-items: center; justify-content: space-between;
        height: 64px; flex-shrink: 0; padding: 0 1rem;
        border-bottom: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
        background: color-mix(in oklch, var(--card) 80%, transparent);
        backdrop-filter: blur(8px); position: relative; z-index: 30;
    }
    .topbar img { height: 22px; }
    .topbar .menu-btn { background: none; border: 0; color: var(--foreground); padding: 6px; cursor: pointer; }
    .topbar .menu-btn svg { width: 24px; height: 24px; display: block; }

    .drawer { display: none; position: absolute; inset-inline: 0; top: 64px; z-index: 30; background: color-mix(in oklch, var(--card) 96%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in oklch, var(--border) 60%, transparent); padding: 12px; flex-direction: column; gap: 4px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
    #nav-toggle:checked ~ .main-col .drawer { display: flex; }

    .app-grid { grid-template-columns: 1fr; }
    .app-detail { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .feature-list { grid-template-columns: 1fr; }
    .section { padding: 4rem 1.25rem; }
    .hero { padding: 3.5rem 1.25rem 3rem; }
    .app-hero { padding: 1.5rem 1.25rem .5rem; }
}
@media (min-width: 769px) and (max-width: 1100px) { .app-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 769px) { .drawer { display: none; } }
