:root {
  color-scheme: light;
  --brand: #008752;
  --brand-strong: #006b41;
  --brand-bright: #00a765;
  --brand-soft: #e8f6ef;
  --brand-wash: #f2fbf6;
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #f8faf9;
  --ink: #111713;
  --ink-soft: #26332b;
  --muted: #657269;
  --muted-strong: #4d5c53;
  --border: #dbe4de;
  --border-strong: #c8d5cd;
  --focus: #006b41;
  --shadow-sm: 0 1px 2px rgba(16, 35, 24, 0.05);
  --shadow-md: 0 16px 42px rgba(15, 44, 28, 0.09);
  --shadow-card: 0 12px 32px rgba(18, 52, 32, 0.08);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shell: 1180px;
  --header-height: 76px;
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #42d997;
  --brand-strong: #78e8b5;
  --brand-bright: #42d997;
  --brand-soft: #153a2a;
  --brand-wash: #10251a;
  --canvas: #09110d;
  --surface: #111b16;
  --surface-raised: #15211b;
  --surface-subtle: #0d1712;
  --ink: #f0f7f3;
  --ink-soft: #d4e2da;
  --muted: #9fb0a6;
  --muted-strong: #bdccc3;
  --border: #27352e;
  --border-strong: #35473d;
  --focus: #78e8b5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.26);
  --shadow-card: 0 16px 38px rgba(0, 0, 0, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #42d997;
    --brand-strong: #78e8b5;
    --brand-bright: #42d997;
    --brand-soft: #153a2a;
    --brand-wash: #10251a;
    --canvas: #09110d;
    --surface: #111b16;
    --surface-raised: #15211b;
    --surface-subtle: #0d1712;
    --ink: #f0f7f3;
    --ink-soft: #d4e2da;
    --muted: #9fb0a6;
    --muted-strong: #bdccc3;
    --border: #27352e;
    --border-strong: #35473d;
    --focus: #78e8b5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.26);
    --shadow-card: 0 16px 38px rgba(0, 0, 0, 0.22);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 30rem),
    var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--canvas);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: var(--header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
}

.header-inner,
.header-actions,
.footer-inner,
.search-meta,
.directory-heading {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: var(--header-height);
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 780;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-company {
  color: var(--brand);
  letter-spacing: 0.015em;
}

.brand-separator {
  color: var(--border-strong);
  font-weight: 400;
}

.brand-product {
  font-weight: 690;
}

.header-actions {
  gap: 10px;
}

.utility-button,
.theme-button,
.clear-search,
.no-results button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.utility-button {
  padding: 0 16px;
}

.theme-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 90px;
  justify-content: center;
  padding: 0 14px;
}

.theme-indicator {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  overflow: hidden;
}

.theme-indicator::after {
  position: absolute;
  inset: -2px -2px -2px 50%;
  border-left: 2px solid currentColor;
  background: currentColor;
  content: "";
}

.utility-button:hover,
.theme-button:hover,
.clear-search:hover,
.no-results button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 8vw, 108px) 0 56px;
}

.hero::before {
  position: absolute;
  z-index: -1;
  width: 480px;
  height: 480px;
  top: -280px;
  right: max(-180px, calc((100vw - var(--shell)) / 2 - 280px));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 56px color-mix(in srgb, var(--brand) 4%, transparent),
    0 0 0 112px color-mix(in srgb, var(--brand) 3%, transparent);
  content: "";
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(32px, 8vw, 112px);
}

.hero-copy {
  max-width: 790px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 6.15rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

h1 span {
  color: var(--brand);
}

.hero-description {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: clamp(1rem, 2vw, 1.17rem);
  line-height: 1.7;
}

.hero-metric {
  display: grid;
  min-width: 180px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.metric-number {
  color: var(--brand);
  font-size: 3.5rem;
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 1;
}

.metric-label {
  margin-top: 10px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.search-panel {
  margin-top: 52px;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.search-panel > label {
  display: block;
  margin: 0 4px 8px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-control input {
  width: 100%;
  min-width: 0;
  padding: 5px 4px 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  font-weight: 600;
}

.search-control input::placeholder {
  color: color-mix(in srgb, var(--muted) 76%, transparent);
  opacity: 1;
}

.search-panel:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent), var(--shadow-card);
}

.search-shortcut {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 750;
  white-space: nowrap;
}

.clear-search {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
}

.search-meta {
  justify-content: space-between;
  gap: 24px;
  padding: 10px 4px 0;
  border-top: 1px solid var(--border);
}

.search-meta p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.directory {
  padding: 44px 0 92px;
}

.directory-heading {
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 22px;
}

.directory-heading .section-kicker {
  margin-bottom: 5px;
}

.directory-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.045em;
}

.source-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.source-note span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent);
}

