:root {
  color-scheme: light;
  --paper: #f7f5f1;
  --white: #fff;
  --ink: #211b27;
  --muted: #584f61;
  --purple: #522d80;
  --deep: #2e1a47;
  --line: #ded7e5;
  --orange: #f56600;
  --ring: #a34110;
  --radius: 12px;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; }

.wrap { width: min(1060px, calc(100% - 64px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 16px;
  background: var(--white);
}
.skip-link:focus { transform: none; }

.site-header { background: var(--deep); color: var(--white); border-bottom: 1px solid #62477e; }
.header-inner { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 150px; height: auto; }
.site-header nav a { display: block; font-weight: 650; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-header nav span { margin-inline-start: 3px; color: #eadcf5; }

.hero {
  color: var(--white);
  background: linear-gradient(114deg, var(--deep) 0%, #432464 64%, var(--purple) 100%);
}
.hero-inner { padding-block: clamp(48px, 7.5vw, 90px) clamp(43px, 6vw, 72px); }
.hero h1, .section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.038em;
}
.hero h1 { font-size: clamp(2.65rem, 7vw, 5.1rem); }
.hero p { margin: 16px 0 25px; color: #eee4f4; max-width: 34rem; font-size: clamp(1rem, 2.5vw, 1.15rem); }

.search-form { display: flex; align-items: stretch; gap: 8px; max-width: 690px; }
.search-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
  min-height: 56px;
  border-radius: 9px;
  padding-inline: 16px 6px;
  background: var(--white);
  color: var(--ink);
}
.search-field:focus-within { outline: 3px solid #ffe0bb; outline-offset: 4px; }
.search-icon { display: block; width: 15px; height: 15px; flex: 0 0 auto; border: 2px solid var(--purple); border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; width: 7px; height: 2px; right: -5px; bottom: -3px; transform: rotate(45deg); background: var(--purple); border-radius: 1px; }
.search-field input { min-width: 0; width: 100%; border: 0; padding: 12px 2px; background: transparent; color: inherit; outline: 0; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field input::placeholder { opacity: 1; color: var(--muted); }
.clear { flex: 0 0 38px; height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--purple); font-size: 1.35rem; line-height: 1; }
.clear:hover { background: #f3edf8; }
.submit { padding-inline: 26px; border: 0; border-radius: 9px; color: #261435; background: var(--orange); font-weight: 750; }
.submit:hover { background: #ff8736; }
.submit:focus-visible, .examples button:focus-visible, .site-header a:focus-visible { outline-color: #ffe0bb; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 17px; color: #eee4f4; font-size: .84rem; }
.examples > span { margin-inline-end: 4px; }
.examples button { padding: 6px 12px; border: 1px solid #a58ebd; border-radius: 30px; color: var(--white); background: #553775; font-size: .81rem; line-height: 1.4; }
.examples button:hover { background: #6d4b91; border-color: #e0c7f4; }

.main-content { min-height: 300px; padding-block: clamp(32px, 5vw, 57px) 64px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; justify-content: space-between; margin-bottom: 23px; }
.section-heading h2 { font-size: clamp(2.1rem, 5vw, 3rem); }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.directory-section { scroll-margin-top: 24px; }
.results-section:not([hidden]) + .directory-section { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); }
.site-group + .site-group { margin-top: 32px; }
.group-title { margin: 0 0 10px; color: var(--purple); font-size: .82rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.site-card {
  padding: 15px 19px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  min-width: 0;
  min-height: 87px;
}
.site-name { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.site-name a { display: inline; text-decoration: none; text-underline-offset: 3px; }
.site-name a:hover, .result-title a:hover { color: var(--purple); text-decoration: underline; }
.site-meta, .site-summary { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.site-summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  list-style: none;
  min-height: 27px;
  border-radius: 4px;
}
.site-summary::-webkit-details-marker { display: none; }
.site-summary::after { content: "+"; color: var(--purple); font-size: 1.2rem; font-weight: 550; line-height: 1; }
.site-details[open] .site-summary::after { content: "−"; }
.site-summary:hover { color: var(--purple); }
.legacy-heading { margin: 15px 0 3px; font-size: .85rem; color: var(--ink); }
.page-links { margin: 9px 0 2px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.page-links a { display: block; padding: 8px 0; color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: .89rem; }
.page-links li + li { border-top: 1px solid #eeebf0; }
.page-links a:hover { color: var(--deep); }

.results-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.view-toggle { display: inline-flex; border-radius: 7px; }
.view-toggle button { min-height: 36px; padding: 5px 12px; border: 1px solid #b8a9c8; background: var(--white); color: var(--purple); font-size: .82rem; font-weight: 700; }
.view-toggle button:first-child { border-radius: 7px 0 0 7px; }
.view-toggle button:last-child { margin-inline-start: -1px; border-radius: 0 7px 7px 0; }
.view-toggle button[aria-pressed="true"] { position: relative; border-color: var(--purple); color: var(--white); background: var(--purple); }
.view-toggle button:focus-visible { z-index: 1; }
.results-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.result-card { display: flex; align-items: center; gap: 17px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.result-content { min-width: 0; overflow-wrap: anywhere; }
.result-image {
  flex: 0 0 clamp(95px, 22vw, 200px);
  aspect-ratio: 16 / 10;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #f3edf8;
  color: var(--purple);
}
.result-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.result-image img.site-image { padding: clamp(6px, 1.2vw, 15px); }
.result-image[data-site="home"] .site-image { background: var(--deep); }
.result-image.has-image img { opacity: 1; }
.image-fallback { text-align: center; font-size: .7rem; font-weight: 700; line-height: 1.25; padding: 8px; }
.result-site { margin: 0 0 3px; color: var(--purple); font-size: .8rem; font-weight: 650; }
.result-title { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.result-title a { text-decoration: none; text-underline-offset: 3px; }
.excerpt { margin: 5px 0 0; font-size: .88rem; color: var(--muted); max-width: 63ch; }
.results-list[data-view="compact"] { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.results-list[data-view="compact"]:empty { border: 0; }
.results-list[data-view="compact"] .result-card { border: 0; border-radius: 0; background: transparent; padding: 11px 16px; }
.results-list[data-view="compact"] .result-card + .result-card { border-top: 1px solid var(--line); }
.load-state, .no-results { margin: 0; padding: 17px 19px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: var(--white); }
.no-results a { color: var(--purple); text-underline-offset: 3px; }
.page-footer { border-top: 1px solid var(--line); padding-block: 22px; color: var(--purple); font-size: .88rem; }
.page-footer a { text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; }
  .brand img { width: 118px; }
  .search-field { padding-inline-start: 12px; min-height: 52px; }
  .submit { padding-inline: 17px; }
  .site-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .site-card { padding-inline: 16px; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 2.4rem; }
  .result-card { gap: 11px; padding: 10px; }
  .result-image { flex-basis: 88px; }
}
