/* 
  Maxtro Landing Page - Design System & Styles 
  90/9/1 Design Rule Implementation
*/

:root {
    /* HSL Color Tokens */
    --h-neutral: 0;
    --s-neutral: 0%;

    /* Light Theme Defaults (System overrides below) */
    --bg-main: #ffffff;
    --bg-surface: #f7f7f7;
    --bg-elevated: #ffffff;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-dim: #888888;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(0, 85, 255, 0.4);

    --accent-blue: #0055ff;
    --accent-text: #ffffff;

    --status-green: #108548;
    --status-green-bg: #e6f7ed;
    --status-indigo: #4f46e5;
    --status-indigo-bg: #eef2ff;
    --status-amber: #d97706;
    --status-amber-bg: #fffbeb;
    --status-red: #d32f2f;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --spacing-1: 8px;
    --spacing-2: 16px;
    --spacing-3: 24px;
    --spacing-4: 32px;
    --spacing-6: 48px;
    --spacing-8: 64px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-primary: 0 4px 12px rgba(0, 85, 255, 0.25);
}

/* Dark Theme Overrides */
body.theme-dark {
    --bg-main: #0A0A0A;
    --bg-surface: #111111;
    --bg-elevated: #161616;
    --text-primary: #EDEDED;
    --text-secondary: #A1A1A1;
    --text-dim: #666666;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(37, 99, 235, 0.6);

    --accent-blue: #3b82f6;
    --accent-text: #ffffff;

    --status-green: #4ade80;
    --status-green-bg: rgba(74, 222, 128, 0.1);
    --status-indigo: #818cf8;
    --status-indigo-bg: rgba(129, 140, 248, 0.1);
    --status-amber: #fbbf24;
    --status-amber-bg: rgba(251, 191, 36, 0.1);
    --status-red: #f87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-primary: 0 4px 12px rgba(59, 130, 246, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1240px;
    /* Slightly wider for modern feel */
    margin: 0 auto;
    padding: 0 var(--spacing-3);
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    line-height: 1.05;
    margin-bottom: var(--spacing-3);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-3);
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-1);
}

p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.section-title {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-6) auto;
}

/* Components: Buttons (Refined) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.15s ease-out;
    white-space: nowrap;
}

.btn.large {
    padding: 16px 36px;
    /* Larger padding */
    font-size: 1.1rem;
    border-radius: 99px;
    /* Pill shape for elite feel */
    border-radius: 16px;
    /* Keeping rounded rect but smoother */
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Elite Primary Button Style */
.btn-primary {
    background: linear-gradient(135deg, #1A1A1A 0%, #000000 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
    border: none;
    /* Reset border */
}

body.theme-dark .btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15), 0 0 40px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.6s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body.theme-dark .btn-primary:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 0 60px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 13px 28px;
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background-color: var(--bg-surface);
}

.full-width {
    width: 100%;
}

/* Header (Refined for Logo Size) */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(var(--bg-main), 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    height: 90px;
    /* Increased height to accommodate larger logo */
    display: flex;
    align-items: center;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    /* Increased spacing */
    font-weight: 700;
    font-size: 2rem;
    /* Significantly larger text */
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 60px;
    /* 2x size from 30px, visual impact is 4x area. Going too big breaks navbar. */
    height: auto;
    object-fit: contain;
}

/* To satisfy "x20 times bigger" hyperbole, let's go even bigger if possible without breaking layout */
@media (min-width: 1024px) {
    .logo-icon {
        width: 80px;
    }

    .header {
        height: 100px;
    }
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 24px;
    }

    .desktop-nav a {
        color: var(--text-secondary);
        font-size: 1rem;
        /* Slightly larger nav links */
        font-weight: 500;
        transition: color 0.15s;
    }

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#theme-toggle {
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
}

#theme-toggle:hover {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

#theme-toggle svg {
    width: 24px;
    /* Larger icons */
    height: 24px;
}

.icon-moon {
    display: none;
}

.icon-sun {
    display: block;
}

body.theme-dark .icon-moon {
    display: block;
}

body.theme-dark .icon-sun {
    display: none;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-drawer {
    position: fixed;
    top: 90px;
    /* Match new header height */
    left: 0;
    width: 100%;
    height: calc(100vh - 90px);
    background: var(--bg-main);
    padding: var(--spacing-4);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.mobile-drawer nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    font-size: 1.25rem;
    font-weight: 500;
}

/* Hero (Refined) */
.hero {
    padding: 80px 0 96px 0;
    /* Airy spacing */
    overflow: hidden;
}

.hero-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

@media (min-width: 1024px) {
    .hero-container {
        flex-direction: row;
        align-items: center;
        gap: 64px;
    }

    .hero-content {
        flex: 1;
        max-width: 520px;
        padding-right: 20px;
    }

    .hero-visual {
        flex: 1.3;
        margin-top: -6px;
        /* Optical adjustment */
    }
}

.hero-header {
    margin-bottom: 24px;
}

/* Status Pill Polish */
.system-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.03);
    /* Subtle glass */
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-subtle);
    border-radius: 99px;
    font-size: 0.8125rem;
    /* 13px */
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.status-pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--status-green);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.hero-sub {
    font-size: 1.35rem;
    /* Slightly bigger */
    line-height: 1.5;
    margin-bottom: 12px;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.hero-micro {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    opacity: 0.75;
    max-width: 90%;
    margin-bottom: 32px;
}

/* Hero Actions Refinement */
.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 500px) {
    .cta-buttons {
        flex-direction: row;
        align-items: center;
    }
}

