:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090d;
  --bg-accent: #12202a;
  --surface: #12171f;
  --surface-hover: #1a222d;
  --text: #f3f6f8;
  --text-muted: #9aa7b4;
  --border: #2a3544;
  --accent: #3ee0c4;
  --accent-hover: #7aead4;
  --accent-soft: rgba(62, 224, 196, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --header: rgba(7, 9, 13, 0.86);
  --ok: #4ade80;
  --warn: #fbbf24;
  --info: #fb923c;
  --danger: #fb7185;
  --radius: 18px;
  --header-h: 4.25rem;
  --focus: #3ee0c4;
  --grid: rgba(62, 224, 196, 0.06);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f8;
  --bg-accent: #e8eef2;
  --surface: #ffffff;
  --surface-hover: #f7f9fb;
  --text: #12151b;
  --text-muted: #5c6570;
  --border: #dbe1e8;
  --accent: #0f6f68;
  --accent-hover: #0b5b55;
  --accent-soft: rgba(15, 111, 104, 0.12);
  --shadow: 0 12px 40px rgba(16, 24, 40, 0.08);
  --header: rgba(243, 245, 248, 0.86);
  --ok: #157347;
  --warn: #9a6700;
  --info: #9a5b12;
  --danger: #b42318;
  --focus: #0f6f68;
  --grid: rgba(15, 111, 104, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 8% -8%, var(--bg-accent), transparent 58%),
    radial-gradient(700px 360px at 110% 8%, rgba(62, 224, 196, 0.08), transparent 50%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  color: var(--text);
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 1000;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: var(--header);
  border-bottom: 1px solid var(--border);
}

.site-header-inner,
.site-footer-inner,
.site-main,
.narrow {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  min-height: var(--header-h);
}

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.125rem;
}

.brand:hover {
  color: var(--accent);
}

.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

.site-main {
  padding: 2.5rem 0 4rem;
}

.hero {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 38rem;
  font-size: 1.05rem;
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  font: inherit;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.chip:hover,
.chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.section {
  margin-bottom: 2.5rem;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 640px) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .app-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1500px) {
  .app-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .site-header-inner,
  .site-footer-inner,
  .site-main,
  .narrow {
    width: min(1480px, calc(100% - 2rem));
  }
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 100%;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.app-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.app-card-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  overflow: hidden;
}

.app-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card h3 {
  font-size: 1.15rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
}

.pill-muted {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.app-card p,
.app-demo p {
  margin: 0;
  color: var(--text-muted);
}

.app-card .description {
  flex: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 650;
  font-size: 0.92rem;
}

.status-available { color: var(--ok); }
.status-development { color: var(--warn); }
.status-maintenance { color: var(--info); }
.status-offline { color: var(--danger); }

.button,
.button-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
}

.button {
  background: var(--accent);
  color: #06251f;
}

[data-theme="light"] .button {
  color: #fff;
}

.button:hover {
  background: var(--accent-hover);
  color: #06251f;
}

[data-theme="light"] .button:hover {
  color: #fff;
}

.button-disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.tiny {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty {
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  background: var(--bg);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.back-link {
  display: inline-flex;
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.back-link:hover {
  color: var(--accent);
}

.app-demo,
.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2.4rem);
}

.app-demo {
  display: grid;
  gap: 0.85rem;
  max-width: 42rem;
}

.app-hero-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.2rem;
}

.kicker {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-lead {
  max-width: 42rem;
}

.faq {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details p {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
}

.prose h2 {
  font-size: 1.15rem;
  margin-top: 1.6rem;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.prose h2:first-of-type {
  margin-top: 1.15rem;
}

.prose address {
  font-style: normal;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 0.35rem 0 1rem;
  font-size: 0.92rem;
}

.legal-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.legal-meta {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.35rem;
}

.legal-toc a {
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 650;
}

.legal-toc a:hover {
  color: var(--text);
  border-color: var(--accent);
}

.legal-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 0 0 0.5rem;
}

@media (min-width: 640px) {
  .legal-facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.legal-fact {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.legal-fact dt {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-fact dd {
  margin: 0.4rem 0 0;
  color: var(--text);
}

.legal-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 640px) {
  .legal-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.legal-summary a {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.legal-summary a:hover {
  border-color: var(--accent);
}

.legal-summary strong {
  color: var(--text);
}

.legal-summary span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.prose p,
.prose ul {
  margin: 0;
  color: var(--text-muted);
}

.prose p + p,
.prose ul + p,
.prose p + ul {
  margin-top: 0.75rem;
}

.prose h2 + p,
.prose h2 + ul,
.prose h2 + .legal-facts {
  margin-top: 0.55rem;
}

.error-panel {
  text-align: left;
  max-width: 36rem;
}

[hidden],
.hidden {
  display: none !important;
}

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

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
