/*
 * solidblocks.app site styles.
 *
 * Design tokens mirrored from doorgames.io so the publisher and the app
 * feel like a single visual family. If doorgames.io's tokens change,
 * sync them here.
 *
 * Source: https://doorgames.io/css/style.css :root
 *
 * Note: the Space Grotesk font is loaded via <link> tags in _layouts/base.njk
 * (preconnect + stylesheet) so the request is parallelized rather than
 * render-blocking inside this CSS file.
 */
:root {
    /* Backgrounds */
    --bg-primary: #1a1a26;
    --bg-secondary: #1e1e2e;
    --bg-tertiary: #252540;

    /* Text */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #606080;

    /* Accents (all WCAG AA+) */
    --accent-cyan: #00bcd4;
    --accent-cyan-bright: #4dd0e1;
    --accent-magenta: #a855f7;
    --accent-lime: #c0ca33;
    --accent-orange: #e57c23;

    /* Structural */
    --border-color: #404060;
    --shadow-color: rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Brand wordmark font — system monospaced stack to match the in-app
       SwiftUI rendering (which uses .scaledFont(design: .monospaced, weight: .black)
       in MainMenuView.logoView). On Apple devices this resolves to SF Mono;
       elsewhere it falls back to whatever the OS provides. The actual brand
       feel comes from the gradient + glow on .brand and .hero h1, not from
       picking a fancy display font. */
    --font-logo: ui-monospace, 'SF Mono', SFMono-Regular, 'Cascadia Mono', Menlo, Consolas, monospace;

    /* Spacing (8px grid) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Content width — controls the max horizontal extent of header, main,
       and footer. Bumped from 800px → 1000px to give the 4-up features
       grid and 3-up screenshots grid more room. Body prose still stays
       readable (~62ch line length at body font). */
    --content-max-width: 1000px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-cyan);
    transition: color 200ms ease;
}

a:hover {
    color: var(--accent-cyan-bright);
}

/* Header */
.site-header {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Brand wordmark — mirrors MainMenuView.logoView treatment:
   monospaced .black weight + cyan→purple linear gradient + cyan glow.
   See Views/MainMenuView.swift:289-309 for the SwiftUI source. */
.brand {
    font-family: var(--font-logo);
    font-size: 1.3em;
    font-weight: 900; /* .black equivalent */
    text-decoration: none;
    text-transform: uppercase; /* Mirrors Text("BLOCKHEAD") in MainMenuView */
    letter-spacing: 0.04em; /* Caps benefit from a touch more tracking */
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 12px rgba(0, 188, 212, 0.4);
}

.site-nav {
    display: flex;
    gap: var(--spacing-lg);
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--accent-cyan);
}

/* Main content */
.site-main {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--spacing-md);
    width: 100%;
    flex: 1;
}

.site-main h1 {
    font-family: var(--font-heading);
    color: var(--accent-cyan);
    font-size: 2.4em;
    font-weight: 700;
    border-bottom: 2px solid var(--accent-cyan);
    padding-bottom: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    letter-spacing: -0.01em;
}

.site-main h2 {
    font-family: var(--font-heading);
    color: var(--accent-cyan);
    margin-top: var(--spacing-2xl);
    font-weight: 600;
}

.site-main h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
    font-weight: 600;
}

.site-main p,
.site-main li {
    color: var(--text-primary);
}

.site-main ul,
.site-main ol {
    padding-left: var(--spacing-lg);
}

.site-main li {
    margin-bottom: var(--spacing-sm);
}

.site-main strong {
    color: #fff;
}

.updated {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: var(--spacing-xl);
}

.highlight {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin: var(--spacing-lg) 0;
}

.faq {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin: var(--spacing-md) 0;
}

.faq h3 {
    margin-top: 0;
    color: var(--accent-cyan);
}

/* Landing page hero */
.hero {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-xl);
}

/* Hero wordmark — same treatment as .brand but larger.
   Mirrors MainMenuView.logoView at the larger fontSize used on iPhone. */
.hero h1 {
    font-family: var(--font-logo);
    font-size: 3.5em;
    font-weight: 900;
    border-bottom: none;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 24px rgba(0, 188, 212, 0.5);
}

/* Mobile: scale wordmark down so it doesn't crash off the viewport */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.4em;
    }
    .brand {
        font-size: 1em;
    }
}

.hero .tagline {
    font-size: 1.4em;
    color: var(--accent-cyan);
    margin-bottom: var(--spacing-sm);
    font-style: italic;
    font-weight: 500;
}

.hero .description {
    font-size: 1.1em;
    color: var(--text-secondary);
    max-width: 560px;
    margin: var(--spacing-md) auto var(--spacing-xl);
}

