/* Organic Chem Basics — built on the Norris Organic Chemistry design system tokens */
@font-face { font-family: 'Clarity City'; src: url('fonts/ClarityCity-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Clarity City'; src: url('fonts/ClarityCity-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Clarity City'; src: url('fonts/ClarityCity-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Clarity City'; src: url('fonts/ClarityCity-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --navy-50: #eef3fa; --navy-100: #dbe6f3; --navy-200: #b7cbe6; --navy-300: #8caed6; --navy-400: #5a86bd;
  --navy-500: #3a68a3; --navy-600: #2a5089; --navy-700: #1f4070; --navy-800: #12305c; --navy-900: #0d2244;
  --blue-200: #97ccec; --blue-500: #0d7bc0;
  --gray-25: #fafcfd; --gray-50: #f4f7fa; --gray-100: #e9eef4; --gray-200: #d8e0ea; --gray-300: #bcc8d6;
  --gray-400: #94a3b5; --gray-500: #6b7c91; --gray-600: #4f6076; --gray-800: #28374a;
  --ochre-50: hsl(41, 100%, 92%); --red-800: hsl(9, 100%, 38%); --green-500: hsl(93, 80%, 37%); --green-800: hsl(93, 80%, 20%); --ochre-800: hsl(37, 100%, 32%);
  --heading: var(--navy-800); --body: var(--gray-800); --secondary: var(--gray-600); --muted: var(--gray-500);
  --link: var(--navy-600); --link-hover: var(--navy-800);
  --app: var(--gray-25); --card: #fff; --sunken: var(--gray-50); --selected: var(--navy-50);
  --border-subtle: var(--gray-100); --border: var(--gray-200); --border-strong: var(--gray-300);
  --shadow-sm: 0 1px 2px 0 hsla(214, 40%, 18%, 0.12);
  --shadow-lg: 0 4px 12px -2px hsla(214, 45%, 16%, 0.22), 0 2px 6px -2px hsla(214, 45%, 16%, 0.16);
  --shadow-xl: 0 12px 32px -4px hsla(214, 45%, 14%, 0.28);
  --focus: 0 0 0 3px hsla(203, 87%, 40%, 0.35);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --wrap: 1200px;
  --frame: 1280px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sunken); }
body { margin: 0; background: var(--app); color: var(--body); font: 400 15px/1.6 'Clarity City', system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column; width: 100%; max-width: var(--frame); margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); box-shadow: 0 0 32px hsla(214, 67%, 20%, 0.06); position: relative; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
img { max-width: 100%; height: auto; }
h2, h3, h4 { color: var(--heading); }
h1 { color: var(--red-800); }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.0125em; line-height: 1.2; margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--secondary); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy-800); color: #fff; padding: 8px 12px; border-radius: 4px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -0.0125em; color: var(--navy-800); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--navy-800); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-item { position: static; }
.nav-btn { font: inherit; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 4px; padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--secondary); cursor: pointer; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.nav-btn:hover, .nav-item.open .nav-btn { background: var(--sunken); color: var(--heading); }
.nav-item.current .nav-btn { color: var(--heading); box-shadow: inset 0 -2px 0 var(--navy-800); border-radius: 0; }
.nav-btn svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.nav-item.open .nav-btn svg { transform: rotate(180deg); }
.mega { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px hsla(214,67%,20%,0.10); }
.nav-item.open .mega { display: block; }
.mega .wrap { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 20px; padding-bottom: 24px; align-items: flex-start; }
.mega-intro { flex: 1 1 220px; max-width: 300px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.5; }
.mega-intro p { margin: 0; }
.mega-list { flex: 3 1 480px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 2px 16px; list-style: none; margin: 0; padding: 0; }
.mega-list a { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--heading); padding: 7px 8px; border-radius: 4px; }
.mega-list a:hover, .mega-list a:focus-visible { background: var(--selected); text-decoration: none; }
.mega-list .n { font-size: 11px; color: var(--muted); min-width: 16px; }
.icon-btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--secondary); cursor: pointer; font-size: 13px; transition: background 0.15s var(--ease); }
.icon-btn:hover { background: var(--sunken); color: var(--heading); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn kbd { font: 600 11px/1 ui-monospace, Menlo, monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 2px 4px; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-xl); flex-direction: column; padding: 8px 16px 16px; max-height: calc(100vh - 64px); overflow: auto; }
  body.menu-open .nav { display: flex; }
  .nav-btn { width: 100%; justify-content: space-between; font-size: 15px; padding: 12px 8px; min-height: 44px; }
  .nav-item.current .nav-btn { box-shadow: none; }
  .mega { position: static; box-shadow: none; border: 0; }
  .mega .wrap { padding: 0 0 8px 8px; }
  .mega-intro { display: none; }
  .mega-list a { min-height: 40px; align-items: center; }
  .search-btn .label, .search-btn kbd { display: none; }
  .header-tools { margin-left: auto; }
}
.header-tools { display: flex; gap: 8px; }

