/* Base styles */
:root {
    /* Primary accent colors */
    --science-blue: #0066CC;
    --cornflower-blue: #7AA1FF;
    --magenta: #EB46F3;
    --red: #FF3535;
    --purple: #897AE5;
    --lavender: #C5B7FF;
    
    /* Neutral/Light tones */
    --sand: #CCAA97;
    --blush: #F7C8B1;
    --skin: #FFF3F2;
    --pearl: #FBF7F1;
    --teal: #AEC5CE;
    --light-teal: #CAE0E9;
    
    /* Dark purple tones */
    --supernova: #633882;
    --nova: #4425B5;

    /* Off color tones */
    --mauve: #BF7B90;
    --light-mauve: #B598A7;
    
    /* Basic colors */
    --black: #000000;
    --white: #FFFFFF;
    --gray: #F5F5F5;
    --dark-gray: #333333;
    --light-gray: #EEEEEE;
    
    /* Functional variables */
    --ease: cubic-bezier(.19,1,.22,1);
    --padding: 10vw;
    --nav-width: 200px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--white);
    background-color: var(--black);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Layout */
.content-width {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--padding);
}

.content-container {
    margin-left: var(--nav-width);
    width: calc(100% - var(--nav-width));
    transition: margin-left 0.3s ease;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.relative {
    position: relative;
}

.smooth {
    transition: all 0.3s ease;
}

.nowrap {
    white-space: nowrap;
}

.normal {
    font-weight: normal;
}

.bold {
    font-weight: bold;
}

/* Spacing */
.margin-bottom-2 {
    margin-bottom: 1rem;
}

.margin-top-6 {
    margin-top: 3rem;
}

.margin-bottom-6 {
    margin-bottom: 3rem;
}

.margin-right-2 {
    margin-right: 1rem;
}

.margin-right-3 {
    margin-right: 1.5rem;
}

.margin-left-2 {
    margin-left: 1rem;
}

.padding-top-2 {
    padding-top: 1rem;
}

.padding-bottom-2 {
    padding-bottom: 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: inherit;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.6s;
}

a:hover {
    opacity: 1;
}

.font-size-small {
    font-size: 0.7rem;
}

.font-size-medium {
    font-size: 1.0rem;
}

.font-size-large {
    font-size: 1.3rem;
}

/* Gradient Text */
.grad {
    background-image: linear-gradient(90deg, var(--cornflower-blue), var(--blush));
    -webkit-background-clip: text;
    -webkit-box-decoration-break: clone;
    color: transparent;
}

/* Alternative gradient options */
.grad-purple {
    background-image: linear-gradient(90deg, var(--supernova), var(--purple));
    -webkit-background-clip: text;
    -webkit-box-decoration-break: clone;
    color: transparent;
}

.grad-mauve {
    background-image: linear-gradient(90deg, var(--nova), var(--light-mauve));
    -webkit-background-clip: text;
    -webkit-box-decoration-break: clone;
    color: transparent;
}

/* Button */
.btn {
    display: inline-flex;
    position: relative;
    padding: 1em 2em;
    border-radius: 2em;
    background: none;
    color: var(--white);
    font-weight: 500;
    opacity: 0.8;
    z-index: 1;
    transition-duration: 0.6s;
}

.btn:hover, .btn:focus {
    color: var(--black);
    opacity: 1;
}

.btn::before {
    content: "";
    position: absolute;
    top: -2.5%;
    left: -2.5%;
    width: 105%;
    height: 105%;
    z-index: -1;
    background-image: linear-gradient(90deg, var(--cornflower-blue), var(--blush));
    border-radius: 50%;
    transform-origin: top;
    transform: scale3d(1, 0, 1);
    transition: border-radius 0.8s, transform 0.8s;
}

.btn:hover::before, .btn:focus::before {
    border-radius: 0;
    transform-origin: bottom;
    transform: scale3d(1, 1, 1);
}

/* Alternative button styles */
.btn-purple {
    border: 1px solid var(--purple);
}

.btn-purple::before {
    background-image: linear-gradient(90deg, var(--purple), var(--lavender));
}

.btn-supernova {
    border: 1px solid var(--supernova);
}

.btn-supernova::before {
    background-image: linear-gradient(90deg, var(--supernova), var(--nova));
}

/* Link */
.link {
    position: relative;
    opacity: 0.7;
}

.link:hover, .link:focus, .link.active {
    opacity: 1;
}

.link::before {
    content: "";
    display: block;
    position: absolute;
    bottom: -0.44em;
    width: 100%;
    height: 0.1875em;
    background-image: linear-gradient(to right, var(--cornflower-blue), var(--blush));
    transform-origin: right;
    transform: scale3d(0.001, 1, 1);
    transition: transform 0.6s;
}

.link:hover::before, .link:focus::before, .link.active::before {
    transform-origin: left;
    transform: scale3d(1, 1, 1);
}

/* Header */
.newlimit-research-header {
    display: flex;             /* Makes the header a flex container, allowing its children (subheader, logo) to be arranged easily. */
    align-items: center;       /* Vertically aligns the children (subheader, logo) in the middle of the header. */
    padding: 0 var(--padding); /* Sets top/bottom padding to 0 and left/right padding to the value of the --padding variable (10vw). This aligns the content inside with the main page content. */
    background-color: var(--black); /* Sets the background color of the header to black. */
    color: var(--white);           /* Sets the default text color for children inside the header to white. */
    position: fixed;           /* Fixes the header to the viewport, so it stays at the top even when scrolling. */
    left: var(--nav-width);    /* Positions the left edge relative to the nav bar width */
    right: 0;                  /* Positions the right edge to the viewport right */
    top: 0;                    /* Positions the fixed header at the very top of the viewport. */
    z-index: 1000;             /* Ensures the header stays visually on top of other elements that might scroll underneath it. */
    height: var(--header-height);  /* Sets the height of the header using the --header-height variable (70px). */
    transition: left 0.3s ease; /* Add transition for smooth adjustment */
}

.newlimit-title {
    display: none;
}

.subheader {
    color: var(--white);
    font-size: 1rem;
    opacity: 0; /* Hide by default */
    transition: opacity 0.3s ease; /* Add transition for fade */
    max-width: 60%;
}

.subheader.visible {
    opacity: 1; /* Show when visible class is added */
}

.newlimit-logo {
    display: block;
    height: 92px;
    z-index: 1001;
    position: fixed; /* Position relative to viewport */
    right: 15px;     /* 15px from viewport right */
    top: calc(var(--header-height) / 2); /* Vertically center relative to header height */
    transform: translateY(-50%); /* Fine-tune vertical centering */
}

.newlimit-logo svg {
    display: block;
    height: 92px;
    width: auto;
    color: var(--white);
}

/* Navigation */
.navigation-tabs {
    display: flex;
    flex-direction: column;
    background-color: var(--black);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--nav-width);
    z-index: 99;
    padding: 6rem 0 2rem;
    overflow-y: auto;
}

