/* Banyan Software palette: Moss Green leads, Sky Blue accents, Charcoal for text. */
:root {
  --moss: #395542;
  --sky: #9bcbeb;
  --bg: #f7f8f7;
  --surface: #ffffff;
  --text: #414141;
  --heading: #2b3f31;
  --muted: #5f6661;
  --border: #e1e5e2;
  --border-strong: #c9d1cb;
  --link: #395542;
  --link-hover: #23362a;
  --hero-bg: #395542;
  --hero-text: #ffffff;
  --hero-muted: #d3e2d7;
  --field-bg: #ffffff;
  --field-text: #414141;
  --field-placeholder: #6b736d;
  --mark: #d6ebf8;
  --focus: #9bcbeb;
  --shadow: 0 1px 2px rgb(31 45 35 / 6%), 0 4px 12px rgb(31 45 35 / 6%);
  --shadow-hover: 0 2px 4px rgb(31 45 35 / 8%), 0 10px 24px rgb(31 45 35 / 10%);
  --skeleton: #eceeec;
  --skeleton-shine: #f6f7f6;
  --card-accent: #395542;
  --headline: "Libre Franklin", "Segoe UI", system-ui, sans-serif;
  --body: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121814;
    --surface: #1a221d;
    --text: #dfe6e1;
    --heading: #f1f5f2;
    --muted: #a3afa7;
    --border: #2a352e;
    --border-strong: #3a473f;
    --link: #9bcbeb;
    --link-hover: #c4e1f4;
    --hero-bg: #22352a;
    --hero-text: #ffffff;
    --hero-muted: #b9cbbf;
    --field-bg: #121814;
    --field-text: #eef2ef;
    --field-placeholder: #93a198;
    --mark: rgb(155 203 235 / 28%);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-hover: 0 4px 16px rgb(0 0 0 / 45%);
    --skeleton: #212a24;
    --skeleton-shine: #29332c;
    --card-accent: #5d8a6b;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--body);
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--headline);
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--link);
  border-radius: 6px;
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* Header: the brand band with search as its centre of attention. */

.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 44px 0 40px;
}

.hero .brand {
  margin: 0 0 6px;
  font: 600 13px/1 var(--headline);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.1;
  color: var(--hero-text);
}

.hero .lede {
  margin: 10px 0 26px;
  max-width: 40em;
  font-weight: 300;
  font-size: 19px;
  color: var(--hero-muted);
}

.search {
  position: relative;
  max-width: 720px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--moss);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

#search {
  width: 100%;
  height: 58px;
  padding: 0 56px 0 52px;
  font: 400 18px var(--body);
  color: var(--field-text);
  background: var(--field-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 18%);
  -webkit-appearance: none;
  appearance: none;
}
#search::placeholder { color: var(--field-placeholder); }
#search:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-color: var(--sky); }
#search:disabled { opacity: 0.85; cursor: progress; }

.search kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 26px;
  padding: 2px 8px;
  font: 600 13px/20px var(--body);
  text-align: center;
  color: var(--field-placeholder);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}
#search:focus + kbd, #search:not(:placeholder-shown) + kbd { display: none; }

.search-status {
  min-height: 1.4em;
  margin: 10px 2px 0;
  font-size: 14px;
  color: var(--hero-muted);
}

@media (prefers-color-scheme: dark) {
  .search-icon { stroke: var(--sky); }
  #search { border-color: var(--border-strong); }
}

/* Sections */

main { flex: 1; padding-top: 12px; padding-bottom: 56px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 36px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; font-size: 22px; }

.count {
  font-size: 14px;
  color: var(--muted);
}

/* Site cards */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--card-accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-top-color: var(--sky); }
.card:focus-within { border-top-color: var(--sky); }

.card h3 { margin: 0; font-size: 19px; line-height: 1.3; }

.card-link { color: var(--heading); text-decoration: none; }
.card-link:hover { color: var(--heading); text-decoration: underline; }
/* The title's link covers the whole card; the repository link sits above it. */
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }

.host {
  margin: 2px 0 10px;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.description {
  flex: 1;
  margin: 0 0 16px;
  font-weight: 300;
  color: var(--text);
}

.repo {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.repo:hover { text-decoration: underline; }

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Isozones */

.isozone { margin-bottom: 32px; }

.isozone-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.isozone-head h3 { margin: 0; font-size: 18px; }
.isozone-head a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.isozone-head a:hover { text-decoration: underline; }
.isozone-head .icon { width: 16px; height: 16px; }

/* Search results */

.results { margin-bottom: 8px; }

#result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.result {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.result:first-child { border-top: none; }

.result a {
  font: 600 18px/1.35 var(--headline);
  text-decoration: none;
}
.result a:hover { text-decoration: underline; }

.result .site {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.excerpt { margin: 4px 0 0; font-weight: 300; }

mark {
  background: var(--mark);
  color: inherit;
  font-weight: 600;
  border-radius: 3px;
  padding: 0 2px;
}

/* Empty and loading states */

.empty {
  grid-column: 1 / -1;
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}
#result-list .empty { border: none; }
.empty p { margin: 0; }
.empty .empty-title {
  margin-bottom: 4px;
  font: 600 17px var(--headline);
  color: var(--heading);
}

.skeleton { gap: 12px; border-top-color: var(--border-strong); }
.skeleton:hover { transform: none; box-shadow: var(--shadow); border-top-color: var(--border-strong); }
.skeleton span {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 50%, var(--skeleton) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton span:nth-child(1) { width: 55%; height: 20px; }
.skeleton span:nth-child(2) { width: 90%; }
.skeleton span:nth-child(3) { width: 35%; margin-top: 12px; }

@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .skeleton span { animation: none; }
  .card { transition: none; }
  .card:hover { transform: none; }
}

.footer {
  padding-top: 20px;
  padding-bottom: 28px;
  font-size: 14px;
  color: var(--muted);
  /* A rule the width of the content, inside the side padding. */
  background: linear-gradient(var(--border), var(--border)) no-repeat center top / calc(100% - 48px) 1px;
}

/* Phone width */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .footer { background-size: calc(100% - 32px) 1px; }
  .hero { padding: 28px 0 24px; }
  .hero .lede { font-size: 17px; margin-bottom: 20px; }
  #search { height: 52px; font-size: 17px; padding-right: 16px; }
  .search kbd { display: none; }
  .section-head { margin-top: 28px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px 18px 14px; }
  .result { padding: 14px 16px; }
}
