*,
*::before,
*::after {
    text-decoration: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

:root {
    --white: #ffffff;
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --nav-bg: rgba(255, 255, 255, 0.72);
    --card-shadow:
        0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-shadow-hover:
        0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* DARK MODE COLOR OVERRIDES */
body.dark-mode {
    --white: #1d1d1f;
    --bg: #000000;
    --bg-card: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #48484a;
    --accent: #2997ff;
    --accent-hover: #51a9ff;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.24);
    --nav-bg: rgba(0, 0, 0, 0.72);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* SPECIFIC SECTION ADJUSTMENTS */
body.dark-mode .hero,
body.dark-mode .product-hero,
body.dark-mode .feature-cell {
    background: var(--bg);
}

body.dark-mode footer {
    background: #161617;
}

body.dark-mode .feature-cell:hover {
    background: #1c1c1e;
}

/* THEME TOGGLE BUTTON STYLING */
.theme-toggle {
    background: rgba(128, 128, 128, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: rgba(128, 128, 128, 0.2);
    transform: scale(1.05);
}

/* --- FIXING PRODUCT & FEATURE SECTIONS --- */

/* Resetting the explicit white backgrounds to use variables */
.hero,
.product-hero,
.feature-cell {
    background: var(
        --bg-card
    ); /* Changed from var(--white) to be more adaptive */
    color: var(--text);
}

/* Feature cell hover state for dark mode */
body.dark-mode .feature-cell:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Border adjustments so lines don't disappear or get too bright */
body.dark-mode .feature-row {
    background: var(--border);
    border: 1px solid var(--border);
}

/* --- DARK MODE FIXES FOR CTA & BENTO --- */

/* Fix the CTA Band (Bottom Bar) */
body.dark-mode .cta-band {
    background: #161617; /* Slightly lighter than pure black for depth */
    border-top: 1px solid var(--border);
}

body.dark-mode .cta-band .section-title {
    color: #ffffff; /* Keep CTA heading bright */
}

body.dark-mode .cta-band .section-sub {
    color: rgba(255, 255, 255, 0.6);
}

/* Theme Toggle Button Specific Style */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--border);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        "Outfit",
        -apple-system,
        sans-serif;
    font-size: 17px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAV */
nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    height: 52px;
    display: flex;
    align-items: center;
}
.nav-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}
.logo-gem {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a259f7 0%, #0071e3 100%);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    display: inline-block;
}
.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.005em;
    transition: color 0.15s;
}
.nav-links a:hover {
    color: var(--text);
}
.nav-cta {
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.15s;
    flex-shrink: 0;
}
.nav-cta:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ANNOUNCE */
.announce {
    background: var(--text);
    color: var(--white);
    text-align: center;
    padding: 14px 24px;
    font-size: 0.85rem;
}
.announce a {
    color: #81c7ff;
    text-decoration: none;
    font-weight: 500;
}
.announce a:hover {
    text-decoration: underline;
}

/* HERO */
.hero {
    background: var(--white);
    text-align: center;
    padding: 120px 24px 110px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse 80% 60% at 50% -10%,
            rgba(162, 89, 247, 0.07) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 60% 40% at 80% 120%,
            rgba(0, 113, 227, 0.05) 0%,
            transparent 60%
        );
}
.hero-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    color: #a259f7;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0;
    animation: fadeDown 0.6s 0.05s cubic-bezier(0.22, 0.68, 0, 1.2) forwards;
}
.hero-headline {
    font-size: clamp(2.8rem, 7vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.02;
    color: var(--text);
    max-width: 860px;
    margin: 0 auto 24px;
    opacity: 0;
    animation: fadeDown 0.7s 0.12s cubic-bezier(0.22, 0.68, 0, 1.2) forwards;
}
.hero-headline .grad {
    background: linear-gradient(135deg, #a259f7 0%, #0071e3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 44px;
    line-height: 1.65;
    opacity: 0;
    animation: fadeDown 0.7s 0.22s cubic-bezier(0.22, 0.68, 0, 1.2) forwards;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeDown 0.7s 0.32s cubic-bezier(0.22, 0.68, 0, 1.2) forwards;
}
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: -0.01em;
}
.btn-blue {
    background: var(--accent);
    color: #fff;
}
.btn-blue:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}
.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--border-strong);
}
.btn-outline:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