.navigation-tabs a {
    padding: 1rem 1.5rem;
    color: var(--white);
    opacity: 0.7;
    border-left: 3px solid transparent;
    transition: opacity 0.3s, border-color 0.3s, background-color 0.3s;
    margin-bottom: 0.5rem; /* Added margin for better spacing */
}

.navigation-tabs a:hover {
    text-decoration: none;
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.08); /* Slightly increased visibility */
}

.navigation-tabs a.active {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, var(--cornflower-blue), var(--blush)) 1;
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.15); /* Slightly increased visibility */
}

/* Content Sections */
#app {
    padding-top: var(--header-height);
    min-height: 100vh;
}

.title {
    font-size: 2.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    margin-left: 0;
    margin-right: 0;
    color: var(--white);
}

.title.purple {
    background-image: linear-gradient(90deg, var(--cornflower-blue), var(--blush));
    -webkit-background-clip: text;
    -webkit-box-decoration-break: clone;
    color: transparent;
}

.citation {
    border-left: 3px solid;
    border-image: linear-gradient(90deg, var(--cornflower-blue), var(--blush)) 1;
    padding-left: 1rem;
}

.author-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem; /* Use gap for spacing */
    margin-bottom: 2rem;
    font-family: 'Fira Mono', monospace;
    font-weight: 300;
}

