/* ----- VARIABLES & THEMING ----- */
:root {
    /* Light Theme (Anthropic warm beige) default */
    --bg-color: #f3f1eb;
    --text-color: #1a1a1a;
    --text-muted: #555555;
    
    /* Contrast Block (Dark cards on light background) */
    --contrast-bg: #1e1e1e;
    --contrast-text: #f3f1eb;
    --contrast-muted: #a0a0a0;
    
    /* UI Elements */
    --border-color: rgba(0, 0, 0, 0.1);
    --btn-bg: #1a1a1a;
    --btn-text: #ffffff;
    --btn-hover: #333333;
    
    /* Spacing & Layout */
    --border-radius: 12px;
    --border-radius-lg: 24px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --section-pad: 140px;
    --container-max: 1440px;
    
    /* SEO / AEO Highlights */
    --highlight-bg: rgba(47, 107, 255, 0.1);
    --highlight-text: #2457D6;
}

[data-theme="dark"] {
    --bg-color: #18181A;
    --text-color: #f3f1eb;
    --text-muted: #a0a0a0;
    
    --contrast-bg: #222225;
    --contrast-text: #ffffff;
    --contrast-muted: #888888;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --btn-bg: #f3f1eb;
    --btn-text: #1a1a1a;
    --btn-hover: #ffffff;
    
    --highlight-bg: rgba(47, 107, 255, 0.15);
    --highlight-text: #a8c1ff;
}

/* ----- RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ----- TYPOGRAPHY ----- */
h1, h2, h3, h4 {
    font-family: 'Sora', sans-serif;
    color: var(--text-color);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
}

h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.underline-emphasis {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}

p {
    max-width: 65ch;
    font-size: 1.125rem;
}

.highlight-pill {
    background-color: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 0.1em 0.4em;
    border-radius: 6px;
    display: inline-block;
}
.highlight-text {
    color: var(--highlight-text);
}

/* View Transition Tags & Interactive Toggle */
.vt-leads { view-transition-name: vt-leads; display: inline-block; }
.vt-customers { view-transition-name: vt-customers; display: inline-block; }

::view-transition-group(vt-leads),
::view-transition-group(vt-customers) {
  animation-duration: 0.8s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-toggle-wrapper {
    margin-bottom: 32px;
}
.hero-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    padding: 4px;
    position: relative;
    cursor: pointer;
    user-select: none;
}
[data-theme="dark"] .hero-toggle {
    background: rgba(255, 255, 255, 0.08);
}
.toggle-option {
    position: relative;
    z-index: 2;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.4s ease;
    font-family: 'Inter', sans-serif;
}
.toggle-option.active {
    color: var(--text-color);
}
.toggle-glider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: var(--bg-color);
    border-radius: 100px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .toggle-glider {
    background: #2a2a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.short-hero-text {
    line-height: 1.1;
}


/* ----- UI DYNAMIC BUBBLES ----- */
.hero-bubbles {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    align-content: start;
    width: 100%;
    min-height: 260px;
    padding-left: 24px;
    gap: 32px;
}

.ui-bubble {
    display: inline-flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 20px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    opacity: 0;
    transform: translateY(20px);
    animation: popIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative; /* Static flow in grid */
    white-space: normal;
    max-width: 320px;
    border: 1px solid rgba(0,0,0,0.05);
}
[data-theme="dark"] .ui-bubble {
    background: #1e1e21;
    color: #f3f1eb;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
}

.ui-bubble svg {
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2;
    margin-top: 2px;
}

.ui-bubble.accent {
    background: #3b82f6;
    color: #ffffff;
    border-color: transparent;
}
[data-theme="dark"] .ui-bubble.accent {
    background: #2563eb;
    color: #ffffff;
}

/* Grid alignments instead of flex coords */
.ui-bubble.pos-inquiry {
    justify-self: start;
}
.ui-bubble.pos-reply {
    justify-self: start;
    margin-left: 120px;
}
.ui-bubble.pos-customer {
    justify-self: start;
    animation-name: popIn;
}

/* Stagger Animation */
.ui-bubble.delay-1 {
    animation-delay: 0.8s;
}

.ui-bubble.no-anim {
    animation: none !important;
    opacity: 1;
    transform: translateY(0);
}

@keyframes popIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.ui-bubble .icon {
    stroke: currentColor;
    fill: none;
}
.ui-bubble:not(.accent) .icon {
    stroke: #3b82f6; /* Blue icon on white block per snapshot */
}

/* ----- UTILS ----- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 40px;
}
.container-narrow {
    max-width: 800px;
}
.text-center { text-align: center; }

/* ----- NAVBAR ----- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.navbar.scrolled {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-svg {
    height: 22px;
    width: auto;
    display: block;
    color: var(--text-color);
    transition: color var(--transition-fast);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 48px;
}

.nav-links {
    display: flex;
    gap: 40px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}
.nav-links a:hover {
    opacity: 0.6;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}
.lang-toggle, .theme-toggle {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    user-select: none;
    display: flex;
    align-items: center;
}
.lang-active {
    color: var(--text-color);
    font-weight: 700;
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform var(--transition-fast);
}
.theme-toggle:hover svg {
    transform: rotate(15deg);
    color: var(--text-color);
}

/* Toggle SVG swapping */
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html:not([data-theme="dark"]) .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: block; }


