:root {
    /* Premium White Theme Palette (Apple/Stripe B2B aesthetics) */
    --bg-dark: #fbfbfd;
    --bg-card: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #000000;
    --accent-hover: #333333;
    --nav-height: 80px;

    /* Typography */
    --font-sans: 'Geist Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;

    /* Spacing */
    --section-gap: 8rem;
    --container-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: var(--section-gap) 0;
}

/* Typography styles */
h1,
h2,
h3 {
    font-weight: 400;
    letter-spacing: -0.04em;
    /* Ultra tight B2B Apple Kerning */
    line-height: 1.1;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-style: italic;
    letter-spacing: -0.05em;
    /* Specific squeeze for the elegant hero text */
    margin-bottom: 1.3rem;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Apply gradient clipping to the nested words created by SplitType */
.hero-title .word {
    background: linear-gradient(180deg, #1d1d1f 0%, #86868b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 2rem;
}

p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
}

/* Components */
.btn-primary,
.btn-primary-outline,
.btn-submit {
    display: inline-block;
    padding: 0.8rem 1.75rem;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
    will-change: transform;
}

.btn-primary:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.btn-primary-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-primary-outline:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.navbar.scrolled {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.85);
    /* Light glass effect instead of black */
}

.logo {
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    /* Anti-aliasing hack for Windows 1080p scaled displays */
    transform: rotate(0.001deg);
    backface-visibility: hidden;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 5rem;
    margin-bottom: 55vh;
    /* Push the next section down significantly to avoid dashboard glimpse overlap at -320px */
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    /*padding: 2rem 2rem;*/
    /* User request: Localized fading background to shield against UI lines */
    background: radial-gradient(circle at center, var(--bg-dark) 40%, rgba(251, 251, 253, 0) 100%);
    border-radius: 50%;
    /* Make the blur look circular and natural */
}

.hero-subtitle {
    font-size: 1.5rem;
    margin: 0 auto 3rem auto;
    font-weight: 300;
}

/* The glow effect behind hero */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(251, 251, 253, 0.9) 0%, rgba(251, 251, 253, 0) 50%);
    z-index: 1;
    pointer-events: none;
}

/* Dashboard Glimpse */
.hero-dashboard-glimpse {
    position: absolute;
    bottom: -320px;
    /* Anchored cleanly to the bottom of the hero */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 60vh;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.08), 0 10px 30px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    z-index: 5;
    /* Cristal Mirage Mask: Subtle fade out at the very top, solid in middle, fades out at bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 75%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 75%, transparent 100%);
}

.hero-dashboard-glimpse img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    /* Important so UI header shows first */
    opacity: 0.8;
    /* Reduced opacity by 20% per user request */
}

/* Vision Section (Act 2: 3D QR Scanner) */
.vision {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding-bottom: 12rem;
    /* Added generous breathing room before the next section */
}

.vision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.vision-header h2 {
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.vision-header p {
    font-size: 1.25rem;
    line-height: 1.8;
    margin: 0 auto;
    color: var(--text-secondary);
}

.perspective-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-3d-box {
    width: 250px;
    height: 250px;
    perspective: 1200px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(-30deg);
    /* Iso perspective */
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 10px;
    position: relative;
}

/* Base QR dot */
.qr-dot {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 1px;
    transition: background-color 0.2s;
    will-change: background-color;
}

/* The 3 large QR positional markers */
.qr-marker {
    background-color: transparent;
    border: 3px solid rgba(0, 0, 0, 0.3);
    position: relative;
    grid-column: span 3;
    grid-row: span 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-marker::after {
    content: '';
    width: 50%;
    height: 50%;
    background-color: rgba(0, 0, 0, 0.3);
}

.qr-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #1d1d1f;
    box-shadow: 0 0 20px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    opacity: 0;
    /* Hidden by default */
}

/* Vision Card Restored Styles */
.vision-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    will-change: transform;
}

