:root {
  color-scheme: light;
  --page: #f3f5f7;
  --surface: #fbfcfd;
  --surface-strong: #ffffff;
  --surface-muted: #e9edf1;
  --ink: #15191f;
  --ink-subtle: #555f6c;
  --ink-muted: #737d89;
  --line: #d4dae1;
  --line-strong: #b9c2cc;
  --accent: #2f63dd;
  --accent-strong: #214eb9;
  --accent-soft: #e1e9fb;
  --focus: #0d4fd6;
  --shadow: 0 18px 50px rgb(32 48 68 / 0.08);
  --radius-card: 18px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --content-width: 1240px;
  font-family:
    "Avenir Next", Avenir, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111418;
  --surface: #171b20;
  --surface-strong: #1d2228;
  --surface-muted: #242a31;
  --ink: #eff2f5;
  --ink-subtle: #b3bcc6;
  --ink-muted: #89939f;
  --line: #303741;
  --line-strong: #46505c;
  --accent: #79a0ff;
  --accent-strong: #a8c0ff;
  --accent-soft: #202d4c;
  --focus: #94b3ff;
  --shadow: 0 20px 60px rgb(0 0 0 / 0.24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111418;
    --surface: #171b20;
    --surface-strong: #1d2228;
    --surface-muted: #242a31;
    --ink: #eff2f5;
    --ink-subtle: #b3bcc6;
    --ink-muted: #89939f;
    --line: #303741;
    --line-strong: #46505c;
    --accent: #79a0ff;
    --accent-strong: #a8c0ff;
    --accent-soft: #202d4c;
    --focus: #94b3ff;
    --shadow: 0 20px 60px rgb(0 0 0 / 0.24);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 84% 6%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 30rem),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px);
  background-size: auto, 88px 100%;
  mask-image: linear-gradient(to bottom, black, transparent 48rem);
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--page);
  transform: translateY(-160%);
}

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

.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;
}

.site-header {
  width: min(calc(100% - 32px), var(--content-width));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--page);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.15;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.command-button,
.theme-control select,
.filter-button,
.visibility-filter select,
.secondary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.command-button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0 10px 0 14px;
  cursor: pointer;
}

.command-button:hover,
.theme-control select:hover,
.visibility-filter select:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

kbd {
  min-width: 24px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--ink-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-align: center;
}

.theme-control select {
  padding: 0 34px 0 12px;
  color: var(--ink-subtle);
  cursor: pointer;
}

main {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
}

.overview {
  min-height: min(700px, calc(100dvh - 72px));
  padding: 84px 0 78px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
}

.overview-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 11em;
  margin-bottom: 28px;
  font-size: clamp(44px, 6.7vw, 84px);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 1.06;
}

.overview-copy > p:last-child {
  max-width: 37em;
  margin-bottom: 0;
  color: var(--ink-subtle);
  font-size: clamp(16px, 2vw, 19px);
}

.overview-panel {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--shadow);
}

.overview-panel::before {
  position: absolute;
  top: 0;
  left: 28px;
  width: 72px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
  content: "";
}

.primary-metric {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 26px;
  border-bottom: 1px solid var(--line);
}

.primary-metric span {
  color: var(--ink-subtle);
  font-size: 13px;
}

.primary-metric strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.metric-list {
  margin: 0;
  padding: 12px 0;
  display: grid;
}

.metric-list div {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.metric-list dt {
  color: var(--ink-subtle);
  font-size: 14px;
}

.metric-list dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 700;
}

.overview-note {
  margin: 8px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.workspace {
  scroll-margin-top: 24px;
  padding: 76px 0 96px;
  border-top: 1px solid var(--line);
}

.workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: end;
  gap: 40px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.workspace-heading p,
.next-actions > div p {
  margin-bottom: 0;
  color: var(--ink-subtle);
}

.search-field {
  display: grid;
  gap: 8px;
}

.search-field label,
.visibility-filter span {
  color: var(--ink-subtle);
  font-size: 12px;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-strong);
  color: var(--ink);
}

