:root {
  --bg: #f6f9ff;
  --card: #ffffff;
  --text: #162134;
  --muted: #4f5f78;
  --slate: #31476c;
  --steel: #5f7aa5;
  --crimson: #d83a62;
  --border: #d8e1ef;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  min-height: 100%;
}
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f4f8ff 0%, #eef4ff 100%);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1320px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, color-mix(in srgb, #f6f9ff 93%, #ffffff), color-mix(in srgb, #f6f9ff 84%, #ffffff));
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(30, 48, 72, 0.07);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
}

@media (min-width: 1100px) {
  .header-inner {
    padding-inline: 1.9rem;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--slate);
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, color 180ms ease;
}

.brand:hover {
  transform: translateY(-1px);
  color: #233b5f;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--steel), var(--crimson));
  box-shadow: 0 6px 16px rgba(81, 112, 163, 0.35);
}

.main-nav {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--slate);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.42rem;
  font-size: 0.92rem;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.nav-icon-svg {
  width: 15px;
  height: 15px;
}

.nav-link:hover {
  border-color: var(--steel);
  background: #edf4ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(53, 77, 116, 0.1);
}

.nav-link.active {
  border-color: var(--crimson);
  color: var(--crimson);
  background: #fff0f4;
}

.icon-home .nav-icon {
  color: #22549d;
  border-color: #a5c0ef;
  background: linear-gradient(145deg, #dfebff, #cadfff);
}

.icon-fundamentals .nav-icon {
  color: #1f4f9e;
  border-color: #a9c5f3;
  background: linear-gradient(145deg, #dbe9ff, #c4ddff);
}

.icon-indexeddb .nav-icon {
  color: #1f7860;
  border-color: #9fdec9;
  background: linear-gradient(145deg, #d9f7ec, #c4f0dd);
}

.icon-sync .nav-icon {
  color: #a5274b;
  border-color: #f0b4c7;
  background: linear-gradient(145deg, #ffe1ea, #ffd0dd);
}

.nav-link.active .nav-icon {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.page-main {
  padding: 1rem 0 2.2rem;
  flex: 1 0 auto;
}

.breadcrumbs {
  margin: 0.2rem 0 1rem;
}
.breadcrumbs ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.45rem;
  color: #7f90ad;
}
.breadcrumbs a { color: var(--steel); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.content-article,
.related {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(24, 40, 64, 0.06);
  padding: clamp(1rem, 2.2vw, 1.6rem);
}

.related { margin-top: 1rem; }
.related h2 { margin-top: 0; }

h1, h2, h3 {
  line-height: 1.25;
  color: #1f2f49;
  scroll-margin-top: calc(var(--header-h) + 14px);
}
h1 {
  font-size: clamp(1.65rem, 2.7vw, 2.2rem);
  margin-top: 0;
}
h2 {
  margin-top: 2rem;
  border-top: 1px solid #e5ebf6;
  padding-top: 1rem;
}

.content-page .content-article > h1 {
  padding: 0.95rem 1rem;
  margin: 0 0 1rem;
  border: 1px solid #d7e3f5;
  border-radius: 12px;
  background: linear-gradient(140deg, #ffffff 0%, #f3f7ff 68%, #ebf3ff 100%);
  box-shadow: inset 0 -1px 0 rgba(140, 162, 200, 0.28);
}

.content-page .content-article > h2,
.content-page .content-article > h3 {
  position: relative;
  border-top: 0;
  margin-top: 2.1rem;
  padding-top: 0.3rem;
  padding-left: 0.95rem;
}

.content-page .content-article > h2::before,
.content-page .content-article > h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1rem;
  bottom: 0.1rem;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5b83c4 0%, #d83a62 100%);
}

.content-page .content-article > h2 {
  font-size: clamp(1.4rem, 2.1vw, 1.7rem);
  color: #1c3458;
}

.content-page .content-article > h3 {
  font-size: clamp(1.15rem, 1.55vw, 1.35rem);
  color: #254a79;
}

.content-page .content-article > h2:hover,
.content-page .content-article > h3:hover {
  color: #143865;
}
a { color: var(--steel); }
a:hover { color: var(--crimson); }

.content-page .content-article p a,
.content-page .content-article li a,
.content-page .content-article td a,
.content-page .content-article blockquote a {
  color: #315d9b;
  text-decoration: none;
  font-weight: 600;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(90deg, #d2e2fb, #f7ccda);
  background-size: 0% 2px, 100% 2px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  transition: color 170ms ease, background-size 170ms ease, text-shadow 170ms ease;
}

.content-page .content-article p a:hover,
.content-page .content-article li a:hover,
.content-page .content-article td a:hover,
.content-page .content-article blockquote a:hover {
  color: #b12c53;
  background-size: 100% 2px, 100% 2px;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.content-page .content-article p a:focus-visible,
.content-page .content-article li a:focus-visible,
.content-page .content-article td a:focus-visible,
.content-page .content-article blockquote a:focus-visible {
  outline: 2px solid #9ab7e2;
  outline-offset: 2px;
  border-radius: 4px;
  background-size: 100% 2px, 100% 2px;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0 0.6rem;
}

.cta {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(140deg, #ffffff 0%, #f3f7ff 65%, #eef4ff 100%);
  color: #1f2f49;
  padding: 1rem;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.cta:hover {
  transform: translateY(-1px);
  border-color: #93a9cc;
  box-shadow: 0 10px 28px rgba(26, 45, 72, 0.12);
  background: linear-gradient(140deg, #ffffff 0%, #eef4ff 55%, #e8f0ff 100%);
}

.cta-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
}

.cta-icon-svg {
  width: 24px;
  height: 24px;
}

.cta-copy {
  display: grid;
  gap: 0.2rem;
}

.cta-title {
  font-weight: 700;
  color: #1f2f49;
  line-height: 1.3;
}

.cta-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.icon-fundamentals .cta-icon-wrap {
  color: #1f4f9e;
  border-color: #a9c5f3;
  background: linear-gradient(145deg, #dbe9ff, #c4ddff);
}

.icon-indexeddb .cta-icon-wrap {
  color: #1f7860;
  border-color: #9fdec9;
  background: linear-gradient(145deg, #d9f7ec, #c4f0dd);
}

.icon-sync .cta-icon-wrap {
  color: #a5274b;
  border-color: #f0b4c7;
  background: linear-gradient(145deg, #ffe1ea, #ffd0dd);
}

.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #cfdff6;
  border-radius: 18px;
  padding: clamp(1.1rem, 2.3vw, 2rem);
  background:
    radial-gradient(1200px 220px at -6% -35%, rgba(99, 136, 198, 0.2), transparent 72%),
    radial-gradient(700px 220px at 108% -20%, rgba(216, 58, 98, 0.2), transparent 70%),
    linear-gradient(140deg, #ffffff 0%, #f3f8ff 55%, #eef4ff 100%);
  box-shadow:
    0 14px 34px rgba(34, 56, 92, 0.13),
    inset 0 -1px 0 rgba(108, 137, 184, 0.18);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 38%);
  z-index: -1;
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -66px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 58, 98, 0.2), rgba(216, 58, 98, 0));
  pointer-events: none;
  z-index: -1;
}

.home-hero h1 {
  margin: 0.1rem 0 0.7rem;
  font-size: clamp(1.95rem, 3.1vw, 2.8rem);
  letter-spacing: -0.02em;
  color: #112f58;
  line-height: 1.14;
  text-wrap: balance;
}

.home-hero p {
  max-width: 78ch;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
  color: #2d5188;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid #bbd0f1;
  background: linear-gradient(145deg, #e5efff, #d5e4ff);
}

.home-kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5888cf, #d83a62);
  box-shadow: 0 0 0 3px rgba(88, 136, 207, 0.16);
}

.home-lead {
  font-size: clamp(1.03rem, 1.34vw, 1.2rem);
  line-height: 1.55;
  color: #1e406e;
  font-weight: 560;
}

.home-page .content-article > h2 {
  margin-top: 2.2rem;
  border-top: 0;
  padding-top: 0;
  padding-bottom: 0.45rem;
  position: relative;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  color: #1d3a64;
}

.home-page .content-article > h2::after {
  content: "";
  display: block;
  width: clamp(120px, 18vw, 210px);
  height: 4px;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #5a86c8 0%, #d83a62 100%);
}

.home-page .content-article > h2:hover {
  color: #12345e;
}

.reading-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.95rem;
  margin-top: 0.95rem;
}

.reading-cta {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.95rem;
  border-radius: 14px;
  border: 1px solid #d7e4f8;
  text-decoration: none;
  color: #1f2f49;
  background: linear-gradient(140deg, #ffffff 0%, #f5f8ff 70%, #edf3ff 100%);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.reading-cta:hover {
  transform: translateY(-2px);
  border-color: #9db6dc;
  box-shadow: 0 12px 28px rgba(24, 45, 78, 0.12);
}

.reading-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  flex: 0 0 auto;
}

.reading-icon-svg {
  width: 24px;
  height: 24px;
}

.reading-copy {
  display: grid;
  gap: 0.2rem;
}

.reading-step {
  color: #3f5f8f;
  font-weight: 700;
  font-size: 0.79rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reading-title {
  font-weight: 700;
  line-height: 1.3;
}

.reading-text {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.path-start .reading-icon {
  color: #1f4f9e;
  border-color: #a9c5f3;
  background: linear-gradient(145deg, #dbe9ff, #c4ddff);
}

.path-middle .reading-icon {
  color: #1f7860;
  border-color: #9fdec9;
  background: linear-gradient(145deg, #d9f7ec, #c4f0dd);
}

.path-finish .reading-icon {
  color: #a5274b;
  border-color: #f0b4c7;
  background: linear-gradient(145deg, #ffe1ea, #ffd0dd);
}

pre {
  position: relative;
  margin: 1rem 0;
  border-radius: 12px;
  border: 1px solid #ccd7ea;
  background: #10213a;
  color: #e7eeff;
  overflow: auto;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
pre code {
  display: block;
  padding: 0.95rem 1rem;
  min-width: max-content;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid #496794;
  background: #183760;
  color: #dce9ff;
  border-radius: 8px;
  font-size: 0.75rem;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}
.copy-btn:hover { background: #204470; }

.hljs-keyword, .hljs-selector-tag, .hljs-title { color: #7cb9ff; }
.hljs-string, .hljs-attr, .hljs-template-variable { color: #8ce5b6; }
.hljs-comment, .hljs-quote { color: #92a6c9; }
.hljs-number, .hljs-literal { color: #f4b47f; }
.hljs-built_in, .hljs-type { color: #ff9cd5; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 1rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.7rem;
  text-align: left;
}
th {
  background: #f1f6ff;
  color: var(--slate);
}

details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.6rem 0.75rem;
  margin: 0.8rem 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-break strong {
  display: block;
  margin-bottom: 0.3rem;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #f7faff;
}

.footer-inner {
  min-height: 120px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem 0;
}

.footer-inner ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (max-width: 900px) {
  .container {
    width: min(1320px, calc(100% - 1.4rem));
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }
}

