:root {
  color-scheme: light;
  --bg: #edf5ff;
  --bg-strong: #dbeafc;
  --surface: rgba(250, 253, 255, 0.84);
  --surface-strong: #f8fbff;
  --border: rgba(79, 114, 152, 0.16);
  --text: #1f3347;
  --text-soft: #4e647a;
  --accent: #3178c6;
  --accent-strong: #245c9a;
  --accent-faint: rgba(49, 120, 198, 0.12);
  --shadow: 0 20px 60px rgba(46, 88, 132, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", "DejaVu Sans", "Arial Unicode MS", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(188, 221, 255, 0.55), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(158, 211, 244, 0.34), transparent 24%),
    linear-gradient(180deg, #fdfefe 0%, var(--bg) 52%, #e4f0fb 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: 1.2rem 0 3.2rem;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 0.75rem 0 1.35rem;
}

.site-kicker,
.eyebrow,
.section-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-strong);
  font-weight: 700;
}

#page-title,
.hero-title,
.section-title,
.card-title,
.step-title {
  font-family: "Segoe UI", "Noto Sans", "DejaVu Sans", "Arial Unicode MS", Arial, sans-serif;
  font-weight: 700;
}

#page-title {
  margin: 0.2rem 0 0;
  font-size: clamp(1.55rem, 3.1vw, 2.35rem);
  max-width: 18ch;
  line-height: 1.12;
  text-wrap: balance;
}

.header-tools {
  display: grid;
  gap: 0.4rem;
  justify-items: end;
  min-width: 0;
}

.language-switcher {
  width: min(100%, 22rem);
}

.language-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  justify-content: flex-end;
}

.language-pills button,
.hero-actions a {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.language-pills button {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 0.26rem 0.52rem;
  font-size: 0.74rem;
  line-height: 1.1;
  min-height: 1.65rem;
}

.language-pills button.active,
.hero-actions a.primary {
  background: var(--accent);
  color: #f7fffd;
}

.hero-actions a.secondary {
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  border: 1px solid var(--border);
}

.language-pills button:hover,
.hero-actions a:hover {
  transform: translateY(-1px);
}

.hero-actions a {
  padding: 0.78rem 1.05rem;
}

#app {
  display: grid;
  gap: 1.2rem;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 0;
}

#app > *,
.hero-copy,
.hero-aside,
.section-header,
.two-column > *,
.steps-grid > *,
.countries-grid > *,
.resources-grid > *,
.map-layout > * {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.hero-copy {
  display: grid;
  gap: 0.9rem;
}

.hero-brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.46rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
}

.brand-chip:hover {
  transform: translateY(-1px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
}

.tor-mark {
  background: rgba(123, 52, 178, 0.12);
  color: #7b34b2;
}

.snowflake-mark {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
}

.logo-icon {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.tor-logo {
  width: 1.8rem;
  height: 1.8rem;
  object-fit: contain;
}

.snowflake-logo {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.95rem, 4vw, 3.1rem);
  line-height: 1.12;
  max-width: 15ch;
  text-wrap: balance;
}

.hero-lead,
.section-intro,
.step-body,
.country-copy,
.footer-copy {
  color: var(--text-soft);
  font-size: 0.99rem;
  line-height: 1.58;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-aside {
  display: grid;
  gap: 1rem;
}

.stat-card,
.country-card,
.step-card,
.resource-card,
.note-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  box-shadow: 0 10px 28px rgba(74, 54, 31, 0.05);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--accent-strong);
}

.section {
  padding: 1.45rem;
}

.section-header {
  display: grid;
  gap: 0.38rem;
  margin-bottom: 1.1rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.18;
}

.two-column {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-bottom: 0.95rem;
}

.widget-spotlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 0.95rem;
  align-items: start;
}

.widget-spotlight-copy {
  display: grid;
  gap: 0.7rem;
}

.widget-preview-card {
  display: grid;
  gap: 0.7rem;
}

.widget-frame {
  display: flex;
  justify-content: center;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
  overflow: auto;
}

.widget-frame iframe {
  display: block;
  width: 320px;
  max-width: 100%;
  min-height: 240px;
  border: 0;
}

.ways-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-bottom: 0.95rem;
}

.way-card {
  display: grid;
  gap: 0.72rem;
}

.way-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.way-head {
  display: grid;
  gap: 0.55rem;
}

.way-meta {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
}

.about-card {
  display: grid;
  gap: 0.65rem;
}

.about-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.95rem;
}