/* Buttons */
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 4px; border: 1px solid var(--navy-700); background: var(--navy-700); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: background 0.15s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--navy-800); color: #fff; text-decoration: none; }
.btn:active { background: var(--navy-900); box-shadow: inset 0 2px 0 hsla(214,67%,8%,0.35); }
.btn.outline { background: transparent; color: var(--navy-700); }
.btn.outline:hover { background: var(--navy-50); color: var(--navy-800); }
.btn.flat { background: transparent; border-color: transparent; color: var(--navy-700); padding: 0 10px; }
.btn.flat:hover { background: var(--navy-50); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 11px; }
.btn svg { width: 16px; height: 16px; }

/* Layout pieces */
main { flex: 1; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding: 24px 0 0; }
.crumbs svg { width: 14px; height: 14px; }
.crumbs span:last-child { color: var(--body); }
.hero { padding: 72px 0 40px; max-width: 780px; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.1; color: var(--green-800); }
.hero p { margin: 0; font-size: 17px; color: var(--secondary); max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; padding-bottom: 72px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
a.card, .card.link { display: flex; flex-direction: column; gap: 10px; padding: 24px; color: inherit; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
a.card:hover, .card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; color: inherit; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.tile-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--navy-50); color: var(--navy-700); display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 20px; height: 20px; }
.card h2, .card h3 { font-size: 20px; }
.card p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--secondary); }
.card .foot { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--secondary); }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 20px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.page-head > div { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.page-head h1 { font-size: clamp(28px, 4vw, 38px); }
.page-head p { margin: 0; font-size: 16px; color: var(--secondary); }
.addr { font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--muted); }

.toc { list-style: none; margin: 0 0 72px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 10px; }
.toc a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.toc a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.toc .num { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--navy-200); color: var(--navy-700); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.toc .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.toc .t strong { font-size: 15px; font-weight: 600; color: var(--heading); }
.toc svg { width: 18px; height: 18px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--gray-100); color: var(--gray-600); }
.badge.info { background: var(--navy-50); color: var(--navy-700); }
.badge.warn { background: var(--ochre-50); color: var(--ochre-800); }

/* Topic page */
.topic { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding: 20px 0 72px; }
.side { flex: 1 1 220px; max-width: 260px; position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 110px); overflow: auto; }
.side .eyebrow { padding: 0 10px 10px; color: var(--heading); }
.side a { font-size: 13px; line-height: 1.35; padding: 7px 10px; border-left: 2px solid var(--border); border-radius: 0 4px 4px 0; color: var(--secondary); }
.side a:hover { background: var(--selected); text-decoration: none; color: var(--heading); }
.side a[aria-current] { border-left-color: var(--navy-800); background: var(--selected); color: var(--heading); font-weight: 600; }
@media (max-width: 860px) { .side { display: none; } }
article { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
article > header { display: flex; flex-direction: column; gap: 10px; }
article > header h1 { font-size: clamp(28px, 4vw, 38px); }

/* Prose */
.prose { display: flex; flex-direction: column; gap: 16px; font-size: 15px; line-height: 1.65; max-width: 760px; }
.prose > * { margin: 0; }
.prose h2 { font-size: 24px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 18px; margin-top: 8px; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose strong { color: var(--heading); font-weight: 600; }
.prose figure { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.prose figure img { display: block; margin: 0 auto; border-radius: 4px; }
.prose figcaption { font-size: 13px; color: var(--secondary); text-align: center; }
.prose .lede { font-size: 17px; color: var(--secondary); }
.prose .note { padding: 12px 16px; border-radius: 8px; background: var(--navy-50); color: var(--navy-800); font-size: 14px; }
.prose .step { display: flex; align-items: baseline; gap: 12px; }
.prose .step-n { font-size: 13px; font-weight: 600; color: var(--navy-400); }
.prose .sub { font-size: 14px; color: var(--secondary); margin-top: -8px; }
.prose .jump { display: flex; flex-wrap: wrap; gap: 8px; }
.prose .jump a { white-space: nowrap; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); }
.prose .jump a:hover { border-color: var(--navy-300); text-decoration: none; }
.prose .more { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.prose .table { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--secondary); background: var(--sunken); }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.prose .facts div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 8px; background: var(--navy-50); }
.prose .facts strong { font-size: 14px; }
.prose .facts span { font-size: 13px; color: var(--secondary); }
.prose .qa { display: flex; flex-direction: column; gap: 8px; }
.prose .embed iframe { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: 4px; display: block; }
.prose details { border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.prose summary { cursor: pointer; list-style: none; display: flex; gap: 12px; padding: 12px 16px; font-weight: 500; color: var(--heading); }
.prose summary::-webkit-details-marker { display: none; }
.prose summary span { flex: none; font-size: 12px; font-weight: 600; color: var(--navy-400); padding-top: 2px; }
.prose summary::after { content: 'Show answer'; margin-left: auto; flex: none; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy-600); padding-top: 3px; }
.prose details[open] summary::after { content: 'Hide'; }
.prose details p { margin: 0; padding: 0 16px 14px 46px; color: var(--body); }

.pending { border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--sunken); padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pending p { margin: 0; color: var(--secondary); max-width: 460px; }

/* Related media */
.related { display: flex; flex-direction: column; gap: 16px; }
.related h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.related h2 svg { width: 18px; height: 18px; color: var(--navy-600); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.video { display: flex; flex-direction: column; gap: 8px; }
.video video { width: 100%; aspect-ratio: 16 / 9; background: var(--navy-900); border-radius: 8px; display: block; }
.video strong { font-size: 14px; color: var(--heading); font-weight: 600; }
.video span { font-size: 13px; color: var(--secondary); }
.app-embed { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; box-shadow: var(--shadow-sm); }
.app-embed .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border-subtle); }
.app-embed .bar strong { font-size: 14px; color: var(--heading); font-weight: 600; }
.app-embed .bar div { display: flex; gap: 4px; }
.app-embed iframe { width: 100%; height: 640px; border: 0; display: block; background: #fff; }
.app-embed .stage { display: none; }
.app-embed.on .stage { display: block; }

.pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); color: inherit; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.pager a.next { align-items: flex-end; text-align: right; grid-column: -2; }
.pager .eyebrow { color: var(--muted); }
.pager strong { font-size: 15px; font-weight: 600; color: var(--heading); }

