/* DREAMS data portal stylesheet.
   Look follows the earlier dreams-project.org site: near-white page, grey
   header band, black text, one orange-red accent, light-weight sans-serif. */

/* Hanken Grotesk (SIL Open Font License; see static/fonts/OFL.txt). */
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Hanken Grotesk";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-ext-wght-italic.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Hanken Grotesk";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-wght-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --page: #fafafa;
    --band: #dcdcdc;
    --band-soft: #ebebeb;
    --ink: #000;
    --muted: #555;
    --rule: #c8c8c8;
    --field: #fff;
    --code-bg: #ececec;
    --accent: #f84c1e;
    --section-gap: clamp(3.5rem, 6vw, 5rem);
    --slant: clamp(20px, 4.5vw, 64px);
    --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    /* The home banner image is as wide as the window, which on some
       systems includes the scrollbar; do not scroll sideways for it. */
    overflow-x: clip;
    background: var(--page);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.45;
    letter-spacing: 0.02em;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

p,
ul,
ol,
dl,
pre,
table {
    margin: 0 0 1rem;
}

label,
input,
textarea,
select,
button {
    font: inherit;
    letter-spacing: inherit;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.8rem;
    font-weight: 300;
    line-height: 1.15;
}

/* The page title, with the one rule that sits under a heading. */
h1 {
    margin-bottom: 1.4rem;
    padding-bottom: 0.45em;
    border-bottom: 1px solid var(--ink);
    font-size: clamp(2.2rem, 4.6vw, 3.4rem);
    line-height: 1.08;
}

h2 {
    font-size: clamp(1.75rem, 3.3vw, 2.6rem);
    line-height: 1.12;
}

h3 {
    font-size: 1.36rem;
    line-height: 1.3;
}

h4 {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.3;
}

strong,
b {
    font-weight: 500;
}

img {
    max-width: 100%;
}

code,
pre {
    font-family: var(--mono);
    font-size: 0.86em;
    letter-spacing: 0;
}

code {
    padding: 0.05em 0.3em;
    background: var(--code-bg);
}

pre {
    padding: 0.9rem 1rem;
    overflow-x: auto;
    background: var(--code-bg);
    line-height: 1.5;
}

pre code {
    padding: 0;
    background: none;
    font-size: 1em;
}

/* ---- Page frame ---- */

.site-shell {
    width: min(1180px, calc(100% - 2.5rem));
    margin: 0 auto;
}

.site-header {
    background: var(--band);
}

.site-header .site-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    min-height: 56px;
    padding: 0.55rem 0;
}

.site-title {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink);
    font-size: 1.36rem;
    text-decoration: none;
    white-space: nowrap;
}

.site-title:hover {
    color: var(--ink);
}

.site-logo {
    display: block;
    width: 36px;
    height: 36px;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem 1.6rem;
}

.site-nav a,
.site-nav-form button {
    padding: 0.15rem 0;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav-form button:hover {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

/* Log Out is a POST form (Django 5 rejects GET logout); make its button
   look like the neighbouring nav links. */
.site-nav-form {
    display: inline-flex;
    margin: 0;
}

.site-nav-form button {
    background: none;
    border-width: 0 0 1px;
    border-style: solid;
    border-color: transparent;
    font-weight: inherit;
    line-height: inherit;
    cursor: pointer;
}

.site-nav-account {
    display: flex;
    align-items: center;
    gap: 0.2rem 1.6rem;
    padding-left: 1.6rem;
    border-left: 1px solid #a9a9a9;
}

.site-main {
    flex: 1 0 auto;
}

/* Black with light text, so it does not repeat the grey header. */
.site-footer {
    background: var(--ink);
    color: var(--page);
    font-size: 0.9rem;
    font-weight: 400;
}

.site-footer a:focus-visible {
    outline-color: var(--page);
}

.site-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 2rem 4rem;
    padding: 3rem 0 3.4rem;
}

.site-footer p {
    margin: 0;
}

.footer-heading {
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.footer-copy {
    max-width: 46rem;
}

.footer-links {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 0.4rem;
}

/* ---- Sections ---- */

.hero,
.content-section {
    padding: var(--section-gap) 0;
}

.hero + .content-section,
.content-section + .content-section {
    border-top: 1px solid var(--rule);
}

/* A section on a light grey band that runs the full width of the window.
   Every second section of a page carries it; no rule is drawn where the
   background changes. */
.band {
    background: var(--band-soft);
    box-shadow: 0 0 0 100vmax var(--band-soft);
    clip-path: inset(0 -100vmax);
}

.content-section.band,
.band + .content-section {
    border-top: 0;
}

/* On a short page the last band runs down to the footer, which sits on
   top of it. */
.band:last-child {
    clip-path: inset(0 -100vmax -100vmax);
}

.site-footer {
    position: relative;
}

.band code,
.band pre {
    background: var(--page);
}

.band pre code {
    background: none;
}

.hero p,
.content-section p {
    max-width: 72ch;
}

.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
    gap: 2rem 3.2rem;
    align-items: start;
}

.hero-split-reverse > :first-child {
    order: 2;
}

.hero-split-reverse > :last-child {
    order: 1;
}

.hero-split.hero-split-reverse {
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr);
}

