/* ABOUTME: Styles for the Counterpart marketing website. */
/* ABOUTME: Dark indigo/purple theme with frosted glass nav, responsive grid, and scroll animations. */

/* ── Reset & Base ────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #e2e0f0;
    background: #0B0A1A;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ── Layout ──────────────────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Typography ──────────────────────────────────────────── */

h1, h2, h3, h4 {
    color: #ffffff;
    line-height: 1.2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 1.15rem;
    text-align: center;
    color: #a5a0c8;
    max-width: 640px;
    margin: 0 auto 3.5rem;
}

/* ── Navigation ──────────────────────────────────────────── */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
    background: rgba(11, 10, 26, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(165, 160, 200, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #818cf8, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: #a5a0c8;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-cta {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: #a78bfa !important;
    transition: background 0.2s, border-color 0.2s;
}

.nav-cta:hover {
    background: rgba(129, 140, 248, 0.25);
    border-color: rgba(129, 140, 248, 0.5);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #a5a0c8;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
    padding: 10rem 0 5rem;
    background: radial-gradient(ellipse at 50% 0%, #1E1B4B 0%, #0B0A1A 70%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #ffffff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #a5a0c8;
    margin-bottom: 2rem;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 32px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
    background: rgba(129, 140, 248, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.btn-secondary:hover {
    background: rgba(129, 140, 248, 0.18);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* ── Screenshot Windows ──────────────────────────────────── */

.screenshot-window {
    border-radius: 12px;
    overflow: hidden;
    background: #13122a;
    border: 1px solid rgba(165, 160, 200, 0.12);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    position: relative;
}

.screenshot-titlebar {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(30, 27, 75, 0.6);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.screenshot-window img {
    width: 100%;
}

.screenshot-window img[data-failed] {
    display: none;
}

.screenshot-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 2rem;
    color: #4a4672;
    font-weight: 500;
    font-size: 0.95rem;
}

.placeholder-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* ── Stats Bar ───────────────────────────────────────────── */

.stats {
    padding: 3rem 0;
    border-top: 1px solid rgba(165, 160, 200, 0.08);
    border-bottom: 1px solid rgba(165, 160, 200, 0.08);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

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

.stat-headline {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7a759e;
    margin-top: 0.25rem;
}

/* ── Features Grid ───────────────────────────────────────── */

.features {
    padding: 6rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    padding: 2rem;
    border-radius: 14px;
    background: rgba(30, 27, 75, 0.35);
    border: 1px solid rgba(165, 160, 200, 0.08);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(129, 140, 248, 0.2);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: #9590b8;
    line-height: 1.55;
}

/* ── Tool Showcases ──────────────────────────────────────── */

.tools {
    padding: 6rem 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(30, 27, 75, 0.5) 0%, transparent 60%);
}

.tool-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
}

.tool-showcase:last-child {
    margin-bottom: 0;
}

.tool-showcase.reverse {
    direction: rtl;
}

.tool-showcase.reverse > * {
    direction: ltr;
}

.tool-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(129, 140, 248, 0.25);
    color: #a78bfa;
    margin-bottom: 1rem;
}

.tool-text h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tool-text p {
    color: #9590b8;
    margin-bottom: 1.5rem;
    line-height: 1.65;
}

.tool-features {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tool-features li {
    font-size: 0.9rem;
    color: #b0acd0;
    padding-left: 1.25rem;
    position: relative;
}

.tool-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #818cf8;
}

/* ── Workflow ─────────────────────────────────────────────── */

.workflow {
    padding: 6rem 0;
}

.workflow-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    justify-content: center;
}

.workflow-step {
    flex: 1;
    max-width: 240px;
    text-align: center;
    padding: 0 1rem;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.workflow-step h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.workflow-step p {
    font-size: 0.85rem;
    color: #9590b8;
    line-height: 1.55;
}

.workflow-connector {
    width: 48px;
    min-width: 48px;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #6366f1);
    margin-top: 23px; /* center on step-number */
    opacity: 0.4;
}

/* ── Tech Specs ──────────────────────────────────────────── */

.specs {
    padding: 6rem 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(30, 27, 75, 0.5) 0%, transparent 60%);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.spec-card {
    padding: 1.75rem;
    border-radius: 12px;
    background: rgba(30, 27, 75, 0.3);
    border: 1px solid rgba(165, 160, 200, 0.08);
}

.spec-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.spec-card p {
    font-size: 0.85rem;
    color: #9590b8;
    line-height: 1.55;
}

/* ── Download CTA ────────────────────────────────────────── */

.download {
    padding: 6rem 0;
    text-align: center;
}

.download .btn {
    margin-top: 0.5rem;
}

.download-note {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: #7a759e;
}

/* ── Footer ──────────────────────────────────────────────── */

.footer {
    padding: 2.5rem 0;
    border-top: 1px solid rgba(165, 160, 200, 0.08);
}

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

.footer-brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.footer-logo {
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
}

.footer-by {
    font-size: 0.85rem;
    color: #7a759e;
}

.footer-links {
    display: flex;
    gap: 1.75rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: #7a759e;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #a78bfa;
}

/* ── Terms Modal ─────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: #16142e;
    border: 1px solid rgba(165, 160, 200, 0.15);
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(165, 160, 200, 0.1);
    flex-shrink: 0;
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.65;
    color: #b0acd0;
}

.modal-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    margin-bottom: 0.75rem;
}

.modal-body ul {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.modal-body ul li {
    margin-bottom: 0.3rem;
}

.modal-body strong {
    color: #e2e0f0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(165, 160, 200, 0.1);
    flex-shrink: 0;
}

.modal-actions .btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
}

/* ── Animations ──────────────────────────────────────────── */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

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

    .tool-showcase,
    .tool-showcase.reverse {
        grid-template-columns: 1fr;
        gap: 2rem;
        direction: ltr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-toggle {
        z-index: 102;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #13122a;
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
        z-index: 101;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 100;
    }

    .nav-overlay.open {
        display: block;
    }

    .nav-links.open {
        right: 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

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

    .workflow-steps {
        flex-direction: column;
        align-items: center;
    }

    .workflow-connector {
        width: 2px;
        height: 32px;
        min-width: unset;
        margin-top: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 7rem 0 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}
