:root {
  --navy-950: #080b0e;
  --navy-900: #0d1013;
  --navy-850: #14181c;
  --navy-800: #1b2026;
  --ink: #f2e9d8;
  --ink-soft: #d8cebb;
  --muted: #a69d8e;
  --muted-light: #7e786f;
  --page: #0b0e11;
  --surface: #111519;
  --surface-soft: #161b20;
  --surface-blue: #182029;
  --border: #34312b;
  --border-strong: #4b4438;
  --cream: #1a1713;
  --amber: #c4923e;
  --blue: #547ba7;
  --teal: #4b8380;
  --purple: #80658c;
  --green: #7e8748;
  --orange: #b96b31;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 38px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.46);
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --sidebar-width: 0px;
  --header-height: 82px;
  --ui-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif-font: Georgia, "Times New Roman", serif;
}

html {
  scrollbar-color: #544837 #0b0e11;
}

body {
  background:
    radial-gradient(circle at 76% 4%, rgba(150, 103, 43, 0.08), transparent 28rem),
    #0b0e11;
  color: var(--ink);
}

h1,
h2,
h3,
.brand-title {
  color: #f5eddd;
}

:focus-visible {
  outline: 2px solid #d2a04a;
  outline-offset: 3px;
}

.skip-link {
  background: #e8d9be;
  color: #17120b;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--header-height) auto;
}

.topbar {
  grid-column: 1;
  grid-template-columns: minmax(330px, 0.9fr) auto minmax(260px, 340px);
  gap: clamp(20px, 3vw, 48px);
  padding: 10px 20px;
  border-bottom: 1px solid rgba(196, 146, 62, 0.18);
  background: rgba(8, 11, 14, 0.96);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 12px;
  color: #d0a24e;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
}

.brand-mark svg {
  filter: drop-shadow(0 0 14px rgba(196, 146, 62, 0.13));
}

.brand-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.35px;
}

.brand-subtitle {
  color: #c79543;
  font-family: var(--ui-font);
  font-size: 12.5px;
}

.top-nav {
  gap: clamp(24px, 3vw, 46px);
}

.top-nav-link {
  color: #e7dece;
  font-size: 14.5px;
  font-weight: 400;
}

.top-nav-link::after {
  bottom: 8px;
  background: #c8943e;
}

.top-nav-link:hover,
.top-nav-link.is-active {
  color: #e8b75d;
}

.header-search {
  height: 42px;
  border-color: #302d28;
  background: rgba(18, 23, 28, 0.78);
  color: #dcd3c5;
}

.header-search:focus-within {
  border-color: #b98739;
  box-shadow: 0 0 0 3px rgba(196, 146, 62, 0.12);
}

.header-search input {
  color: #f2e9d8;
}

.header-search input::placeholder {
  color: #8f887c;
}

.search-results {
  border-color: #403a30;
  background: #12171b;
  box-shadow: var(--shadow-lg);
}

.search-result-item {
  border-bottom-color: #292923;
  color: #eee5d5;
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: #1b1d1c;
}

.search-result-copy strong {
  color: #f1e7d5;
}

.search-result-copy small,
.search-result-era,
.search-no-results {
  color: #aaa091;
}

.main-content {
  grid-column: 1;
  grid-row: 2;
  padding: 16px 20px 54px;
  background: transparent;
}

.hero {
  min-height: 424px;
  border: 1px solid #39342d;
  border-radius: 12px;
  background-color: #0b0c0d;
  background-image: url("assets/hero-curators-gallery.png");
  background-position: center;
  background-size: cover;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(10, 13, 16, 0.98) 0%, rgba(10, 13, 16, 0.90) 32%, rgba(10, 13, 16, 0.34) 56%, rgba(10, 13, 16, 0.05) 100%),
    linear-gradient(0deg, rgba(7, 8, 9, 0.55), transparent 46%);
}

.hero::after {
  height: 42%;
  background: linear-gradient(0deg, rgba(4, 5, 6, 0.74), transparent);
}

.hero-content {
  width: 58%;
  padding: 42px 48px 30px 78px;
}

.hero h1 {
  margin-bottom: 18px;
  color: #f3e9d6;
  font-size: clamp(48px, 4.35vw, 64px);
  font-weight: 400;
  letter-spacing: -2.8px;
  line-height: 0.99;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.56);
}

.hero-content > p {
  max-width: 510px;
  margin-bottom: 22px;
  color: #d1c7b9;
  font-size: 17px;
}