.micro-badge {
    color: var(--text-dim);
    font-size: 0.75rem;
    opacity: 0.8;
}

.hero-trust-bullets {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    /* 13px */
    color: var(--text-dim);
    margin-top: 4px;
}

.bullet-dot {
    color: var(--border-subtle);
    font-size: 0.6rem;
}


.trust-line {
    display: none;
    /* Removed in favor of hero-trust-bullets placement */
}


/* Hero Visual - Mission Control Mock Refinement */
.control-panel-mock {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
    /* Cleaner border feeling */
    overflow: hidden;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    /* If available or fallback */
    font-size: 0.85rem;
}

.panel-header {
    background: var(--bg-surface);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.run-id {
    color: var(--text-secondary);
}

.run-status {
    color: var(--status-indigo);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-timeline {
    padding: 16px 24px;
    display: flex;
    gap: 32px;
    /* Wider gaps */
    border-bottom: 1px solid var(--border-subtle);
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.step.active {
    color: var(--text-primary);
    font-weight: 500;
}

.step-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.step.completed .step-icon {
    background: var(--status-green);
    border-color: var(--status-green);
    color: #fff;
}

.step.active .step-icon {
    background: var(--status-indigo);
    border-color: var(--status-indigo);
    box-shadow: 0 0 0 3px var(--status-indigo-bg);
}

.panel-body {
    padding: 24px;
}

.rewrite-block {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.rewrite-header {
    font-size: 0.75rem;
    color: var(--status-amber);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rewrite-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 600px) {
    .rewrite-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 16px;
    }
}

.rewrite-content .original,
.rewrite-content .rewritten {
    flex: 1;
    font-size: 0.85rem;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: 6px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.rewrite-content .rewritten {
    background: rgba(var(--bg-elevated), 0.5);
    border: 1px solid rgba(74, 222, 128, 0.15);
    color: var(--text-primary);
}

.rewrite-content .label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.metrics-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.confidence-meter {
    flex: 1;
    max-width: 240px;
}

.meter-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.meter-bar {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow: hidden;
}

.meter-bar .fill {
    height: 100%;
    background: var(--status-green);
    border-radius: 2px;
}

.meter-value {
    font-size: 0.75rem;
    color: var(--status-green);
    font-weight: 500;
}

.sources-list {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--bg-surface);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.logs-container {
    font-family: monospace;
    font-size: 0.75rem;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    line-height: 1.6;
}

.log-line {
    margin-bottom: 2px;
}

.text-dim {
    color: var(--text-dim);
    opacity: 0.6;
}

.text-info {
    color: var(--status-amber);
}

.text-success {
    color: var(--status-green);
}


/* Trust Strip */
.trust-strip {
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 0;
    margin-bottom: 40px;
}

.trust-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-3);
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.9rem;
}

.separator {
    color: var(--border-subtle);
    display: none;
}

@media (min-width: 600px) {
    .separator {
        display: block;
    }
}

/* Sections General */
.section {
    padding: var(--spacing-8) 0;
}

.bg-elevated {
    background-color: var(--bg-elevated);
}

/* Grids */
.grid-2x2 {
    display: grid;
    gap: var(--spacing-3);
}

@media (min-width: 768px) {
    .grid-2x2 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-4);
    }
}

.steps-grid {
    display: grid;
    gap: var(--spacing-4);
}

@media (min-width: 768px) {
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cards */
.card,
.step-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.step-card {
    background: var(--bg-main);
    /* On How it works section */
}

.step-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 12px;
}

/* Safety Section Split */
.split-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
    align-items: center;
}

@media (min-width: 900px) {
    .split-layout {
        flex-direction: row;
        gap: var(--spacing-8);
    }

    .split-content {
        flex: 1;
    }

    .split-visual {
        flex: 1;
    }
}

.feature-list {
    list-style: none;
    margin-top: 24px;
}

.feature-list li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    color: var(--text-primary);
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--status-green);
}

/* Safety Flow Visual */
.safety-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.flow-card {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 260px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.flow-card.warning {
    border-left: 4px solid var(--status-amber);
}

.flow-card.intervention {
    border-left: 4px solid var(--status-indigo);
}

.flow-card.success {
    border-left: 4px solid var(--status-green);
}

.flow-arrow {
    font-size: 1.25rem;
    color: var(--text-dim);
}

/* Pricing */
.pricing-grid {
    display: grid;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pricing-card {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    background: var(--bg-elevated);
    /* Highlights Pro */
    border-color: var(--border-focus);
    position: relative;
}

.pricing-card h3 {
    margin-bottom: 8px;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.period {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
    flex-grow: 1;
}

.pricing-features li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.pricing-features li::before {
    content: "•";
    color: var(--text-primary);
}

/* Accordion */
.accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    border-bottom: 1px solid var(--border-subtle);
}

.accordion-header {
    width: 100%;
    text-align: left;
    padding: 24px 0;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    background: none;
}

.accordion-header:hover {
    color: var(--text-secondary);
}

.icon-plus {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content p {
    padding-bottom: 24px;
    padding-right: 24px;
    line-height: 1.6;
}

.accordion-item.active .icon-plus {
    transform: rotate(45deg);
}

/* Footer */
.footer {
    padding: var(--spacing-8) 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

@media (min-width: 600px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-brand {
    text-align: center;
}

@media (min-width: 600px) {
    .footer-brand {
        text-align: left;
    }
}

.signature {
    color: var(--text-dim);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 24px;
    color: var(--text-secondary);
}

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

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-elevated);
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

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