/* =============================
   CrispyCore Website — Styles
   Dark-first, calisthenics-focused
   ============================= */

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

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

/* Design Tokens */
:root {
    color-scheme: dark;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Colors */
    --bg:           #0d1117;
    --bg-card:      #161b22;
    --bg-elevated:  #1c2330;
    --bg-input:     rgba(255,255,255,0.04);

    /* Borders */
    --border:       rgba(255,255,255,0.08);
    --border-hover: rgba(99,179,237,0.4);
    --border-focus: rgba(79,163,232,0.45);

    /* Accent */
    --accent:       #4fa3e8;
    --accent-2:     #9b6dff;
    --accent-soft:  rgba(79,163,232,0.12);
    --gradient:     linear-gradient(135deg, #4fa3e8 0%, #9b6dff 100%);

    /* Danger */
    --danger:       #f85149;
    --danger-soft:  rgba(248,81,73,0.12);

    /* Text */
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-faint:   #4a5568;
    --muted:        var(--text-muted); /* alias used in builder */
    --faint:        var(--text-faint); /* alias used in builder */

    /* Radius */
    --radius-sm:    8px;
    --radius-md:    16px;
    --radius-lg:    24px;
    --radius:       var(--radius-md);  /* alias used in builder */

    /* Shadows */
    --shadow:       0 8px 32px rgba(0,0,0,0.4);
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);

    /* Spacing (used in builder) */
    --space-xs:     6px;
    --space-sm:     12px;
    --space-md:     18px;
    --space-lg:     28px;
    --space-xl:     40px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-active {
    color: var(--text) !important;
    font-weight: 600 !important;
}

.nav-cta {
    background: var(--gradient);
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-weight: 600 !important;
    transition: opacity 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ========== HERO ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -200px;
    right: -100px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(79,163,232,0.12) 0%, transparent 65%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(79,163,232,0.12);
    border: 1px solid rgba(79,163,232,0.25);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient);
    color: #fff;
    padding: 0.875rem 1.75rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 24px rgba(79,163,232,0.25);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(79,163,232,0.35);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.875rem 0;
    transition: color 0.2s;
}

.btn-ghost:hover { color: var(--text); }

.hero-req {
    font-size: 0.8rem;
    color: var(--text-faint);
}

/* Hero visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.hero-phone-placeholder {
    position: relative;
    text-align: center;
}

.hero-screenshot {
    max-width: 280px;
    height: auto;
    border-radius: 36px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
    display: block;
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
}

.placeholder-note {
    margin-top: 16px;
    background: rgba(255,200,0,0.08);
    border: 1px dashed rgba(255,200,0,0.3);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.78rem;
    color: #f0b429;
    line-height: 1.5;
}

.placeholder-note small {
    color: var(--text-faint);
    font-size: 0.72rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

/* ========== PROOF BAR ========== */
.proof-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.proof-items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.proof-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.proof-sep {
    color: var(--text-faint);
    font-size: 1.2rem;
}