.author {
    margin-bottom: 0; /* Reset margin if needed */
}

.author-name {
    /* Keep strong for name if desired, or adjust */
}

.author-affiliations {
    font-size: 0.85em;
    opacity: 0.8;
}

.figure {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    display: block;
}

/* Section Banners */
.section-banner {
    position: relative;
    margin: 2rem 0;
}

.bg-purplegrad {
    background-image: linear-gradient(90deg, var(--cornflower-blue), var(--blush));
}

.bg-purple {
    background-image: var(--purple);
}

.bg-blush {
    background-color: var(--blush);
}

.bg-supernova {
    background-color: var(--supernova);
}

.bg-nova {
    background-image: linear-gradient(90deg, var(--nova), var(--purple));
}

.bg-mauve {
    background-image: linear-gradient(90deg, var(--supernova), var(--mauve));
}

.bg-lavendergrad {
    background-image: linear-gradient(90deg, var(--purple), var(--lavender));
}

.bg-science-bluegrad {
    background-image: linear-gradient(90deg, var(--science-blue), var(--cornflower-blue));
}

.header {
    padding: 0;
    background: none !important;
    margin-bottom: 1rem;
}

.header-small {
    padding: 0.25rem 0; /* smaller vertical space */
    margin-bottom: 0.5rem;
    font-size: 1rem; /* smaller text size */
    font-weight: normal; /* optional: lighter weight */
}

.section-banner .header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--white);
    padding-bottom: 0.6rem;
    margin-bottom: 0;
    border-bottom-width: 3px;
    border-bottom-style: solid;
    display: inline-block;
    border-color: transparent;
}

.section-banner .bg-purple.header h2 {
    border-color: var(--cornflower-blue);
}

.section-banner .bg-nova.header h2 {
    border-color: var(--nova);
}

.section-banner .bg-lavendergrad.header h2 {
    border-color: var(--purple);
}

.section-banner .bg-science-bluegrad.header h2 {
    border-color: var(--science-blue);
}

.section-banner .bg-supernova.header h2 {
    border-color: var(--supernova);
}

.section-banner .bg-mauve.header h2 {
    border-color: var(--mauve);
}

.section-banner .bg-blush.header h2 {
    border-color: var(--blush);
}

.content {
    padding: 1.5rem;
    border-radius: 8px;
}

.white {
    color: var(--white);
}

/* Color utility classes */
.text-science-blue { color: var(--science-blue); }
.text-cornflower { color: var(--cornflower-blue); }
.text-magenta { color: var(--magenta); }
.text-red { color: var(--red); }
.text-purple { color: var(--purple); }
.text-lavender { color: var(--lavender); }
.text-supernova { color: var(--supernova); }
.text-nova { color: var(--nova); }
.text-mauve { color: var(--mauve); }
.text-light-mauve { color: var(--light-mauve); }
.text-blush { color: var(--blush); }

.bg-science-blue { background-color: var(--science-blue); }
.bg-cornflower { background-color: var(--cornflower-blue); }
.bg-magenta { background-color: var(--magenta); }
.bg-red { background-color: var(--red); }
.bg-purple-solid { background-color: var(--purple); }
.bg-lavender { background-color: var(--lavender); }
.bg-blush { background-color: var(--blush); }

