/* HDApps Shared Design System — gemini-frontend-design */
:root {
    --bg-main: #0D0F14;
    --bg-surface: #141821;
    --bg-surface-hover: #1A1F2B;
    --border: #232938;
    --border-strong: #364057;
    --text-primary: #F8FAFC;
    --text-secondary: #A3AEC2;
    --text-muted: #8490A6;
    --accent: #4F8CFF;
    --accent-hover: #6BA0FF;
    --accent-green: #34D399;
    --accent-motionary: #FACC15;
    --accent-taptide: #3BE0C5;
    --accent-dailybrain: #8B5CF6;

    --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Strict 3-size body typography scale */
    --text-heading: 1.5rem;   /* 24px */
    --text-body: 1rem;        /* 16px */
    --text-sm: 0.875rem;      /* 14px */

    --radius-md: 12px;
    --radius-lg: 16px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-variant-numeric: tabular-nums;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

h1, h2, .nav-brand {
    font-family: var(--font-display);
}

h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

h2 {
    font-size: var(--text-heading);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h3, h4 {
    font-size: var(--text-body);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

p, li, td, th, label, input, select, textarea, summary {
    font-size: var(--text-body);
}

/* Shared Top Navigation (Subpages) */
.site-nav,
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13, 15, 20, 0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(35, 41, 56, 0.6);
}

.site-nav a,
.navbar a,
.back-btn,
.back-link,
.breadcrumbs,
.updated,
.meta,
.highlight-meta,
.screen-caption,
footer,
.page-footer {
    font-size: var(--text-sm);
}

/* Remove decorative pill/badge chrome site-wide */
.pill-row,
.app-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    margin: 20px 0 28px;
}

.pill,
.app-tag-free,
.tag-free,
.badge,
.badge-free,
.tool-badge,
.press-badge,
.tab-sub,
.muscle-badge,
.difficulty-badge,
.category-badge {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: var(--text-sm) !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}

.pill::after {
    content: "·";
    margin-left: 14px;
    color: var(--text-muted);
}

.pill:last-child::after {
    content: "";
    margin-left: 0;
}

/* Keep prose readable */
main p,
main li {
    max-width: 68ch;
}

/* Explicit transitions & reduced motion */
a, button {
    transition: color 0.18s var(--ease), background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

/* Site-wide section reveal & interactive box effects */
[data-fx-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

[data-fx-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.fx-card {
    position: relative;
    overflow: hidden;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
    transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
    will-change: transform;
}

.fx-card:hover {
    --ty: -3px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.fx-card > :not(.fx-sheen):not(.app-hero-3d) {
    position: relative;
    z-index: 1;
}

.fx-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 20%), rgba(var(--fx-rgb, 79, 140, 255), 0.11), transparent 68%);
    transition: opacity 0.25s var(--ease);
}

.fx-card:hover .fx-sheen,
.fx-card.is-in-focus .fx-sheen {
    opacity: 0.85;
}

.fx-card-flat {
    position: relative;
    overflow: hidden;
    transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.fx-card-flat > :not(.fx-sheen):not(.app-hero-3d):not(.bottom-cta-3d) {
    position: relative;
    z-index: 1;
}

.fx-card-flat:hover .fx-sheen,
.fx-card-flat.is-in-focus .fx-sheen {
    opacity: 0.85;
}

.steps-list li,
.mistakes-list li {
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.steps-list li:hover,
.mistakes-list li:hover {
    transform: translateX(4px);
}

.app-hero-3d {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.55s var(--ease);
    mask-image: radial-gradient(circle at 82% 35%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 82% 35%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 80%);
}

.app-hero-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.is-hero-3d-ready .app-hero-3d {
    opacity: 0.28;
}

.is-hero-3d-ready:hover .app-hero-3d {
    opacity: 0.42;
}

.screenshot-card,
.screen-card,
.app-screenshots .screenshot-link {
    transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.screenshot-card:hover,
.screen-card:hover,
.app-screenshots .screenshot-link:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

.comparison-table tbody tr {
    transition: background-color 0.2s var(--ease);
}

.comparison-table tbody tr:hover {
    background: rgba(79, 140, 255, 0.05);
}

.faq-item {
    transition: border-color 0.22s var(--ease), background-color 0.22s var(--ease), transform 0.22s var(--ease);
}

.faq-item:hover,
.faq-item[open] {
    border-color: rgba(var(--fx-rgb, 79, 140, 255), 0.45);
}

.feature-icon {
    display: inline-block;
    transition: transform 0.25s var(--ease);
}

.feature-box:hover .feature-icon {
    transform: translateY(-3px) scale(1.12);
}

.tool-card.motionary { --fx-rgb: 250, 204, 21; }
.tool-card.taptide { --fx-rgb: 59, 224, 197; }
.tool-card.dailybrain { --fx-rgb: 139, 92, 246; }

.bottom-cta-3d {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.55s var(--ease);
    mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 85%);
}

.bottom-cta-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.is-cta-3d-ready .bottom-cta-3d {
    opacity: 0.34;
}

.is-cta-3d-ready:hover .bottom-cta-3d {
    opacity: 0.52;
}

/* Cursor-reactive background aura across all pages */
.hdapps-cursor-aura {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(620px circle at var(--cx, 50%) var(--cy, 25%), rgba(var(--fx-rgb, 79, 140, 255), 0.13), transparent 62%),
        radial-gradient(900px circle at 50% 0%, rgba(var(--fx-rgb, 79, 140, 255), 0.05), transparent 70%);
    transition: opacity 0.4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    [data-fx-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
    .fx-card {
        transform: none !important;
    }
}
