:root {
  color-scheme: dark;
  --ink: #eaf3ff;
  --muted: #8ea1b8;
  --panel: rgba(12, 28, 47, 0.86);
  --panel-hover: rgba(18, 41, 67, 0.96);
  --line: rgba(132, 184, 226, 0.18);
  --cyan: #55d8ff;
  --amber: #ffc857;
  --bg: #07111f;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 8%, rgba(31, 126, 168, 0.18), transparent 33rem),
    linear-gradient(rgba(85, 216, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 216, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: Inter, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 44%, rgba(85,216,255,.025) 44% 44.2%, transparent 44.2%);
}

a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; gap: 14px; align-items: center; text-decoration: none; }
.brand strong, h1, .card-title { font-family: "Barlow Condensed", Impact, sans-serif; text-transform: uppercase; }
.brand strong { display: block; font-size: 1.18rem; letter-spacing: .12em; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; letter-spacing: .18em; }

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 9px rgba(85,216,255,.28));
}

.system-status { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .15em; }
.status-light { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #66e49e; box-shadow: 0 0 10px #66e49e; }

main { padding: 64px 0 72px; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 6px; color: var(--cyan); font-size: .72rem; font-weight: 700; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(2.8rem, 7vw, 5.5rem); line-height: .88; letter-spacing: -.025em; }

.search-box { width: min(340px, 100%); height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); background: rgba(6, 17, 31, .8); }
.search-box:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(85,216,255,.08); }
.search-box > span { color: var(--cyan); font-size: 1.4rem; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; }
.search-box input::placeholder { color: #667b92; }
kbd { padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); background: #0a1828; font: 600 .72rem Inter, sans-serif; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  position: relative;
  min-height: 284px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel), rgba(8,21,37,.86));
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.tool-card::after { content: ""; position: absolute; right: -45px; bottom: -70px; width: 180px; height: 180px; border: 1px solid rgba(85,216,255,.13); transform: rotate(45deg); }
.tool-card:hover, .tool-card:focus-visible { transform: translateY(-4px); border-color: rgba(85,216,255,.7); background: linear-gradient(145deg, var(--panel-hover), rgba(9,26,44,.98)); outline: none; }
.tool-card:focus-visible { box-shadow: 0 0 0 3px rgba(85,216,255,.15); }
.card-index { align-self: flex-end; color: #516a81; font: 700 .72rem Inter, sans-serif; letter-spacing: .12em; }
.card-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 14px 0 28px; border: 1px solid rgba(85,216,255,.38); color: var(--cyan); background: rgba(85,216,255,.06); font-size: 1.6rem; }
.card-copy { display: flex; flex-direction: column; }
.card-category { margin-bottom: 5px; color: var(--amber); font-size: .68rem; font-weight: 700; letter-spacing: .17em; }
.card-title { font-size: 1.75rem; line-height: 1; letter-spacing: .01em; }
.card-description { max-width: 27ch; margin-top: 11px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.card-action { position: relative; z-index: 1; margin-top: auto; padding-top: 25px; color: var(--cyan); font-size: .68rem; font-weight: 700; letter-spacing: .18em; }
.card-action b { margin-left: 5px; font-size: 1rem; }
.empty-state { padding: 56px 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

footer { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: #6f8298; font-size: .75rem; }
code { color: #a9c2da; }

@media (max-width: 820px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .directory-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 86px; }
  .brand small, .system-status { display: none; }
  main { padding: 44px 0 52px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 245px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
}
