:root {
  --primary: #2563eb;
  --secondary: #1e40af;
  --accent: #c9a24d;
  --bg: #f8fafc;
  --white: #ffffff;
  --text: #0f172a;
  --body: #1e293b;
  --muted: #64748b;
  --border: #e5e7eb;
  --dark: #020617;
  --dark-soft: #0b1220;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --note-bg: #f8fafc;
  --note-border: #cbd5e1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 10px 26px rgba(15, 23, 42, 0.05);
  --reading-width: 100%;
  --scroll-offset: 96px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

img,
video,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

header {
  background: var(--dark);
  color: var(--white);
  padding: 20px 5%;
  text-align: center;
}

.logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.scroll-menu {
  border-top: 1px solid #0b1220;
  border-bottom: 1px solid #0b1220;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  text-align: center;
  background: var(--white);
}

.scroll-menu::-webkit-scrollbar {
  display: none;
}

.scroll-menu .inner {
  display: inline-flex;
  padding: 6px 0;
}

.scroll-menu a {
  padding: 8px 16px;
  font-size: 14px;
  color: #000000;
  opacity: 0.85;
}

.scroll-menu a:hover,
.scroll-menu a:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.page-hero {
  background: var(--dark);
  color: var(--white);
  text-align: center;
  padding: 70px 5%;
}

.page-hero h1 {
  font-size: clamp(30px, 5vw, 34px);
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.2;
}

.page-hero p {
  max-width: 720px;
  margin: auto;
  font-size: 14px;
  color: #e5e7eb;
}

.page-content {
  background: var(--white);
  padding: 80px 5%;
}

.content-wrap {
  max-width: 900px;
  margin: auto;
}

.article-shell {
  max-width: 860px;
  margin: auto;
}

.section-block + .section-block {
  margin-top: 52px;
}

.intro-block {
  margin-bottom: 40px;
}

.intro-block h2,
.section-heading {
  font-size: 24px;
  margin-bottom: 14px;
}

.intro-block p,
.section-copy {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.doc-list,
.tag-row,
.helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.doc-list a,
.tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}

.subtle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.subtle-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--bg);
}