.hero-split > aside img {
    display: block;
    width: 100%;
    height: auto;
}

.lead {
    font-size: 1.36rem;
    line-height: 1.4;
}

.meta,
.publication-meta,
.small-print {
    margin: 0 0 0.3rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
}

/* A second-level heading that follows other content on the same page. */
.page-subheading {
    margin-top: 2.4rem;
}

.page-subheading,
.catalog-subheading {
    font-size: clamp(1.6rem, 2.4vw, 1.9rem);
    line-height: 1.15;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.4rem;
}

.button,
.link-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 1.35rem;
    border: 1px solid var(--ink);
    border-radius: 300px;
    background: var(--ink);
    color: var(--page);
    font-size: 0.82rem;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.link-chip:hover {
    background: #3a3a3a;
    border-color: #3a3a3a;
    color: var(--page);
}

.button-secondary,
.link-chip {
    background: transparent;
    color: var(--ink);
}

.button-secondary:hover,
.link-chip:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--page);
}

.link-chip {
    min-height: 32px;
    padding: 0 0.95rem;
}

.notice-panel {
    margin: 1.5rem 0 0;
    padding: 0.8rem 1rem;
    border: 0;
    border-left: 3px solid var(--accent);
    background: #f0f0f0;
}

.notice-panel p {
    margin: 0;
}

/* ---- Grids of items ---- */

.reference-grid,
.panel-grid {
    display: grid;
    gap: 1.6rem 2.4rem;
    margin-top: 1.4rem;
}

.reference-grid,
.panel-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.reference-card,
.nav-card {
    padding-top: 0.9rem;
    border-top: 1px solid var(--ink);
}

.reference-card h3,
.nav-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.36rem;
    font-weight: 300;
    line-height: 1.3;
}

.reference-card p:last-child,
.nav-card p:last-child {
    margin-bottom: 0;
}

.nav-card .button {
    margin-top: 0.3rem;
}

/* The same items set as one panel: three cells in a frame, divided by
   lines (the lines are the grid's own background showing through the
   1px gaps). The last paragraph of each cell sits on a common baseline. */
.panel-ruled {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--ink);
    background: var(--ink);
}

.panel-ruled .nav-card {
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.5rem 1.4rem;
    border-top: 0;
    background: var(--page);
}

.panel-ruled .nav-card p:last-child {
    margin-top: auto;
    padding-top: 0.4rem;
}

.step-list {
    max-width: 72ch;
    margin: 1.4rem 0 0;
    padding-left: 1.6rem;
}

.step-list li {
    margin-bottom: 1.3rem;
    padding-left: 0.5rem;
}

.step-list li::marker {
    font-size: 1.36rem;
}

.step-list h3 {
    margin-bottom: 0.3rem;
}

.feature-list {
    margin: 1rem 0;
    padding-left: 1.2rem;
}

.feature-list li {
    margin: 0.4rem 0;
}

.toc-list {
    list-style: none;
    display: grid;
    gap: 0.4rem;
    margin: 1.4rem 0 0;
    padding: 0;
}

.metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.2rem 2rem;
    margin: 1.2rem 0 1.6rem;
}

.metadata > div {
    padding-top: 0.6rem;
    border-top: 1px solid var(--rule);
}

.metadata dt {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
}

.metadata dd {
    margin: 0;
    font-size: 1.15rem;
}

/* ---- Home page ---- */

/* The image runs the full width of the window, directly under the header.
   The intro band below is pulled up so that its slanted edge cuts across
   the bottom of the image; the extra bottom padding keeps the text centred
   in the part that stays visible. */
.home-banner {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(88vh, 820px);
    padding: 3rem 1.5rem calc(3rem + var(--slant));
    text-align: center;
}

.notice-panel + .home-banner {
    margin-top: 1.25rem;
}

