:root {
  color-scheme: dark;
}

[x-cloak] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Fira Sans", system-ui, sans-serif;
}

button,
a {
  touch-action: manipulation;
}

.tool-frame,
.question-card,
.results-hero,
.network-modal {
  border-radius: 8px;
}

.choice-button,
.result-card,
.network-control {
  border-radius: 8px;
}

.language-toggle {
  display: inline-flex;
  min-height: 44px;
  cursor: pointer;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(11, 12, 16, 0.64);
  padding: 8px 10px;
  color: rgb(226 232 240);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease;
}

.language-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 208, 170, 0.68);
  background:
    linear-gradient(135deg, rgba(49, 208, 170, 0.15), rgba(124, 131, 255, 0.08)),
    rgba(11, 12, 16, 0.72);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.language-toggle:active {
  transform: translateY(0) scale(0.985);
}

.language-toggle:focus-visible {
  outline: 2px solid #31d0aa;
  outline-offset: 4px;
}

.language-toggle strong {
  min-width: 34px;
  border-radius: 6px;
  background: rgba(49, 208, 170, 0.14);
  padding: 5px 7px;
  color: #31d0aa;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 0.76rem;
  text-align: center;
}

.question-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    #15171f;
}

.question-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(49, 208, 170, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(124, 131, 255, 0.08), transparent 42%);
  opacity: 0.85;
}

.question-card > * {
  position: relative;
}

.choice-grid {
  perspective: 900px;
}

.choice-button {
  color: rgb(226 232 240);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.026);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  transform: translateZ(0);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease,
    color 220ms ease;
}

.choice-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.choice-button:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 131, 255, 0.68);
  background:
    linear-gradient(135deg, rgba(124, 131, 255, 0.11), rgba(49, 208, 170, 0.035)),
    rgba(255, 255, 255, 0.045);
}

.choice-button:active {
  transform: translateY(0) scale(0.992);
}

.choice-button.is-selected {
  color: white;
  border-color: rgba(49, 208, 170, 0.82);
  background:
    linear-gradient(135deg, rgba(49, 208, 170, 0.2), rgba(124, 131, 255, 0.1)),
    rgba(49, 208, 170, 0.055);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(49, 208, 170, 0.16),
    0 0 34px rgba(49, 208, 170, 0.08);
}

.choice-button.is-selected .choice-icon {
  border-color: rgba(49, 208, 170, 0.42);
  background: rgba(49, 208, 170, 0.12);
  color: #31d0aa;
}

.choice-button.is-idle .choice-icon {
  color: #7c83ff;
}

.choice-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.13) 42%, transparent 58%);
  opacity: 0;
  transform: translateX(-120%);
}

.choice-button.is-selected .choice-sheen,
.choice-button:hover .choice-sheen {
  opacity: 1;
  transform: translateX(120%);
  transition: transform 700ms ease, opacity 220ms ease;
}

.choice-check {
  opacity: 0;
  transform: scale(0.78);
  transition: opacity 180ms ease, transform 180ms ease;
}

.choice-button.is-selected .choice-check {
  opacity: 1;
  transform: scale(1);
}

.choice-pop {
  animation: choice-pop 340ms ease both;
}

.choice-soft-exit {
  animation: choice-soft-exit 240ms ease both;
}

.results-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(124, 131, 255, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(21, 23, 31, 0.94);
}

.results-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(49, 208, 170, 0.08), transparent);
  opacity: 0.65;
}

.results-hero > * {
  position: relative;
  z-index: 1;
}

.typed-panel {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.typed-recommendation::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 4px;
  transform: translateY(2px);
  background: #31d0aa;
  animation: caret-blink 900ms steps(2, start) infinite;
}

.result-stat {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.result-stat span {
  color: rgb(148 163 184);
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.result-stat strong {
  overflow-wrap: anywhere;
  color: white;
  font-size: 1.05rem;
  line-height: 1.35;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 16px;
}

.result-card {
  position: relative;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)),
    #1c1f2a;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  transition:
    transform 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    background 240ms ease;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(49, 208, 170, 0.14), transparent 34%);
  opacity: 0;
  transition: opacity 240ms ease;
}

.result-card:hover {
  transform: translateY(-5px);
  border-color: rgba(49, 208, 170, 0.62);
  box-shadow: 0 28px 62px rgba(0, 0, 0, 0.34);
}

.result-card:hover::before {
  opacity: 1;
}

.result-card--lead {
  border-color: rgba(245, 176, 76, 0.28);
}

.result-image {
  position: relative;
}

.result-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(28, 31, 42, 0.88), transparent);
}

.rank-pill,
.score-pill,
.strength-chip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.spec-tile {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

.spec-tile dt {
  margin-bottom: 4px;
  color: rgb(100 116 139);
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.spec-tile dd {
  overflow: hidden;
  color: rgb(226 232 240);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-control {
  display: inline-flex;
  min-height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgb(226 232 240);
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.network-control:hover {
  border-color: rgba(49, 208, 170, 0.7);
  background: rgba(49, 208, 170, 0.1);
  color: white;
}

.network-control:focus-visible {
  outline: 2px solid #31d0aa;
  outline-offset: 4px;
}

#cy {
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #11131a;
  background-size: 36px 36px;
}

@keyframes choice-pop {
  0% {
    transform: translateY(0) scale(0.985);
  }
  56% {
    transform: translateY(-3px) scale(1.012);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes choice-soft-exit {
  0% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes caret-blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

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