/* =========================================================
   TRON project page — style.css (v2)
   Color/typography borrowed from Audio-SDS + ArtiFixer (SIL)
   ========================================================= */

* { box-sizing: border-box; }

body, html {
    font-family: "Titillium Web", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.55;
    color: #1a1a1a;
    background-color: #f8f8f8;
    margin: 0;
    padding: 0;
}

b, strong { font-weight: 700; }

a:link, a:visited { color: #1772d0; text-decoration: none; }
a:hover           { color: #f09228; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

section { margin: 48px 0; clear: both; }

h1 { font-size: 34px; font-weight: 600; line-height: 1.2em; text-align: center; margin: 16px 0 6px; }
h2 { font-size: 26px; font-weight: 500; margin: 16px 0 10px; text-align: center; }
h3 { font-size: 21px; font-weight: 500; margin: 24px 0 8px; text-align: center; }
h4 { font-size: 18px; font-weight: 500; margin: 18px 0 8px; text-align: center; }
h5 { font-size: 18px; font-weight: 600; margin: 0 0 8px; color: #76B900; }

p  { line-height: 1.6; margin: 12px 0; }
hr { height: 1px; border: 0; border-top: 1px solid #ddd; margin: 0; }

/* ---------- Topnav (ArtiFixer pattern + NVIDIA logo) ---------- */
.topnav {
    overflow: hidden;
    background-color: #EEEEEE;
    padding: 0;
}
.topnav a {
    float: left;
    color: black;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
}
.topnav a:hover { color: #76B900; }
.topnav-logo { padding: 8px 16px !important; }
.topnav-logo img { height: 30px; vertical-align: middle; display: block; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 16px; text-align: center; }
.hero .venue {
    text-align: center;
    color: #76B900;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-size: 14px;
    margin: 4px 0 18px;
}
.authors { text-align: center; margin: 6px 0; line-height: 1.9; }
.authors .author { display: inline-block; margin: 0 8px; font-size: 17px; font-weight: 500; }
.authors .author a { color: #1a1a1a; }
.authors .author sup { color: #76B900; font-weight: 700; padding-left: 1px; font-size: 12px; }
.affiliations { text-align: center; margin: 6px 0 18px; color: #555; font-size: 14px; }
.affiliations sup { color: #76B900; font-weight: 700; padding-right: 2px; }

/* Resource buttons (pill row) */
.resource-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 22px;
}
.resource-button {
    display: inline-flex;
    align-items: center;
    background-color: #444;
    color: white !important;
    padding: 9px 18px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}
.resource-button:hover { background-color: #76B900; color: white !important; transform: translateY(-1px); }
.resource-button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}
.resource-button i { font-size: 17px; }

/* TL;DR (now in hero, before video) */
.tldr {
    background: #fff;
    border-left: 4px solid #76B900;
    padding: 18px 24px;
    border-radius: 6px;
    font-size: 17px;
    line-height: 1.65;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    text-align: left;
    margin: 12px 0 24px;
    position: relative;
}
.tldr-tag {
    display: inline-block;
    background-color: #76B900;
    color: white;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 3px 9px;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Hero video */
.hero-video { margin: 0 auto; max-width: 900px; }
.hero-video video { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,0.12); display: block; }

/* ---------- Carousel (Slick) — fixed box height so page doesn't jump on slide change ---------- */
.slider-nav { max-width: 1000px; margin: 0 auto; padding: 0 30px; }
.slide-btn  { padding: 0 10px; }
.slide-btn:focus { outline: none; }

.slide-row {
    display: flex;
    align-items: stretch;
    gap: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    height: 460px;            /* shorter carousel — user feedback */
    box-sizing: border-box;
    overflow: hidden;
}
.slide-text {
    flex: 0 0 34%;            /* shrink text column, give more room to img */
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}
.slide-text h5 { margin: 0 0 10px; }
.slide-text p  { margin: 0; font-size: 15px; line-height: 1.55; color: #333; }
.slide-img {
    flex: 1 1 66%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.slide-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto; height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* Larger Slick dots, centered — use !important to win over slick-theme.css */
.slick-dots {
    bottom: -50px !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    left: 0 !important;
    line-height: 1 !important;
    list-style: none;
    display: block !important;
}
.slick-dots li {
    width: 28px !important;
    height: 28px !important;
    margin: 0 6px !important;
    display: inline-block !important;
}
.slick-dots li button {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.slick-dots li button:before {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 40px !important;
    line-height: 28px !important;
    width: 28px !important;
    height: 28px !important;
    color: #76B900 !important;
    opacity: 0.35 !important;
    content: "\2022" !important;          /* bullet */
    text-align: center;
}
.slick-dots li.slick-active button:before { color: #76B900 !important; opacity: 1 !important; }

/* Bigger arrows in NVIDIA green circles */
.slick-prev, .slick-next {
    width: 50px !important;
    height: 50px !important;
    z-index: 5;
    background: #76B900 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.15s ease, transform 0.15s ease;
    border: 0;
    cursor: pointer;
}
.slick-prev { left: -34px !important; }
.slick-next { right: -34px !important; }
.slick-prev:hover, .slick-next:hover { background: #5e9300 !important; transform: scale(1.06); }
.slick-prev:focus, .slick-next:focus { background: #76B900 !important; outline: none; }
.slick-prev:before, .slick-next:before {
    color: white !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    line-height: 50px !important;
    font-family: inherit !important;
}
.slick-prev:before { content: "\2039" !important; }      /* single left arrow */
.slick-next:before { content: "\203A" !important; }      /* single right arrow */

/* Carousel reserves bottom space for dots. Slick dots are at bottom:-50px and extend ~30px
   below .slider-nav. We use both margin-bottom on the inner element and padding-bottom on
   the section so the next h2 is clearly separated. */
.slider-nav { padding-bottom: 14px; margin-bottom: 100px; }
section.carousel-section { padding-bottom: 80px; }

/* ---------- Method figure ---------- */
.full-width-figure {
    margin: 24px 0 12px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.full-width-figure img { width: 100%; height: auto; max-width: 960px; }
.full-width-figure .caption { font-size: 14px; color: #555; padding: 8px 16px 4px; text-align: justify; }

/* ---------- Channel grouping brackets (under the channel pill row) ---------- */
.channel-groups {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 4px 0 18px;
    padding: 0;
}
.ch-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ch-bracket {
    height: 12px;
    width: 100%;
    border-left:   2px solid #76B900;
    border-right:  2px solid #76B900;
    border-bottom: 2px solid #76B900;
    border-radius: 0 0 8px 8px;
    box-sizing: border-box;
}
.ch-group-label {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #76B900;
    letter-spacing: 0.3px;
}
@media (max-width: 800px) {
    .channel-groups { display: none; }
}

/* ---------- Dataset pills ---------- */
.dataset-pill-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}
.dataset-pill {
    background-color: #f0f0f0;
    border: 1px solid #d8d8d8;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 22px;
    padding: 0;
}
.dataset-pill a {
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
    color: #444 !important;
    text-decoration: none;
    display: inline-block;
}
.dataset-pill.active { background-color: #76B900; border-color: #76B900; }
.dataset-pill.active a { color: white !important; }
.dataset-pill:hover { background-color: #e2e2e2; transform: translateY(-1px); }
.dataset-pill.active:hover { background-color: #5e9300; }

/* ---------- Channel-grid (2 envmaps side-by-side) ---------- */
.channel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 12px 0;
}
.channel-col {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.channel-col video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    transition: opacity 0.18s ease;     /* mask flicker on src swap */
}
/* Multi-layer channel stack — all 8 channels preloaded, JS toggles .active */
.channel-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.channel-stack .channel-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}
.channel-stack .channel-layer.active {
    opacity: 1;
}
#intensity-video,
#baseline-video,
.compare-video,
.app-tile video,
.flicker-tile video,
.intensity-envmap {
    transition: opacity 0.18s ease;     /* same flicker mask on all swap-capable media */
}
/* Class JS toggles during swap */
.swap-fading { opacity: 0 !important; }
.envmap-thumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #1a1a1a;
    color: #f8f8f8;
    font-size: 13px;
    font-weight: 500;
}
.envmap-thumb img {
    width: 56px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #444;
}

/* ---------- Applications grid ---------- */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0;
}
.app-tile {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}
.app-tile video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}
.app-tile .app-caption {
    padding: 10px 14px 14px;
    font-size: 14px;
    margin: 0;
    color: #333;
    line-height: 1.5;
}

/* ---------- Intensity-slider widget ---------- */
.intensity-widget {
    background: #fff;
    border-radius: 10px;
    padding: 18px 22px 24px;
    margin: 24px 0;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.intensity-help { text-align: center; color: #555; margin: 4px 0 14px; font-size: 15px; }
.intensity-stage { max-width: 800px; margin: 0 auto; }
.intensity-envmap-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    background: #1a1a1a;
    padding: 8px 14px;
    border-radius: 6px;
}
.intensity-envmap {
    width: 80px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #444;
}
.intensity-label {
    color: #f8f8f8;
    font-size: 13px;
    font-weight: 500;
}
.intensity-label #intensity-level-num { color: #76B900; font-weight: 700; font-size: 15px; }
.intensity-video-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}
.intensity-video-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.intensity-video-layer.active { opacity: 1; }
#intensity-range {
    width: 100%;
    margin: 16px 0 4px;
    accent-color: #76B900;
    height: 6px;
    cursor: pointer;
}
.intensity-ticks {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 12px;
    padding: 0 6px;
    user-select: none;
}

/* ---------- Compare slider (before/after, ArtiFixer pattern) ---------- */
.compare-block { margin: 18px 0; }
.compare-block h4 { color: #444; margin-bottom: 10px; }

.compare-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
    flex-wrap: wrap;
}
.compare-ctrl-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    min-width: 70px;
    text-align: right;
}
.compare-controls .dataset-pill-container { margin: 0; }

.compare-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 8px 0 0 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    line-height: 0;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
    user-select: none;
    touch-action: none;
}
.compare-slider .compare-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.compare-slider .compare-video-base {
    position: absolute;
    top: 0; left: 0;
}
.compare-slider .compare-video-after {
    position: absolute;
    top: 0; left: 0;
    /* clip-path set by JS based on handle position */
}
/* Multi-layer: 3 scene stacks preloaded, each with 1 base + 6 baseline layers.
   Scene pill toggles which .scene-stack is .active; baseline pill toggles which
   .compare-layer inside the active scene-stack is .active. Slider clip is on a
   CSS variable so it propagates to every scene-stack's .compare-stack-after. */
.compare-slider {
    --clip: inset(0 0 0 50%);
}
.compare-slider .scene-stack {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}
.compare-slider .scene-stack.active {
    opacity: 1;
}
.compare-slider .scene-stack .compare-video-base {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.compare-slider .compare-stack-after {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    clip-path: var(--clip);
    -webkit-clip-path: var(--clip);
}
.compare-slider .compare-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.compare-slider .compare-layer.active {
    opacity: 1;
}
.compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #fff;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}
.compare-handle-line { width: 100%; height: 100%; background: #fff; }
.compare-handle-arrows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #76B900;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: white;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 1px 5px rgba(0,0,0,0.35);
}
.compare-label {
    position: absolute;
    bottom: 12px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
    line-height: 1.2;
}
.compare-label-left  { left: 12px; }
.compare-label-right { right: 12px; }
.compare-range {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: ew-resize;
    margin: 0;
    z-index: 4;
}

/* ---------- Flicker test grid (2×2) ---------- */
.flicker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0;
}
.flicker-tile {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}
.flicker-tile video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.flicker-tile .flicker-caption {
    text-align: center;
    padding: 8px 6px;
    font-size: 13px;
    margin: 0;
    color: #333;
}

/* ---------- BibTeX ---------- */
.bibtex {
    background: #1a1a1a;
    color: #f4f4f4;
    padding: 18px 22px;
    border-radius: 8px;
    font-family: "Fira Code", Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

.acks { color: #444; font-size: 15px; line-height: 1.6; }

/* ---------- Related Work cards ---------- */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 16px 0;
}
.related-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border: 2px solid transparent;
    display: block;
}
.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    border-color: #76B900;
    color: inherit;
}
.related-title {
    font-size: 17px;
    font-weight: 700;
    color: #76B900;
    margin-bottom: 4px;
}
.related-sub {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}
.related-desc {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}
@media (max-width: 700px) {
    .related-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    .container { padding: 0 14px; }
    .slide-row { flex-direction: column; min-height: auto; }
    .channel-grid { grid-template-columns: 1fr; }
    .applications-grid { grid-template-columns: 1fr; }
    .authors .author { font-size: 15px; }
    .resource-buttons { gap: 8px; }
    .resource-button { padding: 7px 13px; font-size: 13px; }
    .flicker-grid { grid-template-columns: repeat(2, 1fr); }
    .topnav a { padding: 12px 10px; font-size: 14px; }
}

@media (max-width: 480px) {
    .flicker-grid { grid-template-columns: 1fr; }
    .tldr-tag { display: block; margin-bottom: 6px; }
}
