:root {
  --surface: #ffffff;
  --soft: #f7f7f8;
  --ink: #101010;
  --muted: #6f6f73;
  --rule: #d9d9dc;
  --blue: #097e7c;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--surface); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: inherit; }
button, input { font: inherit; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  color: #fff;
  background: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
}

.sync-status { margin: 0; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
main { min-height: calc(100vh - 7.75rem); }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(16rem, 27vw);
  min-height: 7rem;
  border-bottom: 1px solid var(--rule);
}

.intro > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem clamp(1.25rem, 4vw, 4rem);
}

h1 { margin: 0; font-size: clamp(2rem, 3.2vw, 3.5rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.065em; }
.subtitle { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }

.service-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  min-width: 8rem;
  padding: 1rem 1.5rem;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  color: var(--blue);
}

.service-total strong { font-size: clamp(2.4rem, 4vw, 4rem); font-weight: 700; line-height: 1; letter-spacing: -0.08em; font-variant-numeric: tabular-nums; }
.service-total span { color: var(--ink); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.search {
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 3vw, 3rem);
  color: var(--muted);
  font-size: 0.75rem;
}

.search input { width: 100%; padding: 0.6rem 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: 0; color: var(--ink); background: transparent; }
.search input:focus { border-bottom: 3px solid var(--blue); }
.search input::placeholder { color: #99999d; }

.directory { padding: 0 clamp(1.25rem, 4vw, 4rem) clamp(3rem, 6vw, 6rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.service {
  position: relative;
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 10.5rem;
  padding: 1rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.service:hover, .service:focus-visible { z-index: 1; color: #fff; background: var(--blue); outline: 0; }
.service.is-disabled { opacity: 0.42; pointer-events: none; }

.icon-frame { position: relative; display: grid; place-items: center; width: 3.8rem; height: 3.8rem; margin-bottom: 1.15rem; overflow: hidden; border: 1px solid var(--rule); background: var(--soft); }
.service:hover .icon-frame, .service:focus-visible .icon-frame { border-color: rgba(255,255,255,.5); background: #fff; }
.service-icon { position: relative; z-index: 2; display: block; width: 2.55rem; height: 2.55rem; object-fit: contain; }
.service-icon[hidden], .icon-fallback[hidden] { display: none; }
.icon-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: var(--blue); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.08em; }

.service-copy { min-width: 0; display: grid; gap: 0.25rem; }
.service-name { overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; line-height: 1.15; white-space: nowrap; }
.service-domain { overflow: hidden; color: var(--muted); font-size: 0.65rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.service:hover .service-domain, .service:focus-visible .service-domain { color: rgba(255,255,255,.72); }
.service-state { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.65rem; color: var(--muted); font-size: 0.6rem; }
.service-state i { width: 0.4rem; height: 0.4rem; background: currentColor; border-radius: 50%; }
.service[data-state="online"] .service-state { color: var(--blue); }
.service:hover .service-state, .service:focus-visible .service-state { color: #fff; }

.notice, .empty { margin: 1rem 0; padding: 0.8rem 1rem; border-left: 4px solid var(--blue); background: var(--soft); font-size: 0.78rem; line-height: 1.4; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 2rem; min-height: 4.25rem; padding: 0 clamp(1.25rem, 4vw, 4rem); border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.72rem; }
footer p { margin: 0; }
footer button { padding: 0.45rem 0; border: 0; border-bottom: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; }
footer button:hover { color: var(--blue); border-color: var(--blue); }

@media (max-width: 680px) {
  .intro { grid-template-columns: auto minmax(0, 1fr); min-height: 0; }
  .intro > div:first-child { grid-column: 1 / -1; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--rule); }
  h1 { font-size: 2.1rem; }
  .subtitle { display: none; }
  .service-total { min-width: 6.5rem; padding: 0.65rem 1.25rem; border-left: 0; }
  .service-total strong { font-size: 2.25rem; }
  .service-total span { font-size: 0.58rem; }
  .search { grid-template-columns: auto 1fr; padding: 0.55rem 1.25rem; }
  .directory { padding-inline: 0.75rem; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service { min-height: 10rem; padding: 0.9rem; }
  .icon-frame { width: 3.5rem; height: 3.5rem; }
  footer { align-items: flex-start; padding-block: 1rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
