/* Atieh Taheri — site styles.
   Sections: 1 fonts and colours · 2 base · 3 hand-drawn outlines · 4 pieces (buttons, tags, cards, rows)
             5 header and footer · 6 page layouts · 7 paper pages · 8 small screens, motion, print */

/* ---------- 1. Fonts and colours ---------- */
@font-face { font-family: 'Quicksand'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../assets/fonts/quicksand-latin.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url('../assets/fonts/nunito-sans-latin.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: italic; font-weight: 200 1000; font-display: swap; src: url('../assets/fonts/nunito-sans-italic-latin.woff2') format('woff2'); }

:root {
  --page: #F7F8FC; --band: #E3EAF7; --card: #FFFFFF; --ink: #252A53; --muted: #5E6384;
  --blush: #F3CEDA; --mint: #C6E4D8; --lilac: #DAD0F1; --peri: #C3D0F3; --focus: #3345C4;
  --head: 'Quicksand', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --body: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  --gutter: clamp(20px, 8.33vw, 120px);
  --bleed: min(80px, calc(var(--gutter) - 12px));
  color-scheme: light;
}
/* dark theme: chosen with the switch, or taken from the system when nothing is chosen */
:root[data-theme="dark"] {
  --page: #14172E; --band: #1E2346; --card: #1B1F3D; --ink: #ECEEF8; --muted: #A9AECF;
  --blush: #6A3D5A; --mint: #2B5B52; --lilac: #4B4288; --peri: #33447F; --focus: #B7C1FF;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #14172E; --band: #1E2346; --card: #1B1F3D; --ink: #ECEEF8; --muted: #A9AECF;
    --blush: #6A3D5A; --mint: #2B5B52; --lilac: #4B4288; --peri: #33447F; --focus: #B7C1FF;
    color-scheme: dark;
  }
}
[data-c="blush"] { --c: var(--blush); } [data-c="mint"] { --c: var(--mint); }
[data-c="lilac"] { --c: var(--lilac); } [data-c="peri"] { --c: var(--peri); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* scroll-padding-top: a link target, or the element that has keyboard focus, stops below the fixed header (section 5) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-stuck) + 20px); }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1.125rem/1.667 var(--body); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
/* overflow-wrap: a title word that is wider than the screen (very large text on a phone) breaks instead of sticking out */
h1, h2, h3, h4 { font-family: var(--head); font-weight: 500; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
h3, h4, .paper-head h1 { text-wrap: pretty; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
b, strong { font-weight: 600; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 30; padding: 12px 18px; background: var(--card); color: var(--ink); font-weight: 600; border: 2px solid var(--ink); border-radius: 12px; }
.skip:focus { top: 16px; }
/* links inside running text */
/* Underlines are one unbroken line: the browser must not cut gaps into them where letters such as g, p and y
   reach below the line, and the line sits just under those letters instead of crossing them. */
a, .u { text-decoration-skip-ink: none; text-underline-offset: .3em; }
p a:not([class]), dd a:not([class]) { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .3em; }
p a:not([class]):hover, dd a:not([class]):hover { color: var(--focus); }

/* ---------- 3. Hand-drawn outlines (drawn by js/site.js; plain borders without it) ---------- */
.skh { position: relative; isolation: isolate; }
.sk { position: absolute; left: -12px; top: -12px; z-index: -1; max-width: none; pointer-events: none; overflow: visible; }
.sk-l { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sk-f { stroke: none; }
.f-blush { fill: var(--blush); } .f-mint { fill: var(--mint); } .f-lilac { fill: var(--lilac); } .f-peri { fill: var(--peri); }
.f-card { fill: var(--card); } .f-band { fill: var(--band); }
.art { overflow: visible; max-width: 100%; height: auto; flex: none; }
.i { flex: none; overflow: visible; vertical-align: middle; }

/* ---------- 4. Pieces ---------- */
/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 26px; border: 1.6px solid transparent; border-radius: 30px; background: none; color: var(--ink); font: 600 1rem/1.375 var(--body); text-decoration: none; cursor: pointer; transition: transform .12s ease; overflow-wrap: anywhere; }
.btn.sm { min-height: 45px; padding: 10px 18px; font-size: .9375rem; }
.btn:hover { transform: translate(-1px, -1px); }
.btn:hover .sk-l { stroke-width: 2.1; }
.btn:active { transform: translate(1px, 1px); }
.btn:focus-visible { border-radius: 30px; }
html:not(.sk-on) .btn { border-color: var(--ink); }
html:not(.sk-on) .btn.primary { background: var(--blush); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* tags */
.chip { display: inline-flex; align-items: center; padding: 5px 13px; border: 1.6px solid transparent; border-radius: 16px; color: var(--ink); font: 600 .875rem/1.36 var(--body); }
html:not(.sk-on) .chip { border-color: var(--ink); background: var(--c); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* text links with a drawn underline */
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 0; color: var(--ink); font-weight: 600; text-decoration: none; }
.u { display: inline-block; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .3em; }
.u.sk-u { text-decoration: none; }
.link:hover { color: var(--focus); }
.link:hover .sk-l { stroke: var(--focus); }

/* small labels */
.eyebrow, .label { color: var(--muted); font: 600 .875rem/1.36 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; flex: none; width: 22px; border-top: 1.6px solid var(--ink); border-radius: 2px; }
.h-sec { font: 500 clamp(2rem, 1.2rem + 2.4vw, 2.625rem)/1.24 var(--head); letter-spacing: -.01em; }
.sec-head { display: flex; flex-direction: column; gap: 12px; }
.note { font: italic 400 .9375rem/1.4 var(--body); }
.meta { color: var(--muted); font-size: .9375rem; line-height: 1.53; }

/* cards */
.card { padding: clamp(22px, 4vw, 36px); border: 1.6px solid transparent; border-radius: 16px; }
html:not(.sk-on) .card { border-color: var(--ink); background: var(--card); box-shadow: 7px 7px 0 var(--c); }
.card > h2 { margin-bottom: 12px; font: 600 1.75rem/1.29 var(--head); }
.card > h3 { margin-bottom: 12px; font: 600 1.5rem/1.3 var(--head); }
.card > p + p, .card > p + .link { margin-top: 12px; }
.card-text { font-size: 1.0625rem; line-height: 1.6; }
.card > .rule { margin: 16px 0 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 32px; }

/* tinted boxes and picture frames */
.tint { padding: 28px 32px; border-radius: 16px; }
html:not(.sk-on) .tint, html:not(.sk-on) .band { background: var(--band); }
.frame { padding: 12px; border: 1.6px solid transparent; border-radius: 14px; }
.frame.sm { padding: 7px; border-radius: 10px; }
.frame img { display: block; width: 100%; border-radius: 6px; }
html:not(.sk-on) .frame { border-color: var(--ink); background: var(--card); box-shadow: 5px 5px 0 var(--c); }

/* rows inside cards: a title with details, or a date with a line of text */
.rows > * { position: relative; padding: 15px 0; }
.rows > :first-child { padding-top: 6px; }
.rows > :last-child { padding-bottom: 0; }
.rows > li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.row-title { font: 600 1.0625rem/1.47 var(--body); }
dl.rows > div { display: grid; grid-template-columns: var(--dw, 118px) minmax(0, 1fr); gap: 4px 20px; }
dl.rows dt { color: var(--muted); font: 600 .9375rem/1.6 var(--body); }
dl.rows dd { font-size: 1rem; line-height: 1.5; }
.rule { display: block; height: 8px; }
.row-rule { position: absolute !important; left: 0; right: 0; top: -4px; }
html:not(.sk-on) .rows > * + *, html:not(.sk-on) .pubs > li + li, html:not(.sk-on) .facts > div + div { border-top: 1px solid var(--ink); }
html:not(.sk-on) .divider .rule { height: 0; border-top: 1px solid var(--ink); }

/* ---------- 5. Header and footer ---------- */
/* The header stays at the top of the window while the page scrolls. Part of its top padding (--head-tuck) scrolls
   away first, so the fixed bar is lower than the header at the top of a page. --head-stuck is the height that stays
   in view; js/site.js measures it, and the values here are the fallback. Once the page has scrolled, a drawn line
   appears under the bar. On a very low window (a phone held sideways, or a page zoomed far in) the header scrolls
   away as before, so it never takes up most of the screen. */
:root { --head-tuck: 20px; --head-stuck: 78px; }
.site-top { position: sticky; top: calc(-1 * var(--head-tuck)); z-index: 20; background: var(--page); }
.site-header { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px clamp(12px, 1.6vw, 24px); padding-top: 28px; padding-bottom: 20px; }
.stick-rule { position: absolute !important; left: var(--gutter); right: var(--gutter); bottom: -4px; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.scrolled .stick-rule { opacity: 1; }
.site-header.open .stick-rule { display: none; }
html:not(.sk-on) .stick-rule { bottom: 0; height: 0; border-top: 1px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font: 600 1.375rem/1.25 var(--head); text-decoration: none; }
.nav ul { display: flex; flex-wrap: wrap; gap: 0 clamp(8px, 1vw, 14px); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 11px 6px; font-size: 1rem; line-height: 1.375; text-decoration: none; }
.nav a[aria-current] { font-weight: 600; }
.nav a:not([aria-current]):hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .3em; }
/* the Menu button is for phones only: there the links and the theme switch open from it (see section 8) */
.menu-btn, .menu-rule { display: none; }
.menu-btn[aria-expanded="false"] .i-shut, .menu-btn[aria-expanded="true"] .i-open { display: none; }
.tools { display: flex; align-items: center; gap: 16px; }
.switch { display: inline-flex; gap: 2px; min-width: 0; margin: 0; padding: 3px; border: 1.6px solid transparent; border-radius: 24px; }
.switch label { display: inline-flex; cursor: pointer; }
.opt { display: inline-flex; align-items: center; gap: 6px; padding: 10px 13px; border-radius: 20px; font: 600 .875rem/1.36 var(--body); }
.switch input:not(:checked) + .opt > .sk { display: none; }
.switch input:focus-visible + .opt { outline: 3px solid var(--focus); outline-offset: 2px; }
html:not(.sk-on) .switch { border-color: var(--ink); }
html:not(.sk-on) .switch input:checked + .opt { background: var(--blush); }
.no-js .switch { display: none; }

.site-footer { padding-bottom: 44px; }
.divider { display: flex; align-items: center; gap: 0; margin-bottom: 14px; }
.divider .rule { flex: 1; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.foot-right { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.foot-row .link { font-size: .875rem; }

/* ---------- 6. Page layouts ---------- */
.sec { padding-block: 44px; }
.sec-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 36px; padding-bottom: 40px; }
/* the same size as the homepage heading (.hero-title) */
.page-head h1 { font: 500 clamp(2.25rem, 1.5rem + 2.4vw, 3rem)/1.21 var(--head); letter-spacing: -.015em; }
.lead { max-width: 780px; font-size: 1.25rem; line-height: 1.6; }
.profiles { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: .9375rem; }
.cards { padding-bottom: 64px; }
.cards + .cards { margin-top: -12px; }

/* home */
/* the portrait column gives way on mid-size screens (a tablet held sideways), so the title keeps its three lines */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, min(490px, 42%)); align-items: center; gap: 32px 64px; padding-top: 28px; padding-bottom: 84px; }
.hello { margin-bottom: 8px; color: var(--muted); font: italic 400 1.25rem/1.4 var(--body); }
.hero-title { font: 500 clamp(2.25rem, 1.5rem + 2.4vw, 3rem)/1.21 var(--head); letter-spacing: -.015em; }
.hero-title > span { display: block; }
.hero .lead { max-width: 560px; margin-top: 22px; font-size: 1.1875rem; line-height: 1.58; }
.hero .actions { margin-top: 28px; }
.hero .profiles { margin-top: 22px; }
.portrait { justify-self: end; width: 100%; max-width: 490px; }
.portrait-art, .illo { display: block; width: 100%; }
.badge { display: block; margin: -4px 0 14px -4px; }
.topic-card h3 { margin-bottom: 10px; font: 600 1.5rem/1.3 var(--head); }
.topic-card p { color: var(--muted); font-size: 1rem; line-height: 1.625; }
.band { margin-inline: calc(var(--bleed) * -1); padding: 64px var(--bleed); border-radius: 28px; }
.split { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); align-items: start; gap: 40px 64px; }
.split-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.split-intro > p { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.split-intro .btn { margin-top: 8px; }
.about-card p { font-size: 1.0625rem; line-height: 1.65; }
.strip-text { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.strip-text .actions { margin-top: 8px; gap: 16px 28px; }

/* lists of publications */
.pubs > li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px 0; }
.pubs > :first-child { padding-top: 0; }
.pubs > :last-child { padding-bottom: 0; }
.venue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pub-title { font: 600 1.3125rem/1.38 var(--head); }
.pub-title a { text-decoration: none; }
.pub-title a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .3em; }
.pub-authors { color: var(--muted); font-size: .9375rem; line-height: 1.47; }
.me { color: var(--ink); font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: .9375rem; }

/* about */
.bio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 400px); align-items: center; gap: 32px 64px; padding-bottom: 64px; }
.bio-text { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 700px; }
.bio-text .actions { margin-top: 12px; gap: 16px 28px; }

