.hero-preview {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  overflow-x: clip;
}

.hero-preview-inner {
  width: 100%;
  max-width: var(--page-max);
  min-height: calc(100vh - var(--header-height));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(620px, 1.34fr) minmax(420px, 0.82fr);
  gap: clamp(34px, 3.8vw, 62px);
  align-items: stretch;
}

.hero-device {
  position: relative;
  min-width: 0;
  min-height: 730px;
}

.hero-device::before {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: 42px;
  left: calc(var(--gutter) * -1);
  content: "";
  background:
    linear-gradient(126deg, var(--color-panel-soft-alpha) 0%, var(--color-transparent) 56%),
    linear-gradient(180deg, var(--color-transparent) 69%, var(--color-accent-alpha) 100%);
  border-top: var(--line-thin) solid var(--color-border-alpha);
  border-right: var(--line-thin) solid var(--color-border-alpha);
  clip-path: polygon(0 5%, 100% 0, 95% 94%, 7% 100%);
}

.hero-device-heading {
  position: absolute;
  top: 72px;
  left: 0;
  z-index: 2;
  display: grid;
  gap: 4px;
  color: var(--color-text-muted);
  font: 8px/1.4 var(--font-mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-device-heading strong {
  color: var(--color-text);
  font-size: 11px;
}

.hero-network-svg {
  position: absolute;
  inset: 25px -24px 8px -46px;
  width: calc(100% + 70px);
  height: calc(100% - 33px);
  overflow: visible;
}

.hero-web-line,
.hero-web-ring,
.hero-web-spine,
.hero-route,
.hero-route-underlay,
.hero-platform-icon,
.hero-cat-detail,
.hero-window-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-web-line {
  stroke: var(--color-web);
  stroke-width: 1;
}

.hero-web-ring {
  stroke: var(--color-web-light);
  stroke-width: 0.9;
}

.hero-web-spine {
  stroke: var(--color-web);
  stroke-width: 1.55;
}

.hero-route-underlay {
  stroke: var(--color-accent-pale);
  stroke-width: 4.6;
  stroke-dasharray: 1 10;
}

.hero-route {
  stroke: var(--color-accent);
  stroke-width: 3.1;
  stroke-dasharray: 22 14;
  animation: route-pulse var(--ease-calm) infinite;
}

.hero-route-delay {
  animation-delay: -2.1s;
}

.hero-junction {
  fill: var(--color-accent);
  stroke: var(--color-panel);
  stroke-width: 2;
}

.hero-dew-shell {
  fill: var(--color-panel-alpha);
  stroke: var(--color-web);
  stroke-width: 1.2;
}

.hero-dew-core {
  fill: var(--color-panel);
  stroke: var(--color-border);
  stroke-width: 0.8;
}

.hero-dew-highlight {
  fill: var(--color-white-alpha);
  animation: dew-light 5.4s ease-in-out infinite;
}

.hero-dew-delay {
  animation-delay: -2.7s;
}

.hero-platform-icon {
  stroke: var(--color-text);
  stroke-width: 1.7;
}

.hero-platform-name,
.hero-rule-key,
.hero-rule-value {
  font-family: var(--font-mono);
}

.hero-platform-name {
  fill: var(--color-text);
  font-size: 9px;
  font-weight: 650;
  text-anchor: middle;
}

.hero-rule-card {
  fill: var(--color-panel-alpha);
  stroke: var(--color-border);
  stroke-width: 0.8;
}

.hero-rule-mark {
  fill: var(--color-accent);
}

.hero-rule-key {
  fill: var(--color-accent-dark);
  font-size: 8px;
  font-weight: 700;
}

.hero-rule-value {
  fill: var(--color-text-muted);
  font-size: 8px;
}

.hero-window-frame {
  fill: var(--color-panel-cool);
  stroke: var(--color-border);
  stroke-width: 1.1;
}

.hero-window-sill {
  fill: var(--color-panel);
  stroke: var(--color-border);
  stroke-width: 1.15;
}

.hero-window-line {
  stroke: var(--color-border);
  stroke-width: 1;
}

.hero-cat-body,
.hero-cat-head,
.hero-cat-paw {
  fill: var(--color-cat);
}

.hero-cat-tail,
.hero-cat-tail-tip {
  fill: none;
  stroke: var(--color-cat);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-cat-tail {
  stroke-width: 12;
}

.hero-cat-tail-tip {
  stroke-width: 6;
}

.hero-cat-ear {
  fill: var(--color-cat-detail);
}

.hero-cat-eye {
  fill: var(--color-accent);
  stroke: var(--color-accent-dark);
  stroke-width: 0.6;
}

.hero-cat-detail {
  stroke: var(--color-cat-detail);
  stroke-width: 1;
}

.hero-copy {
  min-width: 0;
  align-self: center;
  padding-top: 50px;
  padding-bottom: 42px;
}

.hero-copy h1 {
  max-width: 540px;
}

.hero-brand-line {
  display: block;
  margin-bottom: 11px;
  color: var(--color-accent-dark);
  font-size: 0.52em;
  line-height: 1.15;
  letter-spacing: 0.035em;
}

.hero-description {
  max-width: 500px;
  margin: 27px 0 0;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip-list,
.badge-row {
  margin: 23px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.chip-list li,
.chip,
.badge,
.tag {
  max-width: 100%;
  min-height: 29px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--color-text-muted);
  background: var(--color-panel-alpha);
  border: var(--line-thin) solid var(--color-border-alpha);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-recommended {
  color: var(--color-paper);
  background: var(--color-success);
  border-color: var(--color-success);
}

.badge-primary {
  color: var(--color-paper);
  background: var(--color-accent);
  border-color: var(--color-accent-dark);
}

.badge-retired {
  color: var(--color-error);
  background: var(--color-panel);
  border-color: var(--color-error);
}

.badge-warning {
  color: var(--color-warn);
  border-color: var(--color-warn);
}

.hero-footnote {
  margin-top: 24px;
  padding-top: 17px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  color: var(--color-text-muted);
  border-top: var(--line-thin) solid var(--color-border-alpha);
  font: 9px/1.65 var(--font-mono);
}

.hero-footnote-index {
  color: var(--color-accent-dark);
  font-weight: 700;
}

.preview-plate-number {
  position: absolute;
  top: 22px;
  right: var(--gutter);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--color-text-muted);
  font: 9px/1.4 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.preview-plate-number::before {
  width: 38px;
  height: var(--line-thin);
  flex-shrink: 0;
  content: "";
  background: var(--color-accent);
}

.tabs {
  min-width: 0;
}

.tab-list {
  display: flex;
  align-items: stretch;
  gap: 4px;
  max-width: 100%;
  margin: 0 0 24px;
  padding: 5px;
  overflow-x: auto;
  background: var(--color-panel-cool);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-small);
  scrollbar-width: thin;
}

.tab-list [role="tab"] {
  min-height: 44px;
  padding: 8px 16px;
  flex: 0 0 auto;
  color: var(--color-text-muted);
  background: var(--color-transparent);
  border: var(--line-thin) solid var(--color-transparent);
  border-radius: var(--radius-small);
  font-weight: 650;
}

.tab-list [role="tab"]:hover {
  color: var(--color-text);
}

.tab-list [role="tab"][aria-selected="true"],
.tab-list [role="tab"].active {
  color: var(--color-text);
  background: var(--color-panel);
  border-color: var(--color-border);
}

[role="tabpanel"] {
  min-width: 0;
}

.tab-panel {
  min-width: 0;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 14px);
  z-index: 8;
  max-width: 100%;
  margin-bottom: 36px;
  padding: 8px;
  overflow-x: auto;
  background: var(--color-panel);
  border-top: var(--line-thin) solid var(--color-border);
  border-bottom: var(--line-thin) solid var(--color-border);
  scrollbar-width: thin;
}

.toc-list {
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  list-style: none;
}

.toc-list li {
  margin: 0;
}

.toc a {
  min-height: 40px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-small);
  font-size: 13px;
  white-space: nowrap;
}

.toc a:hover {
  color: var(--color-text);
  background: var(--color-accent-alpha);
}

.faq-list {
  border-top: var(--line-thin) solid var(--color-border);
}

.faq-item {
  border-bottom: var(--line-thin) solid var(--color-border);
}

.faq-item summary {
  position: relative;
  min-height: 64px;
  padding: 18px 52px 18px 0;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 680;
  list-style: none;
}

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

.faq-item summary::after {
  position: absolute;
  top: 20px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  content: "+";
  color: var(--color-accent-dark);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-circle);
  font: 18px/1 var(--font-mono);
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--color-accent-alpha);
}

