/* ============================================
   Whitespace — Design System
   Dark theme with red accent (#e94560)
   ============================================ */

/* ---- Self-hosted Fonts ---- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Colors */
    --bg-primary:    #0a0a14;
    --bg-secondary:  #10101e;
    --bg-card:       #151528;
    --bg-card-hover: #1a1a35;
    --bg-nav:        rgba(10, 10, 20, 0.92);

    --text-primary:   #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted:     #606080;

    /* Gold accent for links, highlights, branding */
    --accent:         #c89b2e;
    --accent-hover:   #dbb23a;
    --accent-glow:    rgba(200, 155, 46, 0.12);
    --accent-subtle:  rgba(200, 155, 46, 0.08);

    /* Blue for CTA buttons */
    --cta:            #4a8fe7;
    --cta-hover:      #5fa0f5;
    --cta-glow:       rgba(74, 143, 231, 0.25);

    --border:         rgba(255, 255, 255, 0.06);
    --border-accent:  rgba(200, 155, 46, 0.3);

    /* Typography */
    --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 5rem;

    /* Layout */
    --container-max: 1200px;
    --nav-height: 72px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.3s var(--ease);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent);
    word-break: break-all;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ---- Container ---- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background var(--transition);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.nav__logo:hover {
    color: var(--text-primary);
}

.nav__logo-mark {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 500;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    list-style: none;
}

.nav__links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: var(--space-xs) 0;
    position: relative;
    transition: color var(--transition);
}

.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform var(--transition);
}

.nav__links a:hover,
.nav__links a.active {
    color: var(--text-primary);
}

.nav__links a.active::after,
.nav__links a:hover::after {
    transform: scaleX(1);
}

.nav__lang {
    font-family: var(--font-mono);
    font-size: 0.8rem !important;
    padding: var(--space-xs) var(--space-md) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em !important;
}

.nav__lang:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.nav__lang::after {
    display: none !important;
}

/* Hamburger */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav__toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

.nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Hero Section ---- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(200, 155, 46, 0.18) 0%, rgba(74, 143, 231, 0.06) 40%, transparent 70%);
    pointer-events: none;
}

.hero__content {
    position: relative;
    max-width: 700px;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__claim {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 0.03em;
    margin-bottom: var(--space-lg);
    opacity: 0.85;
}

.hero__subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.85rem 2rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn--primary {
    background: var(--cta);
    color: #fff;
    box-shadow: 0 4px 24px var(--cta-glow);
}

.btn--primary:hover {
    background: var(--cta-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74, 143, 231, 0.35);
}

.btn--outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-2px);
}

.btn--ghost {
    background: transparent;
    color: var(--accent);
    padding: 0.85rem 1.5rem;
}

.btn--ghost:hover {
    background: var(--accent-subtle);
    color: var(--accent-hover);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
}

/* ---- Sections ---- */
.section {
    padding: var(--space-2xl) 0;
}

.section--alt {
    background: var(--bg-secondary);
}

.section__header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section__title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.section__subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ---- Project Cards ---- */
.projects-featured {
    max-width: 900px;
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card__icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-lg);
    display: block;
}

.project-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.project-card__tagline {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.project-card__desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.project-card__link {
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.project-card__link::after {
    content: '\2192';
    transition: transform var(--transition);
}

.project-card__link:hover::after {
    transform: translateX(4px);
}

/* Featured project card (single project layout) */
.project-card--featured {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.project-card--featured .project-card__visual {
    overflow: hidden;
}

.project-card--featured .project-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.project-card--featured:hover .project-card__visual img {
    transform: scale(1.03);
}

.project-card--featured .project-card__body {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .project-card--featured {
        grid-template-columns: 1fr;
    }

    .project-card--featured .project-card__visual {
        max-height: 250px;
    }
}

/* ---- Product Hero ---- */
.product-hero {
    padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.product-hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 1100px;
    height: 700px;
    background: radial-gradient(ellipse, rgba(200, 155, 46, 0.16) 0%, rgba(74, 143, 231, 0.05) 45%, transparent 65%);
    pointer-events: none;
}

.product-hero__content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.product-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: var(--space-lg);
}

.product-hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
}

.product-hero__subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.product-hero__desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto var(--space-xl);
}

