:root {
  --red:#962d3f; --ink:#242830; --muted:#555f6a; --line:#e0e2e6; --wash:#f6f7f9;
  font:16px/1.55 system-ui,sans-serif; color:var(--ink); background:white;
}
* {box-sizing:border-box}
body {margin:0}
.wrap {max-width:1140px;margin:auto;padding-inline:28px}
header {border-top:5px solid var(--red);border-bottom:1px solid var(--line)}
.header, footer .wrap {display:flex;justify-content:space-between;align-items:center;gap:14px;padding-block:17px}
.brand {color:var(--ink);font-weight:700;text-decoration:none}
.brand span {color:var(--muted);font-weight:450}
nav {display:flex;gap:22px;font-size:14px;flex-wrap:wrap}
a {color:var(--red);text-underline-offset:3px}
a:hover {color:#652030}
button,input,textarea {font:inherit;color:inherit}
button {cursor:pointer}
button:hover {border-color:var(--red);background:#faeff1}
:focus-visible {outline:2px solid #235b8d;outline-offset:3px}
.skip {position:absolute;left:12px;top:-80px;background:white;padding:10px;z-index:2}
.skip:focus {top:12px}
.hero {position:relative;isolation:isolate;background:#f8f8fa;border-bottom:1px solid var(--line)}
#code {position:absolute;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none}
.hero-inner {display:grid;grid-template-columns:1.03fr 1fr;gap:52px;align-items:center;padding-block:38px}
h1,h2,h3,p,figure {margin:0}
h1 {font:600 clamp(38px,5vw,64px)/1.06 Georgia,serif;letter-spacing:-.035em;margin-block:10px 18px}
h2 {font:600 clamp(25px,3vw,34px)/1.16 Georgia,serif;margin-top:5px}
h3 {font-size:18px}
.label {font-size:11px;font-weight:700;letter-spacing:.12em;color:var(--red)}
.lede {font-size:17px;max-width:510px}
.role {font-size:13px;color:var(--muted);margin-top:15px}
.quiet {border:1px solid var(--line);border-radius:4px;background:white;font-size:12px;padding:4px 8px;margin-top:12px}
figure img {display:block;width:100%;height:auto;border-radius:4px}
.hero figure img {aspect-ratio:1.65;object-fit:cover;object-position:center 44%}
figcaption {color:var(--muted);font-size:12px;margin-top:6px}
.topics {padding-block:40px 52px}
.directory-heading {display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:20px}
.search {font-size:13px;color:var(--muted)}
input,textarea {display:block;padding:8px 10px;border:1px solid #a6abb3;border-radius:4px;background:white}
input {width:min(310px,100%);margin-top:4px}
.filters {display:flex;flex-wrap:wrap;gap:7px;margin-bottom:10px}
.filters button {border:1px solid var(--line);background:white;border-radius:4px;padding:5px 10px;font-size:13px}
.filters button:hover {background:#faeff1}
.filters button[aria-pressed=true],.primary {background:var(--red);color:white;border:1px solid var(--red)}
.kinds button {font-size:12px}
#count {font-size:13px;color:var(--muted);margin:13px 0}
.group {border-top:1px solid var(--line);padding-top:14px;margin-top:16px}
.group > p {color:var(--muted);font-size:14px;margin:3px 0 8px}
.resource {display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:13px;padding:10px 6px;border-bottom:1px solid var(--line)}
.resource:hover,.resource:focus-within {background:var(--wash)}
.thumb {display:grid;place-items:center;width:72px;height:43px;background:#f0e5e8;color:var(--red);border-radius:4px;font-size:18px}
.video .thumb {background:#e8edf4;color:#344f70}
.resource p {font-size:13px;color:var(--muted)}
.resource a,.resource button {font-weight:650;font-size:15px;text-align:left}
.resource button {padding:0;border:0;background:transparent;color:var(--red);text-decoration:underline;text-underline-offset:3px}
.resource button:hover {color:#652030}
.resource-type {font-size:12px;color:var(--muted)}
.teaching {background:var(--wash);border-block:1px solid var(--line)}
.teaching-grid {display:grid;grid-template-columns:1fr .75fr;gap:44px;padding-block:38px}
.teaching p:not(.label) {margin-top:12px}
dt {font-weight:650;margin-top:10px}
dd {margin:0;color:var(--muted)}
.photos {display:grid;gap:14px}
.photos img {max-height:175px;object-fit:cover}
footer {font-size:13px;color:var(--muted)}
dialog {width:min(560px,calc(100% - 24px));max-height:90dvh;border:1px solid var(--line);border-radius:8px;padding:22px;color:var(--ink)}
dialog::backdrop {background:#17202b99}
.dialog-heading {display:flex;justify-content:space-between;align-items:center}
#close {border:1px solid var(--line);background:white;border-radius:4px;font-size:22px;width:36px}
#prompt,.demo,#replies,form {margin-top:12px}
.demo,.reply {background:var(--wash);border:1px solid var(--line);padding:10px;border-radius:4px;font-size:14px}
.reply {margin-bottom:8px;white-space:pre-wrap;overflow-wrap:anywhere}
textarea {width:100%;resize:vertical;margin-block:5px 10px}
.primary {padding:6px 10px;border-radius:4px}
.primary:hover {background:#702132}
@media(max-width:680px) {
  .wrap {padding-inline:18px}
  .header,.directory-heading {align-items:flex-start;flex-direction:column}
  nav {gap:13px}
  .hero-inner,.teaching-grid {grid-template-columns:1fr;gap:20px;padding-block:24px}
  h1 br {display:none}
  .hero figure img {max-height:240px}
  .resource {grid-template-columns:48px minmax(0,1fr);gap:10px}
  .thumb {width:48px;height:36px}
  .resource-type {display:none}
}

nav {align-items:center}
.nav-icon {display:grid;place-items:center;width:38px;height:36px;padding:0;border:0;background:transparent}
.nav-icon:hover,.nav-icon[aria-expanded=true] {background:transparent}
.nav-icon img {width:29px;height:27px;object-fit:contain}
.nav-icon:hover img,.nav-icon[aria-expanded=true] img {transform:scale(1.12)}
.p2t2 {padding-block:38px}
.p2t2-subtitle {font-weight:650;color:var(--red);margin:6px 0 12px}
.chat {position:fixed;z-index:3;bottom:18px;right:18px;width:min(360px,calc(100% - 36px));max-height:calc(100dvh - 36px);overflow:auto;background:#87ceeb;border:1px solid var(--line);border-radius:8px;padding:16px;box-shadow:0 8px 32px #17202b33}
.chat h2 {font-size:23px;margin:0}
#chat-close {background:white;border:1px solid var(--line);border-radius:4px;width:34px;font-size:21px}
.chat-note {font-size:13px;color:var(--muted);margin:7px 0 10px}
#chat-messages {max-height:38dvh;overflow:auto;overflow-wrap:anywhere;font-size:14px}
#chat-messages > * {padding:8px;margin-bottom:6px;background:var(--wash);border-radius:4px}
#chat-messages ul {padding-left:20px;margin:6px 0 0}
#chat-form label {font-size:13px}
#chat-form > div {display:flex;gap:6px}
#chat-form input {min-width:0;flex:1;margin:0}

.section-title {display:flex;align-items:baseline;gap:10px}
.back-top {display:inline-grid;place-items:center;min-width:28px;min-height:28px;text-decoration:none;font-size:16px}
.back-top:hover {text-decoration:underline}
.p2t2-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,300px);gap:24px;align-items:center}
.p2t2-mark {width:100%;max-width:300px;height:auto;justify-self:center}
@media(max-width:680px) {
  .p2t2-layout {grid-template-columns:1fr}
  .p2t2-mark {max-width:220px}
}

.hero-tools {display:inline-flex;align-items:center;gap:12px;margin-top:10px}
.hero-tools img {display:block;width:62px;height:62px}
.hero-tools:hover img {transform:scale(1.08)}
.research {padding-block:38px;border-bottom:1px solid var(--line)}
.research h3 {margin-top:16px}
.research p {margin-top:6px;max-width:76ch}

.subject-row {
  position: relative;
  padding-inline-start: 62px;
  min-height: 48px;
  margin-block: 1rem;
}
.subject-icon {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  object-fit: contain;
}
.subject-row h3, .subject-row h4, .course-list .subject-row dt {
  margin: 0;
}
.subject-row p, .course-list .subject-row dd {
  margin: .25rem 0 0;
}