/* ----- BUTTONS ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: transform var(--transition-smooth), background-color var(--transition-fast), box-shadow var(--transition-smooth);
    cursor: pointer;
    border: 1px solid transparent;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
[data-theme="dark"] .btn:hover {
    box-shadow: 0 8px 24px rgba(255,255,255,0.08);
}
.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 10px 24px;
    font-size: 0.95rem;
}
.btn-primary:hover {
    background: var(--btn-hover);
}
.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-contrast {
    background: var(--contrast-text);
    color: var(--contrast-bg);
    padding: 10px 24px;
}
.btn-contrast:hover {
    opacity: 0.9;
}
.btn-secondary {
    margin-left: 12px;
    border-color: var(--border-color);
    color: var(--text-color);
    background: transparent;
}
.btn-secondary:hover {
    background: var(--highlight-bg);
}

/* ----- SECTIONS ----- */
.section {
    padding: var(--section-pad) 0;
}

/* ----- HERO SECTION ----- */
.hero {
    padding: 300px 0 100px;
    min-height: 80vh;
    display: flex;
    align-items: flex-start;
}
.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: start;
}
.hero-content {
    max-width: 800px;
}
.hero-title {
    font-size: 3.75rem;
    margin-bottom: 40px;
    white-space: nowrap;
}
.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

/* Abstract Grid Illustration for Light Mode hero side */
.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 24px;
}
.hero-illustration svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.7;
}

/* ----- CONTRAST BLOCKS (LIKE "Project Glasswing") ----- */
.contrast-block {
    background-color: var(--contrast-bg);
    color: var(--contrast-text);
    border-radius: var(--border-radius-lg);
    padding: 100px;
    margin: 40px 24px;
    display: flex;
    align-items: center;
    gap: 80px;
}
.contrast-block h1, .contrast-block h2, .contrast-block h3 {
    color: var(--contrast-text);
}
.contrast-block p {
    color: var(--contrast-muted);
}
.contrast-content {
    flex: 1;
}
.contrast-visual {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}
.contrast-visual img, .contrast-visual svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ----- GRIDS & CARDS ----- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
.feature-card {
    border-top: 2px solid var(--text-color);
    padding-top: 30px;
    transition: transform var(--transition-fast);
}
.feature-card:hover {
    transform: translateY(-2px);
}
.feature-title {
    font-size: 1.75rem;
    margin-bottom: 20px;
}
.feature-body {
    color: var(--text-muted);
}

/* ----- MODULAR ENGINE PREVIEW ----- */
.module-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 48px;
    background: rgba(255, 255, 255, 0.42);
}
[data-theme="dark"] .module-preview .btn-secondary {
    border-color: rgba(255, 255, 255, 0.12);
}
.module-preview-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
[data-theme="dark"] .module-preview {
    background: rgba(255, 255, 255, 0.04);
}
.module-preview h2 {
    max-width: 760px;
    margin-bottom: 16px;
    font-size: 2.5rem;
}
.module-preview p:not(.module-kicker) {
    color: var(--text-muted);
}
.module-kicker {
    margin-bottom: 12px;
    color: var(--highlight-text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ----- TIMELINE / HOW IT WORKS ----- */
.timeline {
    border-top: 1px solid var(--border-color);
    padding-top: 80px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
}
.timeline-step {
    position: relative;
}
.step-number {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ----- STATS ----- */
.stats-grid {
    display: flex;
    justify-content: center;
    gap: 100px;
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.stat-number {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 5rem;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 16px;
}

/* ----- FAQ (AEO) ----- */
.faq-section { margin-bottom: 80px; }
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
}
.faq-item h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}
.faq-item p {
    color: var(--text-muted);
}

/* ----- FOOTER ----- */
.footer {
    padding: 80px 0 60px;
    border-top: 1px solid var(--border-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}
.footer-grid p, .footer-grid a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}
.footer-grid a:hover {
    color: var(--text-color);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}
.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) {
    .hero { padding: 220px 0 80px; }
    .hero-title { font-size: 3.5rem; }
    .hero-container { grid-template-columns: 1fr; text-align: left; }
    .contrast-block { flex-direction: column; padding: 60px 40px; }
    .module-preview { grid-template-columns: 1fr; }
    .module-preview .btn { justify-self: start; }
}

@media (max-width: 768px) {
    .hero { padding: 180px 0 60px; min-height: auto; }
    .nav-links { display: none; }
    .hero-illustration { display: none; }
    .hero-title { font-size: 2.75rem; white-space: normal; }
    .grid-3 { grid-template-columns: 1fr; }
    .timeline { grid-template-columns: 1fr; border-top: none; }
    .timeline-step { border-top: 1px solid var(--border-color); padding-top: 40px; }
    .stats-grid { flex-direction: column; gap: 60px; text-align: center; }
    .footer-grid { grid-template-columns: 1fr; }
    .contrast-block { margin: 40px 16px; }
    .module-preview { padding: 32px 24px; }
    .module-preview h2 { font-size: 2rem; }
    .btn-secondary { margin-left: 0; margin-top: 12px; }
}
