/* ==========================================================================
   Printable Graph Paper — base stylesheet
   Design tokens, page chrome (header, nav, footer), article typography and
   the shared blocks. Every page loads this first; the generator's own rules
   live in studio.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f6f7f9;
    --ink: #111418;
    --muted: #5f6873;
    --line: #e4e7eb;
    --line-soft: #eff1f4;
    --accent: #2563eb;
    --accent-ink: #fff;
    --accent-soft: #eef3fe;
    --red: #c0432c;
    --stage: #f4f5f7;
    --scrim: rgba(10, 14, 20, .40);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .08);
    --radius: 12px;
    --wrap: 1180px;
    --wrap-wide: 1440px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
    --bg: #0f1216;
    --surface: #15191e;
    --surface-2: #1b2027;
    --ink: #e8ecf1;
    --muted: #97a1ad;
    --line: #262d36;
    --line-soft: #1f252d;
    --accent: #6ea0ff;
    --accent-ink: #0b1220;
    --accent-soft: #17233a;
    --red: #e2705a;
    --stage: #0b0e12;
    --scrim: rgba(0, 0, 0, .66);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .45);
}

/* --------------------------------------------------------------------------
   2. Reset & elements
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    /* Nothing may make the page scroll sideways, whichever way it runs. */
    overflow-x: clip;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

img,
svg {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.mono {
    font-family: var(--mono);
}

/* Any `display` an author rule sets beats the `hidden` attribute's UA default,
   so a hidden element with `display: grid` stays visible. Restate it once,
   here, rather than remembering it at every call site. */
[hidden] {
    display: none !important;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 20px;
}

/* The generator wants every pixel a laptop has; articles read better at the
   narrower measure. */
.wrap--wide {
    max-width: var(--wrap-wide);
}

/* Parked above the page, not far to the left: in a right-to-left language a
   box at left: -9999px stretches the page ten thousand pixels wide. */
.skip-link {
    position: absolute;
    inset-inline-start: 8px;
    top: 0;
    transform: translateY(-120%);
    background: var(--surface);
    color: var(--ink);
    padding: 10px 16px;
    z-index: 200;
    border-radius: 0 0 8px 8px;
}

.skip-link:focus {
    transform: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
/* Static, not sticky: the generator already fills the screen, and a bar
   that follows the reader takes height the sheet and the articles need. */
.appbar {
    position: relative;
    z-index: 60;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.bar {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 58px;
    max-width: var(--wrap-wide);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
    min-width: 0;
}

.topnav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.topnav a:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.topnav a[aria-current="page"] {
    color: var(--ink);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    /* The one thing in the bar allowed to give way on a narrow phone: the
       name shortens with an ellipsis, the buttons stay whole. */
    flex: 0 1 auto;
    min-width: 0;
}

.brand svg {
    width: 26px;
    height: 26px;
    flex: none;
}

.brand-title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.015em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: none;
}

.icon-btn {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink);
}

.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--line);
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

html[data-theme="dark"] .sun {
    display: none;
}

html:not([data-theme="dark"]) .moon {
    display: none;
}

/* Language menu ----------------------------------------------------------- */
.menu-anchor {
    position: relative;
}

.menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 80;
}

.menu.is-on {
    display: block;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    text-decoration: none;
    color: var(--ink);
    font-size: .9rem;
}

.menu a:hover {
    background: var(--surface-2);
}

.menu a[aria-current="true"] {
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-soft);
}

/* Two dozen languages: two columns, scrolling rather than running off the
   bottom of a small screen. */
.menu--lang {
    width: min(420px, calc(100vw - 24px));
    max-height: min(75vh, 560px);
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
}

.menu--lang.is-on {
    display: grid;
}

.menu__flag {
    font-size: 1.05rem;
    line-height: 1;
}

[dir="rtl"] .menu {
    right: auto;
    left: 0;
}

/* On a phone the globe sits too far from the edge for a two-column menu to
   hang from it, so the menu hangs from the header instead: the full width of
   the screen less a margin, the same in either reading direction. */
@media (max-width: 540px) {
    .bar .menu-anchor {
        position: static;
    }

    .bar .menu.menu--lang {
        left: 12px;
        right: 12px;
        top: calc(100% + 6px);
        width: auto;
    }
}

/* --------------------------------------------------------------------------
   3b. Drawer
   ----------------------------------------------------------------------------
   The whole of the navigation lives here, at every width: the header carries
   only the most-printed papers, and fifty-odd paper types were never going
   to fit across it.
   -------------------------------------------------------------------------- */
.scrim {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    transition: opacity .25s ease;
}

.scrim.is-open {
    opacity: 1;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 310px;
    max-width: 86vw;
    z-index: 91;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(10, 20, 28, .25);
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

.drawer.is-open {
    transform: none;
    visibility: visible;
}

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    flex: none;
}

.drawer__brand {
    font-weight: 700;
    font-size: .98rem;
    letter-spacing: -.015em;
}

