/* MODERN UI EFFECTS (Aceternity / MagicUI inspired) */

:root {
    --glow-color: rgba(0, 0, 0, 0.04);
    --border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] {
    --glow-color: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Base spacing helpers */
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mt-24 { margin-top: 6rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-24 { margin-bottom: 6rem; }
.flex-1 { flex: 1; }
.flex-row { display: flex; align-items: center; gap: 2rem; }
.text-4xl { font-size: 2.5rem; }
.text-secondary { color: var(--text-secondary); }

/* Glassmorphism Nav */
.blur-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
[data-theme="dark"] .blur-nav {
    background: rgba(10, 10, 10, 0.7);
}

/* Grid Background */
.bg-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background-size: 40px 40px;
    background-image: linear-gradient(to right, var(--border-color) 1px, transparent 1px),
                      linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
    opacity: 0.5;
}

/* Hero Section */
.hero-modern {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
}

/* Badge Pill */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    background: var(--bg-creme);
    font-size: 0.85rem;
    font-weight: 500;
}
[data-theme="dark"] .badge-pill { background: #111; }

.pulse-dot {
    width: 8px; height: 8px;
    background-color: #34C759;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

/* Sleek Button */
.btn-primary-sleek, .btn-apple-sleek {
    background: var(--text-primary);
    color: var(--bg-creme) !important;
    padding: 10px 20px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}
.btn-primary-sleek:hover, .btn-apple-sleek:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
[data-theme="dark"] .btn-primary-sleek { box-shadow: 0 4px 14px rgba(255,255,255,0.1); }

/* Infinite Marquee */
.marquee-wrapper {
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}
.marquee {
    display: flex;
    width: max-content;
    animation: scroll 20s linear infinite;
    gap: 2rem;
    color: var(--text-secondary);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    opacity: 0.6;
}
.marquee span { white-space: nowrap; }
.marquee .dot { font-size: 0.8rem; opacity: 0.3; }
@keyframes scroll {
    to { transform: translateX(calc(-50% - 1rem)); }
}

/* Modern Bento Grid */
.bento-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}
.bento-box {
    position: relative;
    background: var(--bg-creme);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}
[data-theme="dark"] .bento-box { background: rgba(15,15,15,0.5); backdrop-filter: blur(10px); }
.bento-box.wide { grid-column: span 2; }
.bento-content { position: relative; z-index: 2; }

/* Glow on hover (JS will track mouse) */
.bento-glow, .bento-glow-red {
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}
.bento-glow-red {
    background: radial-gradient(circle, rgba(229, 57, 53, 0.1) 0%, transparent 70%);
}
.bento-box:hover .bento-glow, .bento-box:hover .bento-glow-red { opacity: 1; }

.bento-box h3 { font-size: 1.8rem; margin-bottom: 12px; line-height: 1.2; }
.bento-box p { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.6; }
.border-red { border: 1px solid rgba(229, 57, 53, 0.2); }
.text-red { color: #E53935; }

/* Immersion Mockup */
.mockup-immersion {
    background: rgba(0,0,0,0.03);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
[data-theme="dark"] .mockup-immersion { background: rgba(255,255,255,0.02); }
.lettrine {
    float: left;
    font-size: 3.5rem;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 4px;
    font-weight: 900;
}
.mock-text { font-size: 0.95rem; line-height: 1.5; color: var(--text-secondary); }

/* ML Badge */
.ml-badge-container {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,0,0,0.05), transparent);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
}
[data-theme="dark"] .ml-badge-container { background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent); }
.ml-badge { font-weight: 700; font-size: 0.85rem; text-align: center; }

/* CTA Glow */
.cta-modern {
    text-align: center;
    position: relative;
    padding: 80px 20px;
}
.cta-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 60%);
    z-index: -1;
}

/* Responsive */
@media (max-width: 768px) {
    .bento-container { grid-template-columns: 1fr; }
    .bento-box.wide { grid-column: span 1; }
    .flex-row { flex-direction: column; align-items: flex-start; }
}

