:root {
  --bg-top: #f9fbff;
  --bg-bottom: #e9f1ff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: #c8d6f5;
  --text: #09152b;
  --muted: #425173;
  --accent: #0067ff;
  --accent-soft: #3ea4ff;
  --accent-warm: #ff8d56;
  --shadow: 0 30px 90px rgba(12, 33, 80, 0.15);
  --font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", sans-serif;
  --focus: #0a5bd8;
}

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

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

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

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(123, 194, 255, 0.55), transparent 42%),
    radial-gradient(circle at 92% 2%, rgba(168, 238, 255, 0.6), transparent 44%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(68, 100, 169, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 100, 169, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.55;
  z-index: -1;
}

.site-shell {
  width: min(1140px, 92vw);
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  background: #ffffff;
  color: #0d2656;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  z-index: 200;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0.85rem;
  z-index: 100;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 45px rgba(22, 41, 92, 0.14);
  padding: 0.55rem 0.75rem 0.55rem 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.brand-logo {
  width: clamp(142px, 19vw, 220px);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 103, 255, 0.22));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.52rem 0.85rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.site-nav a:hover {
  background: rgba(0, 103, 255, 0.09);
  color: var(--accent);
}

.site-nav a.active {
  background: rgba(0, 103, 255, 0.14);
  color: var(--accent);
}

.site-nav a.nav-external {
  color: #ffffff;
  background: linear-gradient(145deg, #0d2e64, #1f4e97);
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: 0 8px 20px rgba(7, 29, 74, 0.24);
}

.site-nav a.nav-external:hover {
  color: #ffffff;
  background: linear-gradient(145deg, #134084, #2a66bf);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.4rem 0.8rem;
}

main {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.2rem;
  min-height: 55vh;
}

.hero {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 1rem;
}

.hero-copy,
.hero-viz,
.panel,
.page-hero {
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: var(--panel);
  border-radius: 1.55rem;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(1.35rem, 3.5vw, 2.7rem);
}

.kicker {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.14;
  margin: 0;
}

h1 {
  font-size: clamp(1.95rem, 3.5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

h3 {
  font-size: 1.18rem;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy p {
  margin: 1rem 0 0;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  font-weight: 600;
  font-size: 0.94rem;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

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

.btn-primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-soft));
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 103, 255, 0.32);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.hero-viz {
  position: relative;
  min-height: clamp(540px, 66vh, 760px);
  overflow: hidden;
  background: linear-gradient(160deg, rgba(233, 242, 255, 0.95), rgba(230, 246, 255, 0.88));
}

#labs-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.panel {
  padding: clamp(1.2rem, 2.8vw, 2rem);
}

.page-hero {
  padding: clamp(1.4rem, 3vw, 2.5rem);
}

.page-hero .lead {
  max-width: 67ch;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading.row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
}

.card h3,
.card h2 {
  margin-top: 0.2rem;
}

.card p {
  margin: 0.5rem 0 0;
}

.product-grid {
  align-items: stretch;
}

.product-grid .product-card {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
}

.product-card-content {
  position: relative;
  margin-top: 0.45rem;
  max-height: 11.5rem;
  overflow: hidden;
}

.product-card.can-expand:not(.expanded) .product-card-content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.8rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--panel-strong) 70%);
}

.product-card.expanded .product-card-content {
  max-height: none;
  overflow: visible;
}

.card-expander {
  margin-top: auto;
  align-self: flex-start;
  border: 1px solid rgba(50, 92, 168, 0.58);
  border-radius: 0.64rem;
  background: linear-gradient(140deg, #11284f 0%, #1b3d77 100%);
  color: #eaf2ff;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.52rem 0.8rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(13, 34, 77, 0.25);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.card-expander:hover {
  background: linear-gradient(140deg, #163468 0%, #24549f 100%);
  border-color: rgba(106, 156, 255, 0.72);
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(13, 34, 77, 0.35);
}

.product-card.expanded .card-expander {
  margin-top: 1rem;
}

.card-expander[hidden] {
  display: none;
}

.meta {
  margin: 0;
  color: #4c5b7f;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.8rem;
  font-weight: 600;
  font-size: 0.93rem;
}

.text-link:hover {
  text-decoration: underline;
}

.inline-link {
  color: #1f58b8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.inline-link:hover {
  text-decoration-thickness: 2px;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

.lead {
  font-size: 1.05rem;
}

.tag-list,
.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.tag-list li,
.step-list li {
  border: 1px solid var(--line);
  border-radius: 0.82rem;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.72rem 0.85rem;
  color: #29406f;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(0, 103, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 103, 255, 0.2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.55rem;
  margin-bottom: 0.25rem;
}

.article-list {
  display: grid;
  gap: 0.85rem;
}

.article-card h2 {
  font-size: clamp(1.18rem, 2.3vw, 1.6rem);
}

.article-page {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(1.3rem, 3vw, 2.2rem);
}

.panel,
.page-hero,
.card,
.article-page {
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}

.article-page p {
  margin: 1rem 0 0;
}

.article-page h2 {
  margin-top: 1.9rem;
  font-size: clamp(1.24rem, 2.4vw, 1.76rem);
}

.article-page h3 {
  margin-top: 1.25rem;
  font-size: 1.08rem;
}

.article-page ul,
.article-page ol {
  margin: 0.9rem 0 0 1.2rem;
  padding: 0;
  color: var(--muted);
}

.article-page li {
  margin: 0.4rem 0;
  line-height: 1.58;
}

.article-related {
  margin-top: 2.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.article-related h2 {
  margin: 0;
  font-size: 1.12rem;
}

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

.related-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.4;
}

.related-link:hover {
  text-decoration: underline;
}

.article-pager {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.pager-link,
.pager-spacer {
  flex: 1 1 260px;
  min-width: 0;
}

.pager-link {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.78);
  color: #1b3565;
  text-decoration: none;
  padding: 0.62rem 0.78rem;
}

.pager-link:hover {
  background: #ffffff;
  border-color: #9cb5ea;
}

.pager-label {
  display: block;
  font-size: 0.74rem;
  color: #4f6289;
  letter-spacing: 0.02em;
}

.pager-title {
  display: block;
  margin-top: 0.16rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.36;
}

.pager-link.next {
  text-align: right;
}

blockquote {
  margin: 1.15rem 0 0;
  border-left: 4px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  color: #1a2d59;
}

.footer {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  color: #5a698d;
  font-size: 0.9rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.2rem;
}

.footer p {
  margin: 0;
}

.footer-legal {
  max-width: 70ch;
}

.footer-meta {
  margin-left: auto;
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.footer-link {
  color: #244f9e;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.footer-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .hero,
  .split,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-viz {
    min-height: clamp(470px, 58vh, 660px);
  }
}

@media (max-width: 760px) {
  .topbar {
    border-radius: 1.1rem;
    padding: 0.65rem;
    align-items: start;
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.35rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    border-radius: 0.8rem;
  }

  .brand-logo {
    width: clamp(136px, 50vw, 188px);
  }

  .product-grid .product-card {
    min-height: 19.5rem;
  }

  .section-heading.row .btn {
    width: 100%;
    text-align: center;
  }

  .footer {
    align-items: start;
  }

  .footer-meta {
    margin-left: 0;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    white-space: normal;
  }
}

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

  .btn,
  .site-nav a {
    transition: none;
  }
}
