.padding-box {
    position: relative;
    width: 86vw;
    height: 10vh;
    transform: translateX(7vw);
}
.content-box {
    position: relative;
    transform:none;                     /* ← kills translateX(7vw)      */
    width:calc(90vw - (2 * var(--nav-width)));
    margin-left:var(--nav-width);       /* left gutter  = nav width     */
    margin-right:calc(1 * var( --nav-width));      /* right gutter = nav width     */
    box-sizing:border-box;              /* so padding never breaks it   */
    overflow: hidden;
    display: flex;
    align-items: flex-start; /* align content to top */
    justify-content: space-between; /* image left, text right */
}
.grey-background {
    background-color: #808080;
}

.image-l {
    max-height: 80vh;
    min-width: 30vw;
    margin-right: 2em; /* ensures a gap between image and text */
}
.image-r {
    max-height: 80vh;
    min-width: 30vw;
    float: right;
    margin-left: 2em; /* ensures a gap if used on right */
}
.text-r {
    text-align: right;
    padding-right: 0;
    width: 300px;
    margin-left: 2em; /* ensures a gap from image if needed */

    /* Remove height to allow vertical centering by flex parent */
    /* height: 80vh; */
    /* Remove display: flex and alignment properties to allow <br> to work */
    /* display: flex; */
    /* justify-content: right; */
    /* align-items: center; */

    /* border: 2px solid blue; */
}

.social-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0 0 1rem 0;
    padding: 0;
}
.social-link {
    text-decoration: none !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: block;
    line-height: 1;
}
.social-link:hover {
    transform: scale(1.1);
    opacity: 0.8;
}
.social-link img {
    display: block;
    border-radius: 4px;
}
.social-link img[alt="Substack"] {
    filter: invert(46%) sepia(84%) saturate(2090%) hue-rotate(11deg) brightness(107%) contrast(104%);
}

.link {
    width: auto;
    height: auto;
    text-decoration: underline;
    color: inherit; /* Ensures link uses surrounding text color */
    /* Ensures inline display, prevents line breaks */
    display: inline;
}
.link:visited,
.link:active {
    color: inherit;
}
.link:hover {
    -webkit-text-stroke: 1px black;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
  }
/* Images */
#image-slider {
    /* width: 100%; */
    height: 80vh;
    position: absolute;
    left: 0;
    display: flex;
    transition: transform 1s ease-in-out;
}
.image-padding {
    width: 86vw;
    height: 100%;
    display: flex;
    justify-content: center; /* align horizontal */
    align-items: center; /* align vertical */
}
#image-slider img {
    /* width: auto; */
    /* max-width: 100%; */
    max-height: 100%;
}
.arrow {
    position: absolute;
    top: 50%;
    width: 5vw;
    height: 30px;
    font-size: 20px;
    z-index: 1;
    display: flex;
    justify-content: center; /* align horizontal */
    align-items: center; /* align vertical */
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'  width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0,auto;
    /* background-color: rgba(255, 255, 255, 0.5); */
}
.arrow-left {
    left: 10px;
}
.arrow-right {
    right: 10px;
}
.about-title {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 1em;
    font-family: 'Computer Modern Serif', serif;
    /* Optional: add more styling as desired */
}
/* ----- MOBILE / SMALL-SCREEN STACKING ----- */
@media (max-width: 600px) {      /* tweak breakpoint to taste */
    /* 1️⃣  stack instead of side-by-side  */
    .content-box {
        flex-direction: column;          /* row ➜ column         */
        justify-content: flex-start;     /* natural top-down flow */
        align-items: center;             /* centre the image      */
    }

    /* 2️⃣  make the picture span full width and breathe a little */
    .image-l,
    .image-r {                           /* in case you ever use .image-r */
        width: 100%;
        max-width: 100%;
        height: auto;                    /* keep aspect ratio              */
        max-height: none;                /* remove the 80 vh ceiling       */
        min-width: 0;                    /* override 30 vw on small screens*/
        margin: 0 0 1rem 0;              /* add only bottom gap            */
    }

    /* 3️⃣  keep the text right-aligned, but let it fill the row   */
    .text-r {
        width: 100%;                     /* fill the line                 */
        text-align: right;               /* stay right-aligned            */
        margin: 0;                       /* cancel the left margin        */
        padding-right: 0.5rem;           /* tiny breathing space (opt.)   */
    }
}

