:root {
    --dl-color-primary: #00407a;
    --dl-color-secondary: #52bdec;
    --dl-color-accent: #dd8a2e;
    --dl-color-surface: #f8f9fb;
    --dl-color-surface-alt: #eff6ff;
    --dl-color-section: #f3f4f5;
    --dl-color-text: #0b1f33;
    /* Fallback for pydata/sphinx-design panels */
    --pst-color-panel-background: var(--dl-color-surface);
}

html[data-theme="light"] {
    --pst-color-primary: var(--dl-color-primary);
    --pst-color-secondary: var(--dl-color-secondary);
    --pst-color-accent: var(--dl-color-accent);
}

html[data-theme="dark"] {
    --dl-color-primary: #6fc3ff;
    --dl-color-secondary: #52c7f0;
    --dl-color-accent: #ffb65c;
    --dl-color-surface: #101b2d;
    --dl-color-surface-alt: #0b141f;
    --dl-color-section: #070e18;
    --dl-color-text: #eff6ff;
    --pst-color-primary: var(--dl-color-primary);
    --pst-color-secondary: var(--dl-color-secondary);
    --pst-color-accent: var(--dl-color-accent);
    --pst-color-panel-background: var(--dl-color-surface-alt);
}

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

@keyframes heroPulse {
    0% {
        opacity: 0.35;
        transform: translate3d(-10%, -10%, 0) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate3d(5%, 5%, 0) scale(1.1);
    }
    100% {
        opacity: 0.35;
        transform: translate3d(-10%, -10%, 0) scale(1);
    }
}


.bd-header .bd-page-width {
    max-width: none;
    padding-left: 5rem;
    padding-right: 5rem;
}
/* Media query for small devices */
@media (max-width: 600px) { /* Adjust the max-width as needed */
    .bd-header .bd-page-width {
        padding-left: 2rem;  /* Change padding for small devices */
        padding-right: 2rem;  /* Change padding for small devices */
    }
}


/*
   HOMEPAGE SPECIFIC CSS
*/


/* Hide the right sidebar on the landing page */
body.homepage .bd-toc {
    display: none;
}


/* Full-width banner section with background image */
.full-width-banner {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(82, 189, 236, 0.35), transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(221, 138, 46, 0.25), transparent 50%),
        linear-gradient(135deg, #073763, #091d35 65%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100vw;                  /* Full viewport width */
    min-height: 320px;             /* Keep hero visible but tighter vertically */
    margin: 0;                     /* Remove margins */
    position: relative;
    color: white;
    padding: 1.4rem 0 1.9rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate; /* keep glow layers scoped */
}

.full-width-banner::before,
.full-width-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.full-width-banner::before {
    background: radial-gradient(circle at 60% 40%, rgba(82, 189, 236, 0.35), transparent 60%),
        radial-gradient(circle at 10% 80%, rgba(221, 138, 46, 0.3), transparent 65%);
    mix-blend-mode: screen;
    animation: heroPulse 14s ease-in-out infinite;
}

.full-width-banner::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(2, 9, 15, 0.55));
    opacity: 0.4;
}

.full-width-banner > * {
    position: relative;
    z-index: 1;
}