/* Footer */
.newlimit-research-footer {
    background-color: var(--black);
    color: var(--white);
    padding: 2rem var(--padding);
    margin-top: 3rem;
    width: 100%;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.grey-l {
    color: var(--light-gray);
    opacity: 0.7;
}

/* Bibliography & Citations */
.references {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.references h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.references ol {
    list-style: none;
    padding-left: 0;
}

.references li {
    margin-bottom: 1rem;
    padding-left: 2.5em; /* Indent to align with number */
    position: relative;
    font-size: 0.9em;
    line-height: 1.5;
}

.references li::before {
    content: attr(value) "."; /* Use the value attribute for numbering */
    position: absolute;
    left: 0;
    width: 2em; /* Width for the number */
    text-align: right;
    font-weight: bold;
    margin-right: 0.5em;
}

.references li a {
    color: var(--cornflower-blue);
    text-decoration: underline;
    opacity: 0.8;
}

.references li a:hover {
    opacity: 1;
    color: var(--blush);
}

/* Inline citation link styling */
.citation-link {
    color: var(--purple); /* Use purple color */
    text-decoration: none;
    font-weight: 500; /* Slightly bolder */
    opacity: 0.85;
    transition: color 0.3s, opacity 0.3s;
}

.citation-link:hover {
    color: var(--lavender); /* Lavender on hover */
    opacity: 1;
    text-decoration: underline;
}

/* Animations */
[data-anim] {
    opacity: 0;
    transform: translate3d(0, 5em, 0);
    transition: opacity 3.5s var(--ease), transform 3.5s var(--ease);
    will-change: transform, opacity;
}

[data-anim="200"] {
    transition-delay: 0.2s;
}

[data-anim="400"] {
    transition-delay: 0.4s;
}

[data-anim="600"] {
    transition-delay: 0.6s;
}

.ready [data-anim] {
    opacity: 1;
    transform: none;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section highlighting when active */
.section-highlight {
    transition: background-color 0.5s ease;
}

.section-highlight.active {
    /* background-color: rgba(255, 255, 255, 0.03); */
}

/* Responsive */
@media screen and (max-width: 992px) {
    :root {
        --nav-width: 190px;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --padding: 6.25vw;
        --nav-width: 0;
    }
    
    .navigation-tabs {
        width: 220px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .navigation-tabs.open {
        transform: translateX(0);
    }
    
    .nav-toggle {
        display: block;
        position: fixed;
        left: 1rem;
        top: 1rem;
        z-index: 200;
        background-color: var(--supernova);
        color: var(--white);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: none;
    }
    
    .content-container, 
    .newlimit-research-header,
    .newlimit-research-footer {
        margin-left: 0;
        width: 100%;
    }
    
    .content-width {
        padding: 0 var(--padding);
    }
    
    .newlimit-research-header {
        padding: 0 var(--padding);
        left: 0;
    }
    
    .author-list {
        gap: 1rem; /* Adjust gap for smaller screens if needed */
    }
    
    .title {
        font-size: 2rem;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 3.687vw;
    }
    
    .newlimit-title {
        font-size: 1rem;
    }
} 

.table-latex {
    border-collapse: collapse;
    margin: 1em auto;
    font-family: "Libertinus Serif", sans-serif;
    font-size: 0.95em;
    width: 90%;
    color: #ffffff;             /* white text */
    background-color: transparent;
  }
  
  .table-latex caption {
    caption-side: bottom;
    text-align: center;
    font-style: italic;
    margin-top: 0.5em;
    color: #ffffff;             /* caption text white */
  }
  
  .table-latex th,
  .table-latex td {
    border: 1px solid #ffffff;  /* white borders */
    padding: 6px 12px;
  }
  
  .table-latex th {
    background-color: transparent; /* transparent header background */
    font-weight: bold;
    text-align: center;
  }
  
  .table-latex td {
    text-align: center;
  }
  
  .table-latex .bold {
    font-weight: bold;
  }

/* subsection gradient for approach and algorithm */
.subsection-highlight {
    color: white;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.25),
      rgba(255, 255, 255, 0)
    );
    padding: 0.5rem 0.5rem;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
    border-radius: 0.2rem;
    display: inline-block;
  }