/* research */
.direction { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: start; gap: 32px 64px; padding-block: 36px; }
.direction h2 { margin-bottom: 14px; font: 600 clamp(1.75rem, 1.3rem + 1.4vw, 2.125rem)/1.24 var(--head); }
.direction p { max-width: 700px; }
.direction p + p { margin-top: 14px; }
.area { padding: 28px 32px; }
.area > h3 { margin-bottom: 8px; font: 600 1.25rem/1.3 var(--head); }
.area li { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 0; }
.area .link { font-size: 1rem; }
.area .meta { font-size: .875rem; line-height: 1.4; }
.closing { padding-top: 12px; padding-bottom: 72px; }
.closing .actions { gap: 16px 28px; }

/* talks and media */
.talks { display: grid; grid-template-columns: minmax(0, 480fr) minmax(0, 688fr); gap: 32px; padding-bottom: 64px; }
.rows > li.media-item { display: grid; grid-template-columns: 216px minmax(0, 1fr); align-items: start; gap: 16px 24px; }
.media-item .frame img { aspect-ratio: 202 / 130; object-fit: cover; }
.media-item .frame.fit img { object-fit: contain; background: #fff; }
.media-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 2px; }
.media-text .link { font-size: .9375rem; }
.invite .link { font-size: 1rem; }
.invite { font-size: 1rem; }

