/* ---------- Header ---------- */
.masthead { position: absolute; top: 0; left: 0; right: 0; z-index: 10; height: 96px; display: flex; align-items: center; justify-content: space-between; }
.masthead__nav { display: flex; align-items: center; gap: 28px; font-size: .9375rem; font-weight: 500; }
.masthead__nav a, .masthead__film { color: var(--oe-text); text-decoration: none; background: none; border: 0; padding: 6px 0; }
.masthead__nav a:hover, .masthead__film:hover { color: var(--oe-text-strong); }

/* ---------- Hero: the example data, fitted live ---------- */
.hero { position: relative; min-height: min(100svh, 1000px); padding: 168px 0 240px; overflow: hidden; isolation: isolate;
  background: radial-gradient(60% 55% at 72% 46%, rgba(34, 99, 237, .22), transparent 70%), var(--oe-night); }
.hero::after { content: ''; position: absolute; left: -10%; right: -10%; bottom: 0; height: 260px; z-index: -1; opacity: .5;
  background: linear-gradient(var(--oe-night), transparent 40%), repeating-linear-gradient(90deg, rgba(110, 160, 255, .12) 0 1px, transparent 1px 120px);
  transform: perspective(500px) rotateX(58deg); transform-origin: bottom; }
.hero__sky { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero__copy { max-width: 700px; }
.hero h1 { white-space: nowrap; }
@media (max-width: 420px) { .hero h1 { white-space: normal; } }
.hero__second { color: #6f86a6; }
.hero .lead { margin-top: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero__req { margin-top: 20px; }
.hero .oe-status { margin-top: 8px; }
.release { margin-top: 14px; font-size: var(--oe-type-small); max-width: 34em; }
.release summary { width: max-content; cursor: pointer; color: var(--oe-text); text-decoration: underline; text-decoration-color: var(--oe-line-strong); text-underline-offset: 5px; }
.release summary:hover { text-decoration-color: var(--oe-beam); }
.release__body { margin-top: 14px; padding: 18px 20px; border-radius: var(--oe-r-card); background: rgba(10, 20, 36, .85); border: 1px solid var(--oe-line); display: grid; gap: 10px; line-height: 1.55; }
.hero__fit { position: absolute; left: 0; right: 0; bottom: 72px; margin: 0 auto; display: flex; justify-content: flex-end; pointer-events: none; }
.hero__fit figcaption { max-width: 470px; display: grid; gap: 6px; text-align: right; }
.hero__eq { color: var(--oe-text-strong); font-size: .9375rem; }
.hero__fit span { font-size: .8125rem; color: var(--oe-text-muted); }
.hero__film { position: absolute; bottom: 64px; left: max(var(--oe-gutter), calc((100% - var(--oe-max)) / 2)); display: flex; align-items: center; gap: 16px;
  padding: 8px 20px 8px 8px; border-radius: var(--oe-r-card); border: 1px solid var(--oe-line); background: rgba(10, 20, 36, .75); text-align: left; text-decoration: none; }
.hero__film:hover { border-color: var(--oe-line-strong); }
.hero__film img { width: 104px; height: 58px; object-fit: cover; border-radius: 8px; }
.hero__film-play { position: absolute; left: 8px; top: 8px; width: 104px; height: 58px; display: grid; place-items: center; }
.hero__film-play svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }
.hero__film-text b { display: block; color: var(--oe-text-strong); font-weight: 600; }
.hero__film-text span { font-size: .8125rem; color: var(--oe-text-muted); }

/* ---------- Scenes ---------- */
.scene { padding-top: var(--oe-section); }
.scene__head { margin-bottom: var(--oe-space-8); }
.scene__head .lead, .split__copy .lead { margin-top: var(--oe-space-5); }
.scene__note { margin-top: var(--oe-space-4); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.split--rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split--rev .split__copy { order: 2; }
.split__copy h2 { font-size: clamp(2.2rem, 3.9vw, 3.9rem); }
.split__copy .oe-seg { margin-top: var(--oe-space-6); }
.split__copy .fine { margin-top: var(--oe-space-5); max-width: 34em; }
.split__copy .oe-btn { margin-top: var(--oe-space-6); }

/* Workbench */
.bench__body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 420px; }
.bench__editor { border-right: 1px solid var(--oe-paper-line); }
.bench__tab { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 14px 0 24px; border-bottom: 1px solid var(--oe-paper-line); font-family: var(--oe-mono); font-size: .9375rem; }
.bench__run { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--oe-navy); color: #fff; font-family: var(--oe-font); font-weight: 600; }
.bench__run svg { width: 14px; height: 14px; fill: #fff; }
.bench__run:hover { background: #24475f; }
.bench__code { margin: 0; padding: 22px 24px 28px 0; font-size: .9375rem; line-height: 2; color: var(--oe-ink); white-space: pre; overflow-x: auto; }
.bench__code .ln { display: inline-block; width: 52px; padding-right: 20px; text-align: right; color: #a2adb5; user-select: none; }
.bench__code b { font-weight: 700; } .bench__code i { font-style: normal; color: var(--oe-signal); } .bench__code s { text-decoration: none; color: #b4372e; }
.bench__results { padding: 20px 22px; background: var(--oe-paper-2); }
.bench__done { display: flex; align-items: center; gap: 10px; font-size: .9375rem; font-weight: 500; margin-bottom: 14px; }
.bench__done i { width: 8px; height: 8px; border-radius: 50%; background: var(--oe-ink); }
.bench__done.running i { background: var(--oe-signal); animation: pulse 700ms var(--oe-ease-in-out) infinite alternate; }
@keyframes pulse { to { opacity: .2; } }
.bench__card { padding: 18px; border-radius: 12px; background: #fff; border: 1px solid var(--oe-paper-line); transition: opacity var(--oe-dur-base) var(--oe-ease-out), transform var(--oe-dur-base) var(--oe-ease-out); }
.bench__card.is-running { opacity: .25; transform: translateY(6px); }
.bench__meta { display: flex; align-items: baseline; gap: 10px; }
.bench__meta b { font-size: .8125rem; letter-spacing: .06em; }
.bench__meta span { font-weight: 600; }
.bench__meta em { margin-left: auto; font-style: normal; font-size: .875rem; color: var(--oe-ink-muted); }
.bench__sub { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 12px; font-size: .8125rem; color: var(--oe-ink-muted); flex-wrap: wrap; }
table.tex { width: 100%; border-collapse: collapse; font-family: var(--oe-serif); font-size: .95rem; color: #1b2a35; }
table.tex th { font-weight: 400; text-align: right; padding: 5px 4px; border-top: 1.5px solid #1b2a35; border-bottom: 1px solid #1b2a35; }
table.tex td { text-align: right; padding: 5px 4px; }
table.tex th:first-child, table.tex td:first-child { text-align: left; }
table.tex tbody tr:last-child td { border-bottom: 1.5px solid #1b2a35; }

/* Estimators */
.est__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--oe-space-6); }
.est__names { font-family: var(--oe-mono); font-size: clamp(.95rem, 1.35vw, 1.2rem); line-height: 2.05; color: #7891b3; word-spacing: .35em; }
.est__names span { transition: color var(--oe-dur-base), opacity var(--oe-dur-base), text-shadow var(--oe-dur-base); }
.est__names.filtered span { opacity: .22; }
.est__names.filtered span.on { opacity: 1; color: #fff; text-shadow: 0 0 18px rgba(110, 160, 255, .8); }
.est__more { margin-top: var(--oe-space-6); max-width: 46em; }

/* Inference */
.inf__call { display: block; margin-top: var(--oe-space-4); color: var(--oe-glow); font-size: var(--oe-type-code); }
.inf__post { margin: var(--oe-space-7) 0 0; display: grid; gap: 18px; }
.inf__post dt code { color: var(--oe-text-strong); font-size: var(--oe-type-code); }
.inf__post dd { margin: 4px 0 0; color: var(--oe-text-muted); font-size: var(--oe-type-small); }
.inf__panel { padding: clamp(18px, 2.5vw, 32px); border-radius: var(--oe-r-window); background: var(--oe-deep); border: 1px solid var(--oe-line); }
.inf__plot { width: 100%; height: auto; }
.inf__plot text { fill: var(--oe-text-muted); font-family: var(--oe-mono); font-size: 13px; }
.inf__table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: .9375rem; }
.inf__table th { text-align: left; font-weight: 500; color: var(--oe-text-muted); font-size: .8125rem; padding: 8px 6px; border-bottom: 1px solid var(--oe-line-strong); }
.inf__table td { padding: 10px 6px; border-bottom: 1px solid var(--oe-line); font-family: var(--oe-mono); font-size: .875rem; color: var(--oe-text-strong); white-space: nowrap; }
.inf__table td:first-child { font-family: var(--oe-font); font-size: .9375rem; color: var(--oe-text); }
.ci { display: flex; align-items: center; gap: 12px; }
.ci svg { width: 120px; height: 14px; flex: none; }
.ci rect { fill: rgba(110, 160, 255, .16); }
.ci line { stroke: var(--oe-beam); stroke-width: 3; stroke-linecap: round; transition: all var(--oe-dur-base) var(--oe-ease-out); }
.ci circle { fill: #fff; transition: cx var(--oe-dur-base) var(--oe-ease-out); }
#cov-note { margin-top: 14px; }

/* Network */
.net__graph { width: 100%; height: auto; }
.net__graph line { stroke-width: 1.6; transition: stroke var(--oe-dur-base), opacity var(--oe-dur-base); }
.net__graph circle { transition: r var(--oe-dur-base) var(--oe-ease-out), fill var(--oe-dur-base); }
.net__graph .ring { fill: none; stroke: #fff; stroke-width: 3; }
.net__graph text { fill: #fff; font-family: var(--oe-mono); font-size: 22px; font-weight: 600; paint-order: stroke; stroke: rgba(5, 10, 18, .9); stroke-width: 6px; }
.net__code { margin: var(--oe-space-5) 0 0; padding: 16px 18px; border-radius: var(--oe-r-card); background: var(--oe-deep); border: 1px solid var(--oe-line);
  font-size: .875rem; line-height: 1.8; color: var(--oe-text-strong); white-space: pre-wrap; }
.net__code .k { color: var(--oe-glow); } .net__code .s { color: #ffb38a; } .net__code .c { color: var(--oe-text-muted); }
.net__stat { margin-top: var(--oe-space-4); color: var(--oe-text); }

/* Publish */
.pub__doc { position: relative; }
.pub__seg { margin-bottom: 16px; }
.pub__paper { padding: clamp(28px, 4vw, 52px) clamp(24px, 4.5vw, 64px); min-height: 520px; }
.pub__paper[hidden] { display: none; }
.tt-cap { text-align: center; font-size: 1.35rem; margin-bottom: 18px; }
table.tt { width: 100%; border-collapse: collapse; font-size: 1.2rem; }
table.tt td { padding: 3px 6px; text-align: center; } table.tt td:first-child { text-align: left; }
table.tt tr.rule-top td { border-top: 2.5px solid #111; } table.tt tr.rule-mid td { border-top: 1.2px solid #111; } table.tt tr.rule-bot td { border-bottom: 2.5px solid #111; }
table.tt tr.se td { color: #333; padding-bottom: 8px; }
.tt-note { margin-top: 14px; font-size: .9rem; line-height: 1.5; color: #333; }
.pub__src { margin: 0; font-family: var(--oe-mono); font-size: .8125rem; line-height: 1.75; color: #2b3b47; white-space: pre-wrap; word-break: break-word; background: #fbfcfd; }
.pub__src .cmd { color: var(--oe-signal); } .pub__src .math { color: #0e7c66; }

/* Teams */
.team__body { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 360px; }
.team__side { display: grid; align-content: start; gap: 4px; padding: 18px 14px; border-right: 1px solid var(--oe-paper-line); background: var(--oe-paper-2); font-size: .9375rem; }
.team__side > * { padding: 9px 10px; border-radius: 8px; font-weight: 500; color: #3c4d5a; }
.team__side .on { background: #eef4ff; color: var(--oe-ink); box-shadow: inset 3px 0 0 var(--oe-signal); }
.team__main { padding: 20px 24px; }
.team__members { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 20px; font-size: .9375rem; }
.team__members span { display: inline-flex; align-items: center; gap: 8px; }
.team__members i { width: 30px; height: 30px; border-radius: 50%; background: var(--oe-signal); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: .875rem; }
.team__members i.m2 { background: #0fa3b1; } .team__members i.m3 { background: #8b5cf6; }
.team__members em { font-style: normal; color: var(--oe-ink-muted); font-size: .8125rem; }
.team__file { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-top: 8px; border: 1px solid var(--oe-paper-line); border-radius: 10px; font-size: .9375rem; }
.team__file em { width: 54px; font-style: normal; font-size: .8125rem; font-weight: 600; color: var(--oe-signal); }
.team__file b { font-family: var(--oe-mono); font-weight: 500; font-size: .875rem; }
.team__file span { margin-left: auto; color: #2fa36b; font-size: .8125rem; white-space: nowrap; }

/* Libraries */
.libs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: var(--oe-space-8); }
.lib { padding: clamp(24px, 3vw, 40px); border-radius: 20px; background: var(--oe-deep); border: 1px solid var(--oe-line); }
.lib h3 { font-family: var(--oe-mono); font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; }
.lib h3 a { text-decoration: none; }
.lib h3 a:hover { color: var(--oe-glow); }
.lib p { margin: 12px 0 28px; color: var(--oe-text); max-width: 30em; }

/* Closing */
.close { position: relative; margin-top: var(--oe-section); padding: var(--oe-section) 0; text-align: center; overflow: hidden; isolation: isolate; }
.close__halo { position: absolute; inset: 0; z-index: -1; background: radial-gradient(42% 46% at 50% 52%, rgba(34, 99, 237, .34), rgba(34, 99, 237, .08) 60%, transparent 100%); }
.close h2 { max-width: none; font-size: var(--oe-type-display); line-height: .95; letter-spacing: var(--oe-track-display); }
.close .lead { margin: 28px auto 0; }
.close .hero__actions { justify-content: center; }

/* Footer */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 36px; border-top: 1px solid var(--oe-line); font-size: var(--oe-type-small); }
.foot__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--oe-text-strong); font-weight: 600; }
.foot__brand .oe-mark { width: 22px; height: 20px; }
.foot__brand span { color: var(--oe-text-muted); font-weight: 400; }
.foot__links { display: flex; gap: 22px; color: var(--oe-text-muted); }
.foot__links a { text-decoration: none; } .foot__links a:hover { color: var(--oe-text-strong); }
.foot__links { flex-wrap: wrap; align-items: center; }
.foot__btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; } .foot__btn:hover { color: var(--oe-text-strong); }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .masthead { height: 76px; }
  .masthead__film { display: none; }
  .hero { padding: 104px 0 0; min-height: 0; display: flex; flex-direction: column; }
  .hero__grid { order: 1; }
  .hero__sky { order: 2; }
  .hero__fit { order: 3; }
  .hero__film { order: 4; }
  .hero__sky { position: relative; z-index: 0; height: 320px; margin-top: 36px; }
  .hero__fit { position: static; padding: 0 var(--oe-gutter); justify-content: flex-start; }
  .hero__fit figcaption { text-align: left; }
  .hero__film { position: relative; left: auto; bottom: auto; margin: 28px var(--oe-gutter) 40px; }
  .hero::after { display: none; }
  .split, .libs { grid-template-columns: minmax(0, 1fr); }
  .split--rev .split__copy { order: 0; }
  .bench__body, .team__body { grid-template-columns: minmax(0, 1fr); }
  .bench__editor { border-right: 0; border-bottom: 1px solid var(--oe-paper-line); }
  .team__side { display: none; }
  .ci svg { display: none; }
  .inf__table td, .inf__table th { padding-left: 4px; padding-right: 4px; }
  .bench__card { overflow-x: auto; }
  .oe-window__bar .crumb { display: none; }
  .team__file span { display: none; }
  .oe-seg { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .inf__table th:nth-child(3), .inf__table td:nth-child(3) { display: none; }
  .bench__sub span:nth-child(2) { display: none; }
}

/* Labs teaser */
.hero h1 .hero__second { display: inline-block; }
.courses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.course { display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 26px 24px; border-radius: var(--oe-r-card); background: var(--oe-deep);
  border: 1px solid var(--oe-line); text-decoration: none; transition: border-color var(--oe-dur-fast), transform var(--oe-dur-fast) var(--oe-ease-out); }
.course:hover { border-color: var(--oe-beam); transform: translateY(-2px); }
.course h3 { font-size: 1.6rem; }
.course p { color: var(--oe-text); font-size: .975rem; }
.course__n { margin-top: auto; font-family: var(--oe-mono); font-size: .875rem; color: var(--oe-glow); }
.labs__more { margin-top: var(--oe-space-6); }
@media (max-width: 1100px) { .courses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .courses { grid-template-columns: minmax(0, 1fr); } .course { min-height: 0; } }
@media (max-width: 600px) {
  .masthead__nav { gap: 16px; font-size: .875rem; }
  .masthead__nav a[href*="pypi.org"], .masthead__nav a[href="./#top"] { display: none; }
  .oe-brand { font-size: 1.15rem; gap: 9px; }
  .oe-brand .oe-mark { width: 28px; height: 25px; }
  /* GitHub stays in the footer and Labs is one tap away under Learn, so the header keeps one line. */
  .masthead__nav a[href*="github.com"], .masthead__nav a[href$="labs.html"] { display: none; }
}
@media (max-width: 420px) {
  .masthead__nav { gap: 12px; }
  .oe-brand { font-size: 1rem; gap: 8px; }
}

/* Switchable panels keep their size, so nothing below them moves */
.pub__paper { height: 600px; min-height: 0; overflow: auto; }
.oe-term pre { min-height: 270px; }
.inf__table { table-layout: fixed; font-variant-numeric: tabular-nums; }
.inf__table th:nth-child(1), .inf__table td:nth-child(1) { width: 24%; }
.inf__table th:nth-child(2), .inf__table td:nth-child(2), .inf__table th:nth-child(3), .inf__table td:nth-child(3) { width: 17%; }
.oe-btn--signal:hover, .course:hover { transform: none; }
@media (max-width: 900px) { .pub__paper { height: 520px; } }

.hero .lead { max-width: 30em; }

/* Film card under the hero actions */
.hero { padding-bottom: 150px; }
.hero__copy .hero__film { position: relative; left: auto; bottom: auto; margin-top: 28px; }
@media (max-width: 900px) { .hero__copy .hero__film { margin: 24px 0 0; } }