/* ---- Why Section / Value Props ---- */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.why-card {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.why-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

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

@media (max-width: 768px) {
    .why-grid--2col {
        grid-template-columns: 1fr;
    }
}

.why-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.why-card__icon {
    font-size: 1.8rem;
    margin-bottom: var(--space-md);
    display: block;
}

.why-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.why-card__desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ---- Feature Grid ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.feature-item {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

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

.feature-item__icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    display: block;
}

.feature-item__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.feature-item__desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ---- Screenshot Gallery ---- */
.screenshot-gallery {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.screenshot {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all var(--transition);
}

.screenshot:hover {
    border-color: var(--border-accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot__caption {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Loupe (desktop) + Guest (mobile) side by side, aligned by height */
.screenshot-pair {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.screenshot-pair .screenshot--desktop {
    flex: 1;
    min-width: 0;
}

.screenshot-pair .screenshot--mobile {
    width: 200px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .screenshot-pair {
        flex-direction: column;
        align-items: center;
    }

    .screenshot-pair .screenshot--desktop {
        width: 100%;
    }

    .screenshot-pair .screenshot--mobile {
        width: 220px;
    }
}

/* ---- Compatibility Badges ---- */
.compat-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.compat-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.compat-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
}

/* ---- CTA / Donate Section ---- */
.cta-section {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.cta-section__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.cta-section__desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto var(--space-xl);
}

/* ---- Donate Box ---- */
.donate-box {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    text-align: center;
}

.donate-box__title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.donate-box__desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
}

/* ---- About Page ---- */
.about-content {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.about-story {
    max-width: 680px;
    margin: 0 auto;
}

.about-story__title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.about-story p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: var(--space-md);
}

.about-story p:first-of-type {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 400;
}

.about-story p:last-of-type {
    margin-bottom: 0;
}

.about-story .btn-group {
    justify-content: flex-start;
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border);
    padding: var(--space-xl) 0;
}

.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    text-align: center;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.footer__links {
    display: flex;
    gap: var(--space-lg);
}

.footer__links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer__links a:hover {
    color: var(--text-primary);
}

.footer__social {
    display: flex;
    gap: var(--space-md);
}

.footer__social a {
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer__social a:hover {
    color: var(--accent);
}

.footer__copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- 404 ---- */
.page-404 {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}

.page-404__code {
    font-family: var(--font-mono);
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: var(--space-md);
}

.page-404__title {
    font-size: 6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.page-404__subtitle {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: var(--space-lg);
}

.page-404__text {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
}

/* ---- Scroll Animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* Staggered delays for sibling elements */
.fade-in.stagger-1 { transition-delay: 0.1s; }
.fade-in.stagger-2 { transition-delay: 0.2s; }
.fade-in.stagger-3 { transition-delay: 0.3s; }
.fade-in.stagger-4 { transition-delay: 0.4s; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    :root {
        --space-lg: 1.25rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
        --space-3xl: 3.5rem;
    }

    .nav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #0a0a14;
    }

    .nav__toggle {
        display: flex;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: #0a0a14;
        padding: var(--space-xl);
        gap: var(--space-lg);
        z-index: 999;
    }

    .nav__links.open {
        display: flex;
    }

    .nav__links li {
        border-bottom: 1px solid var(--border);
        padding-bottom: var(--space-md);
    }

    .nav__links li:last-child {
        border-bottom: none;
    }

    .nav__links a {
        font-size: 1.1rem;
        display: block;
    }

    .nav__links a::after {
        display: none;
    }

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

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

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

    .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .hero {
        min-height: 85vh;
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .section__title {
        font-size: 1.5rem;
    }

    .product-hero {
        padding: calc(var(--nav-height) + var(--space-xl)) 0 var(--space-xl);
    }

    .product-hero__title {
        font-size: 2.2rem;
    }

    .cta-section {
        padding: var(--space-2xl) 0;
    }
}

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