/* ----- HIGHLIGHTS SECTION ----- */
.highlights-section {
    position: relative;
    width:calc(90vw - (2 * var(--nav-width)));
    margin-left:var(--nav-width);
    margin-right:calc(1 * var( --nav-width));
    box-sizing:border-box;
    text-align: center;
    padding: 2rem 0;
}

.highlights-header h2 {
    font-family: 'Computer Modern Serif', serif;
    font-size: 2.5em;
    font-weight: bold;
    margin: 0 0 1rem 0;
    text-align: left;
}

.header-line {
    width: 100%;
    height: 2px;
    background-color: black;
    margin: 0 auto;
}

.highlight-box {
    flex-direction: row; /* Default keeps media aligned on the right */
    gap: 4em; /* Adds space between flex items */
}

.llm-divider {
    margin: 60px auto 40px;
    width: 90%;
    border-top: 1px solid #666;
}

.llm-brief {
    width: 90%;
    margin: 0 auto 60px;
    color: #555;
    font-size: 0.8rem;
}

.llm-brief summary {
    cursor: pointer;
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

.llm-brief summary::marker {
    content: '';
}





.llm-content {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    line-height: 1.55;
}

.llm-content h1,
.llm-content h2,
.llm-content h3 {
    font-family: 'Computer Modern Serif', serif;
    margin-top: 1.5rem;
}

.llm-content ul {
    padding-left: 1.2rem;
    margin: 1rem 0;
}

.llm-content a {
    color: inherit;
    text-decoration: underline;
}

.highlight-box.reverse {
    flex-direction: row-reverse; /* Use when alternating so media shifts to the left */
}

.text-l {
    text-align: left;
    padding-left: 0;
    width: 50%;
    margin: 0; /* Remove margins since we're using gap */
}

.media-r {
    max-width: 40%;
    min-width: 35%;
    margin: 0; /* Remove margins since we're using gap */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
}

.highlight-title {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 1em;
    font-family: 'Computer Modern Serif', serif;
}

.highlight-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.highlight-description {
    line-height: 1.6;
}

.blog-links {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid #333;
}

.blog-link-item {
    margin: 0.5rem 0;
    font-size: 1.1em;
}

.research-papers {
    margin-top: 1.5rem;
}

.paper-category {
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.paper-toggle {
    background-color: #f5f5f5;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: background-color 0.2s ease;
}

.paper-toggle:hover {
    background-color: #e8e8e8;
}

.arrow {
    font-family: monospace;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.paper-list {
    background-color: white;
    border-top: 1px solid #ddd;
}

.paper-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.paper-item:last-child {
    border-bottom: none;
}

.paper-item a {
    font-size: 0.95em;
    line-height: 1.4;
}

/* ----- MOBILE HIGHLIGHTS RESPONSIVENESS ----- */
@media (max-width: 800px) {
    .highlight-box {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
    }

    .highlight-box.reverse {
        flex-direction: column; /* Override desktop flip so mobile stacks consistently */
    }

    .text-l {
        width: 100%;
        text-align: left;
        margin: 0 0 1rem 0;
        order: 2; /* Put text below video on mobile */
    }

    .media-r {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0 0 1rem 0;
        order: 1; /* Put video above text on mobile */
        align-items: center;
    }

    .highlight-title {
        text-align: center;
    }

    .highlights-header h2 {
        font-size: 2em;
    }
}

/* ----- FLOATING DOWN ARROW ----- */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
    animation: bounce 2s infinite;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-arrow {
    font-size: 2em;
    color: #666;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ----- SUPERSCRIPT REFERENCES ----- */
.ref-super {
    font-size: 0.75em;
    vertical-align: super;
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    margin-left: 1px;
}

.ref-super:hover {
    color: #004499;
}

.ref-tooltip {
    position: fixed; /* Use fixed positioning to avoid clipping */
    background-color: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 500px;
    max-width: 600px;
    white-space: normal;
    z-index: 9999; /* Very high z-index */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    line-height: 1.4;
}

.ref-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
}

.ref-super:hover .ref-tooltip {
    opacity: 1;
    pointer-events: auto; /* Allow interaction when visible */
}

.tooltip-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tooltip-authors {
    font-style: italic;
    margin-bottom: 0.3rem;
    font-size: 0.9em;
}

.tooltip-journal {
    margin-bottom: 0.3rem;
    font-size: 0.9em;
}

.tooltip-year {
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 0.5rem;
}

.tooltip-link {
    color: #66ccff;
    text-decoration: underline;
    font-size: 0.85em;
}

.tooltip-link:hover {
    color: #99ddff;
}

/* ----- TURBULENCE VISUALIZATION ----- */
.turbulence-viz-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.viz-top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75em;
    color: #888;
}

.toggle-label {
    transition: color 0.2s;
}

.toggle-container .toggle-label.active {
    color: #333;
    background-color: transparent;
}

.toggle {
    position: relative;
    width: 36px;
    height: 18px;
    background: #ccc;
    border-radius: 9px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
    transition: background 0.2s;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #666;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle.active {
    background: #aaa;
}

.toggle.active::after {
    transform: translateX(18px);
}

.expand-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.expand-btn:hover {
    background: #eee;
    color: #333;
    border-color: #ccc;
}

.viz-main-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.up-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 0.8em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.up-arrow {
    font-size: 1.2em;
    line-height: 1;
}

.up-label {
    font-size: 0.9em;
}

.canvas-wrapper-embed {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.canvas-wrapper-embed canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75em;
    color: #666;
}

.slider-label-left,
.slider-label-right {
    white-space: nowrap;
}

#turbulenceSlider,
#modalTurbulenceSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 180px;
    height: 4px;
    background: linear-gradient(to right, #ccc, #888);
    border-radius: 2px;
    outline: none;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
}

#turbulenceSlider::-webkit-slider-thumb,
#modalTurbulenceSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #666;
    border-radius: 50%;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
    transition: transform 0.1s;
}

#turbulenceSlider::-webkit-slider-thumb:hover,
#modalTurbulenceSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#turbulenceSlider::-moz-range-thumb,
#modalTurbulenceSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #666;
    border-radius: 50%;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
    border: none;
}