.categories {
  display: grid;
  gap: 14px;
}

.tool-category {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-sm);
}

.tool-category h3 {
  margin: 0;
}

.category-toggle {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 54px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.category-toggle:hover {
  background: color-mix(in srgb, var(--surface) 88%, var(--brand-soft));
}

.category-index {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.category-name {
  overflow: hidden;
  font-size: 1.08rem;
  font-weight: 740;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.category-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 180ms ease;
}

.category-toggle[aria-expanded="false"] .category-chevron {
  transform: rotate(-45deg) translate(-1px, -1px);
}

.category-panel {
  padding: 18px;
  border-top: 1px solid var(--border);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tool-card {
  display: flex;
  min-height: 224px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tool-card:hover {
  border-color: color-mix(in srgb, var(--brand) 70%, var(--border));
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.tool-top,
.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-type {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.external-mark {
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 700;
  transition: color 160ms ease, transform 160ms ease;
}

.tool-card:hover .external-mark {
  color: var(--brand);
  transform: translate(2px, -2px);
}

.tool-name {
  margin-top: 21px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.tool-description {
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  line-height: 1.62;
}

.tool-meta {
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.tool-meta span:first-child {
  color: var(--muted-strong);
}

.no-results {
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  text-align: center;
}

.no-results p {
  margin-bottom: 18px;
  color: var(--muted-strong);
  font-weight: 700;
}

.no-results button {
  padding: 0 18px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.footer-inner {
  min-height: 100px;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.footer-inner p:first-child {
  color: var(--brand-strong);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.noscript {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: 16px;
  left: 16px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--muted-strong);
  font-size: 0.8rem;
  text-align: center;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.category-toggle:focus-visible {
  position: relative;
  z-index: 2;
  outline-offset: -4px;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-metric {
    display: flex;
    width: fit-content;
    min-width: 0;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
  }

  .metric-number {
    font-size: 2.8rem;
  }

  .metric-label {
    margin-top: 0;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  :root {
    --header-height: 68px;
  }

  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .header-inner {
    gap: 12px;
  }

  .brand {
    gap: 6px;
    font-size: 1rem;
  }

  .utility-button {
    display: none;
  }

  .theme-button {
    min-width: 82px;
    min-height: 38px;
    padding: 0 12px;
  }

  .hero {
    padding: 52px 0 38px;
  }

  .hero::before {
    width: 340px;
    height: 340px;
    top: -230px;
    right: -190px;
  }

  h1 {
    margin-bottom: 20px;
    font-size: clamp(2.55rem, 14vw, 4rem);
    line-height: 0.96;
  }

  .hero-description {
    font-size: 0.98rem;
  }

  .hero-metric {
    width: 100%;
  }

  .search-panel {
    margin-top: 34px;
    padding: 12px 13px 10px;
  }

  .search-shortcut {
    display: none;
  }

  .search-meta {
    gap: 10px;
  }

  #searchHint {
    display: none;
  }

  .directory {
    padding: 34px 0 64px;
  }

  .directory-heading {
    align-items: flex-end;
  }

  .source-note {
    max-width: 130px;
    font-size: 0.69rem;
    text-align: right;
  }

  .category-toggle {
    min-height: 68px;
    grid-template-columns: 36px minmax(0, 1fr) 14px;
    gap: 12px;
    padding: 0 16px;
  }

  .category-count {
    display: none;
  }

  .category-name {
    font-size: 0.98rem;
  }

  .category-panel {
    padding: 10px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .tool-card {
    min-height: 200px;
    padding: 19px;
  }

  .footer-inner {
    min-height: 112px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
  }
}

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