/* Software and Research pages: full-width hero, solver/area cards and a filterable grid of cases */
#title-block-header { display: none; }
/* use the whole screen width (Quarto's full layout still keeps wide side margins), up to 1680px */
main.content.column-page { grid-column: screen-start-inset / screen-end-inset; }
main.content { max-width: 1680px; min-width: 0; width: 100%; margin-left: auto; margin-right: auto; padding: 0 clamp(1rem, 3vw, 3rem); }

.sw-hero { padding: 2.5rem 0 2rem; }
.sw-eyebrow { color: #00abf0; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em; margin: 0 0 0.6rem; text-transform: uppercase; }
.sw-hero h1 { color: #ffffff; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; line-height: 1.05; margin: 0 0 1rem; }
.sw-lead { color: #c9d3e0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.6; margin: 0; max-width: 62rem; }
.sw-stats { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin-top: 1.8rem; }
.sw-stats div { display: flex; flex-direction: column; }
.sw-stats strong { color: #00abf0; font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.sw-stats span { color: #9fb0c4; font-size: 0.85rem; }

/* solver cards */
.sw-solvers { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 0.5rem 0 3rem; }
.sw-solver { background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; display: flex; flex-direction: column; padding: 1.4rem 1.4rem 1.2rem; transition: border-color 0.2s, transform 0.2s; }
.sw-solver:hover { border-color: rgba(0, 171, 240, 0.6); }
.sw-solver.is-active { border-color: #00abf0; box-shadow: 0 0 0 1px #00abf0 inset; }
.sw-solver-kind { color: #00abf0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; margin: 0 0 0.35rem; text-transform: uppercase; }
.sw-solver h2 { border: 0; color: #ffffff; font-size: 1.35rem; font-weight: 700; margin: 0 0 0.6rem; padding: 0; }
.sw-solver > p { color: #c9d3e0; font-size: 0.95rem; line-height: 1.55; margin: 0 0 0.8rem; }
.sw-highlights { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.sw-highlights li { background: rgba(0, 171, 240, 0.12); border-radius: 999px; color: #8fdcff; font-size: 0.78rem; padding: 0.2rem 0.65rem; }
.sw-solver-actions { display: flex; gap: 0.5rem; margin-top: auto; }
.sw-about { border-top: 1px solid rgba(255, 255, 255, 0.1); color: #c9d3e0; font-size: 0.92rem; line-height: 1.6; margin-top: 1rem; padding-top: 0.9rem; }
.sw-about p { margin: 0 0 0.7rem; }
.sw-about[hidden] { display: none; }

.sw-btn { background: #00abf0; border: 2px solid #00abf0; border-radius: 8px; color: #081b29; cursor: pointer; font-size: 0.88rem; font-weight: 600; padding: 0.35rem 0.9rem; transition: 0.25s; }
.sw-btn:hover { background: #081b29; color: #00abf0; }
.sw-btn-ghost { background: transparent; color: #00abf0; }
.sw-btn-ghost:hover { background: #00abf0; color: #081b29; }

/* filters */
.sw-cases-head { align-items: end; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.sw-cases-head h2 { border: 0; color: #ffffff; font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 700; margin: 0; padding: 0; }
#sw-search { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; color: #ffffff; font-size: 0.95rem; max-width: 100%; padding: 0.55rem 0.9rem; width: min(24rem, 100%); }
#sw-search::placeholder { color: #8796a8; }
#sw-search:focus { border-color: #00abf0; outline: none; }
.sw-filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; margin-bottom: 1.4rem; }
.sw-filter-group { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.sw-chip { background: transparent; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px; color: #c9d3e0; cursor: pointer; font-size: 0.85rem; padding: 0.3rem 0.85rem; transition: 0.2s; }
.sw-chip:hover { border-color: #00abf0; color: #ffffff; }
.sw-chip.is-on { background: #00abf0; border-color: #00abf0; color: #081b29; font-weight: 600; }
.sw-chip .n { opacity: 0.7; margin-left: 0.35rem; }

/* case grid: as many columns as the screen allows */
.sw-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 3rem; }
.sw-case { background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
.sw-case:hover, .sw-case:focus-visible { border-color: #00abf0; outline: none; transform: translateY(-3px); }
.sw-case[hidden] { display: none; }
.sw-thumb { aspect-ratio: 16 / 10; background: #ffffff; overflow: hidden; position: relative; }
.sw-thumb img, .sw-thumb video { display: block; height: 100%; object-fit: cover; width: 100%; }
.sw-thumb video { background: #000000; }
.sw-play { align-items: center; background: rgba(8, 27, 41, 0.75); border-radius: 50%; color: #00abf0; display: flex; font-size: 1rem; height: 2.6rem; justify-content: center; left: 50%; pointer-events: none; position: absolute; top: 50%; transform: translate(-50%, -50%); transition: opacity 0.2s; width: 2.6rem; }
.sw-case.is-playing .sw-play { opacity: 0; }
.sw-count { background: rgba(8, 27, 41, 0.8); border-radius: 6px; bottom: 0.5rem; color: #ffffff; font-size: 0.75rem; padding: 0.15rem 0.5rem; position: absolute; right: 0.5rem; }
.sw-body { display: flex; flex: 1; flex-direction: column; padding: 1rem 1.1rem 1.1rem; }
.sw-body h3 { color: #ffffff; font-size: 1.08rem; font-weight: 600; line-height: 1.35; margin: 0.55rem 0 0.4rem; }
.sw-body p { color: #b8c4d3; font-size: 0.9rem; line-height: 1.5; margin: 0 0 0.7rem; }
.sw-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sw-tag { border-radius: 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.15rem 0.5rem; text-transform: uppercase; }
.sw-tag-solver { background: rgba(0, 171, 240, 0.15); color: #6fd3ff; }
.sw-tag-simulation { background: rgba(160, 120, 255, 0.18); color: #c9b5ff; }
.sw-tag-verification { background: rgba(80, 200, 120, 0.18); color: #8ee6ac; }
.sw-tag-validation { background: rgba(255, 170, 60, 0.18); color: #ffc97a; }
.sw-tag-syllabus { background: rgba(80, 200, 120, 0.18); color: #8ee6ac; }
.sw-tag-slides { background: rgba(160, 120, 255, 0.18); color: #c9b5ff; }
.sw-tag-notes, .sw-tag-homework, .sw-tag-project { background: rgba(255, 170, 60, 0.18); color: #ffc97a; }
.sw-keywords { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; }
.sw-keywords span { border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; color: #9fb0c4; font-size: 0.72rem; padding: 0.1rem 0.5rem; }
.sw-empty { color: #9fb0c4; margin: 0 0 3rem; }
.sw-empty[hidden] { display: none; }

/* case viewer */
#sw-viewer { margin: auto; background: #0f1830; border: 1px solid rgba(0, 171, 240, 0.5); border-radius: 16px; color: #ededed; max-height: 92vh; max-width: min(1400px, 94vw); padding: 0; width: 100%; }
#sw-viewer::backdrop { background: rgba(4, 8, 20, 0.8); }
.sw-viewer-bar { background: #0f1830; border-bottom: 1px solid rgba(255, 255, 255, 0.1); display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0.7rem 1rem; position: sticky; top: 0; z-index: 1; }
.sw-viewer-body { padding: 1.2rem 1.6rem 1.8rem; }
.sw-viewer-body h2 { border: 0; color: #ffffff; font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 0.6rem 0 0.8rem; padding: 0; }
.sw-detail-text { color: #c9d3e0; font-size: 1rem; line-height: 1.65; margin: 0 0 1.4rem; max-width: 75rem; }
.sw-media { display: grid; gap: 1.2rem; }
.sw-media-multi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.sw-media figure { margin: 0; position: relative; }
.sw-media img, .sw-media video { background: #ffffff; border-radius: 8px; display: block; max-height: 70vh; object-fit: contain; width: 100%; }
.sw-media video { background: #000000; }
.sw-media figcaption { color: #9fb0c4; font-size: 0.85rem; margin-top: 0.45rem; }
.sw-full { background: rgba(8, 27, 41, 0.8); border: 1px solid #00abf0; border-radius: 6px; color: #00abf0; cursor: pointer; font-size: 0.75rem; padding: 0.15rem 0.5rem; position: absolute; right: 0.5rem; top: 0.5rem; }
.sw-full:hover { background: #00abf0; color: #081b29; }
/* in-page full screen, for browsers without the full-screen API (e.g. images on iPhone) */
.sw-media figure.sw-fig-full { align-items: center; background: #000000; display: flex; flex-direction: column; inset: 0; justify-content: center; padding: 0.5rem; position: fixed; z-index: 10; }
.sw-media figure.sw-fig-full img, .sw-media figure.sw-fig-full video { background: #000000; border-radius: 0; flex: 1 1 auto; max-height: none; min-height: 0; width: 100%; }
.sw-media figure.sw-fig-full figcaption { flex: none; padding: 0.3rem 0.5rem; }
.sw-media figure.sw-fig-full .sw-full { font-size: 0.9rem; padding: 0.35rem 0.8rem; right: max(0.75rem, env(safe-area-inset-right)); top: max(0.75rem, env(safe-area-inset-top)); z-index: 1; }
body.sw-modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .sw-hero { padding-top: 1.2rem; }
  .sw-viewer-body { padding: 1rem; }
  .sw-viewer-bar .sw-btn { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
}

/* whole solver card opens its page */
.sw-solver[data-href] { cursor: pointer; }
.sw-detail-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.sw-detail-links a { text-decoration: none; }
a.sw-btn { display: inline-block; text-decoration: none; }

/* solver pages */
.sw-back { color: #00abf0 !important; font-size: 0.9rem; text-decoration: none; }
.sw-back:hover { text-decoration: underline; }
.sw-solver-hero { padding-top: 1.5rem; }
.sw-solver-hero p { margin: 0; }
.sw-solver-hero p + p { margin-top: 0.8rem; }
.sw-solver-hero .sw-eyebrow { display: inline-block; margin-top: 0.6rem; }
.sw-title { color: #ffffff; display: block; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.05; margin: 0.2rem 0 0.4rem; }
div.sw-lead p { color: #c9d3e0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.6; max-width: 62rem; }
div.sw-highlights ul { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; margin: 1.2rem 0 0; padding: 0; }
div.sw-highlights li { background: rgba(0, 171, 240, 0.12); border-radius: 999px; color: #8fdcff; font-size: 0.85rem; margin: 0; padding: 0.25rem 0.8rem; }

/* discussion text: comfortable line length for reading, figures may use the full width */
.sw-prose { color: #d5dde8; font-size: 1.02rem; line-height: 1.7; margin: 1rem 0 3rem; }
.sw-prose p, .sw-prose ul, .sw-prose ol, .sw-prose blockquote { max-width: 90ch; }
.sw-figs p, .sw-prose figure p { max-width: none; }
.sw-prose h2 { border: 0; color: #ffffff; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; margin: 2rem 0 0.8rem; padding: 0; }
.sw-prose h3 { color: #ffffff; font-size: 1.25rem; font-weight: 600; margin: 1.6rem 0 0.6rem; }
.sw-prose strong { color: #ffffff; }
.sw-prose a { color: #00abf0; }
.sw-prose img, .sw-prose video { background: #ffffff; border-radius: 8px; display: block; height: auto; max-width: 100%; }
.sw-prose video { background: #000000; width: 100%; }
.sw-prose figure { margin: 1.4rem 0; }
.sw-prose figcaption, .sw-prose .figure-caption { color: #9fb0c4; font-size: 0.88rem; margin-top: 0.5rem; }
.sw-figs { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin: 1.4rem 0; }
.sw-figs > * { margin: 0; min-width: 0; }
.sw-figs img { width: 100%; }

/* Research overview: area cards with a picture, and the poster block */
.sw-areas .sw-solver { padding-top: 0; overflow: hidden; }
.sw-area-img { aspect-ratio: 16 / 9; background: #ffffff; margin: 0 -1.4rem 1rem; overflow: hidden; }
.sw-area-img img, .sw-area-img video { display: block; height: 100%; object-fit: cover; width: 100%; }
.sw-area-img video { background: #000000; }
.sw-nutshell { align-items: center; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 180px) 1fr; margin: 0 0 1.6rem; padding: 1.2rem 1.4rem; }
.sw-nutshell-img img { border-radius: 8px; display: block; width: 100%; }
.sw-nutshell h2 { border: 0; color: #ffffff; font-size: 1.4rem; margin: 0 0 0.4rem; padding: 0; }
.sw-nutshell p { color: #c9d3e0; margin: 0 0 0.9rem; }
.sw-nutshell .sw-eyebrow { margin: 0 0 0.3rem; }
@media (max-width: 560px) { .sw-nutshell { grid-template-columns: 1fr; } .sw-nutshell-img { max-width: 220px; } }

/* PDFs (teaching materials): inline on wide screens, preview + link on phones and narrow windows */
.sw-thumb img.sw-thumb-doc { object-position: top; }
a.sw-full { text-decoration: none; }
.sw-pdf iframe { background: #ffffff; border: 0; border-radius: 8px; display: block; height: 78vh; width: 100%; }
.sw-pdf-preview { align-items: center; display: none; flex-direction: column; gap: 0.8rem; text-decoration: none; }
.sw-pdf-preview img { background: #ffffff; border-radius: 8px; display: block; max-height: 60vh; max-width: 100%; }
@media (max-width: 760px), (pointer: coarse) {
  .sw-pdf iframe, .sw-pdf .sw-full { display: none; }
  .sw-pdf-preview { display: flex; }
}
.sw-prose .sw-topics ul { columns: 2 22rem; column-gap: 2.5rem; max-width: none; }
.sw-prose .sw-topics li { break-inside: avoid; margin-bottom: 0.3rem; }