/* The file is dark filaments on a light ground; it is shown inverted. */
.home-banner-image {
    position: absolute;
    top: 0;
    left: calc(50% - 50vw);
    width: 100vw;
    max-width: none;
    height: 100%;
    object-fit: cover;
    filter: invert(1) contrast(1.15) brightness(0.85);
}

.home-banner + .home-intro {
    margin-top: calc(-1 * var(--slant));
}

.home-banner-text {
    position: relative;
}

.home-banner h1 {
    margin: 0 0 1.1rem;
    padding-bottom: 0;
    border-bottom: 0;
    color: var(--accent);
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 1.05;
}

.home-banner-subtitle {
    max-width: 30ch;
    margin: 0 auto;
    color: var(--page);
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1.3;
}

/* Grey band that runs the full width of the window. */
.home-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem 3.2rem;
    align-items: start;
    margin-top: 1.25rem;
    padding: var(--section-gap) 0;
    background: var(--band);
    box-shadow: 0 0 0 100vmax var(--band);
    clip-path: inset(0 -100vmax);
}

.home-intro h2 {
    max-width: 9ch;
    margin-bottom: 1.6rem;
    font-size: clamp(2.4rem, 6vw, 4.25rem);
    line-height: 1.08;
}

.home-intro p {
    max-width: 44ch;
}

.home-intro-logo {
    display: block;
    width: 100%;
    height: auto;
}

.news-list {
    list-style: none;
    display: grid;
    gap: 1.3rem;
    max-width: 72ch;
    margin: 1.2rem 0 0;
    padding: 0;
}

.news-list h3 {
    margin: 0 0 0.25rem;
}

.news-list p {
    margin: 0;
}

/* ---- About page ---- */

.about-motivation-hero + .about-motivation-hero {
    padding-top: 1rem;
}

.about-motivation-hero.band,
.band + .about-motivation-hero {
    padding-top: var(--section-gap);
}

.about-hero-image {
    display: block;
    width: 100%;
    height: auto;
}

/* ---- Publications ---- */

.publication-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3rem 3.6rem;
    margin-top: 2.4rem;
}

.publication-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.publication-figure-wrap {
    margin-bottom: 1rem;
    background: #fff;
}

.publication-figure {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}

.publication-card h3 {
    margin: 0 0 0.7rem;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.3;
}

.publication-card p {
    font-size: 0.9rem;
    font-weight: 400;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.2rem;
}

/* ---- Team page ---- */

.team-heading {
    margin: 2.6rem 0 0;
    text-align: center;
}

.team-heading + .team-grid {
    margin-top: 1.8rem;
}

.team-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 2.2rem 2rem;
    margin: 0 0 1rem;
    padding: 0;
}

.team-photo {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    margin-bottom: 0.7rem;
}

.team-member p {
    margin: 0;
}

.team-affiliation {
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
}

/* ---- Forms ---- */

.stack-form {
    max-width: 30rem;
}

.stack-form p {
    margin: 0 0 1rem;
}

.stack-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.stack-form input,
.stack-form textarea,
.stack-form select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid #8a8a8a;
    border-radius: 0;
    background: var(--field);
    color: var(--ink);
    font-weight: 400;
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
}

.stack-form .helptext,
.stack-form ul {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
}

.stack-form .helptext {
    display: block;
    margin-top: 0.3rem;
}

.stack-form ul {
    margin: 0.3rem 0 0;
    padding-left: 1.2rem;
}

.stack-form + .small-print {
    margin-top: 1rem;
}

.errorlist {
    margin: 0 0 0.4rem;
    padding: 0;
    list-style: none;
    color: #b3261e;
}

/* ---- Catalog ---- */

.catalog-path {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
}

/* Rows of the catalog browse pages: name and description on the left,
   counts on the right. */
.catalog-list {
    list-style: none;
    margin: 1.4rem 0 0;
    padding: 0;
    border-top: 1px solid var(--ink);
}

.catalog-subheading {
    margin-top: 2.6rem;
}

.catalog-subheading + .catalog-list {
    margin-top: 1rem;
}

.catalog-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem 2.4rem;
    align-items: baseline;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
}

.catalog-row-name {
    font-size: 1.36rem;
    line-height: 1.3;
}

.catalog-row p {
    margin: 0.3rem 0 0;
}

.catalog-row-counts {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
    white-space: nowrap;
}

.file-table-wrap,
.documentation-table-wrap {
    overflow-x: auto;
}