.vision-card p {
    font-size: 1.15rem;
    /* Slightly balanced font size */
    line-height: 1.6;
    color: #e4e4e7;
    margin: 0;
}

/* Act 3: Sticky Scroll Choreography */
#experience-section {
    position: relative;
}

.sticky-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    padding-bottom: 15vh;
    /* Buffer at bottom */
}

.sticky-text-panel {
    flex: 1;
    position: sticky;
    top: 30vh;
    height: fit-content;
    padding-bottom: 2rem;
    z-index: 5;
    /* Keep text above passing cards */
}

.sticky-cards-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* << REDUCED FROM 15vh TO 2rem */
    padding-top: 30vh;
}

.experience-title {
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.experience-intro {
    font-size: 1.25rem;
}

.stack-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    will-change: transform;
    opacity: 0.3;
    /* Base opacity manipulated by GSAP */
}

.feature-card:hover,
.vision-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Card Typography & Micro-Nodes */
.card-icon-node {
    width: 6px;
    height: 6px;
    background-color: var(--text-primary);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    position: relative;
    opacity: 0.8;
}

.card-icon-node::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

.card-title-serif {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 500;
    font-style: italic;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Manifesto Styling (Vision Card) */
.manifesto-card {
    padding: 3rem 2.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
}

.manifesto-text-small {
    font-size: 1rem !important;
    color: var(--text-secondary) !important;
    line-height: 1.6 !important;
    margin-bottom: 0.5rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.manifesto-text-large {
    font-size: clamp(1.8rem, 3vw, 2.5rem) !important;
    line-height: 1.1 !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 2rem !important;
}

/* iPhone Video Mockup */
.iphone-mockup {
    width: 320px;
    height: 650px;
    border-radius: 44px;
    background: #000;
    position: relative;
    border: 12px solid #e1e1e6;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.1),
        0 40px 80px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transform: translateZ(0);
    /* Hardware acceleration */
}

.iphone-notch {
    position: absolute;
    top: 0;
    left: 48%;
    /* Nudged left to cover the off-center video notch */
    transform: translateX(-50%);
    width: 48%;
    /* Widened slightly to ensure coverage with the shift */
    height: 30px;
    background: #e1e1e6;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 10;
}

.iphone-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #111;
    /* fallback while loading */
}

/* Bento Grid Section (Data & Power) */
.bento-data {
    position: relative;
    z-index: 10;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.bento-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    /* Override feature-card padding for edge-to-edge images */
    min-height: 400px;
    justify-content: space-between;
}

.bento-wide {
    grid-column: span 2;
}

.bento-square {
    grid-column: span 1;
}

.bento-img-wrapper {
    width: 100%;
    flex: 1;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.bento-box:hover .bento-img-wrapper img {
    transform: scale(1.03);
    /* Subtle premium zoom */
}

/* User Request: Remove hover effects from the first (wide) bento box */
.bento-wide:hover {
    box-shadow: none !important;
    border-color: var(--glass-border) !important;
    transform: none !important;
}

.bento-wide:hover .bento-img-wrapper img {
    transform: none !important;
}

.bento-content {
    padding: 2.5rem 2.5rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-card);
}

.bento-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.bento-content p {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-header p {
    margin: 0 auto;
}

.elegant-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.3s ease;
}

.input-group label {
    position: absolute;
    left: 0;
    top: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-group input:focus,
.input-group input:not(:placeholder-shown) {
    border-bottom-color: var(--text-primary);
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
    top: -0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary);
}

/* Custom Radio Buttons */
.radio-group {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.radio-label:hover {
    color: var(--text-primary);
}

.radio-label input {
    display: none;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input:checked+.custom-radio {
    border-color: var(--text-primary);
}

.radio-label input:checked+.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
}

.radio-label input:checked~span {
    color: var(--text-primary);
}

.btn-submit {
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.btn-submit:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    font-size: 0.9rem;
}

/* Animations (To be triggered by JS intersection observer) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
}

/* GSAP Reveal Utilities */
.reveal-text,
.reveal-card,
.reveal-fade {
    visibility: hidden;
    /* Prevent FOUC before GSAP loads */
}

/* SplitType Line Masking */
.line {
    /* Changed from hidden to visible/padded to prevent Geist Italic kerning from clipping */
    overflow: hidden;
    /*padding-bottom: 0.1em;*/
    /*padding-right: 0.1em;*/
    /* Fix for 's' and 'e' clipping on the right edge */
}

.word {
    transform-origin: bottom left;
    padding-right: 0.05em;
    padding-bottom: 0.05em;
    /* Extra safety for tight kerning and italic descenders like 'y' */
}

/* Custom Cursor */
body {
    cursor: none;
    /* Hide default cursor */
}

a,
button,
input,
label,
.magnetic-el,
.feature-card,
.vision-card {
    cursor: none;
}

.cursor {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    /* Must be white for difference mode to result in black on white backgound */
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    /* Dark border for white background */
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), height 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
}

.cursor-follower.active {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.05);
    /* Slight dark fill on hover */
    border-color: transparent;
    /* Removed backdrop-filter: blur(2px); to keep button text readable */
}

