:root {
  color-scheme: light;
  --canvas: #f7eff2;
  --paper: #fffaf8;
  --ink: #292333;
  --muted: #5e5364;
  --line: #e4d8e4;
  --purple: #503761;
  --lilac: #e9dcf4;
  --rose: #f3d9df;
  --green: #dce8df;
  --butter: #f5e6b9;
  --heading: "Fraunces", Georgia, serif;
  --body: "DM Sans", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body {
  margin: 0;
  background: radial-gradient(#d7c8de .65px, transparent .65px) 0 0 / 15px 15px, var(--canvas);
  color: var(--ink);
  font: 400 1rem/1.65 var(--body);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #8563a0; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); font-weight: 550; line-height: 1.12; }
.icon { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(1152px, calc(100% - 56px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; top: .75rem; left: .75rem; padding: .6rem 1rem; background: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 4; top: 0; border-bottom: 1px solid var(--line); background: #fffaf8f5; backdrop-filter: blur(12px); }
.header-row { min-height: 74px; display: flex; align-items: center; gap: 22px; }
.brand { margin-right: auto; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { flex: none; width: 46px; height: 40px; }
.brand-copy { display: grid; line-height: 1.18; }
.brand-name { font: 600 1.28rem/1.12 var(--heading); }
.brand-note { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.top-nav { display: flex; align-items: center; gap: 8px; }
.top-nav a, .search-button { padding: .55rem .85rem; border-radius: 30px; font-size: .9rem; line-height: 1.15; font-weight: 700; text-decoration: none; }
.top-nav a:hover, .top-nav a[aria-current] { background: var(--lilac); }
.search-button { display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; border: 1px solid var(--line); background: var(--paper); color: var(--purple); }
.search-button:hover { border-color: #987dae; }

.home-hero { display: grid; grid-template-columns: 1fr .98fr; min-height: 415px; margin-top: 28px; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: var(--paper); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 17px; padding: clamp(27px, 5vw, 66px); background: linear-gradient(135deg, #fffaf8, #f2e7f6); }
.eyebrow { color: var(--purple); font-size: .76rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.home-hero h1 { max-width: 14ch; font-size: clamp(2.5rem, 4.65vw, 4.3rem); letter-spacing: -.055em; }
.hero-copy > p:not(.eyebrow) { max-width: 43ch; color: var(--muted); }
.home-photo { position: relative; min-height: 240px; background: #bca6bd url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1350&q=85") center 48% / cover; }
.home-photo::after { position: absolute; inset: 0; background: linear-gradient(0deg, #24182b9c, transparent 54%); content: ""; }
.photo-note { position: absolute; z-index: 1; right: 24px; bottom: 18px; color: #fffaf8; font: 600 clamp(1.48rem, 3vw, 2.28rem)/1.1 var(--hand); text-shadow: 0 1px 8px #2c2032; }
.primary-action { display: inline-flex; align-items: center; gap: .65rem; margin-top: 3px; padding: .64rem 1rem; border-radius: 28px; background: var(--purple); color: white; font-size: .9rem; font-weight: 700; text-decoration: none; }
.primary-action:hover { background: #382345; }

.themes { padding-block: 44px 49px; }
.section-title { margin-bottom: 20px; font-size: clamp(1.9rem, 4vw, 2.45rem); letter-spacing: -.035em; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.information { --topic: var(--lilac); }
.education { --topic: var(--rose); }
.global { --topic: var(--green); }
.society { --topic: var(--butter); }
.theme-card { display: grid; grid-template-columns: 50px 1fr; align-items: start; gap: 16px; min-height: 156px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); text-decoration: none; transition: box-shadow .2s, border-color .2s; }
.theme-card:hover { border-color: #a48ab7; box-shadow: 0 5px 16px #50376112; }
.theme-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 14px; background: var(--topic, var(--lilac)); color: var(--ink); }
.theme-icon .icon { width: 26px; height: 26px; }
.theme-card h3 { margin: 2px 0 7px; font-size: clamp(1.28rem, 2.7vw, 1.58rem); }
.theme-card p { color: var(--muted); font-size: .93rem; line-height: 1.48; }
.card-action { display: inline-flex; align-items: center; gap: .35rem; margin-top: 10px; color: var(--purple); font-size: .83rem; font-weight: 700; }
.card-action .icon { width: 16px; height: 16px; }

.topic-intro { position: relative; margin-top: 25px; padding: clamp(26px, 4.6vw, 54px); overflow: hidden; border: 1px solid var(--line); border-radius: 25px; background: var(--topic); }
.back-link { display: inline-flex; align-items: center; gap: .42rem; color: var(--purple); font-size: .9rem; font-weight: 700; text-underline-offset: .2em; }
.back-link .icon { width: 17px; }
.topic-intro h1 { max-width: 22ch; margin: 13px 0 13px; font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
.topic-intro p { max-width: 64ch; color: #47394a; font-size: clamp(1rem, 2vw, 1.12rem); }
.reading-layout { display: grid; grid-template-columns: minmax(205px, 252px) minmax(0, 1fr); align-items: start; gap: 26px; padding-block: 24px 42px; }
.topic-index { position: sticky; top: 98px; max-height: calc(100dvh - 115px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.topic-index summary { cursor: pointer; color: var(--purple); font-weight: 700; }
.topic-index ul { margin: 9px 0 1px; padding: 0; list-style: none; }
.topic-index a { display: block; padding: 6px 8px; border-radius: 8px; font-size: .84rem; line-height: 1.35; text-decoration: none; }
.topic-index a:hover { background: var(--topic); }
.topic-index a[aria-current="location"] { background: var(--topic); box-shadow: inset 3px 0 var(--purple); color: var(--purple); font-weight: 700; }
.topic-index .part-label { margin-top: .68rem; padding-inline: 8px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.reading { min-width: 0; padding: clamp(19px, 4vw, 42px); border: 1px solid var(--line); border-radius: 21px; background: var(--paper); }
.reading > section, .reading > .part { max-width: 71ch; margin-inline: auto; }
.reading > section + section, .reading > .part { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.reading > .part + section { margin-top: 19px; }
.reading h2 { margin-bottom: 12px; font-size: clamp(1.6rem, 3.5vw, 2.15rem); letter-spacing: -.025em; }
.reading h3 { margin: 17px 0 7px; font: 700 1.02rem/1.42 var(--body); }
.reading p + p { margin-top: .86em; }
.reading h3 + p, .reading ul { margin-block: 0 .72rem; }
.reading ul { padding-left: 1.35rem; }
.reading li + li { margin-top: .35rem; }
.reading .reflection { margin-top: 24px; padding: clamp(16px, 3vw, 26px); border: 0; border-radius: 15px; background: var(--topic); }
.reading .question, .reading blockquote { margin: .85rem 0; padding: .63rem .9rem; border-left: 3px solid #9c78b7; background: #f5edf8; }
.reading .question:last-child { margin-bottom: 0; }
.reading .reference { color: var(--muted); font-size: .88rem; }
.reading .key-idea { margin: 0 0 1rem; padding: .75rem .9rem; border-left: 3px solid var(--purple); border-radius: 0 10px 10px 0; background: var(--topic); }
.reading .key-idea strong { display: block; margin-bottom: .15rem; color: var(--purple); font-size: .81rem; }
.reading .topic-activity { margin-top: 1.2rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 13px; background: #fffdfd; }
.reading .topic-activity h3 { margin-top: 0; }
.reading .topic-activity ol { margin: .65rem 0 .8rem; padding-left: 1.45rem; }
.reading .topic-activity details { margin-top: .65rem; }
.reading .topic-activity summary { width: fit-content; padding: .45rem .7rem; border-radius: 8px; background: var(--topic); color: var(--purple); cursor: pointer; font-weight: 700; }
.reading .topic-activity details[open] p { margin-top: .65rem; }
.reading .topic-figure { margin: 1.1rem 0 1.35rem; }
.reading .topic-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 13px; }
.reading .topic-figure figcaption { margin-top: .42rem; color: var(--muted); font-size: .85rem; }
.reading .topic-figure--compact { max-width: 34rem; margin-inline: auto; }
.reading .topic-figure--portrait { max-width: 17rem; }
.reading .topic-figure--compact figcaption { text-align: center; }
.reading .topic-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .75rem; margin-block: 1.1rem 1.35rem; align-items: start; }
.reading .topic-gallery .topic-figure { width: 100%; margin: 0; }
.reading .topic-table { width: 100%; margin-block: 1rem; border-collapse: collapse; }
.reading .topic-table th, .reading .topic-table td { padding: .5rem .65rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.reading .topic-table thead th { background: var(--topic); }
.reading a { color: var(--purple); font-weight: 700; text-underline-offset: .18em; overflow-wrap: anywhere; }
.reading a:hover { color: #301d3e; }
.reading .resource-list { display: grid; gap: 11px; margin-top: 1rem; padding-left: 0; list-style: none; }
.reading .resource-list li { padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; }
.reading .resource-list p { margin-top: .25rem; font-size: .9rem; }
.reading .part { color: var(--purple); font-size: .81rem; font-weight: 700; }
.reading .part h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.4rem); }
.topic-links { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: space-between; padding-bottom: 36px; }

.site-footer { border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 19px 22px; color: var(--muted); font-size: .84rem; }
.footer-row a { text-underline-offset: .18em; }

.search-dialog { width: min(620px, calc(100% - 28px)); max-height: min(720px, calc(100dvh - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); }
.search-dialog::backdrop { background: #2c203695; }
.search-content { padding: clamp(16px, 4vw, 26px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.dialog-header h2 { font-size: 1.54rem; }
.icon-button { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--purple); }
.search-input { width: 100%; padding: .65rem .8rem; border: 1px solid #a48ab7; border-radius: 9px; background: white; color: var(--ink); }
.search-status { min-height: 1.5em; margin: 10px 0 4px; color: var(--muted); font-size: .86rem; }
.search-results { margin: 0; padding: 0; list-style: none; }
.search-results a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.search-results a:hover strong { text-decoration: underline; }
.search-results strong, .search-results span { display: block; }
.search-results span { color: var(--muted); font-size: .84rem; }

@media (max-width: 760px) {
  html { scroll-padding-top: 136px; }
  .wrap { width: calc(100% - 32px); }
  .header-row { min-height: 64px; gap: 8px; }
  .top-nav { display: none; }
  .home-hero { grid-template-columns: 1fr; margin-top: 16px; border-radius: 20px; }
  .hero-copy { gap: 12px; }
  .home-photo { min-height: clamp(170px, 35vw, 255px); }
  .themes { padding-block: 30px 34px; }
  .reading-layout { display: block; padding-top: 13px; }
  .topic-intro { margin-top: 16px; border-radius: 19px; }
  .topic-index { z-index: 3; top: 72px; max-height: none; margin-bottom: 12px; overflow: visible; padding: 0; border-radius: 12px; }
  .topic-index summary { min-height: 44px; padding: 9px 13px; }
  .topic-index > ul { position: absolute; top: calc(100% + 4px); right: -1px; left: -1px; max-height: min(55dvh, 360px); margin: 0; overflow: auto; overscroll-behavior: contain; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 8px 20px #50376125; }
  .topic-index a { padding-block: 8px; }
}

@media (max-width: 550px) {
  .brand { gap: 6px; }
  .brand svg { width: 37px; }
  .brand-name { font-size: 1.08rem; }
  .brand-note { font-size: .66rem; }
  .search-button { padding-inline: .58rem; }
  .theme-grid { grid-template-columns: 1fr; gap: 12px; }
  .theme-card { min-height: 0; gap: 12px; padding: 16px; }
  .photo-note { right: 15px; bottom: 13px; }
}

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