/* ========== FEATURES ========== */
.features {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.feature-large {
    grid-column: span 2;
    padding: 2rem;
}

.feature-icon-wrap {
    margin-bottom: 1rem;
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-large .feature-icon {
    font-size: 2.5rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.feature-large h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

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

.feature-large p {
    font-size: 0.95rem;
}

/* ========== PLAYER SECTION ========== */
.player-section {
    padding: 100px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.player-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.player-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: block;
}

.section-badge {
    display: inline-block;
    background: rgba(155,109,255,0.12);
    border: 1px solid rgba(155,109,255,0.25);
    color: var(--accent-2);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.player-text h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.player-text > p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.player-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-features li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.pf-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.player-features strong {
    display: block;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.player-features span {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ========== BUILD YOUR OWN PROGRAM ========== */
.byop-section {
    padding: 100px 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.byop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.byop-text h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.byop-text > p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.byop-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.byop-tag {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-family: 'Inter', monospace;
}

.byop-code {
    background: #0a0e14;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.byop-code pre {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 1.5rem;
    margin: 0;
}

.byop-code code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #e6edf3;
    background: none;
    border: none;
    padding: 0;
}

@media (max-width: 900px) {
    .byop-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* ========== SCREENSHOTS ========== */
.screenshots-section {
    padding: 100px 0;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.screenshot-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.phone-frame {
    border-radius: 40px;
    background: #1c1c1e;
    padding: 9px;
    box-shadow:
        0 0 0 1px #3a3a3c,
        0 0 0 3px #0a0a0a,
        0 32px 80px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.phone-frame:hover {
    transform: scale(1.03) translateY(-6px);
    box-shadow:
        0 0 0 1px #3a3a3c,
        0 0 0 3px #0a0a0a,
        0 48px 100px rgba(0,0,0,0.8),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    border-radius: 32px;
    display: block;
}

.screenshot-label {
    font-size: 0.8rem;
    color: var(--text-faint);
    text-align: center;
    font-weight: 500;
}

/* Placeholder screenshots */
.screenshot-placeholders {
    background: var(--bg-card);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 2rem;
}

.ph-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f0b429;
    margin-bottom: 1.25rem;
}

.ph-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.ph-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.ph-frame {
    width: 100%;
    aspect-ratio: 9/19.5;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
    position: relative;
}

.ph-frame::after {
    content: '+';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-faint);
}

.ph-item span {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-weight: 500;
}

/* ========== DOWNLOAD ========== */
.download-section {
    padding: 100px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    text-align: center;
}

.download-content {
    max-width: 500px;
    margin: 0 auto;
}

.download-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(79,163,232,0.2);
}

.download-content h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.download-content > p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.app-store-btn img {
    height: 54px;
    width: auto;
    transition: opacity 0.2s, transform 0.2s;
}

.app-store-btn:hover img {
    opacity: 0.85;
    transform: translateY(-2px);
}

.coming-soon-note {
    font-size: 0.75rem;
    color: #f0b429;
    background: rgba(240,180,41,0.08);
    border: 1px solid rgba(240,180,41,0.2);
    padding: 4px 12px;
    border-radius: 100px;
}

.req-note {
    font-size: 0.8rem;
    color: var(--text-faint);
}

/* ========== FOOTER ========== */
.footer {
    padding: 60px 0 32px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: start;
    margin-bottom: 2rem;
}

.footer-logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.footer-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.footer-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.footer-copyright {
    color: var(--text-faint) !important;
    font-size: 0.8rem !important;
    margin-top: 0.75rem !important;
}

.footer-links {
    display: flex;
    gap: 3rem;
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col ul a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-col ul a:hover {
    color: var(--text);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-large {
        grid-column: span 1;
    }

    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 100px 0 60px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-sub {
        max-width: none;
        margin: 0 auto 2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .player-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .player-visual {
        order: 2;
    }

    .player-text {
        order: 1;
        text-align: center;
    }

    .player-features {
        text-align: left;
    }

    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ph-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .proof-sep {
        display: none;
    }

    .proof-items {
        gap: 0.75rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .screenshots-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .features-grid {
        gap: 0.75rem;
    }

    .hero-screenshot {
        max-width: 220px;
    }

    .download-icon {
        width: 72px;
        height: 72px;
    }
}

/* ========== ANIMATIONS ========== */
@media (prefers-reduced-motion: no-preference) {
    .fade-up {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }

    .fade-up.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========== PRIVACY PAGE ========== */
.privacy-page { padding: 120px 0 80px; }
.privacy-page h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
.privacy-page .updated { color: var(--text-faint); font-size: 0.875rem; margin-bottom: 3rem; display: block; }
.privacy-page h2 { font-size: 1.2rem; font-weight: 600; color: var(--text); margin: 2.5rem 0 0.75rem; }
.privacy-page p, .privacy-page li { color: var(--text-muted); line-height: 1.75; font-size: 0.95rem; }
.privacy-page ul { padding-left: 1.5rem; margin-top: 0.5rem; }
.privacy-page li { margin-bottom: 0.4rem; }
.privacy-page .highlight { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 1rem 0; }
.privacy-page .highlight p { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-size: 0.9rem; font-weight: 500; margin-bottom: 2rem; }
.back-link:hover { opacity: 0.8; }
.prose { max-width: 680px; }