.faq-answer {
  max-width: 860px;
  padding: 0 50px 20px 0;
  color: var(--color-text-muted);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.glossary-card {
  position: relative;
  min-width: 0;
  padding: 24px 24px 24px 32px;
  background: var(--color-panel);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-small);
}

.glossary-card::before {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 14px;
  width: var(--line-medium);
  content: "";
  background: var(--color-accent);
}

.glossary-term {
  margin: 0 0 8px;
  font: 700 17px/1.35 var(--font-mono);
}

.glossary-card p {
  margin: 0;
  color: var(--color-text-muted);
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.client-card {
  position: relative;
  min-width: 0;
  padding: 26px;
  background: var(--color-panel);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-medium);
}

.client-card.is-primary {
  border-top: 4px solid var(--color-accent);
}

.client-card.is-retired {
  background: var(--color-panel-cool);
}

.client-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.client-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.client-card-title {
  min-width: 0;
  flex: 1;
}

.client-card-title h3 {
  margin-bottom: 7px;
}

.client-meta {
  color: var(--color-text-muted);
  font: 11px/1.6 var(--font-mono);
}

.client-card-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

[data-cdnver]:empty {
  display: none;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  min-width: 0;
  min-height: 100%;
  padding: 26px;
  display: flex;
  flex-direction: column;
  background: var(--color-panel);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-small);
  transition: transform var(--ease-fast), border-color var(--ease-fast);
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
}

