/* Public shell refinements. The resource rail is dormant until a resource route exists. */
html.evolution #mobile-nav nav .mobile-theme-switch {
  display: flex; align-items: center; gap: 12px; min-height: 54px;
  padding: 12px 14px; border: 1px solid var(--e-line); border-radius: 16px;
  background: var(--e-glass); color: var(--e-ink); font: inherit;
  font-size: 12px; font-weight: 650; text-align: left; cursor: pointer;
}
html.evolution #mobile-nav nav .mobile-theme-switch svg { width: 21px; height: 21px; flex: none; }
html.evolution #mobile-nav nav .mobile-theme-switch:focus-visible { outline: 2px solid var(--e-blue); outline-offset: 3px; }
html.evolution[data-theme="dark"] #mobile-nav nav .mobile-theme-switch { background: #172d47; border-color: #3a5574; color: #e8f2ff; }
html.evolution #popup .p7-menu-resources #explore-theme-switch { display: inline-flex; align-items: center; gap: 8px; }
html.evolution #popup .p7-menu-resources #explore-theme-switch svg { width: 17px; height: 17px; flex: none; }
html.evolution #popup .p7-menu-resources #explore-theme-switch:focus-visible { outline: 2px solid var(--e-blue); outline-offset: 3px; }

html.evolution .journal-page .journal-heading {
  position: relative; overflow: hidden; padding: clamp(30px, 4vw, 62px) !important;
  background: radial-gradient(circle at 85% 25%, #c5e3ff 0, transparent 36%), linear-gradient(120deg, #fbfdff, #e4efff) !important;
  border: 1px solid #d0e0f3 !important; border-top: 4px solid #146bff !important;
  border-radius: 26px; box-shadow: 0 24px 60px -42px #174b91;
}
html.evolution .journal-page .journal-heading::after {
  content: "J"; position: absolute; right: 2%; bottom: -23%; font-size: clamp(210px, 28vw, 390px);
  font-weight: 800; letter-spacing: -.1em; line-height: 1; color: #1263f10c; pointer-events: none;
}
html.evolution .journal-page .journal-heading > * { position: relative; z-index: 1; }
html.evolution .journal-page .journal-heading .lead { max-width: 61ch; }
html.evolution .journal-page .journal-intro-note {
  max-width: 64ch; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid #7da9d655;
  font-size: 13px; line-height: 1.7; color: #42617d;
}
html.evolution .journal-page .library-tools {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 18px; border: 1px solid #d5e3f3; border-radius: 18px;
  background: #ffffffc9; box-shadow: 0 12px 35px -30px #174b91;
}
html.evolution .journal-page .library-tools .searchbox {
  order: -1; align-self: flex-start; width: min(100%, 340px);
}
html.evolution .journal-page .library-tools .channel-switch { width: 100%; }
html.evolution .journal-page #library-count { margin: 8px 0 20px; font-size: 11px; letter-spacing: .02em; }
html.evolution .journal-page .journal-section-heading {
  grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between;
  gap: 16px; margin: 15px 0 2px; padding: 0 2px 12px; border-bottom: 1px solid #cbdced;
}
html.evolution .journal-page .journal-section-heading span {
  font-size: clamp(22px, 2.8vw, 34px); font-weight: 730; letter-spacing: -.045em; line-height: 1.15;
}
html.evolution .journal-page .journal-section-heading p {
  margin: 0; max-width: 35ch; font-size: 12px; line-height: 1.55; color: #54718b;
}
html.evolution #main .journal-page .journal-story-card {
  position: relative; isolation: isolate; min-height: 370px; border-color: #d1e1f1;
  background: linear-gradient(155deg, #fff, #f5faff) !important;
  box-shadow: 0 15px 36px -29px #164273;
  transform: none !important;
}
html.evolution #main .journal-page .journal-story-card:hover { transform: translateY(-3px) !important; }
html.evolution #main .journal-page .journal-story-card .r6-article-cover {
  position: relative; z-index: 1; background: linear-gradient(130deg, #d7e9fa, #edf4fd);
  border-bottom-color: #d1e1f1;
}
html.evolution #main .journal-page .journal-story-card .r6-article-cover img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top;
}
html.evolution #main .journal-page .journal-story-card > :not(.card-material20) { position: relative; z-index: 1; }
html.evolution #main .journal-page .journal-story-kind {
  align-self: start; margin-top: 1px; font-size: 9px; font-weight: 750; letter-spacing: .14em; color: #426e9e;
}
html.evolution #main .journal-page .article-card h3 { margin-top: 12px; font-size: clamp(21px, 2vw, 27px); }
html.evolution #main .journal-page .article-card p { color: #4b647e; }
@media (min-width: 1000px) {
  html.evolution #main .journal-page #library-results .journal-featured {
    grid-column: 1 / -1; display: grid; grid-template-columns: 1.12fr 1fr;
    column-gap: 38px; min-height: 340px; padding: 30px;
  }
  html.evolution #main .journal-page #library-results .journal-featured .r6-article-cover {
    grid-column: 1; grid-row: 1 / 7; align-self: stretch;
    margin: -30px 0 -30px -30px; aspect-ratio: auto; border: 0;
  }
  html.evolution #main .journal-page #library-results .journal-featured > :not(.r6-article-cover):not(.card-material20) { grid-column: 2; }
  html.evolution #main .journal-page #library-results .journal-featured h3 { font-size: clamp(31px, 3vw, 44px); max-width: 13ch; }
  html.evolution #main .journal-page #library-results .journal-featured .pill,
  html.evolution #main .journal-page #library-results .journal-featured .journal-story-kind { justify-self: start; }
}
html.evolution[data-theme="dark"] .journal-page .journal-heading {
  background: radial-gradient(circle at 85% 25%, #1d507b 0, transparent 38%), linear-gradient(120deg, #172b44, #173653) !important;
  border-color: #355575 !important; border-top-color: #65a1ff !important;
}
html.evolution[data-theme="dark"] .journal-page .journal-heading::after { color: #80b6ff0d; }
html.evolution[data-theme="dark"] .journal-page .journal-intro-note { color: #b6cce4; border-top-color: #54799b66; }
html.evolution[data-theme="dark"] .journal-page .library-tools { background: #172d47; border-color: #34506d; }
html.evolution[data-theme="dark"] .journal-page .journal-section-heading { border-bottom-color: #3b5773; }
html.evolution[data-theme="dark"] .journal-page .journal-section-heading p { color: #aec5dd; }
html.evolution[data-theme="dark"] #main .journal-page .journal-story-card { background: linear-gradient(155deg, #1c3854, #172b43) !important; border-color: #34516e; }
html.evolution[data-theme="dark"] #main .journal-page .journal-story-card p { color: #b5cbe0; }
html.evolution[data-theme="dark"] #main .journal-page .journal-story-kind { color: #92bfff; }
html.evolution[data-theme="dark"] #popup { background: #10253d; color: #e8f2ff; border-color: #3b5774; }
html.evolution[data-theme="dark"] #popup :is(.pop-header, .pop-body, .option, .settings-row) { color: #e8f2ff; }
html.evolution[data-theme="dark"] #popup :is(input, textarea, .searchbox) { color: #e8f2ff; background-color: #172d47; }

/* Resource routes opt into this shell when their first real page is published. */
html.evolution body[data-site-section="resources"] #rail {
  width: 76px; z-index: 80; overflow: hidden;
  transition: width .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s;
}
html.evolution body[data-site-section="resources"] #rail:hover,
html.evolution body[data-site-section="resources"] #rail:focus-within {
  width: 244px; box-shadow: 0 24px 65px #0b34523b;
}
html.evolution body[data-site-section="resources"] #rail .rail-link { white-space: nowrap; overflow: hidden; }
html.evolution body[data-site-section="resources"] #rail .rail-link span { opacity: 0; transition: opacity .18s; }
html.evolution body[data-site-section="resources"] #rail:hover .rail-link span,
html.evolution body[data-site-section="resources"] #rail:focus-within .rail-link span { opacity: 1; }
html.evolution body[data-site-section="resources"] #rail-grip { white-space: nowrap; overflow: hidden; }
html.evolution body[data-site-section="resources"] #dock {
  background: linear-gradient(145deg, #edf8fff0, #dbeeffdd);
  border: 1px solid #a9cce9; box-shadow: 0 16px 50px #0e37613a;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
html.evolution[data-theme="dark"] body[data-site-section="resources"] #dock {
  background: linear-gradient(145deg, #1a3651e8, #112940e8); border-color: #4a6e8d;
}
html.evolution .resource-tool-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 20px; border: 1px solid #85b5e6;
  border-radius: 16px; background: linear-gradient(145deg, #e4f4ff, #a9d3fa 60%, #75b0ef);
  color: #0c386c; font: inherit; font-weight: 720; text-decoration: none;
  box-shadow: inset 0 1px 1px #fff, inset 0 -3px 3px #4784bc56, 0 7px 0 #5a96ce, 0 16px 25px #174b7730;
  transform: translateY(0); transition: transform .18s, box-shadow .18s, filter .18s;
}
html.evolution .resource-tool-button:hover,
html.evolution .resource-tool-button:focus-visible {
  transform: translateY(-2px); filter: saturate(1.12);
  box-shadow: inset 0 1px 1px #fff, inset 0 -3px 3px #4784bc56, 0 9px 0 #5a96ce, 0 19px 30px #174b773b;
}
html.evolution .resource-tool-button:active { transform: translateY(5px); box-shadow: inset 0 2px 4px #4784bc56, 0 2px 0 #5a96ce; }
html.evolution .resource-tool-button:focus-visible { outline: 2px solid #136bff; outline-offset: 5px; }
html.evolution[data-theme="dark"] .resource-tool-button {
  background: linear-gradient(145deg, #2f628d, #21496f 60%, #193755); border-color: #5b91bd;
  color: #eaf5ff; box-shadow: inset 0 1px 1px #93c7ed66, 0 7px 0 #123354, 0 16px 25px #06182e66;
}
@media (max-width: 760px) {
  html.evolution .journal-page .journal-heading { padding: 28px 22px !important; }
  html.evolution .journal-page .journal-heading::after { right: -6%; bottom: -10%; font-size: 210px; }
  html.evolution .journal-page .journal-intro-note { font-size: 12px; }
  html.evolution .journal-page .journal-section-heading { display: block; }
  html.evolution .journal-page .journal-section-heading p { margin-top: 5px; }
  html.evolution #main .journal-page .journal-story-card { min-height: 0; }
  html.evolution #mobile-nav nav .mobile-theme-switch { width: 100%; }
  html.evolution body[data-site-section="resources"] #rail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.evolution #main .journal-page .journal-story-card:hover { transform: none !important; }
  html.evolution .resource-tool-button { transition: none; }
}
