@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./assets/InterVariable.woff2") format("woff2-variations");
}

:root {
  --white: #ffffff;
  --black: #000000;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;
  --canvas: var(--neutral-100);
  --surface: var(--white);
  --surface-subtle: var(--neutral-50);
  --border: var(--neutral-200);
  --border-strong: var(--neutral-300);
  --text-primary: var(--neutral-950);
  --text-secondary: var(--neutral-700);
  --text-metadata: var(--neutral-500);
  color-scheme: light;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--text-primary);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

main {
  width: min(100%, 1800px);
  margin: 0 auto;
  padding: 48px clamp(24px, 3.25vw, 56px) 40px;
}

h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

button,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.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-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.view-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--neutral-200);
}

.view-tab {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--neutral-600);
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
}

.view-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 6%),
    0 0 0 1px rgb(0 0 0 / 3%);
}

.view-tab:hover {
  color: var(--text-primary);
}

.view-tab:focus-visible,
.reset-button:focus-visible,
.filter-select:focus-visible {
  outline: 2px solid var(--neutral-950);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  border: 1px solid var(--neutral-950);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
  transform: translateY(-180%);
}

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

.table-region {
  position: relative;
  max-height: calc(100svh - 154px);
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 3%),
    0 14px 36px rgb(0 0 0 / 4%);
  scrollbar-color: var(--neutral-400) transparent;
  scrollbar-width: thin;
}

.table-region:focus-visible,
a:focus-visible {
  outline: 2px solid var(--neutral-950);
  outline-offset: 3px;
}

.comparison-table {
  width: 100%;
  min-width: 1280px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}

.comparison-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.comparison-table th,
.comparison-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.comparison-table tr > :last-child {
  border-right: 0;
}

.comparison-table tbody:last-child tr:last-child > * {
  border-bottom: 0;
}

.comparison-table thead th {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 78px;
  padding: 17px 18px;
  border-bottom-color: var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text-primary);
  vertical-align: bottom;
}

.comparison-table thead th:first-child {
  z-index: 6;
  left: 0;
  width: 200px;
  box-shadow: 1px 0 0 var(--border);
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--text-metadata);
}

.column-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.column-type {
  display: block;
  color: var(--text-metadata);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.group-heading {
  padding: 10px 18px;
  border-right: 0 !important;
  border-bottom-color: var(--border-strong) !important;
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.075em;
  line-height: 1.4;
  text-transform: uppercase;
}

.comparison-group + .comparison-group .group-heading {
  border-top: 1px solid var(--border-strong);
}

.group-heading-label {
  position: sticky;
  left: 18px;
  display: inline-block;
}

.row-heading {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 200px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

.criterion-index {
  display: block;
  color: var(--neutral-400);
  font-size: 0.65625rem;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.criterion-label {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 0.84375rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.comparison-cell {
  min-height: 140px;
  padding: 18px;
  background: var(--surface);
}

.comparison-cell strong {
  display: block;
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 0.84375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.42;
}

.comparison-cell p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: -0.008em;
  line-height: 1.55;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 12px;
}

.source-list a,
.source-note {
  color: var(--text-metadata);
  font-size: 0.65625rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.source-list a {
  text-decoration-color: var(--neutral-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.source-list a::after {
  content: " ↗";
}

.source-list a:hover {
  color: var(--text-primary);
  text-decoration-color: var(--neutral-700);
}

.source-note::before {
  content: "Wewnętrzne · ";
  color: var(--neutral-400);
}

.comparison-table tbody tr:not(.group-row):hover .row-heading,
.comparison-table tbody tr:not(.group-row):hover .comparison-cell {
  background: var(--surface-subtle);
}

.comparison-notes {
  padding: 18px 2px 0;
  color: var(--text-metadata);
  font-size: 0.6875rem;
  line-height: 1.55;
}

.comparison-notes p {
  margin: 0;
}

.comparison-notes strong {
  color: var(--neutral-700);
  font-weight: 600;
}

.configurator-layout {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.configurator-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100svh - 40px);
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 3%),
    0 10px 28px rgb(0 0 0 / 3%);
}

.configurator-sidebar-header {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.configurator-sidebar h2,
.configurator-results h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.configurator-sidebar-header p,
.results-header p,
.details-header p {
  margin: 5px 0 0;
  color: var(--text-metadata);
  font-size: 0.75rem;
  line-height: 1.5;
}

.filter-field {
  padding: 13px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.filter-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.filter-label-row label {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
}

.filter-number {
  color: var(--neutral-400);
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}

.filter-select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.75rem;
  line-height: 1.3;
  cursor: pointer;
}

.filter-select:hover {
  border-color: var(--neutral-500);
}

.reset-button {
  width: calc(100% - 36px);
  min-height: 38px;
  margin: 16px 18px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--neutral-700);
  font-size: 0.71875rem;
  font-weight: 550;
  cursor: pointer;
}

.reset-button:hover {
  border-color: var(--neutral-500);
  background: var(--neutral-100);
  color: var(--text-primary);
}

.configurator-results {
  min-width: 0;
}

.results-header,
.details-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.results-header h2,
.details-header h2 {
  font-size: 1.125rem;
}

.results-meta {
  max-width: 250px;
  margin: 0 !important;
  text-align: right;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recommendation-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 2%);
}

.recommendation-card.is-primary {
  border-color: var(--neutral-800);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 4%),
    0 10px 28px rgb(0 0 0 / 4%);
}

.recommendation-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.recommendation-rank {
  color: var(--neutral-400);
  font-size: 0.65625rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.recommendation-label {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--neutral-600);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
}

.recommendation-card.is-primary .recommendation-label {
  border-color: var(--neutral-900);
  background: var(--neutral-900);
  color: var(--white);
}

.recommendation-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.recommendation-positioning {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
}

.recommendation-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-metadata);
  font-size: 0.65625rem;
  font-weight: 550;
}

