/* Creable Shop — design system */
:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --ink: #0c0a09;
    --ink-soft: #44403c;
    --muted: #78716c;
    --line: #e7e5e4;
    --line-strong: #d6d3d1;
    --primary: #6d28d9;
    --primary-dark: #5b21b6;
    --primary-soft: #ede9fe;
    --accent-free: #047857;
    --accent-free-bg: #d1fae5;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-soft: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 14px rgba(28, 25, 23, .04);
    --shadow-card: 0 1px 3px rgba(28, 25, 23, .06), 0 8px 24px rgba(28, 25, 23, .06);
    --shadow-hover: 0 4px 8px rgba(28, 25, 23, .08), 0 16px 40px rgba(28, 25, 23, .1);
    --tx: 180ms cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-hd {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(231, 229, 228, .8);
}
.site-hd .wrap { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: grid; place-items: center;
    color: white; font-size: 18px; font-weight: 800; line-height: 1;
    box-shadow: 0 2px 8px rgba(109, 40, 217, .35);
}
.brand-sub { color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: 0; }

.search {
    flex: 1; max-width: 480px;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: 999px; padding: 8px 16px;
    transition: var(--tx);
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search input {
    flex: 1; border: 0; background: transparent; outline: 0;
    font: inherit; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.search svg { color: var(--muted); flex-shrink: 0; }

.hd-actions { display: flex; align-items: center; gap: 14px; }
.btn-ghost {
    color: var(--ink-soft); font-weight: 500; font-size: 14px;
    padding: 8px 12px; border-radius: 8px;
    transition: var(--tx);
}
.btn-ghost:hover { background: var(--line); color: var(--ink); }
.btn-primary {
    background: var(--ink); color: white;
    padding: 8px 16px; border-radius: 999px;
    font-weight: 600; font-size: 14px;
    transition: var(--tx);
}
.btn-primary:hover { background: var(--primary); }

/* ---------- Hero ---------- */
.hero {
    padding: 56px 0 36px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: -40% -10% auto auto; height: 80%; width: 80%;
    background: radial-gradient(ellipse, rgba(167, 139, 250, .35), transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: clamp(36px, 5vw, 56px); line-height: 1.05;
    letter-spacing: -.025em; font-weight: 700;
    margin: 0 0 16px; max-width: 720px;
}
.hero h1 .em {
    background: linear-gradient(90deg, var(--primary), #db2777);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.hero p { font-size: 18px; color: var(--ink-soft); max-width: 600px; margin: 0 0 28px; }

/* ---------- Featured carousel ---------- */
.featured-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px; margin-top: 28px;
}
.featured-card {
    position: relative; padding: 28px;
    border-radius: var(--radius);
    overflow: hidden; min-height: 260px;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: var(--tx); cursor: pointer;
    color: white;
}
.featured-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.featured-card::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.18));
    pointer-events: none;
}
.featured-card > * { position: relative; z-index: 1; }
.featured-card .cat { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.featured-card .name { font-size: 28px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.015em; }
.featured-card .tag { font-size: 15px; opacity: .92; max-width: 24ch; }
.featured-card .price-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, .22); backdrop-filter: blur(8px);
    padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
    align-self: flex-start; margin-top: 16px;
}

/* ---------- Section heading ---------- */
.section { padding: 48px 0; }
.sec-hd { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.sec-hd h2 { font-size: 28px; letter-spacing: -.015em; margin: 0; font-weight: 700; }
.sec-hd .sub { color: var(--muted); font-size: 14px; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
    padding: 8px 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--ink-soft); font-weight: 500; font-size: 14px;
    cursor: pointer; transition: var(--tx);
    user-select: none;
}
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ---------- App grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px;
    transition: var(--tx); cursor: pointer; position: relative;
    display: flex; flex-direction: column; gap: 12px;
}
.card:hover { border-color: transparent; box-shadow: var(--shadow-card); transform: translateY(-1px); }

