:root {
  --ink: #1d2832;
  --navy: #18324a;
  --navy-deep: #102536;
  --paper: #f2f0e9;
  --surface: #fffefb;
  --soft: #e8edf0;
  --line: #cbc8be;
  --muted: #5c6670;
  --accent: #a84732;
  --gold: #d6a73d;
  --link: #245979;
  --max: 1120px;
  --reading: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
[id] { scroll-margin-top: 90px; }
.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; }
.anchor-alias { display:block; }
pre { overflow:auto; max-width:100%; padding:1rem; background:var(--soft); }
code { font-size:.9rem; }
.stack-table caption { padding:.6rem 0; text-align:left; font-weight:700; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
button, input { font: inherit; }
button { color: inherit; }
.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.reading-width { width: min(calc(100% - 40px), var(--reading)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), var(--reading)); margin-inline: auto; }
.full-page-message { min-height: 100vh; display: grid; place-items: center; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 999; padding: .7rem 1rem; background: var(--navy); color: white; }
.skip-link:focus { left: 1rem; top: 1rem; }

.academic-bar { background: var(--navy-deep); color: #d9e1e6; font-size: .78rem; }
.academic-bar .container { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.academic-bar a { color: white; text-decoration: none; }
.academic-bar a:hover { text-decoration: underline; }
.academic-links { display: flex; flex-wrap:wrap; gap: 1rem; }
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,254,251,.98); border-bottom: 1px solid var(--line); }
.header-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.015em; }
.brand img { width: 32px; height: 32px; }
.brand small { display: block; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-nav a { padding: .25rem 0; border-bottom: 2px solid transparent; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 700; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }
.menu-button { display: none; border: 1px solid var(--line); background: var(--surface); padding: .5rem; }
.menu-button span { display: block; width: 23px; height: 2px; margin: 5px 0; background: var(--ink); }

h1, h2, h3 { margin-top: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.14; }
h1 { margin-bottom: 1rem; font-size: clamp(2.55rem, 5vw, 4.8rem); letter-spacing: -.035em; }
h2 { margin-bottom: .7rem; font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -.02em; }
h3 { margin-bottom: .45rem; font-size: 1.35rem; }
p { margin-top: 0; }
.kicker, .eyebrow { margin: 0 0 .7rem; color: var(--accent); font-size: .74rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.lead { max-width: 760px; margin: 0; color: #344657; font-size: clamp(1.05rem, 1.8vw, 1.24rem); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.meta { color: var(--muted); font-size: .82rem; font-weight: 700; letter-spacing: .02em; }

.home-intro { padding: 52px 0 46px; background: var(--paper); border-bottom: 1px solid var(--line); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.home-intro h1 { max-width: 800px; }
.home-intro .lead { margin-bottom: 1.35rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; }
.inline-actions a { font-weight: 800; }
.quick-panel { border-top: 4px solid var(--navy); background: var(--surface); box-shadow: 0 1px 0 rgba(16,37,54,.08); }
.quick-panel h2 { margin: 0; padding: 1rem 1.1rem .75rem; border-bottom: 1px solid var(--line); font-family: inherit; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.quick-links { display: grid; }
.quick-links a { display: grid; grid-template-columns: 1fr auto; gap: .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid #e5e1d8; color: var(--ink); text-decoration: none; font-weight: 700; }
.quick-links a:last-child { border-bottom: 0; }
.quick-links a:hover { background: #f7f4ec; color: var(--accent); }

.page-hero { padding: 38px 0 32px; background: var(--paper); border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 900px; font-size: clamp(2.35rem, 4.7vw, 4rem); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.breadcrumb a { color: inherit; }
.page-guide { background: var(--navy); color: white; }
.page-guide .container { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.2rem; min-height: 46px; }
.page-guide strong { color: #f1cf82; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.page-guide a { color: white; text-decoration: none; font-size: .87rem; font-weight: 700; }
.page-guide a:hover { text-decoration: underline; }

.section { padding: 54px 0; }
.section.compact { padding: 36px 0; }
.section.tinted { background: var(--paper); border-block: 1px solid var(--line); }
.section.dark { background: var(--navy); color: white; }
.section.dark h2, .section.dark h3 { color: white; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.45rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.section-head > div { max-width: 760px; }
.section-head h2 { margin-bottom: .25rem; }
.section-intro { margin: 0; color: var(--muted); font-size: 1.05rem; }
.dark .section-intro { color: #d5dde2; }
.text-link { flex: 0 0 auto; font-weight: 800; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.content-sidebar { display: grid; grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.side-note { padding: 1.15rem; border-top: 4px solid var(--gold); background: var(--paper); }
.side-note p:last-child { margin-bottom: 0; }

.button-row { display: flex; flex-wrap: wrap; gap: .65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .6rem .95rem; border: 1px solid var(--navy); background: var(--navy); color: white; text-decoration: none; font-size: .88rem; font-weight: 800; }
.button:hover { background: var(--accent); border-color: var(--accent); }
.button.secondary { background: transparent; color: var(--navy); }
.button.secondary:hover { background: var(--navy); color: white; }

.resource-list, .article-list, .project-list { border-top: 2px solid var(--navy); }
.resource-row, .article-row, .project-row { display: grid; grid-template-columns: 135px minmax(0, 1fr) auto; gap: 1.2rem; align-items: start; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.resource-row h3, .article-row h3, .project-row h3 { margin: 0 0 .25rem; font-family: inherit; font-size: 1.08rem; letter-spacing: -.01em; }
.resource-row p, .article-row p, .project-row p { margin: 0; color: var(--muted); font-size: .94rem; }
.row-label { color: var(--accent); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .5rem .8rem; text-align: right; white-space: normal; }
.row-actions a { font-size: .88rem; font-weight: 800; }
.access-note { display: inline-flex; margin-top: .45rem; padding: .18rem .42rem; border: 1px solid #b8c4ca; background: var(--soft); color: var(--navy); font-size: .72rem; font-weight: 800; }

.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--navy); border-left: 1px solid var(--line); }
.directory-item { min-height: 155px; padding: 1.1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.directory-item h3 { margin: .5rem 0 .35rem; font-family: inherit; font-size: 1.02rem; }
.directory-item p { margin: 0; color: var(--muted); font-size: .9rem; }
.directory-item a { font-weight: 800; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1.2rem; }
.filter-button { padding: .45rem .72rem; border: 1px solid var(--line); background: white; cursor: pointer; font-size: .83rem; font-weight: 750; }
.filter-button:hover, .filter-button[aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.search-box { flex: 1 1 230px; min-width: 210px; margin-left: auto; padding: .5rem .75rem; border: 1px solid var(--line); background: white; color: var(--ink); }
.search-box:focus { outline: 3px solid rgba(214,167,61,.4); border-color: var(--navy); }
.empty-state { display: none; padding: 1.5rem; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.empty-state.visible { display: block; }

.archive-group { margin-bottom: .75rem; border: 1px solid var(--line); background: white; }
.archive-group summary { padding: .85rem 1rem; cursor: pointer; background: var(--soft); color: var(--navy); font-weight: 850; list-style-position: inside; }
.archive-group .resource-list { margin: 0 1rem 1rem; }

.course-map { display: grid; gap: .65rem; }
details.course-module { border: 1px solid var(--line); background: white; }
details.course-module summary { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; cursor: pointer; font-weight: 800; list-style: none; }
details.course-module summary::-webkit-details-marker { display: none; }
details.course-module summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 1.25rem; }
details.course-module[open] summary::after { content: "–"; }
.module-number { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; background: var(--soft); color: var(--navy); font-weight: 900; }
.module-body { padding: 0 1rem 1rem 3.95rem; color: var(--muted); }
.module-body p { margin-top: 0; }
.module-body ul { margin-bottom: 0; }

.principles { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.principles li { position: relative; padding: .78rem .9rem .78rem 2.5rem; border-bottom: 1px solid var(--line); }
.principles li::before { content: "✓"; position: absolute; left: .55rem; top: .68rem; color: var(--accent); font-weight: 900; }
.stack-table { width: 100%; border-collapse: collapse; background: white; }
.stack-table th, .stack-table td { padding: .78rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.stack-table th { border-top: 2px solid var(--navy); background: var(--soft); color: var(--navy); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.callout { padding: 1rem 1.15rem; border-left: 4px solid var(--gold); background: #faf5e7; }
.callout p:last-child { margin-bottom: 0; }
.story-block { padding: 1.25rem; border-top: 3px solid var(--navy); background: var(--paper); }
.story-block p:last-child { margin-bottom: 0; }

.profile-grid { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.45fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.portrait-frame { aspect-ratio: 1 / .95; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.portrait-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.portrait-caption { margin-top: .65rem; color: var(--muted); font-size: .8rem; }
.fact-list { margin: 1.2rem 0 0; padding: 0; list-style: none; border-top: 2px solid var(--navy); }
.fact-list li { display: grid; grid-template-columns: 105px 1fr; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.fact-list strong { color: var(--navy); }
.philosophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2.5rem; }
.philosophy-item { padding-top: .8rem; border-top: 3px solid var(--navy); }
.philosophy-item h3 { font-family: inherit; font-size: 1.05rem; }
.institution-links { display: flex; flex-wrap: wrap; gap: .55rem 1.1rem; margin-top: 1rem; }
.institution-links a { font-weight: 800; }

.article-header { padding: 42px 0 26px; border-bottom: 1px solid var(--line); background: var(--paper); }
.article-header h1 { max-width: 850px; font-size: clamp(2.35rem, 5vw, 4rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); font-size: .84rem; }
.article-body { padding: 48px 0 68px; }
.article-body h2 { margin-top: 2.4rem; padding-top: .65rem; border-top: 1px solid var(--line); font-size: 1.75rem; }
.article-body h3 { margin-top: 1.7rem; font-family: inherit; font-size: 1.12rem; }
.article-body blockquote { margin: 1.5rem 0; padding: .85rem 1.15rem; border-left: 4px solid var(--gold); background: var(--paper); font-family: Georgia, serif; font-size: 1.12rem; }
.article-body li { margin-bottom: .45rem; }

.site-footer { padding: 32px 0 22px; border-top: 5px solid var(--navy); background: #eef0ed; color: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 2rem; }
.footer-brand p { max-width: 420px; margin: .6rem 0 0; color: var(--muted); font-size: .88rem; }
.footer-title { margin-bottom: .55rem; color: var(--accent); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.footer-links { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.footer-links a { color: var(--ink); text-decoration: none; font-size: .86rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 920px) {
  .js-enabled .menu-button { display: block; }
  html:not(.js-enabled) .header-row { flex-wrap:wrap; padding:.7rem 0; }
  html:not(.js-enabled) .site-nav { position:static; display:flex; flex-wrap:wrap; width:100%; }
  .js-enabled .site-nav { position: absolute; inset: 68px 20px auto; display: none; padding: .7rem 1rem; border: 1px solid var(--line); background: white; box-shadow: 0 12px 30px rgba(16,37,54,.14); }
  .js-enabled .site-nav.open { display: grid; }
  .site-nav a { padding: .55rem 0; }
  .home-grid, .two-column, .content-sidebar, .profile-grid { grid-template-columns: 1fr; }
  .directory-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .container, .reading-width { width: min(calc(100% - 28px), var(--max)); }
  .academic-bar .container { padding: .4rem 0; align-items: start; flex-direction: column; gap: .15rem; }
  .academic-links { gap: .75rem; }
  .home-intro { padding: 38px 0 34px; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.3rem); }
  .section { padding: 42px 0; }
  .section-head { align-items: start; flex-direction: column; gap: .55rem; }
  .resource-row, .article-row, .project-row { grid-template-columns: 1fr; gap: .35rem; }
  .row-actions { justify-content: start; text-align: left; }
  .directory-grid, .philosophy-grid { grid-template-columns: 1fr; }
  .page-guide .container { padding: .65rem 0; }
  .module-body { padding-left: 1rem; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; }
  .stack-table thead { position: absolute; clip: rect(0 0 0 0); }
  .stack-table tr { padding: .45rem 0; border-bottom: 1px solid var(--line); }
  .stack-table td { border: 0; padding: .36rem .75rem; }
  .stack-table td::before { content: attr(data-label); display: block; color: var(--accent); font-size: .68rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}

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

html:not(.js-enabled) .filter-bar { display:none; }
.template-links { columns:2; padding:1rem 2rem; }
.template-links li { break-inside:avoid; padding:.4rem 0; }
@media(max-width:680px){ .template-links { columns:1; } }