/* Marquee fades */
.marquee-fade-left, .marquee-fade-right {
    position: absolute;
    top: 0; bottom: 0;
    width: 60px;
    z-index: 10;
    pointer-events: none;
}
.marquee-fade-left {
    left: 0;
    background: linear-gradient(to right, var(--bg-creme), transparent);
}
.marquee-fade-right {
    right: 0;
    background: linear-gradient(to left, var(--bg-creme), transparent);
}

/* Sticky Scroll Section */
.section-sticky {
    position: relative;
    padding: 60px 24px;
}
.sticky-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1100px;
    margin: 0 auto;
}
.sticky-text {
    padding-top: 40px;
    padding-bottom: 40px;
}
.text-5xl { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; letter-spacing: -0.02em; }
.text-2xl { font-size: 1.5rem; }
.text-xl { font-size: 1.25rem; line-height: 1.6; }
.text-lg { font-size: 1.1rem; line-height: 1.6; }
.leading-tight { line-height: 1.2; }
.max-w-2xl { max-width: 700px; }

.sticky-visual {
    position: sticky;
    top: 120px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.border-dark { border: 1px solid var(--text-primary); color: var(--text-primary); }

.visual-mockup {
    background: var(--bg-creme);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
}
[data-theme="dark"] .visual-mockup {
    background: #111;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.mockup-header {
    font-size: 0.65rem; font-weight: 800; letter-spacing: 2px;
    color: var(--text-secondary); text-align: center;
    margin-bottom: 24px;
}
.mockup-title { font-size: 1.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.mockup-chapeau { font-size: 1rem; font-weight: 600; font-style: italic; color: var(--text-secondary); margin-bottom: 24px; border-left: 2px solid var(--text-primary); padding-left: 12px;}
.mockup-lettrine { float: left; font-size: 3.5rem; font-weight: 900; line-height: 0.8; margin-right: 8px; margin-top: 4px; }
.mockup-text { font-size: 1rem; line-height: 1.6; color: var(--text-primary); opacity: 0.9; }

/* Workflow Section */
.section-workflow {
    padding: 80px 24px;
    max-width: 1100px;
    margin: 0 auto;
}
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
.workflow-step {
    position: relative;
    padding-top: 24px;
}
.step-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-secondary);
    opacity: 0.15;
    position: absolute;
    top: -30px; left: -10px;
    z-index: -1;
}
.step-line {
    height: 2px;
    width: 40px;
    background: #E53935;
    margin-bottom: 24px;
}

/* Manifesto Section */
.section-manifesto {
    padding: 100px 24px;
    background: var(--text-primary);
    color: #F9F8F6 !important;
    text-align: center;
    display: flex;
    justify-content: center;
}
.section-manifesto .text-secondary {
    color: rgba(255,255,255,0.6);
}
[data-theme="dark"] .section-manifesto {
    background: #111;
}

@media (max-width: 900px) {
    .sticky-container { grid-template-columns: 1fr; gap: 40px; }
    .sticky-visual { position: relative; top: 0; height: 400px; }
    .workflow-grid { grid-template-columns: 1fr; }
    .step-line { width: 100%; max-width: 200px; }
}

.sticky-item {
    opacity: 0.3;
    transition: opacity 0.5s ease;
}
.sticky-item.active {
    opacity: 1;
}

/* Story Text Reveal Section */
.section-story {
    min-height: 250vh;
    position: relative;
}
.story-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 950px;
    margin: 0 auto;
    padding: 120px 24px 60px;
    box-sizing: border-box;
}
.reveal-text {
    font-size: clamp(1.6rem, 3.8vw, 3.2rem);
    line-height: 1.2;
    color: var(--text-primary);
}
.reveal-word {
    opacity: 0.15;
    transition: none;
}