.documentation-table-wrap {
    margin: 1.5rem 0 1.75rem;
}

.file-table,
.documentation-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.92rem;
    font-weight: 400;
}

.file-table td:first-child {
    overflow-wrap: anywhere;
}

.documentation-table {
    min-width: 760px;
}

.file-table th,
.file-table td,
.documentation-table th,
.documentation-table td {
    padding: 0.6rem 1rem 0.6rem 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--rule);
}

.file-table th,
.documentation-table th {
    border-bottom-color: var(--ink);
    font-weight: 500;
}

.documentation-table td:first-child {
    min-width: 210px;
}

.documentation-table-separator td {
    padding: 0;
    height: 0;
    border-bottom-color: var(--ink);
}

.file-link-cell {
    white-space: nowrap;
}

/* A campaign can hold about a thousand simulations, so they are set in
   columns, not one per row. */
.simulation-link-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.45rem 1.5rem;
    margin: 1rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid var(--ink);
}

.file-group-card {
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--ink);
}

.file-group-toggle {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.file-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.file-group-name {
    font-size: 1.15rem;
}

.file-group-toggle[aria-expanded="false"] .file-group-header {
    margin-bottom: 0;
}

.file-group-header-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.file-group-count {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
}

.file-group-chevron {
    width: 1.2rem;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1;
}

.file-table-wrap.hidden {
    display: none;
}

.file-group-card:last-of-type {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--ink);
}

.catalog-subheading + .file-table-wrap {
    margin-top: 1rem;
    border-top: 1px solid var(--ink);
}

.documentation-accordion {
    margin: 1.5rem 0 1.75rem;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--rule);
}

.documentation-accordion > summary {
    padding: 0.8rem 0;
    cursor: pointer;
}

.documentation-accordion-meta {
    margin-left: 0.8rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.documentation-accordion-body {
    padding: 0 0 1.2rem;
}

/* ---- Download dialog ---- */

.download-modal.hidden {
    display: none;
}

.download-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.download-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.download-modal-panel {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 2rem));
    max-height: calc(100vh - 3rem);
    overflow: auto;
    padding: 1.6rem 1.8rem 1.8rem;
    border: 1px solid var(--ink);
    background: var(--page);
}

.download-modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
}

.download-modal-callout {
    margin: 1rem 0 1.2rem;
    padding: 0.8rem 1rem;
    border-left: 3px solid var(--ink);
    background: #f0f0f0;
}

.download-modal-callout p {
    margin: 0;
}

.download-modal-panel h2 {
    margin: 0 2rem 0.3rem 0;
    font-size: 1.36rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Show the whole command without sideways scrolling. */
.download-modal-panel pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---- Slanted bands (Home and About) ---- */

/* The top and bottom edges of the band are cut at an angle across the
   full width of the window. The extra padding keeps the text clear of
   the cut. */
.band-slant,
.about-motivation-hero.band-slant {
    --edge-left: calc(50% - 50vw);
    --edge-right: calc(50% + 50vw);
    padding-top: calc(var(--section-gap) + var(--slant));
    padding-bottom: calc(var(--section-gap) + var(--slant));
    clip-path: polygon(
        var(--edge-left) var(--slant),
        var(--edge-right) 0,
        var(--edge-right) 100%,
        var(--edge-left) calc(100% - var(--slant))
    );
}

/* The last band of a page keeps a straight bottom edge and runs down to
   the footer. */
.band-slant:last-child {
    padding-bottom: var(--section-gap);
    clip-path: polygon(
        var(--edge-left) var(--slant),
        var(--edge-right) 0,
        var(--edge-right) calc(100% + 100vmax),
        var(--edge-left) calc(100% + 100vmax)
    );
}

/* ---- Narrow screens ---- */

@media (max-width: 920px) {
    .site-header .site-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .site-footer-grid,
    .hero-split,
    .hero-split.hero-split-reverse,
    .home-intro,
    .panel-ruled {
        grid-template-columns: 1fr;
    }

    .hero-split-reverse > :first-child,
    .hero-split-reverse > :last-child {
        order: 0;
    }

    .home-intro h2 {
        max-width: none;
    }

    .home-intro-logo {
        max-width: 420px;
    }
}

@media (max-width: 720px) {
    .site-shell {
        width: calc(100% - 1.6rem);
    }

    .site-nav-account {
        padding-left: 0;
        border-left: 0;
    }

    .metadata {
        grid-template-columns: 1fr;
    }

    .catalog-row {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.6rem 1.2rem;
    }
}