/* The list is long by design, so it scrolls inside the drawer rather than
   pushing the close button off the top. */
.drawer__scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 10px 28px;
    flex: 1;
    overscroll-behavior: contain;
}

.drawer__title {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 18px 8px 6px;
    font-weight: 600;
}

.drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Paper type icons: a small white tile, so a pale grid still reads on a
   tinted or dark background. */
.pico {
    flex: none;
    display: block;
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
}

.ico {
    flex: none;
}

.drawer__list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: .9rem;
    line-height: 1.3;
}

.drawer__list a:hover {
    background: var(--surface-2);
}

.drawer__list a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. Page intro
   -------------------------------------------------------------------------- */
.intro {
    padding: 18px 0 16px;
    max-width: 80ch;
}

.intro h1 {
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    font-weight: 700;
}

.intro p {
    margin: 0;
    color: var(--muted);
    font-size: .98rem;
}


.intro--home h1 {
    font-size: 2.1rem;
}

.intro .updated {
    margin-top: 8px;
    font-size: .82rem;
    opacity: .8;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0 0;
    font-size: .8rem;
    color: var(--muted);
    list-style: none;
    margin: 0;
}

.crumbs li::after {
    content: "/";
    margin-left: 6px;
    opacity: .5;
}

.crumbs li:last-child::after {
    content: none;
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   5. Content blocks
   -------------------------------------------------------------------------- */
section.block {
    padding: 0 0 52px;
}

section.block h2 {
    font-size: 1.45rem;
    letter-spacing: -.015em;
    margin: 0 0 6px;
    font-weight: 700;
}

section.block .sub {
    color: var(--muted);
    margin: 0 0 20px;
    max-width: 62ch;
}

.block__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.search {
    width: 100%;
    background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 10px center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px 8px 34px;
    font: inherit;
    font-size: .88rem;
    color: var(--ink);
}

.search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search--wide {
    max-width: 320px;
    margin-bottom: 20px;
}

/* Gallery ----------------------------------------------------------------- */
.gallery-title {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    margin: 8px 0 12px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

/* A crop of the top of the sheet, big enough to read the ruling. */
.card__thumb {
    display: block;
    aspect-ratio: 4 / 3;
    background: #fff;
    border-bottom: 1px solid var(--line-soft);
    overflow: hidden;
}

.card__thumb img {
    display: block;
    width: 160%;
    max-width: none;
    margin: -4% 0 0 -8%;
}

.card__body {
    display: grid;
    gap: 3px;
    padding: 10px 12px 12px;
}

.card__body b {
    font-size: .9rem;
    font-weight: 600;
}

.card__body span {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.4;
}

.empty {
    color: var(--muted);
}

/* Preset links ------------------------------------------------------------ */
.linkcols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 28px;
}

.linkcol h3 {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    margin: 0 0 8px;
}

.linkcol ul {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.linkcol a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: var(--ink);
    text-decoration: none;
    font-size: .9rem;
}

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

.prose {
    max-width: 70ch;
    color: var(--muted);
}

.prose h2 {
    color: var(--ink);
    font-size: 1.3rem;
    margin: 30px 0 8px;
}

.prose h3 {
    color: var(--ink);
    font-size: 1.05rem;
    margin: 26px 0 6px;
}

.prose p {
    margin: 0 0 12px;
}

.prose ul,
.prose ol {
    margin: 0 0 14px;
    padding-left: 18px;
}

.prose li {
    margin-bottom: 5px;
}

.prose strong,
.prose b {
    color: var(--ink);
    font-weight: 600;
}

.cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
}

ol.steps {
    counter-reset: s;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
    max-width: 70ch;
}

ol.steps li {
    counter-increment: s;
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 12px;
    color: var(--muted);
}

ol.steps li::before {
    content: counter(s);
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: 6px;
    height: 26px;
    display: grid;
    place-items: center;
    background: var(--surface);
}

ol.steps b {
    color: var(--ink);
    font-weight: 600;
}

ol.steps.steps--row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    max-width: none;
    gap: 22px;
}

/* How it works -------------------------------------------------------------
   Numbered cards, each a real screenshot of this page's own tool. */
.howto {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.howto--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 920px;
}

.howto--1 {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
}

.howto__step {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px 22px 0;
    background: var(--surface);
    overflow: hidden;
}

.howto__num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 14px;
}

.howto__step h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.howto__step p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: .92rem;
}

/* The screenshot sits in a framed window that runs off the card's foot,
   like a glimpse of the tool rather than a pasted picture. */
.howto__shot {
    display: block;
    width: 100%;
    height: auto;
    /* One frame for every step, cropped from the top, so the cards line up
       whatever shape each screenshot is. */
    aspect-ratio: 5 / 4;
    object-fit: cover;
    object-position: top center;
    margin-top: auto;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 14px rgba(16, 24, 40, .06);
}

.howto--1 .howto__shot {
    aspect-ratio: auto;
    object-fit: fill;
    border-bottom: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 22px;
}

