/* ==========================================================================
   fullstack.fit — Longevity Precision Aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --bg: #faf9f7;
    --bg-subtle: #f0eeea;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --accent: #1a5f4a;
    --accent-hover: #145040;
    --border: #e0ddd6;

    /* Typography */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Override Pico defaults */
    --pico-font-family: var(--font-body);
    --pico-font-size: 100%;
    --pico-line-height: 1.6;
    --pico-background-color: var(--bg);
    --pico-color: var(--text);
    --pico-muted-color: var(--text-muted);
    --pico-primary: var(--accent);
    --pico-primary-hover: var(--accent-hover);
    --pico-border-color: var(--border);
    --pico-card-background-color: var(--bg-subtle);
    --pico-block-spacing-vertical: var(--space-md);
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Subtle grain texture */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 300;
    max-width: 16ch;
    margin-bottom: var(--space-sm);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

p {
    max-width: 60ch;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
header {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-md);
    margin: 0;
    padding: 0;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

.brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text) !important;
    letter-spacing: -0.02em;
}

.cta-small {
    background-color: var(--accent) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    font-size: 0.85rem !important;
    font-weight: 500;
}

.cta-small:hover {
    background-color: var(--accent-hover) !important;
}

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

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.hero-content {
    max-width: 540px;
}

.hero h1 {
    margin-bottom: var(--space-sm);
}

.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent);
}

.hero-illustration svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

/* Progress line animation */
@media (prefers-reduced-motion: no-preference) {
    .hero-illustration .progress-line {
        stroke-dasharray: 300;
        stroke-dashoffset: 300;
        animation: drawLine 1.5s ease-out 0.3s forwards;
    }

    .hero-illustration .data-point {
        opacity: 0;
        animation: fadeIn 0.3s ease-out forwards;
    }

    .hero-illustration .data-point:nth-child(3) { animation-delay: 0.8s; }
    .hero-illustration .data-point:nth-child(4) { animation-delay: 1.1s; }
    .hero-illustration .data-point:nth-child(5) { animation-delay: 1.4s; }
    .hero-illustration .data-point:nth-child(6) { animation-delay: 1.7s; }
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Waitlist Form
   -------------------------------------------------------------------------- */
.waitlist-form {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: var(--space-sm);
    max-width: 480px;
    margin-top: var(--space-md);
    width: 100%;
}

.waitlist-form input[type="email"] {
    flex: 1 1 280px !important;
    min-width: 200px !important;
    width: auto !important;
    padding: 0.875rem 1rem !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    background-color: white !important;
    font-family: var(--font-body) !important;
    font-size: 1rem !important;
    color: var(--text) !important;
    margin-bottom: 0 !important;
    height: auto !important;
}

.waitlist-form input[type="email"]:focus {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(26, 95, 74, 0.1) !important;
}

.waitlist-form input[type="email"]::placeholder {
    color: var(--text-muted);
}

.waitlist-form button {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0.875rem 1.5rem !important;
    background-color: var(--accent) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: var(--font-body) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    margin-bottom: 0;
}

.waitlist-form button:hover {
    background-color: var(--accent-hover);
}

.waitlist-form button:disabled {
    background-color: var(--accent);
    opacity: 0.7;
    cursor: default;
}

.form-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Philosophy Section
   -------------------------------------------------------------------------- */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.philosophy-item {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
}

.philosophy-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.philosophy-no {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.philosophy-item p {
    margin: 0;
    color: var(--text);
    font-weight: 500;
}

.philosophy-statement {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-style: italic;
    max-width: 50ch;
}

/* --------------------------------------------------------------------------
   Features Section
   -------------------------------------------------------------------------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    padding: var(--space-md);
    background-color: var(--bg-subtle);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.feature-icon {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-number {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

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

/* --------------------------------------------------------------------------
   For Who Section
   -------------------------------------------------------------------------- */
.for-who {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-lg);
    align-items: center;
}

.for-who-content {
    max-width: 55ch;
}

.for-who-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.for-who-content p:last-child {
    margin-bottom: 0;
}

.for-who-illustration {
    color: var(--accent);
    padding-right: var(--space-md);
}

.for-who-illustration svg {
    width: 120px;
    height: auto;
}

/* Legacy support */
.for-who p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.for-who p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Final CTA
   -------------------------------------------------------------------------- */
.final-cta {
    text-align: center;
    padding: var(--space-xl) 0;
}

.final-cta p {
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
}

.final-cta .waitlist-form {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    padding-bottom: var(--space-lg);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
}

.brand-footer {
    font-family: var(--font-display);
    font-weight: 500;
    margin: 0;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    section {
        padding: var(--space-lg) 0;
    }

    .hero {
        grid-template-columns: 1fr;
        padding-top: var(--space-lg);
        padding-bottom: var(--space-lg);
    }

    .hero-illustration {
        order: -1;
        margin-bottom: var(--space-md);
    }

    .hero-illustration svg {
        max-width: 240px;
    }

    nav ul {
        gap: var(--space-sm);
    }

    nav ul li:not(:last-child):not(:first-child) {
        display: none;
    }

    .waitlist-form {
        flex-direction: column !important;
    }

    .waitlist-form input[type="email"] {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .waitlist-form button {
        width: 100% !important;
    }

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

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

    .for-who {
        grid-template-columns: 1fr;
    }

    .for-who-illustration {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    .hero h1,
    .hero .lead,
    .hero .waitlist-form {
        animation: fadeUp 0.6s ease-out both;
    }

    .hero .lead {
        animation-delay: 0.1s;
    }

    .hero .waitlist-form {
        animation-delay: 0.2s;
    }

    .feature-card {
        animation: fadeUp 0.6s ease-out both;
    }

    .feature-card:nth-child(1) { animation-delay: 0.1s; }
    .feature-card:nth-child(2) { animation-delay: 0.2s; }
    .feature-card:nth-child(3) { animation-delay: 0.3s; }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