.post-card-meta {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
  font: 10px/1.5 var(--font-mono);
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 25px;
}

.post-card p {
  color: var(--color-text-muted);
}

.post-card-link {
  margin-top: auto;
  padding-top: 10px;
  color: var(--color-accent-dark);
  font-weight: 680;
}

.callout {
  position: relative;
  margin: 28px 0;
  padding: 20px 22px 20px 28px;
  overflow-x: clip;
  color: var(--color-text);
  background: var(--color-panel-cool);
  border: var(--line-thin) solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-small);
}

.callout::after {
  position: absolute;
  top: -14px;
  right: 18px;
  content: "NOTE";
  color: var(--color-border);
  font: 700 36px/1 var(--font-mono);
  letter-spacing: 0.08em;
  pointer-events: none;
}

.callout-title {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font: 700 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callout p:last-child {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.callout-success {
  border-left-color: var(--color-success);
}

.callout-warning {
  border-left-color: var(--color-warn);
}

.callout-error {
  border-left-color: var(--color-error);
}

.download-prompt {
  margin-top: 56px;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(120deg, var(--color-panel) 0%, var(--color-panel-cool) 100%);
  border: var(--line-thin) solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-medium);
}

.download-prompt-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dl-fab {
  position: fixed;
  right: max(18px, var(--gutter));
  bottom: 18px;
  z-index: 35;
  max-width: min(310px, calc(100vw - 32px));
}

.dl-fab-link {
  min-height: 58px;
  padding: 10px 18px 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-paper);
  background: var(--color-cat);
  border: var(--line-thin) solid var(--color-cat-detail);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-panel);
}

.dl-fab-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--color-paper);
  background: var(--color-accent);
  border-radius: var(--radius-circle);
}

.dl-fab-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dl-fab-copy {
  min-width: 0;
  display: grid;
}

.dl-fab-copy strong {
  line-height: 1.35;
}

.dl-fab-copy small {
  color: var(--color-border-soft);
  font: 9px/1.5 var(--font-mono);
}

.specimen-index {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 26px;
}

.specimen-nav {
  position: relative;
  padding-left: 30px;
}

.specimen-nav::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 9px;
  width: var(--line-thin);
  content: "";
  background: var(--color-web);
}

.specimen-nav button {
  position: relative;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  display: block;
  color: var(--color-text-muted);
  background: var(--color-transparent);
  border: 0;
  text-align: left;
}

