:root {
  --bg: #edf4fb;
  --bg-alt: #dfeaf6;
  --panel: rgba(247, 251, 255, 0.88);
  --panel-strong: #f8fbff;
  --text: #102235;
  --muted: #58708a;
  --line: rgba(23, 33, 44, 0.1);
  --accent: #1c7df0;
  --accent-deep: #0f5ebc;
  --accent-soft: rgba(28, 125, 240, 0.13);
  --teal: #117c95;
  --shadow: 0 28px 80px rgba(20, 44, 78, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.65;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(28, 125, 240, 0.18), transparent 34%),
    radial-gradient(circle at right 20%, rgba(17, 124, 149, 0.14), transparent 28%),
    linear-gradient(180deg, #f4f9fe 0%, #e4edf7 100%);
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

pre,
code {
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-size: 0.92em;
}

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.74;
}

.orb-a {
  top: 8%;
  left: -6%;
  width: 24rem;
  height: 24rem;
  background: rgba(28, 125, 240, 0.14);
}

.orb-b {
  right: 2%;
  top: 36%;
  width: 18rem;
  height: 18rem;
  background: rgba(17, 124, 149, 0.12);
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 33, 44, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 44, 0.04) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 92%);
}

.site-shell {
  position: relative;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.site-header,
.section,
.site-footer {
  padding: 1.25rem 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 1rem;
  height: 1rem;
  border-radius: 0.35rem;
  background:
    linear-gradient(135deg, var(--accent) 0%, var(--accent) 48%, transparent 48%, transparent 52%, var(--teal) 52%, var(--teal) 100%);
  box-shadow: 0 0 0 6px rgba(247, 251, 255, 0.8);
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.site-nav a {
  padding: 0.68rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-current {
  color: var(--text);
  border-color: rgba(28, 125, 240, 0.18);
  background: rgba(247, 251, 255, 0.74);
}

.site-nav .nav-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #58aeff 100%);
  color: #f4fbff;
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(28, 102, 190, 0.22);
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible,
.site-nav .nav-cta.is-current {
  color: #f4fbff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.language-switcher {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.78);
  box-shadow: 0 12px 28px rgba(20, 44, 78, 0.08);
}

.lang-toggle {
  min-width: 3rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  transform: translateY(-1px);
}

.lang-toggle.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, #4ba2ff 100%);
  color: #f4fbff;
}

.hero {
  display: grid;
  gap: 2rem;
}

.hero-home {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  align-items: stretch;
}

.hero-subpage {
  max-width: 56rem;
}

.hero-panel,
.card,
.link-card,
.code-card,
.visual-card,
.emphasis-card,
.callout,
.faq-item {
  border: 1px solid rgba(23, 33, 44, 0.08);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-panel,
.card,
.code-card,
.callout,
.faq-item,
.visual-card {
  padding: 1.5rem;
}

.hero-panel {
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.94), rgba(247, 251, 255, 0.8)),
    radial-gradient(circle at top right, rgba(17, 124, 149, 0.16), transparent 36%);
}

.eyebrow,
.panel-label,
.card-tag {
  margin: 0 0 0.8rem;
  color: var(--accent-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.03em;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  max-width: 11ch;
}

.hero-subpage h1,
.section-heading h2,
.article-content h1 {
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
}

.lead {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 46rem;
}

.lead.narrow {
  max-width: 40rem;
}

.small-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0 0;
}

.button-row.center {
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  padding: 0.95rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #59afff 100%);
  color: #f4fbff;
  box-shadow: 0 16px 40px rgba(28, 102, 190, 0.28);
}

.button-secondary {
  background: rgba(247, 251, 255, 0.72);
  border-color: var(--line);
}

.section-heading {
  display: grid;
  gap: 0.8rem;
  max-width: 50rem;
  margin-bottom: 1.6rem;
}

.section-heading.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.section-alt {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.card-grid,
.visual-grid,
.link-grid,
.footer-grid {
  display: grid;
  gap: 1.2rem;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card p,
.card li,
.hero-panel p,
.emphasis-card p,
.link-card span,
.article-content p,
.article-content li,
.faq-item p,
.callout span {
  color: var(--muted);
}

.card h2,
.card h3 {
  margin-bottom: 0.8rem;
}

.bullet-list {
  display: grid;
  gap: 0.8rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.bullet-list li {
  position: relative;
  padding-left: 1.4rem;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--accent));
}

.bullet-list.dense {
  gap: 0.55rem;
}

.checklist li::before {
  border-radius: 0.18rem;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  align-items: start;
}

.emphasis-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  font-size: 1.18rem;
  text-align: center;
}

.visual-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-card {
  display: grid;
  gap: 0.9rem;
}

.visual-card img {
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 33, 44, 0.08);
  background: white;
}

.visual-card figcaption {
  color: var(--muted);
}

.link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-card {
  display: grid;
  gap: 0.55rem;
  padding: 1.4rem;
  transition: transform 160ms ease, border-color 160ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(28, 125, 240, 0.25);
}

.link-card strong {
  font-size: 1.06rem;
}

.code-card {
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.94), rgba(241, 247, 253, 0.92)),
    radial-gradient(circle at top right, rgba(28, 125, 240, 0.08), transparent 38%);
}

.code-card pre {
  font-size: 0.98rem;
  line-height: 1.7;
}

.callout {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.cta-section {
  padding-bottom: 3rem;
}

.faq-list {
  display: grid;
  gap: 1rem;
}

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

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

.faq-item p {
  margin: 1rem 0 0;
}

.article-page {
  padding-top: 1rem;
}

.article-content {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(23, 33, 44, 0.08);
  background: rgba(247, 251, 255, 0.84);
  box-shadow: var(--shadow);
}

.lang-block {
  display: none;
}

.lang-block.is-active {
  display: block;
}

.article-content > * + * {
  margin-top: 1rem;
}

.article-content h2 {
  margin-top: 2rem;
  font-size: 2rem;
}

.article-content pre {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(16, 34, 53, 0.06);
}

.article-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.article-links a {
  color: var(--accent-deep);
  font-weight: 600;
}

.article-card {
  transition: transform 160ms ease, border-color 160ms ease;
}

.article-card:hover,
.article-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(28, 125, 240, 0.25);
}

.site-footer {
  margin-top: 2rem;
}

.footer-grid {
  grid-template-columns: 1.5fr 1fr 1fr;
  padding: 1.8rem;
  border: 1px solid rgba(23, 33, 44, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(247, 251, 255, 0.84);
  box-shadow: var(--shadow);
}

.footer-grid h2 {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.footer-summary {
  margin: 0;
}

.footer-links {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover,
.footer-links a:focus-visible,
.article-links a:hover,
.article-links a:focus-visible {
  color: var(--accent-deep);
}

@media (max-width: 1080px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero-home,
  .split-layout,
  .three-up,
  .two-up,
  .four-up,
  .visual-grid,
  .link-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 1.2rem, 1180px);
  }

  .hero h1,
  .hero-subpage h1,
  .section-heading h2,
  .article-content h1 {
    max-width: none;
    font-size: clamp(2.2rem, 11vw, 3.4rem);
  }

  .article-content {
    padding: 1.2rem;
  }

  .site-nav a,
  .button {
    width: 100%;
  }

  .button-row {
    flex-direction: column;
  }
}
