/* ==========================================================================
   pAiCoder — Premium Apple/Tesla-Inspired Design (Enhanced v2)
   Dynamic flashing sections + alternating full-bleed color pages + moving text
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --orange: #E85D04;
    --orange-dark: #D84A02;
    --black: #0A0A0A;
    --gray: #555555;
    --light-gray: #F7F7F7;
    --border: #E8E8E8;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    color: var(--black);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

/* Header - now explicitly tall enough for large logo */
header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
    min-height: 60px;           /* reduced ~1/3 from 240px */
    max-height: 60px;           /* reduced ~1/3 from 240px */
    display: flex;
    align-items: center;
}

/* Header Nav */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100;
    min-height: 60px;            /* reduced ~1/3 from 100px */
    max-height: 60px;            /* reduced ~1/3 from 100px */
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;                /* reduced ~1/3 from 100px */
    flex-shrink: 0;
}

.logo img {
    height: 60px;                /* reduced ~1/3 from 90px */
    width: auto;
    max-height: 60px;
    display: block;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hero with Flash */
.hero {
    padding: 160px 0 140px;
    text-align: center;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.flash-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.6s ease;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 82px;
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: -4.8px;
    margin-bottom: 28px;
    position: relative;
    z-index: 3;
}

.hero .tagline {
    font-size: 23px;
    color: var(--gray);
    max-width: 640px;
    margin: 0 auto 56px;
    line-height: 1.35;
    position: relative;
    z-index: 3;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
    z-index: 3;
}

.badge {
    background: var(--light-gray);
    color: var(--black);
    padding: 9px 22px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.badge.orange {
    background: #FFF1E6;
    color: var(--orange);
}

/* ============================================
   DYNAMIC IMPACT SECTIONS (5 flashing phrases)
   ============================================ */

.impact-section {
    padding: 130px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: filter 0.3s ease;
}

.impact-section.black { background: #0A0A0A; color: #fff; }
.impact-section.grey { background: #1C1C1E; color: #fff; }
.impact-section.orange { background: #E85D04; color: #fff; }
.impact-section.dark-grey { background: #111111; color: #fff; }
.impact-section.white { background: #fff; color: var(--black); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.impact-content {
    max-width: 1100px;
    padding: 0 40px;
}

.dynamic-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 52px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2.5px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 900ms cubic-bezier(0.23, 1, 0.32, 1);
}

.impact-section.visible .dynamic-text {
    opacity: 1;
    transform: translateY(0);
}

.dynamic-text.small {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -1px;
}

/* ============================================
   MANIFESTO + INTRO
   ============================================ */

.manifesto {
    padding: 80px 0;
    background: #fff;
    text-align: center;
}

.manifesto p {
    font-size: 26px;
    font-weight: 600;
    color: var(--black);
    letter-spacing: -0.8px;
}

.intro {
    padding: 100px 0;
    background: #f8f8f8;
}

.intro p {
    font-size: 21px;
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    color: #444;
    line-height: 1.6;
}

/* ============================================
   FEATURE BOXES (4 colored boxes)
   ============================================ */

.feature-boxes {
    padding: 100px 0;
    background: #fff;
}

.feature-boxes h2 {
    text-align: center;
    margin-bottom: 60px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.feature-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px 42px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px -15px rgb(0 0 0 / 0.06);
}

.feature-box.dark {
    background: #111;
    color: #fff;
    border-color: #222;
}

.feature-box.orange {
    background: #E85D04;
    color: #fff;
    border-color: #E85D04;
}

.feature-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 70px -20px rgb(0 0 0 / 0.15);
}

.feature-box .feature-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 18px;
    opacity: 0.7;
}

.feature-box h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.feature-box p {
    font-size: 17px;
    line-height: 1.65;
    opacity: 0.9;
}

/* ============================================
   MOVING BANNERS — Right-to-Left Continuous Marquee
   ============================================ */

.moving-banner {
    padding: 140px 0;
    overflow: hidden;
    position: relative;
}

.moving-banner.black { background: #0A0A0A; }
.moving-banner.orange { background: #E85D04; }

.moving-text {
    display: flex;
    align-items: center;
    gap: 140px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 21px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    animation: marquee 12s linear infinite;
}

.moving-text span {
    display: inline-block;
    padding-right: 140px;
}

@keyframes marquee {
    0%   { transform: translateX(90px); }   /* start ~1 inch from the right */
    100% { transform: translateX(-50%); }
}

/* ============================================
   CONTENT BOX GRIDS
   ============================================ */

.content-section {
    padding: 110px 0;
    background: #fff;
}

.content-section.alt {
    background: #f8f8f8;
}

.content-section h2 {
    margin-bottom: 50px;
}

.content-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.content-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 32px;
    transition: all 0.3s ease;
}

.content-box.dark {
    background: #111;
    color: #fff;
    border-color: #222;
}

.content-box h4 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 12px;
}

.content-box p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.content-box.dark p {
    color: #aaa;
}

/* ============================================
   WORKFLOW STEPS
   ============================================ */

.workflow-section {
    padding: 110px 0;
    background: #fff;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 50px;
}

.step {
    background: #f8f8f8;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    font-size: 17px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-6px);
    border-color: #ddd;
    box-shadow: 0 15px 35px -10px rgb(0 0 0 / 0.08);
}

.step span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* ============================================
   MODELS SECTION
   ============================================ */

.models-section {
    padding: 110px 0;
    background: #111;
    color: #fff;
}

.models-section h2 {
    color: #fff;
}

.models-section p {
    max-width: 720px;
    font-size: 18px;
    color: #aaa;
    margin-bottom: 40px;
}

/* ============================================
   CORE CAPABILITIES GRID
   ============================================ */

.features-grid-section {
    padding: 110px 0;
    background: #fff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 26px;
    margin-top: 50px;
}

.feature {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 42px 36px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.1);
    border-color: #ddd;
}

.feature h3 {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 14px;
}

.feature p {
    color: var(--gray);
    font-size: 16px;
    line-height: 1.7;
}

/* ============================================
   QUICKSTART + LICENSE
   ============================================ */

.quickstart-section {
    padding: 100px 0;
    background: #f8f8f8;
}

.quickstart-section h2 {
    font-size: 32px;
}

.quickstart-section ol {
    font-size: 17px;
    line-height: 2.4;
    max-width: 620px;
    margin-top: 30px;
    padding-left: 30px;
}

.license-section {
    padding: 80px 0;
    text-align: center;
    background: #fff;
    font-size: 17px;
    color: var(--gray);
}

.license-section a {
    color: var(--orange);
    text-decoration: none;
}

.license-section a:hover {
    text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    border-top: 1px solid var(--border);
    padding: 70px 0;
    color: var(--gray);
    font-size: 15px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.links a {
    color: var(--black);
    margin-left: 36px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* ============================================
   CODE BLOCKS
   ============================================ */

pre {
    background: #0F0F0F;
    color: #E5E5E5;
    padding: 36px;
    border-radius: 18px;
    overflow-x: auto;
    font-size: 15.5px;
    line-height: 1.65;
    margin: 36px 0;
    box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.2);
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    header { min-height: 120px; }
    .nav { min-height: 107px; }
    .logo { height: 93px; }
    .logo img { height: 80px; }
    
    .nav-links { gap: 26px; }
    
    .hero { padding: 110px 0 90px; }
    .hero h1 { font-size: 52px; letter-spacing: -2.5px; }
    .hero .tagline { font-size: 19px; }
    
    h2 { font-size: 36px; }
    section { padding: 80px 0; }
    
    .impact-section { padding: 100px 0; }
    .dynamic-text { font-size: 34px; letter-spacing: -1.5px; }
    .dynamic-text.small { font-size: 22px; }
    
    .feature-grid,
    .content-box-grid,
    .workflow-steps,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-box { padding: 36px 28px; }
    
    .moving-text { font-size: 17px; }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .links a { margin-left: 0; margin-right: 28px; }
}