@font-face {
  font-family: "Sylexiad Sans";
  src: url("/fonts/SylexiadSansMedium.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffcf6;
  --paper-soft: #f6f0ea;
  --card: #ffffff;
  --ink: #2a2430;
  --muted: #746873;
  --plum: #51305a;
  --clay: #9e7d71;
  --line: #c9b7bf;
  --success: #2e6547;
  --warning: #8b4b33;
  --shadow: 0 9px 24px rgba(31, 42, 55, 0.08);
}
.js-fallback { display: none; }
.no-js .js-only { display: none !important; }
.no-js .js-fallback { display: block; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1f2a37;
  --paper-soft: #2a3645;
  --card: #253241;
  --ink: #eaeaea;
  --muted: #b2bdc8;
  --line: #4a5a6a;
  --success: #8fd0aa;
  --warning: #efae90;
  --shadow: 0 9px 24px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 97px;
  background: linear-gradient(180deg, var(--paper), var(--paper-soft));
  color: var(--ink);
  font-family: "Sylexiad Sans", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.02em;
}
a { color: var(--clay); }
a:hover, a:focus-visible { color: var(--plum); }
button, input, select, textarea { letter-spacing: inherit; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 2000; padding: .7rem 1rem; border: 2px solid #111; border-radius: 999px; background: #fff; color: #111; }
.skip-link:focus { top: 1rem; }
.site-header { position: fixed; inset: 0 0 auto; z-index: 1000; width: 100%; background: #51305a; border-bottom: 1px solid var(--line); overflow-x: clip; }
.nav { width: 100%; max-width: 1180px; min-height: 96px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-link { display: flex; align-items: center; height: 96px; flex: 0 0 auto; }
.logo { display: block; width: auto; height: 96px; max-width: 220px; object-fit: contain; margin: 0; }
.brand-txt { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-width: 0; color: #f4e9fc; line-height: 1.05; margin-left: 2px; }
.brand-name { color: #f4e9fc; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; line-height: 1.05; }
.brand-tagline { color: #e4d2f9; font-size: .72rem; opacity: .9; white-space: nowrap; }
.site-header nav { margin-left: auto; }
.site-header nav > ul { list-style: none; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; }
.site-header nav a, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; padding: 7px 13px; border: 0; border-radius: 999px; background: none; color: #f4e9fc !important; font: inherit; font-size: .98rem; font-weight: 500; text-decoration: none !important; cursor: pointer; }
.site-header nav a:hover, .site-header nav a:focus-visible, .theme-toggle:hover, .theme-toggle:focus-visible, .site-header nav a.is-current { background: #9e7d71; color: #fff !important; }
.theme-toggle-input, #nav-toggle { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.hamburger { display: none; width: 48px; height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 14px; background: #ffffffd1; box-shadow: 0 10px 24px var(--shadow); cursor: pointer; position: relative; }
.hamburger span { width: 20px; height: 2.5px; border-radius: 999px; background: #51305a; transition: .2s; }

.page { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.6rem) 0 4rem; flex: 1 0 auto; }
.hero { max-width: 900px; margin: 0 auto 2rem; text-align: center; }
.eyebrow { margin: 0 0 .4rem; color: var(--clay); font-size: .8rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 1.05; letter-spacing: -.015em; }
.lede { max-width: 780px; margin: 1rem auto 0; color: var(--muted); font-size: 1.08rem; }
.hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem 1rem; margin: 1rem 0 0; color: var(--muted); font-size: .87rem; }
.hero-meta strong { color: var(--plum); }
:root[data-theme="dark"] .hero-meta strong { color: #d7bfe3; }

.filter-panel, .panel, .resource-card, .empty-state, .submit-panel { border: 1px solid var(--line); background: var(--card); }
.filter-panel { margin-bottom: 1.75rem; padding: clamp(1.1rem, 3vw, 1.7rem); border-radius: 20px; box-shadow: var(--shadow); }
.filter-heading, .results-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.filter-heading h2, .results-heading h2, .panel h2, .submit-panel h2 { margin: 0; line-height: 1.12; }
.field { display: grid; gap: .35rem; }
.field > span, .alignment-fieldset legend { font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--clay) 45%, transparent); outline-offset: 1px; border-color: var(--plum); }
.field-search { margin-top: 1.1rem; }
.field-search input { min-height: 56px; font-size: 1.04rem; }
.search-understanding { margin-top: .6rem; color: var(--muted); font-size: .82rem; }
.concept-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.concept-chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .25rem .55rem .25rem .7rem; border: 1px solid var(--clay); border-radius: 999px; background: var(--paper-soft); color: var(--ink); font: inherit; font-size: .78rem; cursor: pointer; }
.concept-chip::after { content: "×"; font-size: 1.1em; }
.concept-chip:hover, .concept-chip:focus-visible { border-color: var(--plum); }
.search-behavior { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: .85rem; margin-top: 1rem; }
.search-style-fieldset { margin: 0; padding: 0; border: 0; }
.search-style-fieldset legend { margin-bottom: .35rem; font-weight: 700; font-size: .9rem; }
.search-style-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.search-style-options label { position: relative; min-width: 0; cursor: pointer; }
.search-style-options label + label { border-left: 1px solid var(--line); }
.search-style-options input { position: absolute; opacity: 0; pointer-events: none; }
.search-style-options span { display: grid; align-content: center; min-height: 72px; padding: .65rem .75rem; background: var(--paper-soft); }
.search-style-options strong { font-size: .84rem; }
.search-style-options small { margin-top: .12rem; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.search-style-options input:checked + span { background: var(--plum); color: #fff; }
.search-style-options input:checked + span small { color: #f4e9fc; }
.search-style-options input:focus-visible + span { outline: 3px solid var(--clay); outline-offset: -3px; }
.constellation-option { display: flex; align-items: flex-start; gap: .65rem; align-self: end; min-height: 72px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-soft); cursor: pointer; }
.constellation-option input { flex: 0 0 auto; width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--plum); }
.constellation-option span { display: grid; }
.constellation-option strong { font-size: .82rem; }
.constellation-option small { margin-top: .12rem; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.constellation-option.is-disabled { opacity: .55; cursor: not-allowed; }
.alignment-fieldset { margin: 1.1rem 0 0; padding: 0; border: 0; }
.field-help { margin: .08rem 0 .55rem; color: var(--muted); font-size: .82rem; }
.alignment-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.alignment-options label { position: relative; cursor: pointer; }
.alignment-options label + label { border-left: 1px solid var(--line); }
.alignment-options input { position: absolute; opacity: 0; pointer-events: none; }
.alignment-options span { display: flex; min-height: 54px; align-items: center; justify-content: center; padding: .45rem .55rem; text-align: center; background: var(--paper-soft); font-size: .77rem; font-weight: 700; }
.alignment-options input:checked + span { background: var(--plum); color: #fff; }
.alignment-options input:focus-visible + span { outline: 3px solid var(--clay); outline-offset: -3px; }
.alignment-options small { display: block; margin-left: .3rem; opacity: .75; font-size: .66rem; }
.primary-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: 1.05rem; }
.basic-search-form { display: grid; gap: 1rem; }
.basic-search-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.basic-search-form .button { width: fit-content; }
.more-filters { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.more-filters summary, .resource-details summary { width: fit-content; color: var(--clay); font-weight: 700; cursor: pointer; }
.secondary-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-top: .9rem; }

.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 22px; border: 1.5px solid #51305a; border-radius: 999px; background: linear-gradient(135deg, #51305a, #9e7d71); color: #fff !important; font: inherit; font-weight: 700; text-decoration: none !important; cursor: pointer; box-shadow: 0 4px 14px rgba(49,49,49,.2); }
.button.secondary { border-color: #111; background: #fff; color: #111 !important; }
.button:hover, .button:focus-visible { border-color: #111; background: #f6f0ea; color: #111 !important; }
.button.compact { min-height: 40px; padding: 8px 16px; font-size: .84rem; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.results-heading { max-width: 980px; margin: 0 auto .75rem; scroll-margin-top: 110px; }
.results-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.constellation { max-width: 980px; margin: 0 auto 1rem; padding: clamp(1rem, 3vw, 1.45rem); border: 1px solid var(--clay); border-radius: 18px; background: color-mix(in srgb, var(--card) 88%, var(--paper-soft)); box-shadow: var(--shadow); }
.constellation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.constellation-heading h2 { margin: 0; font-size: 1.4rem; line-height: 1.15; }
.constellation-label { flex: 0 0 auto; padding: .25rem .55rem; border: 1px solid var(--clay); border-radius: 999px; color: var(--clay); font-size: .68rem; font-weight: 700; }
.constellation-summary { max-width: 780px; margin: .55rem 0 1rem; color: var(--muted); font-size: .9rem; }
.constellation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.constellation-group { min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.constellation-group h3 { margin: 0; font-size: 1rem; line-height: 1.2; }
.constellation-group-intro { margin: .25rem 0 .65rem; color: var(--muted); font-size: .76rem; }
.constellation-resource { padding-top: .55rem; border-top: 1px solid var(--line); }
.constellation-resource h4 { margin: 0; font-size: .96rem; line-height: 1.2; }
.constellation-resource h4 a { color: var(--ink); text-underline-offset: .14em; }
.constellation-resource p { display: -webkit-box; margin: .35rem 0 .55rem; overflow: hidden; color: var(--muted); font-size: .76rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.constellation-resource .button { min-height: 34px; padding: 6px 11px; font-size: .7rem; }
.resource-list { display: grid; max-width: 980px; margin: 0 auto; gap: .8rem; }
.resource-card { padding: 1.15rem 1.25rem; border-radius: 16px; box-shadow: 0 4px 14px rgba(31,42,55,.06); scroll-margin-top: 120px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.resource-card h3 { margin: 0; font-size: 1.28rem; line-height: 1.15; }
.resource-card h3 a { color: var(--ink); text-decoration-thickness: .08em; text-underline-offset: .16em; }
.resource-domain { margin: .18rem 0 0; color: var(--muted); font-size: .78rem; }
.alignment-badge { display: inline-flex; flex: 0 0 auto; max-width: 190px; padding: .25rem .55rem; border: 1px solid var(--clay); border-radius: 999px; color: var(--clay); font-size: .7rem; font-weight: 700; text-align: center; }
.resource-description { margin: .7rem 0; font-size: .92rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin: .65rem 0; }
.tag { display: inline-flex; padding: .23rem .52rem; border: 1px solid rgba(158,125,113,.45); border-radius: 999px; background: var(--paper-soft); color: var(--ink); font-size: .72rem; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: .8rem 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact { min-width: 0; padding: .7rem .8rem; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact dt, .detail-grid dt { margin: 0 0 .1rem; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.fact dd, .detail-grid dd { margin: 0; overflow-wrap: anywhere; font-size: .84rem; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .85rem; }
.card-actions .button { min-height: 40px; padding: 8px 15px; font-size: .79rem; }
.feedback-actions { display: inline-flex; gap: .35rem; margin-left: auto; }
.icon-button { display: inline-flex; align-items: center; gap: .25rem; min-height: 40px; padding: .42rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-soft); color: var(--ink); font: inherit; font-size: .76rem; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--plum); }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .75rem; max-width: 980px; margin: 1rem auto 0; }
.pagination p { min-width: 7rem; margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }
.empty-state { max-width: 980px; margin: 0 auto; padding: 2rem; border-radius: 16px; text-align: center; }
.empty-state h3 { margin-top: 0; }

.submit-panel { max-width: 980px; margin: 2.4rem auto 0; padding: clamp(1.2rem,3vw,2rem); border-radius: 20px; box-shadow: var(--shadow); scroll-margin-top: 120px; }
.submit-panel > p:not(.eyebrow) { color: var(--muted); }
.submit-panel form { display: grid; gap: .8rem; }
.submit-panel .button { justify-self: start; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4em; margin: 0; color: var(--muted); font-size: .84rem; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--warning); }
.panel { padding: 1.1rem; border-radius: 16px; }
.panel p:last-child { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.api-docs code { overflow-wrap: anywhere; }
.api-docs pre { max-width: 100%; margin: 1rem 0 0; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; overflow-x: auto; }
.api-docs pre code { display: inline; white-space: inherit; overflow-wrap: inherit; word-break: inherit; }

.dialog { width: min(720px, calc(100% - 1rem)); max-height: min(86vh, 820px); padding: clamp(1rem,3vw,1.7rem); border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 24px 70px rgba(31,42,55,.35); overflow: auto; }
.dialog::backdrop { background: rgba(31,42,55,.68); }
.dialog-close { float: right; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); color: var(--ink); font: inherit; font-size: 1.5rem; cursor: pointer; }
.dialog h2 { margin-top: 0; line-height: 1.15; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem 1rem; margin: .9rem 0; padding: .9rem; border-radius: 12px; background: var(--paper-soft); }
.dialog form { display: grid; gap: .85rem; }
.capability-dialog { width: min(650px, calc(100% - 1rem)); }
.capability-notice { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-soft); }
.capability-notice p { margin: .35rem 0 0; color: var(--muted); }
.small-copy { color: var(--muted); font-size: .86rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.site-footer { width: 100%; margin-top: auto; padding: 28px 20px 22px; flex-shrink: 0; background: #51305a; color: #f4e9fc; font-size: 18px; text-align: center; }
.site-footer a { color: #9e7d71; }
.site-footer a:hover, .site-footer a:focus-visible { color: #f4e9fc; }

@media (max-width: 900px) {
  body { padding-top: 76px; }
  .nav { min-height: 76px; padding: 0 10px; }
  .logo-link, .logo { height: 70px; }
  .logo { max-width: 172px; }
  .brand-txt { height: 43px; max-width: 78px; }
  .brand-name { font-size: .855rem; }
  .brand-tagline { font-size: .6075rem; }
  .hamburger { display: flex; margin-left: auto; margin-right: 10px; }
  .site-header nav { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; max-height: 0; opacity: 0; pointer-events: none; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #51305a; box-shadow: var(--shadow); transition: max-height .2s, opacity .2s; }
  .site-header nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 7px 0; }
  .site-header nav a, .theme-toggle { display: block; width: 100%; text-align: left; font-size: 1.05rem; }
  #nav-toggle:checked ~ nav { max-height: calc(100svh - 90px); opacity: 1; pointer-events: auto; overflow-y: auto; overscroll-behavior: contain; }
  body:has(#nav-toggle:checked) { overflow: hidden; }
  #nav-toggle:checked + label .line1 { transform: translateY(8px) rotate(45deg); }
  #nav-toggle:checked + label .line2 { opacity: 0; }
  #nav-toggle:checked + label .line3 { transform: translateY(-8px) rotate(-45deg); }
  .secondary-filters { grid-template-columns: 1fr 1fr; }
  .search-behavior { grid-template-columns: 1fr; }
  .basic-search-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 22px 16px; }
}

@media (max-width: 680px) {
  .page { width: min(100% - 1rem,1120px); padding-top: 1.2rem; }
  .hero { margin-bottom: 1.4rem; text-align: left; }
  .hero h1 { font-size: 2.2rem; }
  .lede { margin-left: 0; }
  .hero-meta { justify-content: flex-start; }
  .filter-heading { align-items: flex-start; }
  .alignment-options { grid-template-columns: 1fr 1fr; }
  .search-style-options, .constellation-grid { grid-template-columns: 1fr; }
  .search-style-options label + label { border-left: 0; border-top: 1px solid var(--line); }
  .constellation-heading { display: grid; }
  .constellation-label { justify-self: start; }
  .alignment-options label:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .alignment-options label:nth-child(4) { border-top: 1px solid var(--line); }
  .primary-filters, .secondary-filters { grid-template-columns: 1fr; }
  .resource-card { padding: 1rem; }
  .card-heading { display: grid; }
  .alignment-badge { justify-self: start; }
  .facts { grid-template-columns: 1fr; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
  .feedback-actions { width: 100%; margin-left: 0; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media print {
  body { padding: 0; background: #fff; color: #111; }
  .site-header, .filter-panel, .site-footer, .card-actions, .pagination, .submit-panel { display: none !important; }
  .page { width: 100%; padding: 0; }
  .resource-card, .panel { box-shadow: none; break-inside: avoid; }
}
