:root {
  color-scheme: light;
  font-family:
    Inter,
    "Noto Sans JP",
    "Yu Gothic UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: #1f2925;
  background: #edf0eb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 5%, rgb(255 255 255 / 88%), transparent 28rem),
    linear-gradient(135deg, #edf1eb 0%, #f5f0e8 100%);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: #fff;
  background: #1f2925;
  transform: translateY(-110%);
}

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

.site-header,
main,
body > footer {
  width: min(80rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
.site-header nav,
.brand,
body > footer {
  display: flex;
  align-items: center;
}

.site-header {
  min-height: 3.8rem;
  justify-content: space-between;
  border-bottom: 1px solid rgb(31 41 37 / 11%);
}

.site-header nav {
  gap: 1rem;
  color: #67716d;
  font-size: 0.76rem;
}

.brand {
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand > span {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  color: #fff;
  background: #355e51;
  border-radius: 0.55rem 0.55rem 0.55rem 0.1rem;
  font-size: 0.78rem;
  place-items: center;
}

.route-intro {
  display: flex;
  min-height: 6.8rem;
  padding: 1.25rem 0.25rem;
  gap: 1rem;
  align-items: center;
}

.route-intro h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.route-intro p {
  margin: 0.35rem 0 0;
  color: #66716c;
  font-size: 0.82rem;
  line-height: 1.55;
}

.route-symbol {
  position: relative;
  display: flex;
  width: 5.3rem;
  height: 2rem;
  align-items: center;
  justify-content: space-between;
}

.route-symbol::before {
  position: absolute;
  right: 0.8rem;
  left: 0.8rem;
  height: 2px;
  background: linear-gradient(90deg, #355e51, #d08b3f);
  content: "";
}

.route-symbol i {
  z-index: 1;
  width: 0.86rem;
  height: 0.86rem;
  background: #fff;
  border: 3px solid #355e51;
  border-radius: 50%;
}

.route-symbol i:nth-child(2) {
  border-color: #7c5fc4;
}

.route-symbol i:nth-child(3) {
  border-color: #d08b3f;
}

.route-workspace {
  display: grid;
  overflow: hidden;
  min-height: 43rem;
  background: rgb(255 255 255 / 75%);
  border: 1px solid rgb(31 41 37 / 12%);
  border-radius: 1.1rem;
  box-shadow: 0 1.3rem 4rem rgb(61 62 48 / 9%);
  grid-template-columns: minmax(17.5rem, 0.7fr) minmax(0, 1.65fr);
}

.route-builder {
  position: relative;
  padding: 1.35rem;
  background: #f9faf6;
  border-right: 1px solid rgb(31 41 37 / 10%);
}

.route-builder::before {
  position: absolute;
  top: 5.6rem;
  bottom: 7.8rem;
  left: 2.11rem;
  width: 1px;
  background: #ccd3ce;
  content: "";
}

.builder-heading,
.results-heading,
.server-card-heading,
.server-meta,
.server-stats,
.server-actions,
.compare-dock > header,
.compare-dock > header > div,
.compare-item > div,
.toggle-row {
  display: flex;
  align-items: center;
}

.builder-heading {
  min-height: 2.5rem;
  justify-content: space-between;
  font-size: 0.82rem;
}

.builder-heading button,
.compare-dock > header button {
  padding: 0;
  color: #718079;
  background: transparent;
  border: 0;
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.route-step {
  position: relative;
  z-index: 1;
  margin: 1rem 0 0;
  padding: 0 0 1.4rem 2.6rem;
  border: 0;
}

.route-step legend {
  width: 100%;
  margin: 0 0 0.8rem -2.6rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 820;
}

.route-step legend > span {
  display: inline-grid;
  width: 1.55rem;
  height: 1.55rem;
  margin-right: 0.55rem;
  color: #fff;
  background: #355e51;
  border: 3px solid #f9faf6;
  border-radius: 50%;
  font-size: 0.64rem;
  outline: 1px solid #b9c3bd;
  place-items: center;
}

.purpose-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.purpose-choices button {
  display: flex;
  min-height: 3.25rem;
  padding: 0.55rem;
  gap: 0.45rem;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 1px solid #d7ddd8;
  border-radius: 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
}

.purpose-choices button > span {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  color: #45675d;
  background: #edf2ef;
  border-radius: 0.48rem;
  font-size: 0.75rem;
  place-items: center;
}

.purpose-choices button[data-selected="true"] {
  background: #e7f0eb;
  border-color: #355e51;
  box-shadow: inset 0 0 0 1px #355e51;
}

.purpose-choices button[data-selected="true"] > span {
  color: #fff;
  background: #355e51;
}

.segment-control {
  display: grid;
  padding: 0.22rem;
  background: #e9ede9;
  border-radius: 0.65rem;
  grid-template-columns: repeat(3, 1fr);
}

.segment-control button {
  min-height: 2.25rem;
  padding: 0.4rem 0.25rem;
  background: transparent;
  border: 0;
  border-radius: 0.48rem;
  font-size: 0.68rem;
  font-weight: 720;
}

.segment-control button[data-selected="true"] {
  background: #fff;
  box-shadow: 0 1px 5px rgb(31 41 37 / 12%);
}

.final-step {
  padding-bottom: 0.5rem;
}

.toggle-row {
  min-height: 3.3rem;
  padding: 0.65rem 0.7rem;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #d7ddd8;
  border-radius: 0.65rem;
}

.toggle-row > span {
  display: grid;
  gap: 0.14rem;
  font-size: 0.71rem;
}

.toggle-row small {
  color: #7b8580;
  font-size: 0.61rem;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-row > i {
  position: relative;
  width: 2.15rem;
  height: 1.25rem;
  background: #aeb8b3;
  border-radius: 999px;
  transition: background 140ms ease;
}

.toggle-row > i::after {
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 0.89rem;
  height: 0.89rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(31 41 37 / 25%);
  content: "";
  transition: transform 140ms ease;
}

.toggle-row input:checked + i {
  background: #355e51;
}

.toggle-row input:checked + i::after {
  transform: translateX(0.9rem);
}

.route-key {
  display: flex;
  margin: 1.3rem 0 0 2.6rem;
  gap: 0.8rem;
  color: #74807a;
  font-size: 0.62rem;
}

.dot {
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.25rem;
  background: #a3ada8;
  border-radius: 50%;
}

.dot.open {
  background: #2b9c69;
}

.server-results {
  min-width: 0;
  padding: 1.35rem;
  background:
    linear-gradient(rgb(255 255 255 / 45%), rgb(255 255 255 / 45%)),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgb(31 41 37 / 2%) 32px), #eef2ef;
}

.results-heading {
  min-height: 3.25rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.results-kicker {
  display: block;
  margin-bottom: 0.18rem;
  color: #9b6840;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.results-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.results-heading > div:last-child {
  display: grid;
  gap: 0.15rem;
  text-align: right;
}

.results-heading output {
  font-size: 0.78rem;
  font-weight: 800;
}

.results-heading small {
  color: #7d8782;
  font-size: 0.6rem;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.server-card {
  --server-accent: #67736e;
  display: flex;
  min-width: 0;
  min-height: 17.5rem;
  padding: 1rem;
  flex-direction: column;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(31 41 37 / 11%);
  border-top: 3px solid var(--server-accent);
  border-radius: 0.85rem;
  box-shadow: 0 0.55rem 1.4rem rgb(49 60 54 / 6%);
}

.server-card-heading {
  min-width: 0;
  gap: 0.65rem;
}

.server-mark,
.mini-mark {
  display: grid;
  flex: 0 0 auto;
  color: #fff;
  background: var(--server-accent);
  place-items: center;
}

.server-mark {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 0.75rem 0.75rem 0.75rem 0.18rem;
  font-size: 0.83rem;
  font-weight: 850;
}

.server-card-heading > div {
  min-width: 0;
}

.server-card h3 {
  overflow: hidden;
  margin: 0;
  font-size: 0.87rem;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-domain {
  display: block;
  overflow: hidden;
  margin-top: 0.12rem;
  color: #7a8580;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.57rem;
  text-overflow: ellipsis;
}

.registration {
  display: inline-flex;
  min-height: 1.6rem;
  margin-left: auto;
  padding: 0.25rem 0.48rem;
  align-items: center;
  flex: 0 0 auto;
  background: #edf0ee;
  border-radius: 999px;
  color: #6e7974;
  font-size: 0.56rem;
  font-weight: 780;
}

.registration[data-status="open"] {
  color: #166a46;
  background: #e2f4e9;
}

.registration[data-status="open"]::before {
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.28rem;
  background: #2b9c69;
  border-radius: 50%;
  content: "";
}

.server-meta {
  min-height: 2.6rem;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.software,
.purpose-list span {
  display: inline-flex;
  min-height: 1.35rem;
  padding: 0.2rem 0.42rem;
  align-items: center;
  border-radius: 0.35rem;
  font-size: 0.55rem;
  font-weight: 750;
}

.software[data-software="mastodon"] {
  color: #5540a7;
  background: #eeeafd;
}

.software[data-software="misskey"] {
  color: #557600;
  background: #edf4dc;
}

.purpose-list {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.purpose-list span {
  color: #6a746f;
  background: #f0f2f0;
}

.server-description {
  display: -webkit-box;
  overflow: hidden;
  min-height: 3.95rem;
  margin: 0.35rem 0;
  color: #56625d;
  font-size: 0.69rem;
  line-height: 1.58;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.server-stats {
  margin-top: auto;
  padding: 0.65rem 0;
  justify-content: space-between;
  color: #7b8580;
  border-top: 1px solid rgb(31 41 37 / 8%);
  font-size: 0.56rem;
}

.version {
  overflow: hidden;
  max-width: 45%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-actions {
  gap: 0.45rem;
}

.server-actions button,
.server-actions a {
  display: inline-flex;
  min-height: 2.15rem;
  padding: 0.45rem 0.62rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.52rem;
  font-size: 0.62rem;
  font-weight: 780;
  text-decoration: none;
}

.compare-button {
  color: #495650;
  background: #f3f5f3;
  border: 1px solid #dce1dd;
}

.compare-button[data-selected="true"] {
  color: #fff;
  background: #355e51;
  border-color: #355e51;
}

.visit-link {
  flex: 1;
  gap: 0.3rem;
  color: #fff;
  background: #202d28;
}

.server-card.skeleton {
  min-height: 17.5rem;
  animation: pulse 1.1s ease-in-out infinite alternate;
  border-top-color: #d9dfdb;
}

.skeleton span,
.skeleton i {
  display: block;
  height: 0.7rem;
  margin-bottom: 1rem;
  background: #e3e8e4;
  border-radius: 999px;
}

.skeleton span {
  width: 48%;
  height: 2.4rem;
  border-radius: 0.65rem;
}

.skeleton i:nth-child(2) {
  width: 75%;
}

.skeleton i:nth-child(3) {
  width: 60%;
}

.empty-result {
  grid-column: 1 / -1;
  min-height: 13rem;
  padding: 2rem;
  display: grid;
  place-items: center;
  color: #66716c;
  background: rgb(255 255 255 / 72%);
  border: 1px dashed #bdc7c1;
  border-radius: 0.85rem;
  font-size: 0.76rem;
  text-align: center;
}

.compare-dock {
  position: sticky;
  z-index: 5;
  bottom: 0.8rem;
  width: min(63rem, calc(100% - 2rem));
  margin: 0.8rem auto 1.5rem;
  padding: 0.8rem;
  color: #fff;
  background: rgb(31 45 39 / 96%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 0.95rem;
  box-shadow: 0 1rem 2.5rem rgb(22 31 27 / 28%);
  backdrop-filter: blur(12px);
}

.compare-dock[hidden] {
  display: none;
}

.compare-dock > header {
  min-height: 1.8rem;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.compare-dock > header > div {
  gap: 0.55rem;
  font-size: 0.7rem;
}

.compare-dock output {
  color: #b7c5bf;
  font-size: 0.58rem;
}

.compare-dock > header button {
  color: #bdc9c4;
}

.compare-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.compare-item {
  display: flex;
  min-width: 0;
  padding: 0.55rem;
  gap: 0.45rem;
  justify-content: space-between;
  align-items: center;
  background: rgb(255 255 255 / 9%);
  border-radius: 0.6rem;
}

.compare-item > div {
  min-width: 0;
  gap: 0.45rem;
}

.mini-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.45rem 0.45rem 0.45rem 0.12rem;
  font-size: 0.58rem;
}

.compare-item strong,
.compare-item small {
  display: block;
  overflow: hidden;
  max-width: 9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-item strong {
  font-size: 0.62rem;
}

.compare-item small {
  margin-top: 0.12rem;
  color: #b8c4bf;
  font-size: 0.52rem;
}

.compare-item a {
  flex: 0 0 auto;
  color: #fff;
  font-size: 0.56rem;
}

.prose {
  width: min(46rem, 100%);
  margin: 2rem auto 5rem;
  padding: clamp(1.3rem, 4vw, 2.5rem);
  background: rgb(255 255 255 / 82%);
  border: 1px solid rgb(31 41 37 / 10%);
  border-radius: 1rem;
}

.prose-kicker {
  color: #97633d;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.prose h1 {
  margin: 0 0 2rem;
  font-size: 1.35rem;
}

.prose h2 {
  margin: 1.5rem 0 0.4rem;
  font-size: 0.9rem;
}

.prose p {
  color: #56615d;
  font-size: 0.78rem;
  line-height: 1.85;
}

body > footer {
  min-height: 4.8rem;
  justify-content: space-between;
  color: #69756f;
  border-top: 1px solid rgb(31 41 37 / 11%);
  font-size: 0.7rem;
}

body > footer nav {
  display: flex;
  gap: 1rem;
}

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

button:focus-visible,
a:focus-visible,
.toggle-row:has(input:focus-visible) {
  outline: 3px solid #d89a4b;
  outline-offset: 3px;
}

@keyframes pulse {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 61rem) {
  .route-workspace {
    grid-template-columns: minmax(16.5rem, 0.72fr) minmax(0, 1.3fr);
  }

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

@media (max-width: 45rem) {
  .site-header,
  main,
  body > footer {
    width: min(100% - 1rem, 80rem);
  }

  .route-intro {
    min-height: 6rem;
    padding-inline: 0.5rem;
  }

  .route-symbol {
    width: 3.3rem;
    flex: 0 0 auto;
  }

  .route-intro h1 {
    font-size: 1.08rem;
  }

  .route-intro p {
    font-size: 0.71rem;
  }

  .route-workspace {
    grid-template-columns: 1fr;
  }

  .route-builder {
    border-right: 0;
    border-bottom: 1px solid rgb(31 41 37 / 10%);
  }

  .server-results {
    padding: 1rem 0.7rem;
  }

  .server-grid {
    gap: 0.65rem;
  }

  .server-card {
    min-height: 16.5rem;
  }

  .compare-dock {
    bottom: 0.35rem;
    width: calc(100% - 1rem);
  }

  .compare-list {
    grid-template-columns: 1fr;
  }

  .compare-item strong,
  .compare-item small {
    max-width: 13rem;
  }

  body > footer {
    padding-block: 1.2rem;
    gap: 0.8rem;
    align-items: flex-start;
    flex-direction: column;
  }
}

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