/* SECTION COMMON */
.section {
    padding: 100px 24px;
}
.section-center {
    text-align: center;
}
.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.section-title {
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 18px;
}
.section-sub {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto;
}

/* BENTO GRID - FIXED FOR DARK MODE */
.bento-wrap {
    max-width: 980px;
    margin: 64px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bento-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition:
        box-shadow 0.3s,
        transform 0.3s;
    padding: 48px 40px;
    position: relative;
    border: 1px solid var(--border); /* Subtle border for dark mode depth */
}

.bento-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-3px);
}

.bento-card.span2 {
    grid-column: span 2;
}

/* GRADIENT BOXES - Adaptive for Dark Mode */
.bento-card.dark {
    background: var(--text);
    color: var(--white);
}

.bento-card.purple {
    background: linear-gradient(135deg, #6e3bac 0%, #2d0e5e 100%);
    color: #ffffff; /* Keep white for contrast on dark gradient */
}

body.dark-mode .bento-card.purple {
    background: linear-gradient(135deg, #1a0533 0%, #2d0e5e 100%);
}

.bento-card.blue {
    background: linear-gradient(135deg, #005bb5 0%, #001d3d 100%);
    color: #ffffff;
}

body.dark-mode .bento-card.blue {
    background: linear-gradient(135deg, #001d3d 0%, #003380 100%);
}

/* Internal Text Elements */
.bento-icon {
    font-size: 2.4rem;
    margin-bottom: 24px;
    display: block;
    line-height: 1;
}

.bento-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}

/* Force label visibility on colored boxes */
.bento-card.purple .bento-label,
.bento-card.blue .bento-label,
.bento-card.dark .bento-label {
    color: rgba(255, 255, 255, 0.6);
}

.bento-heading {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--text); /* Uses variable */
}

/* Force heading white on colored boxes */
.bento-card.purple .bento-heading,
.bento-card.blue .bento-heading,
.bento-card.dark .bento-heading {
    color: #ffffff;
}

.bento-body {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-secondary); /* Uses variable */
    line-height: 1.65;
}

/* Force body readable on colored boxes */
.bento-card.purple .bento-body,
.bento-card.blue .bento-body,
.bento-card.dark .bento-body {
    color: rgba(255, 255, 255, 0.8);
}
.grad-purple {
    background: linear-gradient(135deg, #bf5af2, #a259f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.grad-blue {
    background: linear-gradient(135deg, #60b3ff, #0071e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* PRODUCT SECTION */
.product-hero {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.product-hero-inner {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    padding: 100px 24px;
}
.product-tag {
    display: inline-block;
    background: rgba(162, 89, 247, 0.1);
    color: #a259f7;
    border-radius: 980px;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.product-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 18px;
}
.product-desc {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 32px;
}
.product-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s;
}
.product-link:hover {
    gap: 10px;
}
.product-link.grey {
    color: var(--text-secondary);
}

/* Terminal */
.terminal {
    background: #1c1c1e;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}
.terminal-bar {
    background: #2c2c2e;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tdot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.tdot.r {
    background: #ff5f57;
}
.tdot.y {
    background: #ffbd2e;
}
.tdot.g {
    background: #28c840;
}
.tpath {
    margin-left: 10px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
}
.terminal-body {
    padding: 24px 22px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    line-height: 2.1;
}
.tp {
    color: #28c840;
}
.tc {
    color: rgba(255, 255, 255, 0.85);
}
.tg {
    color: #28c840;
}
.tm {
    color: rgba(255, 255, 255, 0.3);
}
.ta {
    color: #ffbd2e;
}
.tcursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: rgba(255, 255, 255, 0.7);
    vertical-align: middle;
    animation: blink 1.1s step-end infinite;
}
@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* FEATURE ROW */
.licence-feature-row {
    max-width: 980px;
    margin: 64px auto 0;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.documentation-feature-row {
    max-width: 980px;
    margin: 64px auto 0;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.product-feature-row {
    max-width: 980px;
    margin: 64px auto 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.feature-row {
    max-width: 980px;
    margin: 64px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.feature-cell {
    background: var(--white);
    padding: 48px 36px;
    transition: background 0.2s;
}
.feature-cell:hover {
    background: #fafafa;
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    display: block;
}
.feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.documentation-feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-align: left;
}
.feature-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    font-weight: 300;
}
.documentation-feature-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    font-weight: 300;
    text-align: left;
}
.documentation-list-feature-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    font-weight: 300;
    text-align: left;
    padding-left: 50px;
}

/* CTA BAND */
.cta-band {
    background: var(--text);
    text-align: center;
    padding: 100px 24px;
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 80% at 50% 50%,
        rgba(162, 89, 247, 0.15) 0%,
        transparent 60%
    );
    pointer-events: none;
}
.cta-band .section-title {
    color: var(--white);
}
.cta-band .section-sub {
    color: rgba(255, 255, 255, 0.5);
}
.cta-band .section-eyebrow {
    color: #a259f7;
}
.cta-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}
.btn-white {
    background: var(--white);
    color: var(--text);
}
.btn-white:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}
.btn-ghost-white {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}
.btn-ghost-white:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    transform: scale(1.02);
}