.subtle-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.subtle-card p,
.subtle-card li {
  font-size: 14px;
  color: var(--muted);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  align-items: start;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: clip;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.article-card:hover,
.article-card:focus-within {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.article-card-media {
  display: block;
  background: linear-gradient(180deg, #eef2ff, #dbeafe);
}

.article-card-media img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.article-card-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 700;
}

.article-card-title {
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.article-card-title a:hover,
.article-card-title a:focus-visible {
  color: var(--primary);
}

.article-card-excerpt {
  font-size: 14px;
  color: var(--muted);
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.article-card-footer {
  margin-top: auto;
}

.article-link,
.back-link,
.inline-nav,
.meta-card a,
.doc-list a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-link,
.back-link,
.inline-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.article-header {
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  margin-bottom: 32px;
}

.article-header .eyebrow {
  margin-bottom: 14px;
}

.article-title {
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.article-deck {
  max-width: 720px;
  font-size: clamp(16px, 2.8vw, 18px);
  color: var(--muted);
}

.article-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.meta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg);
}

.meta-card span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-card strong,
.meta-card time,
.meta-card a {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.featured-figure {
  margin: 0 0 36px;
}

.featured-figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.featured-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.article-body,
.type-demo {
  max-width: var(--reading-width);
}

.article-body > * + *,
.type-demo > * + * {
  margin-top: 22px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6,
.type-demo h1,
.type-demo h2,
.type-demo h3,
.type-demo h4,
.type-demo h5,
.type-demo h6,
.heading-sample-h1,
.heading-sample-h2,
.heading-sample-h3,
.heading-sample-h4,
.heading-sample-h5,
.heading-sample-h6 {
  color: var(--text);
  line-height: 1.3;
}

.article-body h1,
.type-demo h1,
.heading-sample-h1 {
  font-size: clamp(30px, 5vw, 34px);
}

.article-body h2,
.type-demo h2,
.heading-sample-h2 {
  font-size: clamp(24px, 4vw, 28px);
  margin-top: 52px;
}

.article-body h3,
.type-demo h3,
.heading-sample-h3 {
  font-size: 22px;
  margin-top: 42px;
}

.article-body h4,
.type-demo h4,
.heading-sample-h4 {
  font-size: 18px;
  margin-top: 34px;
}

.article-body h5,
.type-demo h5,
.heading-sample-h5 {
  font-size: 16px;
  margin-top: 28px;
}

.article-body h6,
.type-demo h6,
.heading-sample-h6 {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 28px;
}

.article-body p,
.article-body li,
.article-body td,
.article-body th,
.article-body dd,
.article-body dt,
.article-body blockquote,
.article-body figcaption,
.type-demo p,
.type-demo li,
.type-demo td,
.type-demo th,
.type-demo dd,
.type-demo dt,
.type-demo blockquote,
.type-demo figcaption {
  font-size: clamp(15px, 2.7vw, 17px);
}

.article-body p,
.article-body li,
.article-body td,
.article-body dd,
.type-demo p,
.type-demo li,
.type-demo td,
.type-demo dd {
  color: var(--body);
  overflow-wrap: break-word;
}

.article-body small,
.type-demo small {
  font-size: 13px;
  color: var(--muted);
}

.article-body strong,
.type-demo strong {
  color: var(--text);
}

.article-body em,
.type-demo em {
  font-style: italic;
}

.article-body u,
.type-demo u {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-body mark,
.type-demo mark {
  background: #fde68a;
  color: var(--text);
  padding: 2px 4px;
  border-radius: 4px;
}

.article-body sup,
.article-body sub,
.type-demo sup,
.type-demo sub {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.article-body sup,
.type-demo sup {
  top: -0.45em;
}

.article-body sub,
.type-demo sub {
  bottom: -0.2em;
}

.article-body a,
.type-demo a,
.article-link,
.back-link,
.inline-nav,
.meta-card a,
.doc-list a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.article-body a:hover,
.article-body a:focus-visible,
.type-demo a:hover,
.type-demo a:focus-visible,
.article-link:hover,
.article-link:focus-visible,
.back-link:hover,
.back-link:focus-visible,
.inline-nav:hover,
.inline-nav:focus-visible,
.meta-card a:hover,
.meta-card a:focus-visible,
.doc-list a:hover,
.doc-list a:focus-visible {
  color: var(--secondary);
}

.article-body ul,
.article-body ol,
.type-demo ul,
.type-demo ol {
  padding-left: 24px;
}

.article-body li + li,
.type-demo li + li {
  margin-top: 10px;
}

.article-body ul ul,
.article-body ol ol,
.article-body ul ol,
.article-body ol ul,
.type-demo ul ul,
.type-demo ol ol,
.type-demo ul ol,
.type-demo ol ul {
  margin-top: 12px;
}

.article-body dl,
.type-demo dl {
  display: grid;
  gap: 6px;
}

.article-body dt,
.type-demo dt {
  font-weight: 700;
  color: var(--text);
}

.article-body dd,
.type-demo dd {
  margin-left: 0;
  padding-left: 16px;
}

.article-body blockquote,
.type-demo blockquote {
  background: #f1f5f9;
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.pull-quote {
  padding: 22px 0;
  font-size: clamp(21px, 4vw, 28px);
  line-height: 1.4;
  color: var(--text);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-body hr,
.type-demo hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

.article-body code,
.type-demo code,
.article-body kbd,
.type-demo kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.article-body :not(pre) > code,
.type-demo :not(pre) > code,
.article-body kbd,
.type-demo kbd {
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: 4px;
}

.article-body :not(pre) > code,
.type-demo :not(pre) > code {
  color: var(--primary);
}

.article-body kbd,
.type-demo kbd {
  color: var(--text);
  border: 1px solid var(--border);
}

.article-body pre,
.type-demo pre {
  position: relative;
  background: var(--dark);
  color: #f8fafc;
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 28px 0;
  -webkit-overflow-scrolling: touch;
}

.article-body pre code,
.type-demo pre code {
  display: block;
  min-width: max-content;
  background: transparent;
  color: inherit;
  padding: 0;
}

.code-block {
  scrollbar-width: thin;
}

.code-block[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 10px;
  right: 12px;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.token-comment,
.token-doctype,
.token-selector {
  color: #94a3b8;
}

.token-keyword,
.token-property,
.token-attr {
  color: #93c5fd;
}

.token-string,
.token-inserted {
  color: #86efac;
}

.token-number,
.token-boolean,
.token-entity {
  color: #fca5a5;
}

.token-function,
.token-tag {
  color: #fcd34d;
}

.token-operator,
.token-punctuation {
  color: #cbd5e1;
}

.token-variable {
  color: #f9a8d4;
}

.table-responsive,
.embed-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table,
.type-demo table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0;
}

.table-responsive th,
.table-responsive td,
.type-demo th,
.type-demo td {
  padding: 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-responsive thead,
.type-demo thead {
  background: var(--primary);
  color: var(--white);
}

.table-responsive tfoot,
.type-demo tfoot {
  background: var(--bg);
  color: var(--muted);
}

.article-body figure,
.type-demo figure {
  margin: 30px 0;
}

.article-body figure img,
.type-demo figure img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.article-body figcaption,
.type-demo figcaption {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.embed-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--dark-soft);
}

.embed-wrap iframe,
.embed-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.callout {
  border: 1px solid var(--note-border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--note-bg);
}

.callout > strong {
  display: block;
  margin-bottom: 8px;
}

.callout-info {
  background: var(--info-bg);
  border-color: var(--info-border);
}

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.loading-state,
.empty-state,
.error-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
}

.article-footer {
  margin-top: 52px;
  max-width: var(--reading-width);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-footer-nav {
  margin-top: 10px;
}

.article-footer-tags,
.article-footer-note,
.article-footer-back,
.article-footer-nav {
  margin: 0;
}

.article-footer-tags {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.article-footer-note {
  margin-top: 18px;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}

.article-footer-back {
  margin-top: 16px;
}

.article-footer .inline-nav,
.article-footer .back-link {
  display: inline;
  font-size: 14px;
  font-weight: 500;
}

footer {
  background: var(--dark);
  color: #9ca3af;
  padding: 40px 5% 28px;
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

footer h4 {
  color: #ffffff;
  margin-bottom: 10px;
  font-size: 15px;
}

footer p {
  color: #9ca3af;
}

footer a {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
}

.copyright {
  text-align: center;
  margin-top: 30px;
  border-top: 1px solid #1f2937;
  padding-top: 18px;
}

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

@media (max-width: 900px) {
  .article-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: 56px 5%;
  }

  .page-content {
    padding: 60px 5%;
  }

  .article-body h2,
  .type-demo h2 {
    margin-top: 42px;
  }
}

@media (max-width: 560px) {
  .logo {
    font-size: 20px;
  }

  .subtle-grid,
  .footer-grid,
  .article-meta {
    grid-template-columns: 1fr;
  }

  .article-footer {
    padding-top: 18px;
  }

  .article-footer-note {
    max-width: none;
    font-size: 14px;
  }

  .article-card-body,
  .meta-card,
  .callout,
  .subtle-card {
    padding: 16px;
  }

  .article-body ul,
  .article-body ol,
  .type-demo ul,
  .type-demo ol {
    padding-left: 20px;
  }

  .article-body pre,
  .type-demo pre {
    padding: 16px 14px;
    font-size: 13px;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