/* Brand Utilities */
.text-accent {
    color: #FF4F00;
}

/* Responsive basics */
@media (max-width: 768px) {
    :root {
        --section-gap: 4rem;
    }

    .container {
        padding: 0 1rem;
    }

    .navbar {
        padding: 1rem 1rem;
        /* Ensure navbar doesn't cause overflow on narrow screens */
        box-sizing: border-box;
        max-width: 100vw;
    }

    .logo img {
        height: 20px;
        /* Make logo slightly smaller on mobile to leave space for button */
    }

    .btn-primary-outline {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .hero {
        min-height: 100vh;
        padding-top: 0;
        margin-bottom: 0;
        /* Perfectly center on mobile, ignoring the hidden dashboard */
    }

    .hero-glow {
        width: 100vw;
        height: 100vw;
    }

    .hero-dashboard-glimpse {
        display: none !important;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .vision-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-wide {
        grid-column: span 1;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    .bento-content {
        padding: 1.5rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }

    /* Fix Experience Section (Act 2) Mobile Breakage */
    .sticky-wrapper {
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .sticky-visual-panel {
        position: relative !important;
        top: 0 !important;
        height: auto !important;
        margin-top: 1rem;
    }

    .sticky-cards-panel {
        padding-top: 5vh !important;
        padding-bottom: 2vh !important;
        gap: 3vh !important;
    }

    /* Scale down iPhone so it doesn't overflow 320px screens */
    .iphone-mockup {
        width: 280px !important;
        height: 570px !important;
        margin: 0 auto;
    }

    /* Fix gaps between sections */
    .vision {
        padding-bottom: 4rem !important;
        min-height: auto !important;
    }

    .manifesto-card {
        padding: 2.5rem 1.75rem;
    }

    .manifesto-text {
        font-size: 1.45rem !important;
    }

    .bento-header {
        margin-bottom: 2rem !important;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem !important;
        /* Considerably reduced for mobile compactness */
    }

    /* Fix Form elements overflowing */
    .input-group input {
        width: 100%;
        box-sizing: border-box;
    }

    .elegant-form {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .btn-submit {
        width: 100%;
        display: block;
        text-align: center;
        box-sizing: border-box;
    }

    /* Ensure Footer is visible on Mobile */
    footer {
        padding: 2rem 1rem;
        text-align: center;
        width: 100%;
        display: block;
    }
}

/* Touch Device Specifics (Hide custom cursor & restore defaults) */
@media (hover: none) and (pointer: coarse) {

    .cursor,
    .cursor-follower {
        display: none !important;
    }

    body,
    a,
    button,
    input,
    label,
    .magnetic-el,
    .feature-card,
    .vision-card {
        cursor: auto !important;
    }
}