/* Related ----------------------------------------------------------------- */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.related-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    border-color: var(--accent);
}

.related-card__icon {
    flex: none;
    color: var(--accent);
    padding-top: 2px;
}

.related-card strong {
    display: block;
    font-size: .92rem;
    margin-bottom: 3px;
}

.related-card span {
    font-size: .8rem;
    color: var(--muted);
}

/* FAQ ---------------------------------------------------------------------
   Read like the rest of the article: every question a heading, every answer
   on the page, nothing folded away. */
.faq {
    max-width: 74ch;
}

.faq h3 {
    font-size: 1.02rem;
    color: var(--ink);
    margin: 22px 0 6px;
    font-weight: 600;
}

.faq h3:first-child {
    margin-top: 4px;
}

.faq p {
    margin: 0;
    color: var(--muted);
    max-width: 66ch;
}

/* --------------------------------------------------------------------------
   5b. Buttons
   ----------------------------------------------------------------------------
   Shared by the generator's toolbar, the drawing tools and the 404 page.
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.2;
    cursor: pointer;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    filter: brightness(1.06);
}

.btn.ghost {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
    font-weight: 500;
}

.btn.ghost:hover {
    border-color: var(--ink);
    filter: none;
}

/* Reset sits disabled until a setting actually differs from the page default,
   so it has to read as unavailable rather than merely quiet. */
.btn[disabled] {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* --------------------------------------------------------------------------
   5c. Not found
   -------------------------------------------------------------------------- */
.notfound {
    padding-top: 40px;
    padding-bottom: 36px;
}

.notfound__code {
    font-size: 4.5rem !important;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--accent) !important;
    margin: 0 0 8px !important;
}

.notfound__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

/* --------------------------------------------------------------------------
   5d. Right-to-left
   ----------------------------------------------------------------------------
   Arabic and Hebrew mirror the page — the drawer opens from the right, the
   paper list sits on the right — but never the sheet: a ruler, a grid and a
   printed page read left to right in every language.
   -------------------------------------------------------------------------- */
[dir="rtl"] .drawer {
    left: auto;
    right: 0;
    transform: translateX(104%);
    border-right: 0;
    border-left: 1px solid var(--line);
}

[dir="rtl"] .drawer.is-open {
    transform: none;
}

[dir="rtl"] .search {
    background-position: right 10px center;
    padding: 8px 34px 8px 10px;
}

[dir="rtl"] .q select,
[dir="rtl"] .f select {
    background-position: left 10px center;
}

/* A measurement is one token: "6 mm" must not come out as "mm 6". */
[dir="rtl"] .chips button,
[dir="rtl"] .chips a,
[dir="rtl"] .num {
    unicode-bidi: plaintext;
}

[dir="rtl"] .canvas .stage,
[dir="rtl"] .sheet,
[dir="rtl"] .dims {
    direction: ltr;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 40px 0 30px;
    margin-top: 20px;
}

.foot-cols {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
}

.foot-about p {
    color: var(--muted);
    font-size: .88rem;
    max-width: 34ch;
    margin: 12px 0 0;
}

.foot-col h2 {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    margin: 4px 0 10px;
}

.foot-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.foot-col a {
    display: block;
    padding: 3px 0;
    color: var(--ink);
    text-decoration: none;
    font-size: .88rem;
}

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

.foot {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: .85rem;
}

.foot nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.foot a {
    color: var(--muted);
    text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   7. Toast
   -------------------------------------------------------------------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: .86rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 120;
}

.toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1099px) {
    .topnav {
        display: none;
    }
}

@media (max-width: 960px) {
    .howto,
    .howto--2 {
        grid-template-columns: minmax(0, 1fr);
        max-width: 560px;
    }

    .foot-cols {
        grid-template-columns: 1fr 1fr;
    }

    .foot-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .bar {
        gap: 10px;
        padding: 0 14px;
    }

    .brand svg {
        width: 24px;
        height: 24px;
    }

    .brand-title {
        font-size: .95rem;
    }

    .tools {
        gap: 4px;
    }

    .intro h1,
    .intro--home h1 {
        font-size: 1.5rem;
    }

    .search--wide {
        max-width: none;
    }

    /* Three across on a phone: the whole directory stays a short scroll. */
    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 22px;
    }

    .card__thumb {
        aspect-ratio: 1 / 1;
    }

    .card__body {
        padding: 7px 8px 9px;
    }

    .card__body b {
        font-size: .78rem;
        line-height: 1.25;
    }

    .card__body span {
        display: none;
    }

    .linkcols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 16px;
    }

    .linkcol a {
        font-size: .84rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* The on-screen page is chrome around a preview; printing it would waste
   paper. The sheet itself is printed from an isolated iframe. */
@media print {
    body > *:not(main),
    .side,
    .toolbar,
    .panel,
    section.block,
    .mobbar,
    .stagefoot,
    .intro,
    .crumbs {
        display: none !important;
    }
}
