:root {
  --bg: #fbfaff;
  --surface: #ffffff;
  --surface-soft: #f6f1ff;
  --ink: #1e1b2e;
  --muted: #6d6880;
  --line: #e6def5;
  --accent: #8b5cf6;
  --accent-dark: #6d3fd4;
  --accent-soft: #efe7ff;
  --shadow: 0 20px 50px rgba(68, 44, 116, 0.12);
  --radius: 18px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12101a;
  --surface: #1c1828;
  --surface-soft: #282236;
  --ink: #f7f2ff;
  --muted: #c7bdd9;
  --line: #3a314d;
  --accent: #a78bfa;
  --accent-dark: #c4b5fd;
  --accent-soft: #33284c;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 18px;
  background: rgba(251, 250, 255, 0.88);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .site-header {
  background: rgba(18, 16, 26, 0.88);
}

.logo {
  flex: 0 0 auto;
  font-size: 1.3rem;
  font-weight: 850;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 22px);
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
}

.site-nav a,
.site-footer a,
.text-link,
.button {
  overflow-wrap: anywhere;
}

.site-nav a:hover {
  color: var(--accent-dark);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-control select,
.theme-button {
  min-height: 38px;
  max-width: 140px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 750;
}

.language-control select {
  padding: 0 34px 0 12px;
  cursor: pointer;
}

.theme-button {
  min-width: 64px;
  padding: 0 14px;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--surface);
}

.hero {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0 56px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 8vw, 6.7rem);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.hero-copy,
.page-hero p,
.content-card p,
.generator-card p,
.result-card p,
.step-card p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto 30px;
  font-size: 1.18rem;
}

.hero-search {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-search input,
.contact-form input,
.contact-form textarea,
.generator-form input,
.generator-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
}

.hero-search input {
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  outline: 0;
}

.button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.15;
}

.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.28);
}

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

.ghost {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.section,
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 54px 0;
}

.section.compact {
  padding-top: 18px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.category-grid,
.card-grid,
.step-grid,
.result-grid {
  display: grid;
  gap: 18px;
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.card-grid,
.result-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.step-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.category-card,
.generator-card,
.step-card,
.result-card,
.content-card,
.generator-panel,
.contact-form {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.category-card {
  padding: 22px;
  display: grid;
  gap: 8px;
}

.category-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.category-card small,
.card-kicker {
  color: var(--muted);
}

.generator-card,
.step-card,
.result-card,
.content-card {
  padding: 24px;
  overflow: hidden;
}

.generator-card h2,
.generator-card h3,
.step-card h3,
.result-card h3,
.content-card h1,
.content-card h2 {
  max-width: 100%;
  overflow-wrap: break-word;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--accent-dark);
  background: var(--surface-soft);
}

.card-kicker {
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 800;
}

.step-card span {
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-weight: 850;
}

.page-hero {
  padding: 56px 0 22px;
  max-width: 760px;
}

.page-hero h1,
.generator-panel h1,
.content-card.legal h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}

.filter-row,
.pill-row,
.button-row,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-actions {
  align-items: center;
  justify-content: flex-end;
}

.button-row {
  align-items: stretch;
}

.button-row .button,
.button-row a.button {
  min-width: 0;
  white-space: normal;
}

.filter-button,
.pill-row span,
.pill-row a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 700;
}

.filter-button.active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.generator-panel {
  margin-top: 42px;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}

.generator-form,
.contact-form {
  display: grid;
  gap: 14px;
}

.generator-form label,
.contact-form label {
  color: var(--muted);
  font-weight: 750;
}

.generator-form input,
.generator-form select,
.contact-form input,
.contact-form textarea {
  min-height: 48px;
  padding: 0 14px;
}

.contact-form textarea {
  padding-top: 14px;
  resize: vertical;
}

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

.result-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  color: var(--muted);
}

.result-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.result-title-row h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.score-badge {
  flex: 0 0 auto;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.result-checks {
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.result-checks li {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-checks li::before {
  margin-right: 8px;
  font-weight: 900;
}

.result-checks .pass::before {
  content: "OK";
  color: var(--accent-dark);
}

.result-checks .review::before {
  content: "!";
  color: #b7791f;
}

.result-card dt {
  color: var(--ink);
  font-weight: 800;
}

.content-card {
  max-width: 920px;
  margin: 26px 0 64px;
}

.content-card.article {
  margin-top: 44px;
}

.content-card.small {
  margin: 0;
}

.content-card h2 {
  margin-top: 28px;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.content-card h2:first-child {
  margin-top: 0;
}

.content-card li {
  margin-bottom: 10px;
  color: var(--muted);
}

.content-card ol {
  color: var(--muted);
  line-height: 1.7;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: var(--surface-soft);
}

td {
  color: var(--muted);
}

details {
  border-top: 1px solid var(--line);
  padding: 15px 0;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
  margin-bottom: 64px;
}

.contact-form {
  padding: 26px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 40px auto 0;
  padding: 30px 0 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 100%;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  border-radius: 999px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--accent-dark);
  font-weight: 800;
}

.skip-link:focus {
  top: 16px;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: none;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav a {
    padding: 4px 0;
  }

  .header-actions {
    margin-left: auto;
  }

  .site-nav.open {
    display: grid;
  }

  .category-grid,
  .card-grid,
  .step-grid,
  .result-grid,
  .generator-panel,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .site-header {
    width: min(100% - 20px, 1180px);
  }

  .header-actions {
    order: 2;
    width: 100%;
    justify-content: flex-end;
  }

  .nav-toggle {
    order: 1;
  }

  .site-nav {
    top: calc(100% + 8px);
  }

  .result-actions {
    justify-content: start;
  }

  .button-row .button,
  .button-row a.button {
    flex: 1 1 100%;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 4.2rem);
  }

  .hero {
    padding-top: 56px;
  }

  .hero-search {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .hero-search input {
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .site-footer,
  .section-heading.split {
    display: grid;
  }
}