/* Value Cards with Beam Border Effect */
.section-values {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.value-card {
    position: relative;
    background: var(--bg-creme);
    border-radius: 20px;
    padding: 1px; /* space for the border gradient */
    overflow: hidden;
}
[data-theme="dark"] .value-card {
    background: #111;
}
.card-border {
    position: absolute;
    top: 50%; left: 50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, transparent 80%, var(--text-primary) 100%);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotate-border 4s linear infinite;
    opacity: 0.15;
}
[data-theme="dark"] .card-border {
    background: conic-gradient(from 0deg, transparent 0%, transparent 80%, rgba(255,255,255,0.8) 100%);
    opacity: 0.3;
}
.card-content {
    position: relative;
    background: var(--bg-creme);
    border-radius: 19px;
    padding: 32px;
    height: 100%;
    z-index: 2;
}
[data-theme="dark"] .card-content { background: #0A0A0A; }
@keyframes rotate-border {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 900px) {
    .values-grid { grid-template-columns: 1fr; }
}

/* Stacking Cards Section */
.section-stacking {
    position: relative;
    padding: 60px 24px;
    max-width: 1000px;
    margin: 0 auto;
}
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }

.stacking-cards {
    position: relative;
    padding-bottom: 100px; /* space to scroll past the last card */
}

.stack-card {
    position: sticky;
    margin-bottom: 24px;
    transition: transform 0.3s ease, filter 0.3s ease;
}
/* Stacking offsets */
.card-1 { top: 120px; z-index: 10; }
.card-2 { top: 140px; z-index: 20; }
.card-3 { top: 160px; z-index: 30; }

.card-inner {
    background: var(--bg-creme);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    overflow: hidden;
}
[data-theme="dark"] .card-inner {
    background: #161616;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.08);
}

.card-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.border-green { border: 1px solid rgba(52, 199, 89, 0.4); }
.text-green { color: #34C759; }

/* Visuals for cards */
.card-right {
    background: rgba(0,0,0,0.03);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    overflow: hidden;
    position: relative;
}
[data-theme="dark"] .card-right { background: rgba(255,255,255,0.03); }

/* Visual 1: Noise */
.noise-visual {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 0 32px;
    position: relative;
}
.mock-alert {
    height: 16px;
    background: var(--text-primary);
    opacity: 0.1;
    border-radius: 4px;
    animation: flash-noise 2s infinite alternate;
}
.mock-alert.red {
    background: #E53935;
    opacity: 0.4;
    animation: flash-noise-red 1.5s infinite alternate;
}
.mock-alert.delay-1 { animation-delay: 0.3s; }
.mock-alert.delay-2 { animation-delay: 0.7s; }
.mock-alert.delay-3 { animation-delay: 1.1s; }

@keyframes flash-noise {
    0% { transform: translateX(0); opacity: 0.1; }
    100% { transform: translateX(-10px); opacity: 0.3; }
}
@keyframes flash-noise-red {
    0% { transform: translateX(10px) scale(0.98); opacity: 0.2; }
    100% { transform: translateX(0) scale(1.02); opacity: 0.6; }
}

/* Visual 2: Filter */

.filter-visual { padding: 40px; }
.funnel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.funnel-top {
    width: 120px;
    height: 60px;
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, var(--text-primary) 5px, var(--text-primary) 10px);
    opacity: 0.2;
    clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
}
.funnel-bottom {
    background: var(--text-primary);
    color: var(--bg-creme);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Visual 3: Solution */
.solution-visual { background: var(--text-primary); color: var(--bg-creme); }
[data-theme="dark"] .solution-visual { background: #E53935; color: #FFF; }
.check-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
}

@media (max-width: 768px) {
    .card-inner { grid-template-columns: 1fr; padding: 32px; gap: 32px; }
    .card-right { min-height: 180px; }
}

/* MagicUI Shiny Button Effect */
.btn-primary-sleek, .btn-apple-sleek {
    position: relative;
    overflow: hidden;
}
.btn-primary-sleek::after, .btn-apple-sleek::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    animation: shine-button 6s infinite;
}
[data-theme="dark"] .btn-primary-sleek::after, [data-theme="dark"] .btn-apple-sleek::after {
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.3), transparent);
}
@keyframes shine-button {
    0% { left: -100%; }
    15% { left: 200%; }
    100% { left: 200%; }
}

.section-manifesto h2 {
    color: #F9F8F6 !important;
}
[data-theme="dark"] .section-manifesto h2 {
    color: #F9F8F6 !important;
}
.section-manifesto p.text-secondary {
    color: rgba(255,255,255,0.6) !important;
}