/* FOOTER */
footer {
    background: #f5f5f7;
    border-top: 1px solid var(--border);
    padding: 40px 24px 32px;
}
.footer-inner {
    max-width: 980px;
    margin: 0 auto;
}
.footer-top {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.footer-copy {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.footer-col h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 8px;
}
.footer-col a {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-col a:hover {
    color: var(--text);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* SCROLL REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 0.68, 0, 1),
        transform 0.7s cubic-bezier(0.22, 0.68, 0, 1);
}
.reveal.in {
    opacity: 1;
    transform: none;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* RESPONSIVE */
@media (max-width: 860px) {
    .nav-links {
        display: none;
    }
    .bento-wrap {
        grid-template-columns: 1fr 1fr;
    }
    .bento-card.span2 {
        grid-column: span 2;
    }
    .product-hero-inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .feature-row {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .bento-wrap {
        grid-template-columns: 1fr;
    }
    .bento-card.span2 {
        grid-column: span 1;
    }
    .hero-headline {
        font-size: 2.6rem;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Projects Showcase */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.project-card {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--surface) 80%, transparent),
        color-mix(in srgb, var(--surface-elevated) 80%, transparent)
    ); /* Brighter dark mode value */
    border: 1px solid rgba(139, 92, 246, 0.2); /* Brighter dark mode value */
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.28, 0.11, 0.32, 1);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.light-mode .project-card {
    background: linear-gradient(
        135deg,
        var(--surface),
        var(--surface-elevated)
    ); /* Light mode value */
    border: 1px solid rgba(139, 92, 246, 0.1); /* Lighter for light mode */
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(139, 92, 246, 0.15));
    opacity: 0;
    transition: opacity 0.3s;
}

body.light-mode .project-card::after {
    background: linear-gradient(
        135deg,
        transparent,
        rgba(139, 92, 246, 0.1)
    ); /* Lighter for light mode */
}

.project-card:hover::after {
    opacity: 1;
}

.project-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(
        135deg,
        var(--surface),
        var(--surface-elevated)
    ); /* Brighter dark mode value */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    position: relative;
    overflow: hidden;
}

body.light-mode .project-image {
    background: linear-gradient(
        135deg,
        var(--surface-elevated),
        var(--bg)
    ); /* Light mode value */
}

.project-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 30% 50%,
        rgba(139, 92, 246, 0.3),
        transparent
    );
}

body.light-mode .project-image::before {
    background: radial-gradient(
        circle at 30% 50%,
        rgba(139, 92, 246, 0.15),
        /* Lighter for light mode */ transparent
    );
}

.project-content {
    padding: 32px;
}

.project-tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-light);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}