.recommendation-strengths {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.71875rem;
  line-height: 1.45;
}

.recommendation-compromise {
  margin-top: auto;
  padding-top: 16px;
}

.recommendation-compromise span {
  display: block;
  margin-bottom: 5px;
  color: var(--neutral-500);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.recommendation-compromise p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.71875rem;
  line-height: 1.45;
}

.recommendation-details {
  margin-top: 28px;
}

.recommendation-table-region {
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 3%),
    0 10px 28px rgb(0 0 0 / 3%);
  scrollbar-color: var(--neutral-400) transparent;
  scrollbar-width: thin;
}

.recommendation-table-region:focus-visible {
  outline: 2px solid var(--neutral-950);
  outline-offset: 3px;
}

.recommendation-table {
  width: 100%;
  min-width: 900px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}

.recommendation-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.recommendation-table th,
.recommendation-table td {
  padding: 15px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.recommendation-table tr > :last-child {
  border-right: 0;
}

.recommendation-table tbody tr:last-child > * {
  border-bottom: 0;
}

.recommendation-table thead th {
  background: var(--surface-subtle);
  color: var(--text-metadata);
  font-size: 0.6875rem;
  font-weight: 550;
}

.recommendation-table thead th:first-child {
  position: sticky;
  z-index: 3;
  left: 0;
  width: 210px;
  box-shadow: 1px 0 0 var(--border);
}

.recommendation-table .is-primary {
  background: var(--neutral-50);
}

.details-stack-name {
  display: block;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}

.details-stack-rank {
  display: block;
  margin-top: 3px;
  color: var(--text-metadata);
  font-size: 0.625rem;
  font-weight: 500;
}

.recommendation-table tbody th {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 210px;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

.recommendation-table tbody th strong,
.recommendation-table tbody th span {
  display: block;
}

.recommendation-table tbody th strong {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.recommendation-table tbody th span {
  margin-top: 4px;
  color: var(--text-metadata);
  font-size: 0.6875rem;
  font-weight: 450;
  line-height: 1.4;
}

.recommendation-table td p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.71875rem;
  line-height: 1.5;
}

.fit-status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.fit-score-2 {
  background: var(--neutral-900);
  color: var(--white);
}

.fit-score-1 {
  border: 1px solid var(--border-strong);
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.fit-score-0 {
  border: 1px dashed var(--neutral-400);
  background: var(--surface);
  color: var(--neutral-600);
}

.configurator-methodology {
  max-width: 760px;
  margin: 14px 2px 0;
  color: var(--text-metadata);
  font-size: 0.6875rem;
  line-height: 1.55;
}

.error-message {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--neutral-900);
  font-size: 0.8125rem;
}

@media (max-width: 980px) {
  .configurator-layout {
    grid-template-columns: 1fr;
  }

  .configurator-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .configurator-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-field:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .reset-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  main {
    padding: 26px 16px 28px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
  }

  h1 {
    margin: 0;
    font-size: 1.875rem;
  }

  .view-tabs {
    display: flex;
    width: 100%;
  }

  .view-tab {
    flex: 1;
  }

  .table-region {
    max-height: calc(100svh - 132px);
    margin-inline: -16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .comparison-table {
    min-width: 1080px;
  }

  .comparison-table thead th {
    height: 72px;
    padding: 14px;
  }

  .comparison-table thead th:first-child,
  .row-heading {
    width: 148px;
  }

  .row-heading,
  .comparison-cell {
    padding: 14px;
  }

  .group-heading {
    padding: 9px 14px;
  }

  .group-heading-label {
    left: 14px;
  }

  .criterion-label,
  .comparison-cell strong {
    font-size: 0.8125rem;
  }

  .comparison-cell p {
    font-size: 0.78125rem;
  }

  .comparison-notes {
    padding: 15px 0 0;
  }

  .configurator-form {
    grid-template-columns: 1fr;
  }

  .filter-field:nth-child(odd) {
    border-right: 0;
  }

  .configurator-sidebar,
  .recommendation-card,
  .recommendation-table-region {
    border-radius: 12px;
  }

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

  .results-header,
  .details-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .results-meta {
    max-width: none;
    text-align: left;
  }

  .recommendation-table {
    min-width: 820px;
  }

  .recommendation-table thead th:first-child,
  .recommendation-table tbody th {
    width: 170px;
  }
}

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