.about-steps li p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.bullet-list,
.manual-list {
  margin: 0;
  padding-left: 1.2rem;
}

.bullet-list li,
.manual-list li {
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.steps-grid,
.countries-grid,
.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  align-items: start;
}

.steps-grid {
  margin-top: 0.9rem;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 0.95rem;
  margin-bottom: 1rem;
}

.map-card,
.map-side {
  display: grid;
  gap: 1rem;
}

.map-head {
  display: grid;
  gap: 0.4rem;
}

.map-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 20% 20%, rgba(49, 120, 198, 0.13), transparent 22%),
    linear-gradient(180deg, #f7fbff 0%, #ebf4fd 100%);
  padding: 0.95rem;
  overflow: hidden;
}

.map-visual {
  position: relative;
  aspect-ratio: 2754 / 1398;
}

.world-map-shell,
.world-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.world-map-shell {
  overflow: hidden;
}

.world-map-svg {
  max-width: 100%;
}

.project-link,
.resource-card a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.58rem 0.82rem;
  border-radius: 999px;
  background: rgba(49, 120, 198, 0.08);
  border: 1px solid rgba(49, 120, 198, 0.16);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.project-link:hover,
.resource-card a:hover {
  background: rgba(49, 120, 198, 0.14);
}

.map-markers {
  position: absolute;
  inset: 0;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 1rem;
  height: 1rem;
}

.map-marker-ping,
.map-marker-core {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.map-marker-ping {
  width: 1.8rem;
  height: 1.8rem;
  fill: currentColor;
  background: currentColor;
  opacity: 0.16;
  animation: map-pulse 2.6s ease-out infinite;
}

.map-marker-core {
  width: 0.76rem;
  height: 0.76rem;
  background: currentColor;
  border: 2px solid #fffdf8;
  box-shadow: 0 4px 14px rgba(20, 24, 24, 0.18);
}

.severity-5 {
  color: #b42318;
  fill: #b42318;
}

.severity-4 {
  color: #dc6803;
  fill: #dc6803;
}

.severity-3 {
  color: #b54708;
  fill: #b54708;
}

.severity-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  margin-top: 0.32rem;
  background: currentColor;
}

.severity-list,
.map-country-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.severity-list li,
.map-country-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
}

.severity-list p {
  margin: 0.18rem 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.step-card pre {
  margin: 0.9rem 0 0;
  padding: 0.95rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #1e2a28;
  color: #eff8f6;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
}

.country-card {
  display: grid;
  gap: 0.65rem;
}

.country-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-faint);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-footer {
  padding: 1rem 0 0;
}

.site-footer .panel {
  padding: 1.1rem 1.3rem;
}

.install-banner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.95rem;
}

.install-banner-card,
.install-code-card {
  display: grid;
  gap: 0.75rem;
}

.support-badge-link {
  display: inline-flex;
  width: fit-content;
}

.support-badge-image {
  display: block;
  max-width: 100%;
  height: auto;
}

.install-code-group {
  display: grid;
  gap: 0.55rem;
}

.install-code-card pre {
  margin: 0;
  padding: 0.95rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #e8f1fb;
  color: #1d3550;
  border: 1px solid rgba(79, 114, 152, 0.16);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
}

.widget-preview-card pre {
  margin: 0;
  padding: 0.95rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #e8f1fb;
  color: #1d3550;
  border: 1px solid rgba(79, 114, 152, 0.16);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
}

.site-footer,
.site-footer .panel,
.footer-credit {
  text-align: center;
}

.footer-credit {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.footer-support {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.footer-credit a {
  color: var(--accent-strong);
  text-decoration: none;
}

.footer-credit a:hover {
  text-decoration: underline;
}

@keyframes map-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.2;
  }

  70% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0;
  }
}

@media (max-width: 1080px) {
  .hero,
  .about-grid,
  .widget-spotlight-grid,
  .ways-grid,
  .two-column,
  .map-layout,
  .install-banner-grid,
  .steps-grid,
  .countries-grid,
  .resources-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-tools {
    justify-items: start;
  }

  .language-pills {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--content-width));
  }

  .hero,
  .section {
    padding: 1rem;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  #page-title {
    font-size: 1.45rem;
  }

  .language-switcher {
    width: 100%;
  }

  .map-frame {
    padding: 0.65rem;
  }

  .severity-list li,
  .map-country-list li {
    grid-template-columns: auto 1fr;
  }

  .map-country-list strong {
    grid-column: 2;
  }
}