.primary-button {
  min-height: 45px;
  border-color: #d2a04a;
  border-radius: 6px;
  background: linear-gradient(135deg, #a87327, #6f4614);
  color: #fff7e8;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.18);
}

.primary-button:hover {
  border-color: #e1b45d;
  background: linear-gradient(135deg, #bd8932, #7f521b);
}

.hero-facts {
  top: auto;
  right: auto;
  bottom: 30px;
  left: 78px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(660px, calc(100% - 120px));
  min-height: 0;
  padding: 16px 0 0;
  gap: 0;
  border: 0;
  border-top: 1px solid rgba(210, 160, 74, 0.32);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-fact {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 0 18px;
  border-left: 1px solid rgba(210, 160, 74, 0.22);
  color: #d4a348;
}

.hero-fact:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-fact svg {
  width: 28px;
  height: 28px;
}

.hero-fact strong {
  color: #f0e6d5;
  font-size: 11.5px;
}

.hero-fact small {
  color: #aea596;
  font-size: 10.5px;
}

.sidebar {
  position: absolute;
  z-index: 35;
  top: calc(var(--header-height) + 478px);
  right: 20px;
  left: 20px;
  width: auto;
  height: 76px;
  overflow: visible;
  border: 1px solid #39342d;
  border-radius: 9px;
  background: rgba(17, 20, 22, 0.98);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.sidebar-scroll {
  display: flex;
  align-items: stretch;
  height: 100%;
  overflow: visible;
}

.sidebar-section {
  border: 0;
}

.sidebar-section h2 {
  color: #c69543;
}

.explore-section {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 16px;
}

.explore-section > h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sidebar-link {
  display: grid;
  grid-template-columns: 20px auto 13px;
  width: auto;
  min-height: 74px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 0;
  color: #ddd4c5;
  font-size: 12.5px;
}

.sidebar-link + .sidebar-link {
  border-left: 1px solid #2e2c28;
}

.sidebar-link:hover {
  background: #1a1d1e;
  color: #efbc63;
}

.sidebar-link > svg:not(.chevron),
.sidebar-link .chevron {
  stroke: #c89843;
}

.sidebar-link > svg:not(.chevron) {
  width: 19px;
  height: 19px;
}

.sidebar-link .chevron {
  width: 13px;
  height: 13px;
}

.selection-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #292821;
  color: #d6aa59;
}

.themes-sidebar {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-left: 1px solid #39342d;
}

.themes-sidebar h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 9px;
}

.theme-chip-list {
  flex-wrap: wrap;
  gap: 4px;
}

.theme-chip {
  min-height: 23px;
  padding: 3px 7px;
  border-color: #34332f;
  border-radius: 4px;
  background: #202225;
  color: #c9c0b2;
  font-size: 9.5px;
}

.theme-chip:hover,
.theme-chip.is-active {
  border-color: #aa7c34;
  background: #302719;
  color: #efc574;
}

.quote-card,
.beginner-card {
  display: none;
}

.featured-section {
  padding-top: 112px;
}

.compact-heading-row h2 {
  color: #eee4d2;
  font-size: 22px;
  font-weight: 500;
}

.text-link,
.action-link {
  color: #d4a348;
}

.text-link:hover,
.action-link:hover {
  color: #efbf69;
}

.featured-grid {
  gap: 18px;
  margin-top: 12px;
}

.featured-card {
  grid-template-columns: 48% minmax(0, 1fr);
  min-height: 214px;
  border-color: #433a2e;
  border-radius: 9px;
  background: #101417;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.featured-card:hover {
  border-color: #a77b39;
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.34);
}

.featured-card-copy {
  padding: 18px 12px 11px 14px;
}

.featured-card-name {
  color: #f1e6d3;
  font-family: var(--serif-font);
  font-size: 18px;
}

.featured-lifespan {
  color: #9d9487;
}

.featured-thought {
  color: #d0c7ba;
  font-size: 11.4px;
}

.featured-era {
  border: 1px solid #564125;
  background: #261f16;
  color: #d9a94e;
}

.featured-card[data-era="Enlightenment"] .featured-era {
  border-color: #293d52;
  background: #16212c;
  color: #759dc4;
}

.featured-card[data-era="Modern"] .featured-era {
  border-color: #23413e;
  background: #142522;
  color: #76a49c;
}

.time-preview {
  margin-top: 12px;
  padding: 20px 24px 15px;
  border: 1px solid #34312b;
  border-radius: 10px;
  background: #101315;
}

.era-preview-dot {
  box-shadow: 0 0 0 4px #101315;
}

.era-preview-item small {
  color: #aaa193;
}

.quick-actions {
  gap: 20px;
  padding-top: 22px;
}

.quick-action {
  border-color: #34312b;
  background: #101417;
}

.quick-action:hover {
  border-color: #7e6034;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
}

.quick-action-copy strong {
  color: #ede3d2;
}

.quick-action-copy small {
  color: #9f978b;
}

.quick-action-icon {
  border: 1px solid currentColor;
}

.quick-action-icon.amber {
  background: #211b12;
  color: #c8943e;
}

.quick-action-icon.blue {
  background: #141d27;
  color: #6289b5;
}

.quick-action-icon.teal {
  background: #122220;
  color: #57928c;
}

.content-section,
.filter-panel,
.empty-state,
.theme-card,
.connection-card,
.timeline-era-group,
.about-panel {
  border-color: #34312b;
  background: #101417;
  color: #cec5b8;
}

.section-intro,
.section-heading {
  border-color: #34312b;
}

.section-overline,
.filter-field label {
  color: #c8943e;
}

.section-intro p,
.section-heading p,
.about-panel p {
  color: #a69d8e;
}

.filter-field input,
.filter-field select {
  border-color: #403b33;
  background: #171b1f;
  color: #eee5d5;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: #b88739;
  box-shadow: 0 0 0 3px rgba(196, 146, 62, 0.12);
}

.result-summary {
  border-color: #3c3831;
  background: #171b1e;
  color: #aaa193;
}

.clear-filters-button.secondary-button {
  border-color: #5b4a35;
  background: #211c16;
  color: #e1bd7a;
}

.clear-filters-button.secondary-button:hover {
  border-color: #a77b3d;
  background: #2b2319;
  color: #f2ce8b;
}

.active-filter-pill {
  border-color: #665136;
  background: #211c16;
  color: #e1ba72;
}

.active-filter-pill button {
  background: #33291d;
  color: #e7c98f;
}

.active-filter-pill button:hover {
  background: #4a3824;
  color: #ffe0a4;
}

.library-card,
.theme-card,
.connection-card,
.timeline-person {
  border-color: #413a31;
  background: #15191c;
  color: #d6cdbf;
}

.library-card:hover,
.theme-card:hover,
.connection-card:hover,
.timeline-person:hover {
  border-color: #a77b3d;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

.theme-browser-card {
  border-color: #413a31;
  background: #15191c;
  color: #d6cdbf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.theme-browser-card::before {
  height: 3px;
  opacity: 0.86;
}

.theme-browser-card:hover {
  border-color: color-mix(in srgb, var(--theme-color) 62%, #6d604e);
  background: #1a1f22;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.theme-browser-icon {
  border: 1px solid color-mix(in srgb, var(--theme-color) 34%, #3d3932);
  background: color-mix(in srgb, var(--theme-color) 14%, #1a1e20);
  color: color-mix(in srgb, var(--theme-color) 78%, #f0d9ae);
}

.theme-browser-card h3 {
  color: #f1e6d3;
}

.theme-browser-card p {
  color: #b8afa2;
}

.theme-count {
  color: #d2ad6a;
}

.timeline-control {
  padding: 9px 16px;
  border-color: #4a4237;
  background: #171b1f;
  color: #cfc4b5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.timeline-control:hover {
  border-color: color-mix(in srgb, var(--control-color) 52%, #75634b);
  background: color-mix(in srgb, var(--control-color) 10%, #1a1e21);
  color: #f0e5d4;
  transform: translateY(-1px);
}

.timeline-control.is-active {
  border-color: color-mix(in srgb, var(--control-color) 70%, #b58a48);
  background: color-mix(in srgb, var(--control-color) 18%, #1b1f21);
  color: #f4e8d5;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--control-color) 22%, transparent),
    0 8px 20px rgba(0, 0, 0, 0.24);
}

#showMoreButton {
  min-height: 48px;
  padding: 12px 24px;
  border-color: #745a35;
  background: #1d1b17;
  color: #e9c67e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 10px 24px rgba(0, 0, 0, 0.24);
  font-weight: 700;
}

#showMoreButton:hover {
  border-color: #b88a42;
  background: #292218;
  color: #ffe1a3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 30px rgba(0, 0, 0, 0.32);
  transform: translateY(-2px);
}

.connection-selector label {
  color: #b9955a;
}

.connection-selector select {
  border-color: #544937;
  background: #171b1f;
  color: #e7dccb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.connection-selector select:focus {
  border-color: #b88840;
  box-shadow: 0 0 0 3px rgba(184, 136, 64, 0.14);
}

.connection-node {
  border-color: #453d32;
  background: #171b1e;
  color: #d7cdbf;
  box-shadow:
    inset 0 3px 0 color-mix(in srgb, var(--node-color) 76%, #a77b3d),
    0 14px 30px rgba(0, 0, 0, 0.26);
}

.connection-node:hover {
  border-color: color-mix(in srgb, var(--node-color) 56%, #75634b);
  background: #1b2023;
  transform: translateY(-2px);
}

.connection-node-number {
  border: 1px solid color-mix(in srgb, var(--node-color) 34%, #453e33);
  background: color-mix(in srgb, var(--node-color) 14%, #1b2022);
  color: color-mix(in srgb, var(--node-color) 72%, #e5c78e);
}

.connection-node h3 {
  color: #f1e6d3;
}

.connection-node p {
  color: #a9a093;
}

.connection-node button {
  padding: 6px 10px;
  border: 1px solid #5b4931;
  border-radius: 999px;
  background: #211c16;
  color: #dfb96f;
}

.connection-node button:hover {
  border-color: #a77b3d;
  background: #2b2319;
  color: #f2ce8b;
}

.connection-node:not(:last-child)::after {
  background: #846d4b;
}

.connection-node:not(:last-child)::before {
  border-color: #846d4b;
}

.library-card-main {
  color: #d6cdbf;
}

.library-avatar {
  background: #20241f;
  box-shadow:
    inset 0 0 0 1px rgba(226, 187, 112, 0.16),
    0 7px 18px rgba(0, 0, 0, 0.24);
}

.library-avatar img {
  filter: saturate(0.88) contrast(1.04);
}

.library-card-name,
.theme-card h3,
.connection-card h3,
.timeline-person strong {
  color: #f1e6d3;
}

.library-card-lifespan {
  color: #b7a892;
}

.library-card-summary {
  color: #c9c0b3;
}

.library-card .meta-pill {
  border: 1px solid #403b34;
  background: #20252a;
  color: #bdb4a7;
}

.library-card .meta-pill:first-child {
  border-color: #4e5231;
  background: #24281b !important;
  color: #cad477 !important;
}

.favorite-button {
  color: #a89f91;
}

.favorite-button:hover {
  border-color: #554838;
  background: #272018;
  color: #e1ad57;
}

.favorite-button.is-favorite {
  color: #df9b62;
}

.library-card-footer {
  border-color: #35312b;
  background: #111518;
}

.compare-toggle {
  color: #b9b0a3;
}

.compare-toggle input {
  accent-color: #c4923e;
}

.card-open-link {
  color: #dfad5b;
}

.card-open-link:hover {
  color: #f2c879;
}

.library-card:focus-within {
  border-color: #c4923e;
  box-shadow: 0 0 0 3px rgba(196, 146, 62, 0.14);
}

.modal-backdrop {
  background: rgba(2, 4, 5, 0.84);
  backdrop-filter: blur(8px);
}

.modal,
.detail-modal,
.compare-modal,
.guide-modal {
  border: 1px solid #443c31;
  background: #111519;
  color: #d5ccbe;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.62);
}

.modal h2,
.modal h3,
.detail-modal h2,
.compare-modal h2,
.guide-modal h2 {
  color: #f1e6d3;
}

.detail-modal {
  width: min(1060px, calc(100vw - 40px));
  border-color: #574832;
  border-radius: 18px;
  background: #101417;
  scrollbar-color: #695538 #101417;
}

.detail-hero {
  grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
  min-height: 360px;
  border-bottom: 1px solid #3f382f;
  background: #15191c;
}

.detail-portrait,
.detail-monogram {
  min-height: 360px;
}

.detail-portrait {
  filter: saturate(0.9) contrast(1.04);
}

.detail-monogram {
  background: #1c211f;
  color: #d8b36d;
}

.detail-heading {
  justify-content: center;
  padding: 54px 76px 43px 48px;
}

.detail-kicker {
  margin-bottom: 12px;
  color: #a5ad56;
  font-size: 12px;
  letter-spacing: 0.15em;
}

.detail-heading h2 {
  margin-bottom: 8px;
  color: #f1e6d3;
  font-size: clamp(42px, 5vw, 62px);
  letter-spacing: -1.8px;
}

.detail-lifespan {
  margin-bottom: 20px;
  color: #d0a55d;
  font-size: 17px;
}

.detail-summary {
  max-width: 620px;
  margin-bottom: 22px;
  color: #cec4b5;
  font-size: 15px;
  line-height: 1.72;
}

.detail-tags {
  margin-top: 0;
  gap: 8px;
}

.detail-tags span {
  padding: 6px 10px;
  border-color: #494238;
  background: #1d2225;
  color: #d1c5b4;
}

.detail-body {
  gap: 42px;
  padding: 38px 48px 46px;
  background: #101417;
}

.detail-section {
  padding-top: 2px;
}

.detail-section h3 {
  margin-bottom: 14px;
  color: #e8d7bb;
  font-size: 18px;
}

.detail-section + .detail-section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #302d28;
}

.idea-list li,
.works-list li {
  color: #c2b9ad;
  line-height: 1.6;
}

.idea-list li::before {
  background: #b88a42;
}

.works-list svg {
  stroke: #c79543;
}

.start-card {
  border-color: #403a31;
  background: #171c1f;
  box-shadow: inset 3px 0 0 #9b7338;
}

.start-card span,
.start-card small,
.difficulty-row > span {
  color: #9f978b;
}

.start-card strong {
  color: #eadfcd;
}

.difficulty-dot {
  background: #353733;
}

.difficulty-dot.is-filled {
  background: #b98a42;
}

.detail-section .secondary-button {
  border-color: #604d33;
  background: #211c16;
  color: #e2bb75;
}

.detail-section .secondary-button:hover {
  border-color: #b1813d;
  background: #2b2319;
  color: #f4cf88;
}

.related-list button {
  border-color: #3f3a33;
  background: #171c1f;
  color: #cdbfae;
}

.related-list button:hover {
  border-color: #8d6938;
  background: #211d18;
  color: #edc77e;
}

.detail-modal .modal-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-color: #4d4438;
  background: #171b1e;
  color: #b7aa98;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
}

.detail-modal .modal-close:hover {
  border-color: #a77b3d;
  background: #242019;
  color: #edc576;
}

.icon-button,
.modal-close {
  color: #d3c9b9;
}

.icon-button:hover,
.modal-close:hover {
  background: #24221e;
  color: #efbd66;
}

@media (max-width: 900px) {
  .detail-hero {
    grid-template-columns: minmax(210px, 34%) minmax(0, 1fr);
  }

  .detail-heading {
    padding: 48px 62px 38px 34px;
  }
}

@media (max-width: 1240px) {
  .topbar {
    grid-template-columns: minmax(285px, 0.8fr) auto minmax(230px, 285px);
  }

  .top-nav {
    gap: 24px;
  }

  .hero-content {
    padding-left: 54px;
  }

  .hero-facts {
    left: 54px;
  }

  .sidebar-link {
    padding-inline: 11px;
  }

  .themes-sidebar {
    gap: 9px;
    padding-inline: 10px;
  }

  .theme-chip:nth-child(n + 8) {
    display: none;
  }
}

@media (max-width: 1050px) {
  :root {
    --sidebar-width: 264px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  }

  .top-nav {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    right: auto;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    border: 0;
    border-right: 1px solid #39342d;
    border-radius: 0;
    transform: translateX(-102%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scroll {
    display: block;
    height: 100%;
    overflow-y: auto;
  }

  .explore-section {
    display: block;
    padding: 24px 20px 14px;
  }

  .explore-section > h2 {
    position: static;
    width: auto;
    height: auto;
    margin-bottom: 10px;
    overflow: visible;
    clip: auto;
  }

  .sidebar-link {
    grid-template-columns: 24px minmax(0, 1fr) 20px;
    width: 100%;
    min-height: 42px;
    padding: 8px 4px;
    border: 0;
  }

  .themes-sidebar {
    display: block;
    padding: 18px 20px;
    border-top: 1px solid #39342d;
    border-left: 0;
  }

  .themes-sidebar h2 {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .theme-chip {
    min-height: 29px;
    font-size: 11px;
  }

  .theme-chip:nth-child(n) {
    display: block;
  }

  .quote-card,
  .beginner-card {
    display: block;
  }

  .quote-card {
    border-color: #39342d;
    background: #171716;
  }

  .quote-card blockquote,
  .quote-card .quote-author {
    color: #d6cbbb;
  }

  .beginner-card {
    background: #181714;
    border: 1px solid #49391f;
  }

  .featured-section {
    padding-top: 24px;
  }

  .hero {
    min-height: 500px;
  }

  .hero-content {
    width: 64%;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 72px;
  }

  .topbar {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    height: var(--header-height);
    padding: 8px 14px;
  }

  .mobile-menu-button {
    color: #d2a04a;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-title {
    font-size: 21px;
  }

  .brand-subtitle {
    font-size: 10.5px;
  }

  .header-search {
    grid-column: 1 / -1;
    height: 40px;
  }

  .main-content {
    padding: 14px 14px 42px;
  }

  .hero {
    min-height: 570px;
    background-position: 66% center;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(9, 12, 14, 0.97) 0%, rgba(9, 12, 14, 0.78) 55%, rgba(9, 12, 14, 0.36) 100%),
      linear-gradient(90deg, rgba(9, 12, 14, 0.84), transparent);
  }

  .hero-content {
    width: 100%;
    padding: 34px 24px 20px;
  }

  .hero h1 {
    font-size: clamp(42px, 13vw, 58px);
    letter-spacing: -1.8px;
  }

  .hero-content > p {
    font-size: 15px;
  }

  .hero-facts {
    right: 24px;
    bottom: 24px;
    left: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    gap: 14px 0;
  }

  .hero-fact:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-card {
    grid-template-columns: 42% minmax(0, 1fr);
    min-height: 220px;
  }

  .time-preview {
    padding-inline: 14px;
  }

  .era-preview {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 0;
  }

  .era-preview::before {
    display: none;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .detail-modal {
    width: 100%;
    border: 0;
    border-radius: 0;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-portrait,
  .detail-monogram {
    height: 260px;
    min-height: 260px;
  }

  .detail-heading {
    padding: 32px 24px 28px;
  }

  .detail-heading h2 {
    font-size: 38px;
    letter-spacing: -1px;
  }

  .detail-summary {
    font-size: 14px;
  }

  .detail-body {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 30px 24px 38px;
  }

  .detail-modal .modal-close {
    top: 14px;
    right: 14px;
  }
}

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

/* Museum-catalogue theme cards */
html,
body {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

.theme-browser {
  max-width: 1460px;
  gap: 15px;
}

.theme-browser-card {
  isolation: isolate;
  display: block;
  min-height: 248px;
  padding: 0;
  border-color: color-mix(in srgb, var(--theme-color) 26%, #494138);
  border-radius: 13px;
  background: #121619;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 12px 26px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-browser-card::before {
  z-index: 3;
  height: 3px;
  background: var(--theme-color);
  opacity: 0.94;
}

.theme-browser-card:hover {
  border-color: color-mix(in srgb, var(--theme-color) 74%, #75644d);
  background: #121619;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 22px 42px rgba(0, 0, 0, 0.42);
  transform: translateY(-3px);
}

.theme-browser-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--theme-color) 76%, #f1d59f);
  outline-offset: 4px;
}

.theme-browser-copy {
  position: relative;
  z-index: 2;
  display: flex;
  width: 58%;
  min-height: 248px;
  padding: 25px 8px 21px 25px;
  flex-direction: column;
  align-items: flex-start;
}

.theme-browser-label {
  margin-bottom: 25px;
  color: color-mix(in srgb, var(--theme-color) 76%, #e7c68c);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.theme-browser-card h3 {
  max-width: 190px;
  margin: 0 0 10px;
  color: #f2e6d1;
  font-family: var(--serif-font);
  font-size: clamp(22px, 1.6vw, 29px);
  line-height: 1.03;
  letter-spacing: -0.018em;
}

.theme-browser-card p {
  max-width: 205px;
  margin: 0 0 18px;
  color: #b9afa1;
  font-size: 12px;
  line-height: 1.48;
}

.theme-browser-card .theme-count {
  margin-top: auto;
  color: color-mix(in srgb, var(--theme-color) 62%, #e7bd73);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.theme-browser-art {
  position: absolute;
  z-index: 1;
  top: 3px;
  right: 0;
  bottom: 0;
  left: 40%;
  overflow: hidden;
  border-radius: 0 12px 12px 0;
  pointer-events: none;
}

.theme-browser-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.88;
  transition: transform 260ms ease, opacity 260ms ease;
}

.theme-browser-card:hover .theme-browser-art img {
  opacity: 1;
  transform: scale(1.025);
}

@media (max-width: 1180px) {
  .theme-browser {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .theme-browser {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .theme-browser {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .theme-browser-card,
  .theme-browser-copy {
    min-height: 224px;
  }

  .theme-browser-copy {
    width: 60%;
    padding: 22px 8px 18px 21px;
  }

  .theme-browser-label {
    margin-bottom: 19px;
  }

  .theme-browser-card h3 {
    font-size: 25px;
  }

  .theme-browser-art {
    left: 42%;
  }
}

/* Completed long-form philosopher profiles */
.has-completed-profile {
  border-color: #554328;
  box-shadow: inset 0 1px 0 rgba(228, 180, 94, 0.06), 0 16px 34px rgba(0, 0, 0, 0.16);
}

.completed-profile-pill {
  border-color: rgba(205, 157, 76, 0.34) !important;
  background: rgba(112, 78, 28, 0.22) !important;
  color: #ddb468 !important;
}

.detail-complete-badge {
  align-self: flex-start;
  margin-bottom: 13px;
  padding: 5px 9px;
  border: 1px solid rgba(204, 155, 73, 0.4);
  border-radius: 999px;
  background: rgba(92, 62, 22, 0.32);
  color: #e3b766;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.expanded-profile-reader {
  border-top: 1px solid #443b2e;
  background:
    radial-gradient(circle at 92% 0%, rgba(149, 103, 39, 0.13), transparent 30%),
    linear-gradient(180deg, #12171a, #0e1215 36%);
  color: #c8beb0;
}

.expanded-profile-reader-header {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 34px;
  padding: 44px 50px 28px;
  border-bottom: 1px solid #302c26;
}

.expanded-profile-overline {
  margin: 4px 0 0;
  color: #c79543;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.expanded-profile-reader-header h3 {
  max-width: 760px;
  margin: 0 0 8px;
  color: #f0e4d0;
  font-family: var(--serif-font);
  font-size: clamp(27px, 3.4vw, 38px);
  font-weight: 500;
  line-height: 1.13;
}

.expanded-profile-reader-header > div > p {
  margin: 0;
  color: #958d82;
  font-size: 13px;
}

.expanded-profile-epigraph {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 34px;
  margin: 0;
  padding: 26px 50px;
  border-bottom: 1px solid #302c26;
  background: rgba(198, 145, 61, 0.045);
}

.expanded-profile-epigraph blockquote {
  grid-column: 2;
  margin: 0;
  color: #ddd0bd;
  font-family: var(--serif-font);
  font-size: 20px;
  font-style: italic;
  line-height: 1.55;
}

.expanded-profile-epigraph figcaption {
  grid-column: 2;
  color: #a98c60;
  font-size: 11px;
}

.expanded-profile-tabs {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  gap: 8px;
  padding: 14px 50px;
  overflow-x: auto;
  border-bottom: 1px solid #383229;
  background: rgba(15, 19, 22, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
}

.expanded-profile-tabs button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 12px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid #403a32;
  border-radius: 999px;
  background: #171c1f;
  color: #aaa196;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.expanded-profile-tabs button span {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: #252a2c;
  color: #8f877d;
  font-size: 9px;
}

.expanded-profile-tabs button:hover,
.expanded-profile-tabs button[aria-selected="true"] {
  border-color: #8c6634;
  background: #2a2117;
  color: #efc77e;
}

.expanded-profile-tabs button[aria-selected="true"] span {
  background: #a87532;
  color: #16120c;
}

.expanded-profile-panels {
  padding: 36px 50px 56px;
}

.expanded-profile-panel[hidden] {
  display: none;
}

.expanded-profile-panel {
  max-width: 920px;
  margin: 0 auto;
}

.expanded-profile-intro {
  margin-bottom: 22px;
}

.expanded-profile-facts {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid #40382d;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(34, 31, 26, 0.92), rgba(22, 26, 28, 0.95));
  box-shadow: inset 3px 0 0 #9e7336;
}

.expanded-profile-facts h3 {
  margin: 0 0 17px;
  color: #e8d8bd;
  font-size: 19px;
}

.expanded-profile-facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  margin: 0;
}

.expanded-profile-facts dl > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #363129;
}

.expanded-profile-facts dt {
  color: #a98b5c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.expanded-profile-facts dd {
  margin: 0;
  color: #cfc4b5;
  font-size: 12px;
  line-height: 1.55;
}

.expanded-profile-chapter {
  overflow: hidden;
  border: 1px solid #38342e;
  border-radius: 12px;
  background: #151a1d;
}

.expanded-profile-chapter + .expanded-profile-chapter {
  margin-top: 13px;
}

.expanded-profile-chapter > summary {
  display: flex;
  min-height: 60px;
  padding: 16px 19px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  color: #e9ddca;
  font-family: var(--serif-font);
  font-size: 18px;
  font-weight: 600;
  list-style: none;
}

.expanded-profile-chapter > summary::-webkit-details-marker {
  display: none;
}

.expanded-profile-chapter > summary:hover {
  background: #1c201f;
  color: #f1c879;
}

.expanded-profile-chapter > summary svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: #b88b47;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.expanded-profile-chapter[open] > summary svg {
  transform: rotate(180deg);
}

.expanded-profile-chapter[open] > summary {
  border-bottom: 1px solid #38342e;
  background: linear-gradient(90deg, rgba(119, 82, 30, 0.16), transparent 55%);
}

.expanded-profile-chapter-copy {
  padding: 22px 24px 26px;
}

.expanded-profile-chapter-copy p,
.expanded-profile-intro p {
  margin: 0 0 15px;
  color: #c1b8ac;
  font-size: 13px;
  line-height: 1.78;
}

.expanded-profile-chapter-copy h4,
.expanded-profile-chapter-copy h5 {
  margin: 27px 0 10px;
  color: #e2c895;
  font-family: var(--serif-font);
  line-height: 1.3;
}

.expanded-profile-chapter-copy h4 {
  font-size: 20px;
}

.expanded-profile-chapter-copy h5 {
  font-size: 17px;
}

.expanded-profile-chapter-copy h4:first-child,
.expanded-profile-chapter-copy h5:first-child {
  margin-top: 0;
}

.expanded-profile-chapter-copy ul,
.expanded-profile-chapter-copy ol {
  margin: 0 0 18px;
  padding-left: 23px;
  color: #c1b8ac;
}

.expanded-profile-chapter-copy li {
  margin: 7px 0;
  padding-left: 3px;
  font-size: 13px;
  line-height: 1.65;
}

.expanded-profile-chapter-copy li::marker {
  color: #c39043;
}

.expanded-profile-chapter-copy blockquote {
  margin: 22px 0 8px;
  padding: 16px 18px;
  border-left: 3px solid #a87938;
  background: #1d1d1a;
  color: #ddc9aa;
  font-family: var(--serif-font);
  font-size: 17px;
  font-style: italic;
  line-height: 1.55;
}

.expanded-profile-note {
  color: #9e8d75 !important;
  font-size: 11px !important;
}

.expanded-profile-callout {
  margin: 18px 0;
  padding: 17px 19px;
  border: 1px solid #55452f;
  border-radius: 9px;
  background: linear-gradient(135deg, #211d16, #181c1e);
  color: #d6c4a7;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
}

.expanded-profile-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid #3c372f;
  border-radius: 9px;
}

.expanded-profile-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: #12171a;
  font-size: 11px;
  line-height: 1.55;
}

.expanded-profile-table th,
.expanded-profile-table td {
  padding: 11px 13px;
  border-right: 1px solid #37332d;
  border-bottom: 1px solid #37332d;
  text-align: left;
  vertical-align: top;
}

.expanded-profile-table th {
  background: #211d17;
  color: #dbb66f;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.expanded-profile-table td {
  color: #bdb4a8;
}

.expanded-profile-table tr:last-child td {
  border-bottom: 0;
}

.expanded-profile-table th:last-child,
.expanded-profile-table td:last-child {
  border-right: 0;
}

@media (max-width: 760px) {
  .expanded-profile-reader-header,
  .expanded-profile-epigraph {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 30px 22px 22px;
  }

  .expanded-profile-epigraph blockquote,
  .expanded-profile-epigraph figcaption {
    grid-column: 1;
  }

  .expanded-profile-tabs {
    padding: 12px 18px;
  }

  .expanded-profile-panels {
    padding: 25px 18px 40px;
  }

  .expanded-profile-facts {
    padding: 19px;
  }

  .expanded-profile-facts dl {
    grid-template-columns: 1fr;
  }

  .expanded-profile-facts dl > div {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .expanded-profile-chapter > summary {
    min-height: 56px;
    padding: 14px 16px;
    font-size: 16px;
  }

  .expanded-profile-chapter-copy {
    padding: 19px 17px 22px;
  }
}
