/* Cadence AI Style - Dark Mode Theme */
:root {
    --bg-dark: #050505;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);
    /* Faint border */
    --primary-text: #FFFFFF;
    --secondary-text: #A1A1A1;
    --accent: #2A84FF;
    --accent-glow: #2A84FF;
    --accent-gradient: linear-gradient(135deg, #2A84FF 0%, #2ACB8F 100%);

    --font-heading: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Card Icons */
.card-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--primary-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    font-weight: 700;
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

p {
    color: var(--secondary-text);
    font-size: 1.125rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.text-center {
    text-align: center;
}

.text-gradient {
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-text);
    color: black;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--secondary-text);
    font-weight: 500;
}

.nav-link:hover {
    color: white;
}

/* Hero Section */
.hero {
    position: relative;
    padding-top: 220px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

/* Glow Background */
.glow-bg {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle at center, rgba(42, 132, 255, 0.15) 0%, rgba(5, 5, 5, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 60px;
}

.hero-subtitle {
    margin-top: 24px;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

/* New Store Badges */
.store-link {
    display: block;
    transition: transform 0.2s;
}

.store-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.store-badge-img {
    height: 40px;
    /* Force consistent height */
    width: auto;
}

/* Coming Soon Wrapper */
.store-link-wrapper {
    position: relative;
    display: inline-block;
}

.store-link-wrapper.coming-soon .store-badge-img {
    opacity: 0.4;
    filter: grayscale(50%);
}

.coming-soon-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Beta Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    will-change: opacity;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background:
        linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)),
        url('images/Early_access_modal.png');
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    position: relative;
    text-align: left;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    animation: slideUp 0.4s ease 0.1s forwards;
}

@keyframes slideUp {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.modal-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.modal-step .step-num {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.modal-step strong {
    display: block;
    margin-bottom: 4px;
}

.modal-step p {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin: 0;
}

.modal-step a {
    color: var(--accent);
    text-decoration: underline;
}

.modal-cta {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), #1a7fd4);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(42, 132, 255, 0.3);
}

/* Monitoring Section */
.monitoring-container {
    width: 100%;
    max-width: 950px;
    margin: 60px auto 0;
}

.monitoring-container .preview-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.monitoring-container .app-screen-flat {
    height: 400px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .monitoring-container {
        max-width: 100%;
        padding: 0 16px;
    }

    .monitoring-container .preview-container {
        gap: 8px;
    }

    .monitoring-container .app-screen-flat {
        height: auto;
        width: 30vw;
        max-width: 120px;
    }
}

/* Meals Feature Section */
.meals-feature-container {
    width: 100%;
}

.meals-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.meals-left {
    flex-shrink: 0;
}

.meals-vertical-img {
    height: 540px;
    width: auto;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.meals-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.meals-horizontal-img {
    width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .meals-grid {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
    }

    .meals-left {
        display: flex;
        align-items: stretch;
    }

    .meals-vertical-img {
        height: 100%;
        width: auto;
        max-width: 40vw;
        object-fit: cover;
    }

    .meals-right {
        flex-direction: column;
        gap: 5px;
        justify-content: space-between;
    }

    .meals-horizontal-img {
        width: 40vw;
        max-width: 160px;
        height: auto;
    }
}

.store-btn {
    background: rgba(255, 255, 255, 0.08);
    /* Just slightly lighter than bg */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    min-width: 160px;
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.store-icon {
    width: 24px;
    height: 24px;
}

.store-text {
    text-align: left;
}

.store-text span {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-text);
}

.store-text strong {
    display: block;
    font-size: 1rem;
    color: white;
    line-height: 1.2;
}


/* UI Preview / Screenshots */
.ui-preview-container {
    margin-bottom: 80px;
    width: 100%;
}

.preview-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: nowrap;
    /* Force side-by-side */
}

.app-screen-flat {
    width: 280px;
    /* Base width */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.app-screen-flat:hover {
    transform: scale(1.02);
    border-color: var(--accent);
}

.preview-caption {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
    color: var(--secondary-text);
    padding: 0 20px;
    line-height: 1.5;
}

/* Monitoring Grid Specifics */
.monitor-grid {
    flex-wrap: wrap;
    /* Allow wrapping on very small screens if needed, or controlled by media query */
    gap: 24px;
}

@media (min-width: 769px) {
    .monitor-grid {
        flex-wrap: nowrap;
        /* Side by side on desktop/tablet */
    }
}

/* Problem / Solution */
.problem-solution {
    padding: 100px 0;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-dark) 0%, #111 100%);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 60px;
}

.comparison-card {
    padding: 40px;
    border-radius: 24px;
    /* Glass Effect */
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.comparison-card.problem {
    border-left: 4px solid #FF4D4D;
}

.comparison-card.solution {
    border-left: 4px solid #2ACB8F;
    background: rgba(42, 203, 143, 0.05);
    /* Slight green tint */
}

/* Bento Grid Features */
.features {
    padding: 120px 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 300px);
    gap: 24px;
    margin-top: 60px;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
    position: relative;
}

.bento-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-card-hover);
}