.card-top { display: flex; gap: 12px; align-items: flex-start; }
.icon {
    width: 56px; height: 56px; flex-shrink: 0;
    border-radius: 14px; display: grid; place-items: center;
    color: white; font-size: 28px; font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.18);
    line-height: 1;
}
.card .name { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.card .tagline { font-size: 13px; color: var(--muted); margin: 2px 0 0; line-height: 1.4; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.rating { color: var(--ink-soft); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.rating .stars { color: #eab308; letter-spacing: -1px; }
.rating .count { color: var(--muted); font-size: 12px; }
.price-pill {
    font-weight: 600; font-size: 13px;
    padding: 4px 10px; border-radius: 999px;
}
.price-pill.free { background: var(--accent-free-bg); color: var(--accent-free); }
.price-pill.paid { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- App detail (app.php) ---------- */
.app-hero {
    padding: 40px 0 24px;
    display: grid; grid-template-columns: 96px 1fr auto; gap: 28px; align-items: center;
}
.app-hero .icon { width: 96px; height: 96px; border-radius: 22px; font-size: 48px; }
.app-hero h1 { font-size: 32px; margin: 0 0 4px; letter-spacing: -.015em; font-weight: 700; }
.app-hero .tagline { font-size: 17px; color: var(--ink-soft); margin: 0; }
.app-hero .breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.app-hero .breadcrumb a:hover { color: var(--ink); }

.cta-block { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 200px; }
.cta-btn {
    padding: 14px 24px; border-radius: 14px; border: 0;
    font: inherit; font-weight: 600; font-size: 15px;
    cursor: pointer; transition: var(--tx);
}
.cta-btn.free { background: var(--ink); color: white; }
.cta-btn.free:hover { background: var(--primary); }
.cta-btn.paid { background: var(--primary); color: white; }
.cta-btn.paid:hover { background: var(--primary-dark); }
.cta-block .cta-meta { font-size: 12px; color: var(--muted); text-align: center; }

.facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0; margin: 24px 0;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.fact { padding: 14px 18px; border-right: 1px solid var(--line); }
.fact:last-child { border-right: 0; }
.fact .l { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; font-weight: 600; }
.fact .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 32px 0; }
.shot {
    aspect-ratio: 16 / 10; border-radius: 14px;
    display: grid; place-items: center; color: rgba(255,255,255,.92);
    font-weight: 600; font-size: 14px;
    box-shadow: var(--shadow-soft);
    position: relative; overflow: hidden;
}
.shot::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 60%);
}
.app-body { display: grid; grid-template-columns: 2fr 1fr; gap: 36px; margin-bottom: 60px; }
.app-body h2 { font-size: 22px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; }
.app-body p { margin: 0 0 12px; color: var(--ink-soft); }
.features-list { list-style: none; padding: 0; margin: 0; }
.features-list li {
    padding: 12px 0; border-bottom: 1px solid var(--line);
    display: flex; align-items: start; gap: 10px;
}
.features-list li:last-child { border-bottom: 0; }
.features-list li::before {
    content: "✓"; color: var(--accent-free);
    font-weight: 700; flex-shrink: 0; font-size: 16px; line-height: 1.4;
}

.side-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; position: sticky; top: 90px;
}
.side-card .kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.side-card .kv:last-child { border-bottom: 0; }
.side-card .kv .k { color: var(--muted); }
.side-card .kv .v { font-weight: 600; color: var(--ink); }

/* ---------- Footer ---------- */
.site-ft { padding: 40px 0; border-top: 1px solid var(--line); margin-top: 60px; color: var(--muted); font-size: 13px; }
.site-ft .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-ft a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .site-hd .wrap { gap: 12px; flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .app-hero { grid-template-columns: 80px 1fr; }
    .app-hero .cta-block { grid-column: 1 / -1; }
    .app-body { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: 1fr 1fr; }
    .hero { padding-top: 32px; }
    .featured-card { min-height: 200px; padding: 22px; }
}