.search-field input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.filter-bar {
  margin-top: 36px;
  padding: 18px 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  padding: 0 14px;
  color: var(--ink-subtle);
  cursor: pointer;
}

.filter-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.filter-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

.visibility-filter {
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
}

.visibility-filter select {
  min-width: 140px;
  padding: 0 34px 0 12px;
  color: var(--ink);
}

.results-summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

.results-summary strong {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.service-card {
  min-height: 380px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.service-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  transform: translateY(-2px);
}

.service-card.is-featured {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 74%, var(--surface)) 0%, var(--surface) 58%);
}

.service-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
}

.service-category {
  letter-spacing: 0.04em;
}

.service-visibility {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
}

.service-card-body {
  padding: 36px 0 30px;
}

.service-card h3 {
  margin-bottom: 14px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.service-description {
  max-width: 38em;
  margin-bottom: 0;
  color: var(--ink-subtle);
  font-size: 14px;
}

.service-meta {
  margin: auto 0 0;
  padding: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  border-top: 1px solid var(--line);
}

.service-meta div {
  min-width: 0;
}

.service-meta dt {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}

.service-meta dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-subtle);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-domain {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.service-actions {
  min-height: 46px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  padding: 0 20px;
  background: var(--accent);
  color: #ffffff;
}

:root[data-theme="dark"] .primary-button {
  color: #111827;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .primary-button {
    color: #111827;
  }
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:active,
.secondary-button:active,
.command-button:active,
.filter-button:active {
  transform: translateY(1px);
}

.local-note {
  color: var(--ink-muted);
  font-size: 12px;
}

.empty-state,
.error-state {
  padding: 54px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.empty-state p,
.error-state p {
  margin-bottom: 22px;
  color: var(--ink-subtle);
}

.secondary-button {
  padding: 0 18px;
  cursor: pointer;
}

.next-actions {
  padding: 82px 0 100px;
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(48px, 8vw, 120px);
  border-top: 1px solid var(--line);
}

.next-actions ol {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
  counter-reset: next-actions;
}

.next-actions li {
  min-height: 94px;
  padding: 20px 0 20px 58px;
  position: relative;
  display: grid;
  align-content: center;
  border-bottom: 1px solid var(--line);
  counter-increment: next-actions;
}

.next-actions li:first-child {
  border-top: 1px solid var(--line);
}

.next-actions li::before {
  position: absolute;
  left: 0;
  top: 25px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-subtle);
  content: counter(next-actions);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

.next-actions li strong {
  font-size: 15px;
}

.next-actions li span {
  margin-top: 3px;
  color: var(--ink-subtle);
  font-size: 13px;
}

footer {
  width: min(calc(100% - 32px), var(--content-width));
  min-height: 110px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--ink-subtle);
  text-underline-offset: 4px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .overview {
    min-height: auto;
    padding: 64px 0 72px;
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .overview-panel {
    max-width: 520px;
  }

  .workspace-heading,
  .next-actions {
    grid-template-columns: 1fr;
  }

  .workspace-heading {
    align-items: stretch;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .visibility-filter select {
    width: 100%;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .next-actions {
    gap: 38px;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  footer {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .site-header {
    min-height: 64px;
  }

  .brand small,
  .command-button span,
  .theme-control select {
    display: none;
  }

  .theme-control::after {
    min-width: 42px;
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    content: "Aa";
    color: var(--ink-subtle);
    font-size: 12px;
    font-weight: 700;
  }

  .theme-control {
    position: relative;
  }

  .theme-control select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
  }

  .command-button {
    gap: 0;
    padding: 0 9px;
  }

  .overview {
    padding-top: 54px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 56px);
  }

  .overview-panel,
  .service-card {
    padding: 20px;
  }

  .filter-group {
    flex-wrap: nowrap;
    padding-bottom: 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .filter-button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .service-card {
    min-height: 0;
  }

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

  .domain-row {
    grid-column: 1 / -1;
  }

  .service-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  footer {
    padding: 28px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .command-button,
  .theme-control select,
  .overview-panel {
    background: var(--surface-strong);
  }
}