/* Library pages (videos, apps) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { font: inherit; font-size: 13px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--body); cursor: pointer; }
.chip:hover { border-color: var(--navy-300); }
.chip[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.lib-section { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.lib-section h2 { font-size: 22px; display: flex; align-items: baseline; gap: 10px; }
.lib-section h2 small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.vcard { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; color: inherit; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.vcard strong { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--heading); }
.vcard strong svg { flex: none; width: 16px; height: 16px; color: var(--navy-600); }
.vcard span { font-size: 13px; line-height: 1.4; color: var(--secondary); }
.acard { font: inherit; text-align: left; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; padding: 0; color: inherit; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.acard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.acard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sunken); border-bottom: 1px solid var(--border-subtle); display: block; }
.acard span { padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--heading); }

/* Modal (video / app / search) */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: hsla(214, 67%, 12%, 0.55); }
.modal.open { display: flex; }
.modal-box { width: 100%; max-width: 960px; max-height: 88vh; display: flex; flex-direction: column; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-xl); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--border-subtle); }
.modal-head strong { font-size: 16px; font-weight: 600; color: var(--heading); }
.modal-head div { display: flex; gap: 4px; align-items: center; }
.modal-body { overflow: auto; }
.modal-body video { width: 100%; display: block; background: #000; max-height: 72vh; }
.modal-body iframe { width: 100%; height: 76vh; border: 0; display: block; }
.modal-desc { padding: 12px 20px 16px; margin: 0; font-size: 14px; color: var(--secondary); }

.search-box { max-width: 640px; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.search-input svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-input input { flex: 1; font: inherit; font-size: 16px; border: 0; height: 56px; outline: none; background: transparent; color: var(--heading); min-width: 0; }
.results { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.results a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: inherit; }
.results a:hover, .results a.active { background: var(--selected); text-decoration: none; }
.results .r-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.results strong { font-size: 14px; font-weight: 600; color: var(--heading); }
.results em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.results span { font-size: 13px; color: var(--secondary); line-height: 1.4; }
.results mark { background: var(--navy-100); color: inherit; border-radius: 2px; }
.empty { padding: 24px 20px; margin: 0; font-size: 14px; color: var(--secondary); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--card); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; padding-bottom: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 13px; }
.site-footer small { font-size: 12px; color: var(--muted); }

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

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.prose .glossary td:first-child { white-space: nowrap; }
.prose .glossary td:last-child { width: 1%; }
@media (max-width: 600px) { .prose .glossary td:first-child { white-space: normal; } }
.prose .refs { gap: 12px; }
.prose .refs li strong { font-weight: 500; }
.prose .refs .cite { font-size: 13px; color: var(--secondary); }
.prose img.zoomable { cursor: zoom-in; transition: opacity 0.15s var(--ease); }
.prose img.zoomable:hover { opacity: 0.85; }
.img-lightbox .modal-box { max-width: min(1200px, 96vw); }
.img-lightbox .modal-body { display: flex; justify-content: center; background: #fff; padding: 16px; }
.img-lightbox .modal-body img { max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; cursor: zoom-out; }
@media (max-width: 1280px) { body { border-left: 0; border-right: 0; box-shadow: none; } }
/* Phone & tablet */
@media (max-width: 860px) {
  .prose img.zoomable { width: auto !important; max-width: 100%; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0 28px; }
  .page-head { padding: 12px 0 20px; }
  .prose th, .prose td { padding: 8px 10px; }
  .prose details p { padding-left: 16px; }
  .prose summary::after { display: none; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}
