:root {
  --bg: #f5f8fb;
  --card: #ffffff;
  --surface: #fbfdff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ec;
  --blue: #2563eb;
  --teal: #14b8a6;
  --soft: #eef6ff;
  --shadow: 0 16px 36px rgba(15, 23, 42, .08);
  --radius: 8px;
  color-scheme: light;
}

html.dark {
  --bg: #0b1220;
  --card: #101827;
  --surface: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #243044;
  --blue: #60a5fa;
  --teal: #2dd4bf;
  --soft: #111827;
  --shadow: 0 18px 42px rgba(0, 0, 0, .32);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), transparent 280px),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 50%, #eef2f7 100%);
  color: var(--text);
}

html.dark body {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, .34), transparent 300px),
    linear-gradient(180deg, #08111f 0%, var(--bg) 56%, #111827 100%);
}

a { color: inherit; }

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

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: 86px;
  height: 42px;
  padding: 4px 6px 4px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, var(--bg));
  color: var(--text);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.theme-label { line-height: 1; }

.theme-icon {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, .07);
  border: 1px solid rgba(15, 23, 42, .08);
}

.theme-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: inset -7px -6px 0 0 var(--card);
}

.theme-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
}

html.dark .theme-toggle {
  justify-content: flex-start;
  padding: 4px 13px 4px 6px;
  background: color-mix(in srgb, #111827 88%, #2563eb);
  border-color: color-mix(in srgb, var(--line) 72%, #60a5fa);
  color: #e2e8f0;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .26);
}

html.dark .theme-label { order: 2; }

html.dark .theme-icon::before {
  inset: 5px;
  box-shadow: none;
}

html.dark .theme-icon::after {
  border-color: color-mix(in srgb, #facc15 70%, transparent);
  opacity: 1;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 10px 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 6px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
}

html.dark .logo { background: transparent; }

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
  transition: box-shadow .2s ease, transform .2s ease;
}

.logo:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(20, 184, 166, .20);
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  color: var(--text);
  font-size: clamp(1.52rem, 2.2vw, 2.18rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-name span {
  color: #0f766e;
}

html.dark .brand-name {
  color: #f8fafc;
}

html.dark .brand-name span {
  color: #5eead4;
}

.brand-tagline {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.logo img:not(.brand-mark) {
  display: block;
  width: min(220px, 58vw);
  height: auto;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.nav,
.related-grid,
.cta-row,
.footer-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav {
  justify-content: flex-end;
}

.nav a,
.breadcrumb a,
.related-grid a,
.cta-row a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: rgba(255, 255, 255, .78);
  color: var(--text);
  font-weight: 800;
  font-size: .92rem;
  line-height: 1.2;
  white-space: nowrap;
}

.nav a:hover,
.related-grid a:hover,
.cta-row a:hover {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  text-decoration: none;
}

html.dark .nav a,
html.dark .breadcrumb a,
html.dark .related-grid a,
html.dark .cta-row a {
  background: rgba(15, 23, 42, .82);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: .9rem;
  min-width: 0;
  padding: 10px 0 2px;
}

.breadcrumb span {
  font-weight: 800;
}

.breadcrumb span:last-child {
  min-width: 0;
  max-width: min(48ch, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  padding: 22px 0 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
  font-size: .82rem;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(2.1rem, 4.8vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.lede {
  max-width: 860px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.75;
  font-weight: 600;
}

.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 18px;
  align-items: start;
}

.content,
.sidebar-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--card));
  box-shadow: var(--shadow);
}

.content {
  padding: clamp(22px, 4vw, 42px);
}

.sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.sidebar-card {
  padding: 18px;
}

h2 {
  margin: 30px 0 10px;
  font-size: clamp(1.28rem, 2vw, 1.55rem);
  letter-spacing: 0;
}

h3 {
  margin: 18px 0 8px;
  font-size: 1.06rem;
  letter-spacing: 0;
}

p,
li {
  color: var(--muted);
  line-height: 1.74;
  font-weight: 600;
}

ul,
ol {
  padding-left: 22px;
}

.note {
  border-left: 4px solid var(--teal);
  background: var(--soft);
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
}

.steps {
  display: grid;
  gap: 10px;
  padding-left: 0;
}

.steps li {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--soft);
}

.faq-item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.cta-row {
  margin: 22px 0 4px;
}

.cta-row a.primary {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .18);
}

.ad-section {
  margin: 24px 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card);
  text-align: center;
}

.ad-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ad-placeholder {
  min-height: 72px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.footer {
  color: var(--muted);
  margin-top: 30px;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(260px, .92fr) minmax(420px, 1.55fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: start;
  padding: 30px 0 28px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.footer-brand {
  display: grid;
  gap: 10px;
  align-content: start;
}

.footer-brand p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(.96rem, 1.4vw, 1.08rem);
  font-weight: 650;
  line-height: 1.68;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 6px 0;
  margin-bottom: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}

html.dark .footer-logo { background: transparent; }

.footer-logo:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(20, 184, 166, .20);
}

.footer-logo .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
.footer-logo .brand-name { font-size: 1.44rem; }
.footer-logo .brand-tagline { font-size: .66rem; }

.footer-groups {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(170px, .7fr);
  gap: clamp(24px, 5vw, 72px);
  min-width: 0;
}

.footer-group {
  display: grid;
  gap: 11px;
  align-content: start;
  min-width: 0;
}

.footer-group h2 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 8px 18px;
  min-width: 0;
}

.footer-links--tools {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

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

.footer-group a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  width: 100%;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.25;
  border-radius: 6px;
  overflow-wrap: anywhere;
  transition: color .18s ease, transform .18s ease;
}

.footer a:hover {
  color: var(--text);
  text-decoration: none;
  transform: translateX(2px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0 46px;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  font-size: .9rem;
  font-weight: 750;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 44%, var(--teal));
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .page { width: min(100% - 22px, 1120px); }
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    justify-items: start;
    padding: 8px 0;
  }
  .logo {
    min-height: 46px;
    padding: 2px 0;
  }
  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .brand-name {
    font-size: 1.42rem;
  }
  .brand-tagline {
    display: none;
  }
  .nav-shell {
    display: none;
  }
  .footer-main,
  .footer-groups {
    grid-template-columns: 1fr;
  }
  .footer-links {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .footer-links--tools {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .article {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .page { width: min(100% - 20px, 1120px); }
  .logo {
    width: auto;
    justify-content: flex-start;
    padding: 2px 0;
  }
  .hero {
    padding-top: 16px;
  }
}