/* contact */
.contact-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 360px); align-items: center; gap: 24px 64px; padding-top: 36px; padding-bottom: 48px; }
.contact-head .page-head { padding: 0; }
.contact-head .actions { margin-top: 12px; }
.contact-card > h2 { font-size: 1.5rem; }
.contact-card p { font-size: 1.0625rem; line-height: 1.6; }
.contact-card p.meta { margin-top: 10px; font-size: .9375rem; line-height: 1.53; }
.contact-card .link { font-size: 1.0625rem; }
.contact-card .meta { font-size: .9375rem; }
.contact-card .rows > li { gap: 0; padding: 9px 0; }
address { font-style: normal; }

/* accessibility statement */
.statement { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; gap: 40px 64px; padding-bottom: 72px; }
.statement-main { display: flex; flex-direction: column; gap: 36px; }
.prose h2 { margin-bottom: 14px; font: 600 1.75rem/1.29 var(--head); }
.prose p { max-width: 700px; }
.prose p + p { margin-top: 14px; }
.prose .actions { margin-top: 18px; }
.leaves { display: flex; flex-direction: column; gap: 12px; max-width: 700px; }
.leaves li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; }
.leaves .i { margin-top: .5em; }
.glance { padding: 28px; }
.glance > h2 { margin-bottom: 8px; font-size: 1.375rem; line-height: 1.27; }
.kv > div { padding: 10px 0; }
.kv dt { color: var(--muted); font: 600 .875rem/1.36 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.kv dd { font-size: 1.0625rem; line-height: 1.5; }

/* ---------- 7. Paper pages ---------- */
.paper-head { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 24px; padding-bottom: 44px; }
.paper-head h1 { max-width: 1040px; font: 500 clamp(1.875rem, 1.25rem + 2.6vw, 2.75rem)/1.27 var(--head); letter-spacing: -.01em; }
.paper-head .note { font-size: 1rem; }
.authors { max-width: 1040px; color: var(--muted); font-size: 1.125rem; line-height: 1.56; }
.status { color: var(--muted); font: italic 400 1.0625rem/1.4 var(--body); }
.paper-body { display: grid; grid-template-columns: minmax(0, 776fr) minmax(260px, 360fr); align-items: start; gap: 48px 64px; padding-bottom: 72px; }
.paper-main { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
figcaption { margin-top: 14px; color: var(--muted); font: italic 400 1rem/1.5 var(--body); }
.in-short p { margin-top: 10px; font-size: 1.25rem; line-height: 1.6; }
.cite h2 { margin-bottom: 14px; font: 600 1.75rem/1.29 var(--head); }
.ref { max-width: 700px; font-size: 1rem; line-height: 1.625; }
.cite .actions { margin: 16px 0; gap: 12px; }
.copy-status { font-size: .9375rem; font-weight: 600; }
.no-js [data-copy] { display: none; }
.bibtex pre { margin: 10px 0 0; font: 400 .875rem/1.57 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.paper-aside { display: flex; flex-direction: column; gap: 32px; }
.paper-aside .label { margin-bottom: 10px; }
.facts > div { position: relative; padding: 12px 0; }
.facts > :last-child { padding-bottom: 0; }
.facts dt { color: var(--muted); font: 600 .875rem/1.4 var(--body); }
.facts dd { margin-top: 2px; font-size: 1rem; line-height: 1.5; }
.related { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.related .link { font-size: 1rem; }

/* ---------- 8. Small screens, motion, print ---------- */
/* below this width the name, the links and the tools do not fit in one row: the links take a row of their own */
@media (max-width: 1099px) {
  :root { --head-stuck: 116px; }
  .site-header { row-gap: 2px; padding-bottom: 12px; }
  .site-header .nav { order: 3; flex-basis: 100%; margin-left: -6px; }
}
@media (max-width: 1000px) {
  .hero, .bio, .contact-head, .direction, .statement, .paper-body, .split, .talks { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-bottom: 56px; }
  .portrait { justify-self: start; max-width: 420px; }
  /* in one column the homepage photo comes first, so the bottom of the first screen does not cut it in half */
  .hero .portrait { order: -1; max-width: 340px; }
  .bio .portrait { max-width: 340px; }
  /* the plant drawing on the Contact page shows only where it sits beside the heading */
  .illo { display: none; }
  .band { padding-block: 44px; }
  .direction { padding-block: 28px; }
}
/* phones, also held sideways: the header is the name and a Menu button, and the links and the theme switch
   open from that button. Without JavaScript there is no button and the links stay visible, in rows. */
@media (max-width: 700px) {
  :root { --head-stuck: 65px; }
  .site-header { gap: 4px 8px; }
  /* an open menu that is taller than the window scrolls inside itself, so every link can be reached */
  .js .site-header.open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .opt { padding: 11px 13px; }
  .nav ul { gap: 0 8px; }
  .js .menu-btn { display: inline-flex; padding-inline: 14px; }
  .js .site-header:not(.open) .nav, .js .site-header:not(.open) .tools { display: none; }
  .js .nav ul { flex-direction: column; flex-wrap: nowrap; gap: 0; padding-top: 4px; }
  .js .nav a { display: flex; min-height: 48px; font-size: 1.0625rem; }
  .js .site-header .tools { order: 4; flex-basis: 100%; padding-top: 4px; }
  .js .site-header.open .menu-rule { display: block; order: 5; flex-basis: 100%; margin-top: 6px; }
}
@media (max-width: 600px) {
  :root { --head-tuck: 8px; --head-stuck: 65px; }
  body { font-size: 1.0625rem; line-height: 1.65; }
  .site-header { padding-top: 16px; padding-bottom: 12px; }
  .brand { gap: 8px; font-size: 1.25rem; }
  .lead, .in-short p { font-size: 1.125rem; }
  .hero .lead { font-size: 1.0625rem; }
  .hero .portrait { max-width: 260px; }
  .tint { padding: 22px 20px; }
  .area { padding: 22px; }
  .sec { padding-block: 32px; }
  dl.rows > div { grid-template-columns: minmax(0, 1fr); }
  .rows > li.media-item { grid-template-columns: minmax(0, 1fr); }
  .media-item .frame { max-width: 260px; }
  .btn { padding-inline: 22px; }
}
/* a phone zoomed to 200% and beyond: any long word may break, so the page never scrolls sideways */
@media (max-width: 20em) {
  body { overflow-wrap: anywhere; }
}
/* a very low window (a phone held sideways, a page zoomed far in): the header scrolls away with the page */
@media (max-height: 500px) {
  html { scroll-padding-top: 24px; }
  .site-top { position: static; }
  .scrolled .stick-rule { opacity: 0; }
  .js .site-header.open { max-height: none; overflow-y: visible; }
}
/* very narrow phones: the name and the Menu button still share one row */
@media (max-width: 21.25em) {
  .brand { gap: 6px; font-size: 1.125rem; }
  .js .menu-btn { gap: 6px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:hover, .btn:active { transform: none; }
}
@media print {
  .site-header .nav, .tools, .skip, .cite .actions, .divider, .js .menu-btn, .stick-rule { display: none; }
  .site-top { position: static; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .band, .tint { background: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 400; font-size: .85em; }
}