.specimen-nav button::before {
  position: absolute;
  top: 22px;
  left: -25px;
  width: 11px;
  height: 11px;
  content: "";
  background: var(--color-panel);
  border: var(--line-thin) solid var(--color-web);
  border-radius: var(--radius-circle);
}

.specimen-nav button[aria-selected="true"] {
  color: var(--color-accent-dark);
}

.specimen-nav button[aria-selected="true"]::before {
  background: var(--color-accent);
  border-color: var(--color-accent-dark);
}

.specimen-detail {
  min-width: 0;
  padding: clamp(24px, 4vw, 50px);
  background: var(--color-panel);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-small);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.color-swatch {
  min-width: 0;
  overflow: hidden;
  background: var(--color-panel);
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-small);
}

.color-sample {
  height: 92px;
  border-bottom: var(--line-thin) solid var(--color-border);
}

.swatch-bg {
  background: var(--color-bg);
}

.swatch-panel {
  background: var(--color-panel);
}

.swatch-panel-cool {
  background: var(--color-panel-cool);
}

.swatch-border {
  background: var(--color-border);
}

.swatch-accent {
  background: var(--color-accent);
}

.swatch-accent-dark {
  background: var(--color-accent-dark);
}

.swatch-text {
  background: var(--color-text);
}

.swatch-muted {
  background: var(--color-text-muted);
}

.swatch-success {
  background: var(--color-success);
}

.swatch-warn {
  background: var(--color-warn);
}

.swatch-error {
  background: var(--color-error);
}

.swatch-web {
  background: var(--color-web);
}

.color-name {
  padding: 12px;
  font: 10px/1.5 var(--font-mono);
  overflow-wrap: anywhere;
}

.type-sample {
  padding: 28px 0;
  border-bottom: var(--line-thin) solid var(--color-border);
}

.type-display {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
}

.type-body {
  max-width: 720px;
  font-family: var(--font-body);
  font-size: 18px;
}

.type-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.data-table {
  min-width: 680px;
}

.prose > .data-table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes route-pulse {
  0%,
  100% {
    opacity: 0.34;
  }

  45% {
    opacity: 0.94;
  }
}

@keyframes dew-light {
  0%,
  100% {
    opacity: 0.38;
  }

  50% {
    opacity: 0.96;
  }
}

@media (max-width: 1120px) {
  .hero-preview-inner {
    grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
  }

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

@media (max-width: 900px) {
  .hero-preview-inner {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-device {
    min-height: 610px;
    order: 1;
  }

  .hero-copy {
    order: 2;
    padding-top: 12px;
    padding-bottom: 72px;
  }

  .preview-plate-number {
    display: none;
  }

  .specimen-index {
    grid-template-columns: 1fr;
  }

  .specimen-nav {
    padding: 0;
    display: flex;
    max-width: 100%;
    overflow-x: auto;
  }

  .specimen-nav::before,
  .specimen-nav button::before {
    display: none;
  }

  .specimen-nav button {
    width: auto;
    min-width: max-content;
  }
}

@media (max-width: 700px) {
  .glossary-grid,
  .client-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .toc {
    overflow-x: visible;
  }

  .toc-list {
    width: 100%;
    flex-wrap: wrap;
  }

  .toc a {
    white-space: normal;
  }

  .hero-preview {
    min-height: auto;
  }

  .hero-preview-inner {
    min-height: auto;
  }

  .hero-device {
    min-height: 430px;
  }

  .hero-network-svg {
    inset: 30px -8px 5px -24px;
    width: calc(100% + 32px);
    height: calc(100% - 35px);
  }

  .hero-device-heading {
    top: 46px;
  }

  .hero-copy {
    padding-bottom: 58px;
  }

  .hero-description {
    margin-top: 20px;
  }

  .hero-actions {
    margin-top: 22px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .tab-list {
    margin-inline: calc(var(--gutter) * -0.25);
  }

  .faq-answer {
    padding-right: 0;
  }

  .client-card-head {
    align-items: center;
  }

  .dl-fab {
    right: 16px;
    bottom: 12px;
    left: 16px;
    max-width: none;
  }

  .dl-fab-link {
    width: 100%;
  }

  .download-prompt-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-route,
  .hero-dew-highlight {
    animation: none;
  }
}