/* Apple's official "Download on the App Store" badge.
   Asset: docs/launch/site/public/app-store-badge.svg
   Source: https://tools.applemediaservices.com/app-store/

   Apple guidelines:
   - Don't modify, recolor, tilt, or skew the badge.
   - Maintain minimum padding equal to 1/10th the badge height.
   - Don't pair with text claiming Apple endorses the app.
*/
.app-store-badge {
    /* Apple's badge SVG has its own internal padding. Setting an explicit
       height keeps it crisp across breakpoints; width is intrinsic. */
    height: 60px;
    width: auto;
    display: inline-block;
}

/* Post-launch wrapper: only used when the badge is wrapped in an <a> link. */
.badge-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 200ms ease;
}

.badge-link:hover {
    transform: translateY(-2px);
}

/* Pre-launch state: dimmed to telegraph "not live yet". The badge is
   rendered as a non-interactive <img> until the App Store listing exists. */
.app-store-badge--coming-soon {
    opacity: 0.5;
    filter: saturate(0.6);
}

@media (max-width: 480px) {
    .app-store-badge {
        height: 48px;
    }
}

/* Screenshot showcase — 3 device-shaped images, side by side on desktop.
   Reuses the App Store carousel hero/daily/campaign captures from
   fastlane/screenshots/en-US/, resized to 720px wide for web delivery. */
.screenshots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin: var(--spacing-2xl) 0;
}

.screenshot {
    margin: 0;
    /* The :hover lift gives some interactivity without being a link. */
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.screenshot:hover {
    transform: translateY(-4px);
}

.screenshot img {
    display: block;
    width: 100%;
    height: auto;
    /* Subtle device-screen feel without faking an actual bezel. */
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 800px) {
    .screenshots {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .screenshots {
        /* Horizontal scroll on phones — single screenshot dominates the
           viewport, swipe right to see the next. Better than stacking
           three 700px-tall images in a column. */
        grid-template-columns: repeat(3, 78%);
        gap: var(--spacing-md);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        padding: 0 var(--spacing-md) var(--spacing-md);
        margin-left: calc(-1 * var(--spacing-md));
        margin-right: calc(-1 * var(--spacing-md));
    }
    .screenshots::-webkit-scrollbar {
        display: none;
    }
    .screenshot {
        scroll-snap-align: center;
    }
}

/* Feature grid — 4 across on desktop, mirrors the App Store carousel arc:
   filter → offline → modes → CTA. Cards collapse to 2 cols on tablet,
   1 col on mobile. */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin: var(--spacing-2xl) 0;
}

.feature {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    transition: border-color 200ms ease;
}

.feature:hover {
    border-color: var(--accent-cyan);
}

.feature h3 {
    margin-top: 0;
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1em;
    /* Balance multi-line headings so wrapped lines have similar length —
       prevents "Try before you / buy" with one orphan word. */
    text-wrap: balance;
}

.feature p {
    font-size: 0.9em;
    line-height: 1.55;
    /* Avoid orphan words at line ends — prevents "No / microtransactions"
       splitting "No" onto its own line. */
    text-wrap: pretty;
}

@media (max-width: 800px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    .feature {
        padding: var(--spacing-lg);
    }
    .feature h3 {
        font-size: 1.1em;
    }
    .feature p {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .features {
        grid-template-columns: 1fr;
    }
}

/* About section — single richer section with internal sub-headings.
   Lead paragraph sets the heritage story; mode cards detail the three
   ways to play; commitments list the technical promises. */
.about {
    margin-top: var(--spacing-2xl);
}

.about h3 {
    font-family: var(--font-heading);
    color: var(--accent-cyan);
    margin-top: var(--spacing-2xl);
    font-weight: 600;
    font-size: 1.4em;
}

.about .lead {
    font-size: 1.15em;
    color: var(--text-primary);
    line-height: 1.7;
    margin: var(--spacing-lg) 0;
}

/* Three modes — 3-across on desktop (matches the 3 actual modes),
   collapses to 1-col on narrow screens. Distinct from the top-of-page
   .features grid by having a left cyan border instead of a full border. */
.modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.mode {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-cyan);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
}

.mode h4 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-wrap: balance;
}

.mode p {
    margin: 0;
    font-size: 0.92em;
    color: var(--text-primary);
    line-height: 1.6;
    text-wrap: pretty;
}

@media (max-width: 800px) {
    .modes {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* Commitments — styled list with cyan markers, hangs from the left. */
.commitments {
    list-style: none;
    padding: 0;
    margin: var(--spacing-lg) 0;
}

.commitments li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.commitments li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: 700;
}

.commitments strong {
    color: #fff;
}

/* Footer */
.site-footer {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-md);
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

.site-footer .tagline {
    display: block;
    margin-top: var(--spacing-sm);
    color: var(--text-muted);
    font-style: italic;
}

.site-footer a {
    color: var(--text-secondary);
}

.site-footer a:hover {
    color: var(--accent-cyan);
}
