:root {
  color-scheme: light;
  --ink: #18221c;
  --ink-soft: #334138;
  --muted: #727b70;
  --paper: #f4f0e6;
  --paper-deep: #e8e1d3;
  --card: #fffdf8;
  --line: #dcd6c9;
  --forest: #254337;
  --forest-deep: #1e352c;
  --moss: #64795c;
  --coral: #d97857;
  --coral-light: #f3b398;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', 'Avenir Next', Avenir, sans-serif;
  --mono: 'DM Mono', 'SFMono-Regular', Consolas, monospace;
  --content: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.25rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}

.site-shell { overflow: clip; }
#learn-app > .hero, #learn-app > .library-section,
#learn-app > .about-strip, #learn-app > .article-page, #learn-app > .not-found,
.site-header, .site-footer,
main > .noscript-card { width: min(var(--content), calc(100% - 64px)); margin-inline: auto; }

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid rgba(24, 34, 28, .12);
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  background: var(--forest);
  color: #fff9e9;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  transform: rotate(-3deg);
}
.brand-copy { display: grid; line-height: 1.2; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: .025em; }
.brand-section { margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.site-navigation { display: flex; align-items: center; gap: clamp(20px, 4vw, 54px); }
.nav-link { color: #687168; font-size: 13px; font-weight: 600; transition: color .2s ease; }
.nav-link:hover, .nav-link.is-current { color: var(--forest); }
.nav-link.is-current { position: relative; }
.nav-link.is-current::after { position: absolute; right: 0; bottom: -11px; left: 0; height: 2px; background: var(--coral); content: ''; }
.menu-toggle { display: none; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  min-height: 400px;
  margin-top: 32px !important;
  padding: clamp(36px, 7vw, 84px) clamp(28px, 7vw, 86px);
  overflow: hidden;
  border-radius: 28px;
  background: var(--forest);
  color: #fbf7ec;
  isolation: isolate;
}
.hero::before {
  position: absolute;
  z-index: -1;
  top: -270px;
  right: 110px;
  width: 650px;
  height: 650px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.018);
  content: '';
}
.hero-copy { position: relative; z-index: 1; max-width: 670px; }
.eyebrow, .topic-index, .section-count, .aside-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.5;
  text-transform: uppercase;
}
.hero .eyebrow { color: #c9d2c5; }
.eyebrow-mark { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--coral-light); vertical-align: 1px; }
.hero h1 {
  max-width: 670px;
  margin: 25px 0 18px;
  font-size: clamp(44px, 6.4vw, 78px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1.04;
}
.hero h1 em { color: var(--coral-light); font-family: var(--serif); font-weight: 500; letter-spacing: -.045em; }
.hero-lede { max-width: 545px; margin: 0; color: #d4ddd3; font-size: 15px; line-height: 1.8; }
.hero-link { display: inline-flex; align-items: center; gap: 22px; margin-top: 30px; padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.45); color: #fffaf0; font-size: 13px; font-weight: 700; }
.hero-link span { color: var(--coral-light); font-size: 17px; transition: transform .2s ease; }
.hero-link:hover span { transform: translateY(3px); }
.hero-stamp {
  position: relative;
  z-index: 1;
  width: 206px;
  height: 206px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, .43);
  border-radius: 50%;
  color: #fff9eb;
  text-align: center;
  transform: rotate(7deg);
}
.hero-stamp::before { position: absolute; inset: 11px; border: 1px dashed rgba(255,255,255,.3); border-radius: 50%; content: ''; }
.stamp-number { font-family: var(--serif); font-size: 68px; line-height: .95; }
.stamp-label { margin-top: 5px; color: #d5dfd5; font-family: var(--mono); font-size: 9px; letter-spacing: .11em; line-height: 1.5; text-transform: uppercase; }
.stamp-rule { width: 33px; height: 1px; margin: 10px 0 7px; background: var(--coral-light); }
.stamp-foot { color: #c6d2c6; font-family: var(--mono); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.hero-orbit { position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; pointer-events: none; }
.orbit-one { right: 17%; bottom: -270px; width: 470px; height: 470px; }
.orbit-two { right: 10%; bottom: -335px; width: 600px; height: 600px; }

.library-section { padding: 92px 0 74px; scroll-margin-top: 18px; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.section-heading-row .eyebrow, .about-strip .eyebrow, .related-heading .eyebrow { color: var(--moss); }
.section-heading-row h2, .about-strip h2, .related-heading h2 {
  margin: 11px 0 7px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 49px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.15;
}
.section-intro { max-width: 560px; margin: 0; color: var(--muted); }
.search-box {
  width: min(100%, 315px);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.42);
  color: var(--muted);
}
.search-icon { color: var(--moss); font-size: 23px; line-height: 1; transform: rotate(-20deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: #8b9389; }
.search-box kbd { flex: 0 0 auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: #8b9389; font-family: var(--mono); font-size: 10px; }
.filter-row { display: flex; gap: 8px; margin: 33px 0 18px; overflow-x: auto; padding: 2px 1px 8px; scrollbar-width: thin; }
.filter-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: #646e64;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.filter-chip:hover { border-color: var(--moss); color: var(--forest); }
.filter-chip span { color: #98a093; font-family: var(--mono); font-size: 9px; }
.filter-chip.is-selected { border-color: var(--forest); background: var(--forest); color: #fffaf0; }
.filter-chip.is-selected span { color: #c3d1c2; }
.result-count { margin: 0 0 15px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.topic-group { margin-top: 42px; }
.topic-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.topic-index { color: #9ba393; font-size: 9px; }
.topic-heading h3 { margin: 3px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1.2; }
.topic-heading > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.note-card, .related-card {
  position: relative;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 20px 21px 21px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,253,248,.66);
  transition: background .22s ease, border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.note-card:hover, .related-card:hover { transform: translateY(-4px); border-color: #a9b09f; background: var(--card); box-shadow: 0 12px 24px rgba(39,55,44,.08); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--moss); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.card-meta span:last-child { color: #92998d; }
.card-title { max-width: 270px; margin-top: 22px; padding-right: 10px; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -.025em; line-height: 1.24; }
.card-summary { max-width: 310px; margin-top: 9px; color: #717a70; font-size: 11px; line-height: 1.65; }
.card-arrow { position: absolute; right: 19px; bottom: 17px; color: var(--coral); font-size: 17px; transition: transform .2s ease; }
.note-card:hover .card-arrow, .related-card:hover .card-arrow { transform: translate(2px, -2px); }
.empty-results { margin: 35px 0; padding: 40px; border: 1px dashed #c9c2b5; border-radius: 12px; text-align: center; }
.empty-mark { color: var(--coral); font-size: 26px; }
.empty-results h3 { margin: 6px 0; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.empty-results p { margin: 0 0 15px; color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--forest); cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

.about-strip {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  align-items: center;
  gap: 25px;
  margin: 18px auto 76px !important;
  padding: 31px 0 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 18px;
}
.about-number { align-self: start; color: var(--coral); font-family: var(--serif); font-size: 38px; line-height: 1; }
.about-strip h2 { max-width: 340px; margin-bottom: 0; font-size: clamp(25px, 3vw, 34px); }
.about-strip > p { max-width: 430px; justify-self: end; margin: 0; color: #70796f; font-size: 12px; }

.site-footer {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  border-top: 1px solid var(--line);
  color: #727a70;
  font-size: 11px;
}
.site-footer p { margin: 0; text-align: center; }
.footer-brand { color: var(--forest); font-size: 12px; font-weight: 700; }
.footer-brand span { color: #898f84; font-weight: 500; }
.footer-links { display: flex; align-items: center; gap: 16px; }
.footer-links a { color: var(--forest); font-size: 11px; font-weight: 600; transition: color .2s ease; }
.footer-links a:hover { color: var(--coral); }
.back-to-top { display: inline-flex; align-items: center; gap: 8px; color: var(--forest); font-weight: 700; }
.back-to-top span { color: var(--coral); font-size: 16px; }

.article-page { padding: 25px 0 78px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #81897d; font-size: 10px; }
.breadcrumbs a { color: var(--forest); font-weight: 700; }
.breadcrumbs [aria-current="page"] { max-width: min(55vw, 420px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-hero { max-width: 835px; margin: 45px auto 38px; text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 9px; color: var(--forest); font-size: 11px; font-weight: 700; }
.back-link span { color: var(--coral); font-size: 17px; }
.article-meta { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 24px; color: #858d81; font-family: var(--mono); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.category-pill { padding: 5px 9px; border-radius: 999px; background: #e4e9dc; color: var(--forest); }
.article-hero h1 { margin: 21px auto 13px; font-family: var(--serif); font-size: clamp(42px, 6vw, 68px); font-weight: 500; letter-spacing: -.055em; line-height: 1.08; }
.article-dek { max-width: 610px; margin: 0 auto; color: #6f786e; font-size: 15px; }
.article-rule { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; }
.article-rule span { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.article-rule span:nth-child(2) { width: 40px; height: 1px; border-radius: 0; background: #c9c4b8; }
.article-layout { display: grid; grid-template-columns: 190px minmax(0, 720px); justify-content: center; gap: clamp(35px, 7vw, 95px); }
.article-aside { position: sticky; top: 22px; align-self: start; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.aside-title { margin-bottom: 4px; color: #90988c; font-size: 9px; }
.article-aside > a { color: #727a70; font-size: 11px; line-height: 1.45; }
.article-aside > a:hover { color: var(--forest); }
.article-aside .aside-return { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--forest); font-weight: 700; }
.aside-return span { margin-left: 7px; color: var(--coral); }
.article-body { min-width: 0; }
.article-opening { margin: 0 0 30px; color: var(--ink-soft); font-family: var(--serif); font-size: 22px; line-height: 1.55; }
.article-section { position: relative; padding: 27px 0 24px 25px; border-top: 1px solid var(--line); scroll-margin-top: 22px; }
.section-count { position: absolute; top: 34px; left: 0; color: var(--coral); font-size: 9px; }
.article-section h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.24; }
.article-section p { margin: 9px 0; color: #5f695f; font-size: 13px; line-height: 1.85; }
.field-checklist { display: grid; gap: 9px; margin: 18px 0 1px; padding: 0; list-style: none; }
.field-checklist li { position: relative; padding-left: 22px; color: #3d4c41; font-size: 12px; }
.field-checklist li::before { position: absolute; top: 8px; left: 1px; width: 8px; height: 8px; border: 1px solid var(--coral); border-radius: 2px 2px 2px 0; content: ''; transform: rotate(-8deg); }
.try-card { display: flex; gap: 16px; margin: 28px 0 45px; padding: 22px; border: 1px solid #d4d9cd; border-radius: 10px; background: #e9ede3; }
.try-icon { flex: 0 0 auto; color: var(--coral); font-size: 21px; }
.try-card .eyebrow { color: var(--moss); font-size: 9px; }
.try-card p:last-child { margin: 6px 0 0; color: #556257; font-size: 12px; }
.related-section { margin-top: 18px; }
.related-heading { margin-bottom: 17px; }
.related-heading h2 { margin-top: 5px; font-size: 32px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-card { min-height: 165px; padding: 17px; }
.related-card .card-title { margin-top: 16px; font-size: 18px; }
.related-card .card-arrow { right: 15px; bottom: 13px; }
.all-notes-link { display: inline-flex; align-items: center; gap: 9px; margin-top: 25px; color: var(--forest); font-size: 11px; font-weight: 700; }
.all-notes-link span { color: var(--coral); font-size: 16px; }
.not-found { min-height: 55vh; display: grid; align-content: center; justify-items: center; padding: 55px 0; text-align: center; }
.not-found .eyebrow { color: var(--moss); }
.not-found h1, .noscript-card h1 { max-width: 650px; margin: 13px 0; font-family: var(--serif); font-size: clamp(38px, 6vw, 66px); font-weight: 500; letter-spacing: -.05em; line-height: 1.12; }
.not-found p { max-width: 500px; color: var(--muted); }
.button-link { margin-top: 10px; padding: 11px 17px; border-radius: 5px; background: var(--forest); color: white; font-size: 12px; font-weight: 700; }
.noscript-card { margin-block: 70px; padding: 40px; border-radius: 14px; background: var(--card); }
.noscript-card .eyebrow { color: var(--moss); }
.noscript-card > p:last-child { color: var(--muted); }
.skip-link { position: fixed; z-index: 10; top: 10px; left: 10px; padding: 9px 12px; transform: translateY(-160%); border-radius: 4px; background: var(--ink); color: white; }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 850px) {
  #learn-app > .hero, #learn-app > .library-section,
  #learn-app > .about-strip, #learn-app > .article-page, #learn-app > .not-found,
  .site-header, .site-footer,
  main > .noscript-card { width: min(var(--content), calc(100% - 42px)); }
  .hero { grid-template-columns: 1fr 180px; min-height: 365px; padding-inline: 42px; }
  .hero-stamp { width: 160px; height: 160px; }
  .stamp-number { font-size: 55px; }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 155px minmax(0, 1fr); gap: 34px; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  #learn-app > .hero, #learn-app > .library-section,
  #learn-app > .about-strip, #learn-app > .article-page, #learn-app > .not-found,
  .site-header, .site-footer,
  main > .noscript-card { width: calc(100% - 32px); }
  .site-header { position: relative; min-height: 72px; gap: 12px; }
  .brand-mark { width: 38px; height: 38px; font-size: 22px; }
  .menu-toggle { width: 42px; height: 42px; display: grid; align-content: center; justify-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
  .menu-toggle span { width: 15px; height: 1px; background: var(--forest); transition: transform .2s ease; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .site-navigation { position: absolute; z-index: 5; top: calc(100% - 1px); right: 0; left: 0; display: none; align-items: stretch; gap: 0; padding: 8px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; background: var(--card); box-shadow: 0 14px 22px rgba(24,34,28,.1); }
  .site-navigation.is-open { display: flex; flex-direction: column; }
  .nav-link { padding: 12px 10px; }
  .nav-link.is-current::after { display: none; }
  .nav-link + .nav-link { border-top: 1px solid #eee9df; }
  .hero { grid-template-columns: 1fr; min-height: 440px; margin-top: 18px !important; padding: 35px 25px 29px; border-radius: 20px; }
  .hero h1 { max-width: 480px; margin-top: 20px; font-size: clamp(43px, 12vw, 62px); }
  .hero-lede { font-size: 13px; }
  .hero-stamp { position: absolute; right: 20px; bottom: 18px; width: 105px; height: 105px; opacity: .95; }
  .hero-stamp::before { inset: 6px; }
  .stamp-number { font-size: 35px; }
  .stamp-label { margin-top: 3px; font-size: 7px; }
  .stamp-rule { margin: 5px 0 4px; }
  .stamp-foot { font-size: 6px; }
  .hero-link { margin-top: 24px; }
  .orbit-one { right: -12%; bottom: -320px; }
  .orbit-two { right: -25%; bottom: -380px; }
  .library-section { padding: 61px 0 52px; }
  .section-heading-row { align-items: stretch; flex-direction: column; gap: 20px; }
  .section-heading-row h2 { font-size: 38px; }
  .search-box { width: 100%; }
  .filter-row { margin-top: 23px; margin-right: -16px; padding-right: 16px; }
  .topic-group { margin-top: 31px; }
  .topic-heading { align-items: start; flex-direction: column; gap: 5px; }
  .topic-heading > p { text-align: left; }
  .notes-grid { grid-template-columns: 1fr; gap: 9px; }
  .note-card { min-height: 158px; padding: 17px; }
  .card-title { max-width: 88%; margin-top: 15px; font-size: 20px; }
  .card-summary { max-width: 88%; }
  .about-strip { grid-template-columns: 39px 1fr; gap: 8px 15px; margin-bottom: 47px !important; padding: 24px 0; }
  .about-number { font-size: 29px; }
  .about-strip h2 { font-size: 28px; }
  .about-strip > p { grid-column: 2; justify-self: start; margin-top: 7px; font-size: 11px; }
  .site-footer { min-height: 120px; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding-block: 20px; }
  .footer-links { gap: 10px; }
  .site-footer p { order: 1; width: 100%; text-align: left; }
  .article-page { padding-top: 20px; }
  .breadcrumbs { gap: 7px; font-size: 9px; }
  .article-hero { margin: 33px auto 24px; }
  .article-meta { gap: 9px; margin-top: 19px; font-size: 8px; }
  .article-hero h1 { margin-top: 18px; font-size: clamp(39px, 10vw, 53px); }
  .article-dek { font-size: 13px; }
  .article-layout { display: block; }
  .article-aside { position: static; display: block; margin-bottom: 26px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.62); }
  .aside-title { margin-bottom: 9px; }
  .article-aside > a:not(.aside-return) { display: inline-block; margin: 2px 6px 6px 0; padding: 6px 8px; border-radius: 4px; background: #e9e7dc; font-size: 10px; }
  .article-aside .aside-return { display: block; margin-top: 8px; padding-top: 9px; }
  .article-opening { font-size: 19px; }
  .article-section { padding-left: 21px; }
  .article-section h2 { font-size: 25px; }
  .article-section p { font-size: 12px; }
  .try-card { gap: 10px; padding: 16px; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card { min-height: 142px; }
  .not-found { min-height: 58vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