/* Span classes for bento layout */
.span-2 {
    grid-column: span 2;
}

.span-1 {
    grid-column: span 1;
}

.bento-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.bento-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: white;
}

.bento-bg-img {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60%;
    opacity: 0.3;
    mask-image: linear-gradient(to top, black, transparent);
    -webkit-mask-image: linear-gradient(to top, black, transparent);
}

/* How It Works */
.how-it-works {
    padding: 100px 0;
    position: relative;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 60px;
    position: relative;
}

/* Vertical Line */
.steps-container::before {
    content: '';
    position: absolute;
    left: 20px;
    /* Aligned with number center */
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding-left: 60px;
    /* Space for number */
    position: relative;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #222;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.step-content h3 {
    margin-bottom: 8px;
    font-size: 1.5rem;
}

/* User Types & Tracking - Mixed Section */
.user-types {
    padding: 100px 0;
    background: #080808;
}

.types-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
}

.type-pill {
    padding: 12px 24px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    font-weight: 600;
}

/* FAQ */
.faq {
    padding: 100px 0;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
    cursor: pointer;
}

.faq-question {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    height: 0;
    overflow: hidden;
    color: var(--secondary-text);
    transition: height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    height: auto;
    padding-top: 16px;
}

.faq-icon {
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}


/* Footer */
footer {
    padding: 80px 0 40px;
    border-top: 1px solid var(--border-color);
    background: #020202;
    text-align: center;
}

.footer-logo img {
    width: 40px;
    margin-bottom: 16px;
}

.footer-links {
    margin: 32px 0;
    display: flex;
    justify-content: center;
    gap: 32px;
}

.footer-links a {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    font-size: 0.8rem;
    color: #555;
}


/* Animation Utilities for Script */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}


/* Tablet Optimizations */
@media (max-width: 1024px) {
    h1 {
        font-size: 3.5rem;
    }

    .container {
        padding: 0 40px;
    }

    .hero {
        padding-top: 180px;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    /* Force certain items to fit 2-col layout if needed, or let them flow naturally */

    .ui-preview-grid {
        transform: rotateX(10deg) scale(0.8);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 24px;
    }

    .nav-links {
        display: flex;
        gap: 16px;
        margin-top: 16px;
        font-size: 0.9rem;
        justify-content: center;
        width: 100%;
    }

    .nav {
        flex-direction: column;
        align-items: center;
    }

    /* Hide desktop nav */

    .hero {
        padding-top: 160px;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .span-2,
    .span-1 {
        grid-column: span 1;
    }

    .app-screen {
        width: 200px;
        height: 400px;
    }

    .ui-preview-grid {
        flex-wrap: wrap;
        transform: none;
    }

    /* Force side-by-side on mobile for the new preview */
    /* Force side-by-side on mobile for the new preview */
    .preview-container {
        flex-wrap: nowrap;
        gap: 12px;
    }

    /* Override for monitoring grid (3 items) to allow wrapping */
    /* Override for monitoring grid (3 items) to allow wrapping */
    .monitor-grid {
        flex-wrap: nowrap;
        justify-content: center;
        gap: 8px;
        /* Reduce gap to prevent overflow */
    }

    .monitor-grid .app-screen-flat {
        width: 28vw;
        /* Slightly larger to fill space */
        max-width: 110px;
    }

    .hero-content {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .app-screen-flat {
        width: 40vw;
        max-width: 180px;
    }

    .step-row {
        padding-left: 50px;
    }

    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
}