/* ----- TURBULENCE MODAL ----- */
.turbulence-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.turbulence-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
}

.modal-viz-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modal-description {
    max-width: 300px;
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9em;
    line-height: 1.6;
}

.modal-description p {
    margin: 0 0 1em 0;
}

.modal-description p:last-child {
    margin-bottom: 0;
}

.modal-link,
.modal-link:visited,
.modal-link:active {
    display: inline;
    width: auto;
    height: auto;
    color: inherit;
    text-decoration: underline;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>⛈️</text></svg>") 16 0, pointer;
}

.modal-link:hover {
    -webkit-text-stroke: 1px white;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.modal-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #888;
}

.modal-toggle-container .toggle-label.active {
    color: #ddd;
    background-color: transparent;
}

.modal-toggle-container .toggle {
    background: #444;
}

.modal-toggle-container .toggle.active {
    background: #555;
}

.modal-toggle-container .toggle::after {
    background: #aaa;
}

.modal-canvas-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-canvas-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.modal-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.modal-up-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #888;
    font-size: 1em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.modal-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85em;
    color: #888;
}

#modalTurbulenceSlider {
    width: 300px;
    background: linear-gradient(to right, #444, #666);
}

#modalTurbulenceSlider::-webkit-slider-thumb {
    background: #aaa;
}

#modalTurbulenceSlider::-moz-range-thumb {
    background: #aaa;
}

/* Responsive turbulence viz - medium screens */
@media (max-width: 1100px) and (min-width: 801px) {
    .turbulence-viz-container {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

/* Mobile/stacked responsiveness for turbulence viz */
@media (max-width: 800px) {
    .turbulence-viz-container {
        transform: none;
        width: 100%;
        max-width: 400px;
    }

    .viz-main-area {
        width: 100%;
        justify-content: center;
    }

    .canvas-wrapper-embed {
        width: 280px;
        height: 280px;
    }

    .canvas-wrapper-embed canvas {
        width: 100%;
        height: 100%;
    }

    .viz-top-controls {
        width: 100%;
        max-width: 350px;
    }

    .slider-container {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }

    #turbulenceSlider {
        width: 160px;
    }

    .slider-label-left,
    .slider-label-right {
        font-size: 0.7em;
    }

    .modal-layout {
        flex-direction: column;
        align-items: center;
    }

    .modal-description {
        max-width: 90vw;
        text-align: center;
        margin-top: 15px;
    }

    .modal-canvas-wrapper {
        width: 70vw;
        height: 70vw;
        max-width: 350px;
        max-height: 350px;
    }

    .modal-canvas-wrapper canvas {
        width: 100%;
        height: 100%;
    }

    #modalTurbulenceSlider {
        width: 180px;
    }

    .modal-slider-container {
        font-size: 0.75em;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}