html[data-theme="dark"] .full-width-banner {
    background-image:
        radial-gradient(circle at 35% 25%, rgba(82, 189, 236, 0.25), transparent 60%),
        radial-gradient(circle at 90% 10%, rgba(221, 138, 46, 0.2), transparent 65%),
        linear-gradient(135deg, #030b15, #041326 70%);
    color: #f6fbff;
}

html[data-theme="dark"] .full-width-banner::after {
    background: linear-gradient(180deg, rgba(3, 8, 15, 0.85), rgba(4, 10, 18, 0.95));
    opacity: 0.7;
}

/* Remove padding from these elements on the homepage */
body.homepage .bd-main,
body.homepage .bd-content,
body.homepage .bd-article-container,
body.homepage .bd-article {
    padding: 0 !important; /* Forcefully remove padding */
    margin: 0;             /* Optionally, remove margin if necessary */
    max-width: none !important;  /* Remove any max-width restrictions */
    width: 100% !important;      /* Ensure full width */
}


body.homepage .bd-page-width {
    max-width: none !important;  /* Remove any max-width restrictions */
}

body.homepage {
    font-family: "Inter", "Space Grotesk", "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.homepage-text {
    padding-left: 5rem;
    padding-right: 5rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}


.homepage-text-grey {
    padding-left: 5rem;
    padding-right: 5rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    background-color: var(--dl-color-section);
}


/* Flexbox container to align text and image side by side */

.button-container {
    align-items: center;
    width: 80%;
    margin: auto;
}

/* Flexbox container to align text and image side by side */
.text-image-container-title {
    display: flex;
    justify-content: center; /* Adjust spacing between text and image */
    align-items: center;            /* Aligns text and image vertically */
    gap: 1.25rem;
}

.banner_title_buttons {
    width: min(880px, 90vw);
    margin: 0 auto;
    position: static;
    transform: none;
    left: auto;
    top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

/* The text section */
.text-image-container-title .text-container {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hero-subtitle {
    font-family: "Space Grotesk", "Inter", "Work Sans", sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 700;
    font-family: "Space Grotesk", "Inter", "Work Sans", sans-serif;
    letter-spacing: -0.015em;
    color: inherit;
    margin: 0;
}

.hero-tagline {
    font-family: "Space Grotesk", "Inter", "Work Sans", sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    opacity: 0.9;
    margin: 0;
}

.hero-description-block {
    color: white;
    max-width: 860px;
    margin: 1rem auto 0;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    padding: 0 1rem;
}

.hero-description-heading {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 0.4rem;
}

.hero-description-block p {
    margin: 0;
}

html[data-theme="dark"] .hero-description-block {
    color: rgba(239, 246, 255, 0.92);
}

html[data-theme="dark"] .hero-subtitle {
    color: rgba(255, 255, 255, 0.75);
}


/* The image section */

.text-image-container-title .image-container {
    text-align: left;              /* Align image to the right */
    height: clamp(110px, 13vw, 180px);
}


/* Adjust image size to fit the container */
.text-image-container-title img {
    height: 100%;
    width: auto;                   /* Maintain image aspect ratio */
}

.hero-logo {
    display: block;
    background: none !important; /* prevent default image background */
    border-radius: 0 !important;
}


/* Use-case stack and alternating cards */
.use-case-stack {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: -1rem 0 4rem;
    padding: 0 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.use-case-stack > .use-case-row {
    width: min(560px, 48vw) !important;
    max-width: 560px;
    min-width: 320px;
    flex: 0 0 auto;
}

.use-case-row {
    padding: 2.4rem 3rem;
    box-sizing: border-box;
    border-radius: 28px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    gap: 0.65rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.use-case-row::before {
    content: "";
    position: absolute;
    inset: -40% -10%;
    background-image: var(--use-case-line-art, none);
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.32;
    transform: translate3d(0, 0, 0);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.use-case-row::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.use-case-row > * {
    position: relative;
    z-index: 1;
}

.use-case-row:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.15);
}

.use-case-row:hover::before {
    opacity: 0.55;
}

.use-case-row:hover::after {
    opacity: 0.3;
}

.use-case-row.use-case-left {
    align-self: flex-start;
    margin-left: clamp(1.5rem, 10vw, 7rem);
    margin-top: -11rem; /* overlap roughly half the preceding card */
    z-index: 2;
}

.use-case-row.use-case-right {
    align-self: flex-end;
    margin-right: clamp(1.5rem, 10vw, 7rem);
    margin-top: 2rem;
    z-index: 1;
}

.use-case-row .use-case-label {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--pst-color-secondary);
    margin-bottom: 0.2rem;
}

.use-case-row .use-case-heading {
    font-size: 1.8rem;
    margin: 0;
    font-family: "Space Grotesk", "Inter", "Work Sans", sans-serif;
}

.use-case-row .use-case-description {
    font-size: 0.96rem;
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.use-case-cta {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    padding-right: 1.8rem;
}

.use-case-cta::after {
    content: "→";
    position: absolute;
    right: 0;
    transition: transform 0.25s ease;
}

.use-case-row:hover .use-case-cta::after {
    transform: translateX(6px);
}

.use-case-row:hover .use-case-cta {
    color: var(--dl-color-primary);
}

.use-case-pattern-neural {
    --use-case-line-art: url('images/pattern-neural.svg');
}

.use-case-pattern-circuit {
    --use-case-line-art: url('images/pattern-circuit.svg');
}

.use-case-bg-light {
    background-color: var(--dl-color-surface);
}

.use-case-bg-dark {
    background-color: var(--dl-color-surface-alt);
    margin-bottom: 3rem;
}

html[data-theme="dark"] .use-case-row {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.55);
}

@media (max-width: 1500px) {
    .use-case-stack {
        padding: 0 1.5rem 2rem;
        align-items: center;
        justify-content: center;
        gap: 1.4rem;
        flex-direction: column;
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }

    .use-case-stack > .use-case-row {
        width: 100% !important;
        max-width: 640px;
        min-width: 0;
        margin-left: auto;
        margin-right: auto;
        align-self: center;
    }

    .use-case-row.use-case-left,
    .use-case-row.use-case-right {
        align-self: stretch;
        margin: 1.2rem 0 0;
    }

    .use-case-row.use-case-left {
        margin-top: 1.2rem;
    }
}

html[data-theme="dark"] .use-case-row .use-case-heading,
html[data-theme="dark"] .use-case-row .use-case-description {
    color: var(--dl-color-text);
}

html[data-theme="dark"] .use-case-row .use-case-label {
    color: var(--dl-color-primary);
}

html[data-theme="dark"] .use-case-row:hover .use-case-cta {
    color: var(--dl-color-primary);
}

.banner_title_buttons .sd-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.banner_title_buttons .sd-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

/* ERC logo banner */
.erc-logo-banner {
    margin: 2rem auto 4rem;
    display: flex;
    justify-content: center;
}

.erc-logo-banner img {
    width: min(360px, 55vw);
    height: auto;
}

@media (max-width: 900px) {
    .use-case-stack {
        margin: 1rem auto 3rem;
        gap: 1.5rem;
        padding: 0 1.25rem 2rem;
    }

    .use-case-row {
        width: 100%;
        margin: 0 auto;
        padding: 1.75rem;
        gap: 0.75rem;
    }

    .use-case-stack > .use-case-row {
        width: 100% !important;
        max-width: none;
        min-width: 0;
    }

    .use-case-row.use-case-left,
    .use-case-row.use-case-right {
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
    }
}
.section-anchor {
    scroll-margin-top: 120px;
}

.sticky-sub-nav {
    position: sticky;
    top: calc(var(--pst-header-height, 0px));
    z-index: 30;
    background: rgba(248, 249, 251, 0.96);
    border-bottom: 1px solid rgba(11, 31, 51, 0.08);
    backdrop-filter: blur(12px);
    padding: 0.35rem 1rem;
    width: 100%;
}

.sticky-sub-nav__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sticky-sub-nav__inner a {
    color: var(--dl-color-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sticky-sub-nav__inner a:hover {
    color: var(--dl-color-primary);
}

.sticky-sub-nav__inner span {
    opacity: 0.4;
}

html[data-theme="dark"] .sticky-sub-nav {
    background: rgba(5, 10, 18, 0.94);
    border-bottom-color: rgba(111, 195, 255, 0.18);
}

html[data-theme="dark"] .sticky-sub-nav__inner a {
    color: var(--dl-color-text);
}

html[data-theme="dark"] .sticky-sub-nav__inner a:hover {
    color: var(--dl-color-primary);
}

html[data-theme="dark"] .sticky-sub-nav__inner span {
    color: rgba(239, 246, 255, 0.35);
    opacity: 1;
}

/*
   AUTOAPI PAGES
*/

body.is-autoapi-page .bd-main {
    background: var(--dl-color-section);
    padding-top: 2rem;
    padding-bottom: 2rem;
}

body.is-autoapi-page .bd-article > .section {
    background: var(--dl-color-surface);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 40px 80px -60px rgba(11, 31, 51, 0.6);
}

body.is-autoapi-page .bd-article > .section > h1 {
    margin-bottom: 1.25rem;
    font-family: "Space Grotesk", "Inter", "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(2rem, 3vw, 2.5rem);
}

body.is-autoapi-page .bd-article > .section > p:first-of-type {
    font-size: 1.05rem;
    color: rgba(11, 31, 51, 0.85);
}

body.is-autoapi-page .bd-article > .section > .section {
    margin-top: 2.5rem;
}

body.is-autoapi-page dl.py {
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
}

body.is-autoapi-page dl.py > dt {
    border: 1px solid rgba(11, 31, 51, 0.1);
    border-radius: 1rem;
    padding: 0.9rem 1.25rem;
    background: var(--dl-color-surface-alt);
    box-shadow: 0 25px 45px -35px rgba(5, 15, 25, 0.6);
}

html[data-theme="dark"] body.is-autoapi-page dl.py > dt {
    border-color: rgba(111, 195, 255, 0.25);
    background: rgba(8, 20, 35, 0.85);
    box-shadow: 0 20px 40px -30px rgba(3, 9, 15, 0.85);
}

body.is-autoapi-page dl.py > dd {
    margin-left: 1.1rem;
    border-left: 3px solid rgba(11, 31, 51, 0.08);
    padding-left: 1rem;
}

html[data-theme="dark"] body.is-autoapi-page dl.py > dd {
    border-color: rgba(111, 195, 255, 0.25);
}

body.is-autoapi-page .sig-name {
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--dl-color-primary);
}

html[data-theme="dark"] body.is-autoapi-page .sig-name {
    color: var(--dl-color-secondary);
}

body.is-autoapi-page .sig-param {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(11, 31, 51, 0.05);
    font-size: 0.95em;
    font-weight: 500;
}

html[data-theme="dark"] body.is-autoapi-page .sig-param {
    background: rgba(111, 195, 255, 0.12);
}

body.is-autoapi-page .sig-return {
    margin-left: 0.5rem;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(11, 31, 51, 0.65);
}

html[data-theme="dark"] body.is-autoapi-page .sig-return {
    color: rgba(239, 246, 255, 0.65);
}

body.is-autoapi-page table.docutils {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 1.5rem 0;
}

body.is-autoapi-page table.docutils tbody tr {
    display: block;
    padding: 1.1rem 1.25rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(11, 31, 51, 0.08);
    background: var(--dl-color-surface-alt);
    box-shadow: 0 30px 60px -50px rgba(11, 31, 51, 0.65);
    margin-bottom: 1rem;
}

html[data-theme="dark"] body.is-autoapi-page table.docutils tbody tr {
    border-color: rgba(111, 195, 255, 0.2);
    background: rgba(8, 20, 35, 0.65);
}

body.is-autoapi-page table.docutils td,
body.is-autoapi-page table.docutils th {
    display: block;
    padding: 0;
    border: none;
}

body.is-autoapi-page table.docutils td p:last-child {
    margin-bottom: 0;
}

body.is-autoapi-page .toctree-wrapper {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(82, 189, 236, 0.12), rgba(221, 138, 46, 0.12));
}
