/* ==========================================================================
   ClearNC landing and changelog stylesheet
   Shared by index.html and changelog.html. studio.html has its own styles.
   Zero external CDN dependencies: system fonts, inline SVG, no web fonts.
   ========================================================================== */

/* ---------- Structure tokens (each look sets its own colours below) ---------- */
:root {
  --max-width: 1200px;
  --nav-height: 64px;
  --gutter: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --transition: 160ms var(--ease);
}

/* ===== BASE RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body-size, 16px);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--ink);
}

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

::selection {
  background: var(--selection);
  color: var(--ink);
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-inline-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  padding: 0.08em 0.38em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: var(--btn-weight, 500);
  font-size: 14px;
  line-height: 1;
  letter-spacing: var(--btn-tracking, 0);
  padding: 11px 18px;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

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

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-color: var(--btn-bg);
}

.btn-primary:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  color: var(--btn-ink);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--rule);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-lg {
  font-size: 15px;
  padding: 14px 22px;
}

.btn-sm {
  font-size: 12.5px;
  padding: 8px 12px;
}

/* ===== TOP NAVIGATION BAR ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-nav);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}


.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--btn-radius);
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .icon-moon,
[data-theme="light"] .icon-sun {
  display: none;
}

.mobile-menu-btn {
  display: none;
  color: var(--ink);
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 12px var(--gutter) 20px;
  z-index: 99;
  box-shadow: var(--shadow);
}

.mobile-drawer.open {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-drawer .nav-link {
  display: block;
  padding: 12px 4px;
  font-size: 15px;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}

.mobile-drawer .btn {
  margin-top: 12px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 88px 0 96px;
}

.hero-content {
  max-width: 880px;
  margin: 0 0 56px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 26px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

.hero h1 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: var(--h1-size);
  line-height: var(--h1-leading, 1.04);
  letter-spacing: var(--h1-tracking, -0.035em);
  font-weight: var(--h1-weight, 600);
  color: var(--ink);
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0 0 32px;
  max-width: 660px;
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* Hero screenshot */
.hero-showcase {
  position: relative;
  margin: 0;
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.window-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--rule);
}

.chrome-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chrome-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.chrome-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rule-strong);
}

.chrome-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ok);
  white-space: nowrap;
}

.hero-frame-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #0d1117;
  cursor: zoom-in;
  overflow: hidden;
}

.hero-frame-trigger img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}

.zoom-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--btn-radius);
  background: rgba(10, 10, 10, 0.78);
  color: #f2f2f0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition);
}

.hero-frame-trigger:hover .zoom-hint,
.hero-frame-trigger:focus-visible .zoom-hint {
  opacity: 1;
  transform: none;
}

/* ===== SECTIONS ===== */
.section {
  padding: 112px 0;
  border-top: 1px solid var(--rule);
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  max-width: 780px;
  margin: 0 0 56px;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: var(--h2-size);
  line-height: 1.08;
  letter-spacing: var(--h2-tracking, -0.03em);
  font-weight: var(--h2-weight, 600);
  text-wrap: balance;
}

.section-header p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.02rem;
  max-width: 640px;
  text-wrap: pretty;
}

.section-header p strong {
  color: var(--ink);
  font-weight: 600;
}

/* ===== WHY: 3-WAY COMPARISON ===== */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 88px;
}

.compare-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 26px;
  position: relative;
}

.compare-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.compare-label.bad { color: var(--bad); }
.compare-label.warn { color: var(--warn); }
.compare-label.good { color: var(--ok); }

.compare-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.compare-card > p {
  margin: 0 0 20px;
  font-size: 0.93rem;
  color: var(--ink-2);
}

.mini-snippet {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-code);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--ink-2);
}

/* Problems solved */
.problems-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 28px;
  color: var(--ink);
}

.problems-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.problem-card {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 24px;
}

.problem-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.04rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.problem-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ===== SHOWCASE GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}

.gallery-card.wide {
  grid-column: span 3;
}

.gallery-card:hover {
  border-color: var(--rule-strong);
}

.gallery-media {
  position: relative;
  display: block;
  border: 0;
  padding: 0;
  width: 100%;
  background: #0d1117;
  cursor: zoom-in;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.gallery-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform 420ms var(--ease);
}

.gallery-card:hover .gallery-media img {
  transform: scale(1.02);
}

.gallery-zoom-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: var(--btn-radius);
  background: rgba(10, 10, 10, 0.72);
  color: #f2f2f0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-card:hover .gallery-zoom-badge,
.gallery-media:focus-visible .gallery-zoom-badge {
  opacity: 1;
}

.gallery-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gallery-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c-mill3);
  margin-bottom: 8px;
}

.gallery-tag.mill5 { color: var(--c-mill5); }
.gallery-tag.millturn { color: var(--c-millturn); }

.gallery-body h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.gallery-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== TUTORIAL ===== */
.tutorial-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.tutorial-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  min-width: 0;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}

.sidebar-heading #tutorial-step-label {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-3);
}

.progress-track {
  height: 3px;
  background: var(--rule);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 11.1%;
  background: var(--ink);
  transition: width 260ms var(--ease);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  transition: background var(--transition), color var(--transition);
}

.toc-link:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.toc-link.active {
  background: var(--bg-hover);
  color: var(--ink);
  font-weight: 500;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 1px;
  flex-shrink: 0;
}

.toc-link.active .toc-num {
  color: var(--ink);
}

.sidebar-cta {
  margin-top: 18px;
}

.sidebar-cta .btn {
  width: 100%;
}

.tutorial-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.lesson-card {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
}

.lesson-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.lesson-header > div:first-child {
  min-width: 0;
  flex: 1 1 320px;
}

.lesson-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.lesson-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
}

.lesson-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lesson-lead {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.lesson-subhead {
  margin: 32px 0 10px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.lesson-list {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.lesson-list li {
  margin-bottom: 6px;
}

.lesson-list strong {
  color: var(--ink);
  font-weight: 600;
}

/* Code blocks */
.code-block {
  margin: 20px 0;
  min-width: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  background: var(--bg-code);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
}

.code-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.lang-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  flex-shrink: 0;
}

.code-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.copy-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.copy-btn.copied {
  color: var(--ok);
  border-color: currentColor;
}

.code-pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--tok-ident);
  tab-size: 2;
}

/* Syntax token classes (set by landing.js) */
.tok-kw { color: var(--tok-kw); font-weight: 600; }
.tok-op { color: var(--tok-op); font-weight: 600; }
.tok-unit { color: var(--tok-unit); font-weight: 600; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-bool { color: var(--tok-bool); font-weight: 600; }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-punct { color: var(--tok-punct); }
.tok-ident { color: var(--tok-ident); }

/* Reference tables */
.table-wrap {
  margin: 20px 0;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.ref-table th {
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12.5px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
  background: var(--bg-alt);
}

.ref-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: top;
}

.ref-table tbody tr:last-child td {
  border-bottom: none;
}

.ref-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Callouts */
.callout {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-3);
  background: var(--bg-alt);
  font-size: 0.92rem;
  color: var(--ink);
}

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

.callout-title {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.callout p {
  margin: 0;
  color: var(--ink-2);
}

.lesson-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.example-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== CONTROLLERS & EXAMPLES ===== */
.controllers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 64px;
}

.controller-card {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controller-flavor {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.controller-flavor::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--c-mill3);
  flex-shrink: 0;
}

.controller-flavor.mill5::before { background: var(--c-mill5); }
.controller-flavor.millturn::before { background: var(--c-millturn); }
.controller-flavor.lathe::before { background: var(--c-lathe); }

.controller-card h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.controller-flag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.example-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  color: var(--ink);
  transition: border-color var(--transition), background var(--transition);
}

.example-card:hover {
  border-color: var(--rule-strong);
  background: var(--bg-hover);
  color: var(--ink);
}

.example-card > div {
  min-width: 0;
}

.example-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.example-arrow {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

.example-card:hover .example-arrow {
  color: var(--ink);
  transform: translateX(3px);
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 72px 0 40px;
  border-top: 1px solid var(--rule);
}

.footer-cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0 0 56px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.footer-cta-band > div {
  min-width: 0;
}

.footer-cta-band h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: var(--h2-size);
  line-height: 1.08;
  letter-spacing: var(--h2-tracking, -0.03em);
  font-weight: var(--h2-weight, 600);
  max-width: 16em;
  text-wrap: wrap;
}

.footer-cta-band p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--ink-2);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-2);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 6, 7, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 1280px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #111112;
  border: 1px solid #2c2c2f;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #2c2c2f;
  color: #f2f2f0;
}

.lightbox-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8e8e93;
  margin-left: 10px;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 11px;
  border-radius: var(--btn-radius);
  border: 1px solid #38383c;
  background: transparent;
  color: #f2f2f0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.lightbox-btn:hover {
  background: #232326;
  border-color: #58585e;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: auto;
  background: #0a0a0b;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(92vh - 115px);
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.lightbox-caption {
  padding: 11px 18px;
  border-top: 1px solid #2c2c2f;
  color: #b4b4ba;
  font-size: 13px;
}

/* ===== CHANGELOG ===== */
.changelog-hero {
  position: relative;
  padding: 80px 0 48px;
}

.changelog-hero-inner {
  max-width: 820px;
}

.changelog-hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: var(--h2-size);
  line-height: 1.05;
  letter-spacing: var(--h1-tracking, -0.035em);
  font-weight: var(--h1-weight, 600);
  color: var(--ink);
}

.changelog-hero p {
  margin: 0 0 36px;
  font-size: 1.03rem;
  color: var(--ink-2);
  max-width: 640px;
}

.changelog-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-pill:hover {
  background: var(--bg-hover);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.changelog-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.changelog-section {
  padding: 56px 0 112px;
  border-top: 1px solid var(--rule);
}

.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.release-entry {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.release-entry[hidden] {
  display: none;
}

.release-rail {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 28px;
  min-width: 0;
}

.release-date {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.release-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}

.release-entry.latest .release-dot {
  background: var(--ok);
}

.release-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.release-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 0;
  color: var(--ink-2);
}

.release-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--ink-3);
}

.release-tag.tag-5axis::before { background: var(--c-mill5); }
.release-tag.tag-gcode::before { background: var(--ok); }
.release-tag.tag-sim::before { background: var(--c-mill3); }
.release-tag.tag-language::before { background: var(--c-lathe); }
.release-tag.tag-millturn::before { background: var(--c-millturn); }

.release-version {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  text-decoration: none;
}

.release-card {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}

.release-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.release-card-header > div:first-child {
  min-width: 0;
  flex: 1 1 300px;
}

.release-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.release-entry.latest .release-kicker {
  color: var(--ok);
}

.release-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.release-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.metric-chip strong {
  color: var(--ink);
  font-weight: 600;
}

.change-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.change-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--ink-2);
  min-width: 0;
}

.change-list li > span:last-child {
  min-width: 0;
}

.change-list li strong {
  color: var(--ink);
  font-weight: 600;
}

.change-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 78px;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
  color: var(--ink-2);
}

.change-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.change-badge.added { color: var(--ok); }
.change-badge.improved { color: var(--c-mill3); }
.change-badge.verified { color: var(--c-mill5); }

.release-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.changelog-empty {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--rule-strong);
  color: var(--ink-2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1080px) {
  .compare-grid,
  .problems-grid,
  .controllers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tutorial-layout {
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .nav-link {
    padding: 7px 8px;
  }

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

  .gallery-card,
  .gallery-card.wide {
    grid-column: span 1;
  }

  .tutorial-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tutorial-sidebar {
    position: static;
  }

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

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

  .release-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .release-rail {
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --nav-height: 58px;
  }

  .nav-links {
    display: none;
  }

  .nav-actions {
    gap: 8px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .hero-content {
    margin-bottom: 40px;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-cta .btn {
    flex: 1 1 auto;
  }

  .section {
    padding: 72px 0;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .changelog-section {
    padding: 40px 0 72px;
  }

  .changelog-hero {
    padding: 48px 0 32px;
  }

  .compare-grid,
  .problems-grid,
  .gallery-grid,
  .controllers-grid,
  .examples-grid,
  .toc-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .compare-grid {
    margin-bottom: 64px;
  }

  .lesson-card,
  .release-card {
    padding: 22px 18px;
  }

  .compare-card,
  .problem-card,
  .controller-card {
    padding: 20px;
  }

  .code-pre {
    padding: 14px 16px;
    font-size: 12.5px;
  }

  .change-list li {
    flex-direction: column;
    gap: 4px;
  }

  .chrome-right .verified-pill {
    display: none;
  }

  .footer-cta-band .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .nav-actions .btn-primary {
    display: none;
  }

  .chrome-title {
    font-size: 11px;
  }
}

/* ===== MOTION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   LOOK: DATASHEET
   The page is ruled like an engineering datasheet: two hairline rails run
   the full height at the edges of the column, every section starts on a
   rule with registration marks where it meets them, and every grid runs
   rail to rail. Type is one quiet sans. The one bold object is the part
   itself: the sensor bracket from the hero screenshot, drawn in its own
   G-code toolpath and printed in line by line when the page opens.
   ========================================================================== */

:root,
[data-theme="dark"] {
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ui: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --part-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='641' height='436' viewBox='0 0 640.5 436.0'%3E%3Cdefs%3E%3CclipPath id='op'%3E%3Cpath d='M276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z'/%3E%3C/clipPath%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='640.5' height='436.0'%3E%3Crect width='640.5' height='436.0' fill='black'/%3E%3Cpath d='M574.2 198.9L375.5 313.6L375.5 369.8L574.2 255.0Z' fill='rgb(117,117,117)' /%3E%3Cpath d='M66.3 135.1L375.5 313.6L375.5 369.8L66.3 191.2Z' fill='rgb(51,51,51)' /%3E%3Cpath d='M265.1 20.4L574.2 198.9L375.5 313.6L66.3 135.1ZM276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z' fill-rule='evenodd' fill='rgb(255,255,255)'/%3E%3Cg clip-path='url(%23op)'%3E%3Cpath d='M276.1 108.4L474.8 223.1L364.4 286.9L165.7 172.1Z' fill='rgb(153,153,153)' /%3E%3Cpath d='M276.1 77.8L165.7 141.5L165.7 172.1L276.1 108.4Z' fill='rgb(82,82,82)' /%3E%3Cpath d='M276.1 77.8L474.8 192.5L474.8 223.1L276.1 108.4Z' fill='rgb(36,36,36)' /%3E%3C/g%3E%3Cellipse cx='265.1' cy='51.0' rx='14.1' ry='8.1' fill='rgb(46,46,46)'/%3E%3Cellipse cx='265.1' cy='54.2' rx='14.1' ry='8.1' fill='rgb(0,0,0)'/%3E%3Cellipse cx='521.2' cy='198.9' rx='14.1' ry='8.1' fill='rgb(46,46,46)'/%3E%3Cellipse cx='521.2' cy='202.1' rx='14.1' ry='8.1' fill='rgb(0,0,0)'/%3E%3Cellipse cx='119.3' cy='135.1' rx='14.1' ry='8.1' fill='rgb(46,46,46)'/%3E%3Cellipse cx='119.3' cy='138.3' rx='14.1' ry='8.1' fill='rgb(0,0,0)'/%3E%3Cellipse cx='375.5' cy='283.0' rx='14.1' ry='8.1' fill='rgb(46,46,46)'/%3E%3Cellipse cx='375.5' cy='286.2' rx='14.1' ry='8.1' fill='rgb(0,0,0)'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='640.5' height='436.0' fill='white' mask='url(%23m)'/%3E%3C/svg%3E");

  --bg: #0a0a0b;
  --bg-alt: #0a0a0b;
  --bg-raised: #121214;
  --bg-hover: #17171a;
  --bg-code: #0e0e10;
  --bg-nav: rgba(10, 10, 11, 0.82);
  --code-inline-bg: #18181b;

  --ink: #ededec;
  --ink-2: #9d9ea3;
  --ink-3: #66686e;
  --rule: #1f2023;
  --rule-strong: #303136;
  --rail: #26272b;
  --mark: #6c6e74;

  --link: var(--ink);
  --focus: #ededec;
  --selection: rgba(237, 237, 236, 0.2);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);

  --ok: #4cc283;
  --warn: #e0b341;
  --bad: #f0645a;
  --c-mill3: #8fb3e8;
  --c-mill5: #e39a5b;
  --c-millturn: #c99ae6;
  --c-lathe: #d9c07a;

  --btn-bg: #ededec;
  --btn-bg-hover: #ffffff;
  --btn-ink: #0a0a0b;
  --btn-radius: 8px;
  --btn-weight: 500;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --h1-size: clamp(2rem, 1.15rem + 3.3vw, 3.25rem);
  --h1-weight: 500;
  --h1-tracking: -0.042em;
  --h1-leading: 1.02;
  --h2-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem);
  --h2-weight: 500;
  --h2-tracking: -0.035em;

  --tok-kw: #8fb3e8;
  --tok-op: #d9c07a;
  --tok-unit: #6fcf97;
  --tok-key: #c4c5c9;
  --tok-str: #e39a7b;
  --tok-num: #c99ae6;
  --tok-bool: #8fb3e8;
  --tok-comment: #66686e;
  --tok-ident: #ededec;
  --tok-punct: #85878d;
}

[data-theme="light"] {
  --part-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='641' height='436' viewBox='0 0 640.5 436.0'%3E%3Cdefs%3E%3CclipPath id='op'%3E%3Cpath d='M276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z'/%3E%3C/clipPath%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='640.5' height='436.0'%3E%3Crect width='640.5' height='436.0' fill='black'/%3E%3Cpath d='M574.2 198.9L375.5 313.6L375.5 369.8L574.2 255.0Z' fill='rgb(153,153,153)' /%3E%3Cpath d='M66.3 135.1L375.5 313.6L375.5 369.8L66.3 191.2Z' fill='rgb(230,230,230)' /%3E%3Cpath d='M265.1 20.4L574.2 198.9L375.5 313.6L66.3 135.1ZM276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z' fill-rule='evenodd' fill='rgb(66,66,66)'/%3E%3Cg clip-path='url(%23op)'%3E%3Cpath d='M276.1 108.4L474.8 223.1L364.4 286.9L165.7 172.1Z' fill='rgb(117,117,117)' /%3E%3Cpath d='M276.1 77.8L165.7 141.5L165.7 172.1L276.1 108.4Z' fill='rgb(184,184,184)' /%3E%3Cpath d='M276.1 77.8L474.8 192.5L474.8 223.1L276.1 108.4Z' fill='rgb(242,242,242)' /%3E%3C/g%3E%3Cellipse cx='265.1' cy='51.0' rx='14.1' ry='8.1' fill='rgb(204,204,204)'/%3E%3Cellipse cx='265.1' cy='54.2' rx='14.1' ry='8.1' fill='rgb(255,255,255)'/%3E%3Cellipse cx='521.2' cy='198.9' rx='14.1' ry='8.1' fill='rgb(204,204,204)'/%3E%3Cellipse cx='521.2' cy='202.1' rx='14.1' ry='8.1' fill='rgb(255,255,255)'/%3E%3Cellipse cx='119.3' cy='135.1' rx='14.1' ry='8.1' fill='rgb(204,204,204)'/%3E%3Cellipse cx='119.3' cy='138.3' rx='14.1' ry='8.1' fill='rgb(255,255,255)'/%3E%3Cellipse cx='375.5' cy='283.0' rx='14.1' ry='8.1' fill='rgb(204,204,204)'/%3E%3Cellipse cx='375.5' cy='286.2' rx='14.1' ry='8.1' fill='rgb(255,255,255)'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='640.5' height='436.0' fill='white' mask='url(%23m)'/%3E%3C/svg%3E");

  --bg: #fbfbfa;
  --bg-alt: #fbfbfa;
  --bg-raised: #ffffff;
  --bg-hover: #f3f3f1;
  --bg-code: #f6f6f4;
  --bg-nav: rgba(251, 251, 250, 0.86);
  --code-inline-bg: #efefec;

  --ink: #0c0c0d;
  --ink-2: #55575c;
  --ink-3: #8c8e93;
  --rule: #e6e6e2;
  --rule-strong: #cfcfca;
  --rail: #dcdcd7;
  --mark: #9a9ca0;

  --focus: #0c0c0d;
  --selection: rgba(12, 12, 13, 0.12);
  --shadow: 0 24px 60px rgba(12, 12, 13, 0.1);

  --ok: #17804a;
  --warn: #8a6400;
  --bad: #c42b20;
  --c-mill3: #2f5fa8;
  --c-mill5: #b4561a;
  --c-millturn: #7d43a3;
  --c-lathe: #866b12;

  --btn-bg: #0c0c0d;
  --btn-bg-hover: #2a2a2c;
  --btn-ink: #fbfbfa;

  --tok-kw: #2f5fa8;
  --tok-op: #866b12;
  --tok-unit: #17804a;
  --tok-key: #3d3f44;
  --tok-str: #a8431f;
  --tok-num: #7d43a3;
  --tok-bool: #2f5fa8;
  --tok-comment: #8c8e93;
  --tok-ident: #0c0c0d;
  --tok-punct: #6b6d72;
}

body {
  font-size: 15.5px;
  letter-spacing: -0.006em;
}

/* ---------- the rails: two hairlines down the full page ---------- */
@media (min-width: 1260px) {
  body {
    position: relative;
  }

  body::after {
    content: "";
    position: absolute;
    z-index: 101;
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--max-width);
    transform: translateX(-50%);
    border-left: 1px solid var(--rail);
    border-right: 1px solid var(--rail);
    pointer-events: none;
  }

  /* registration marks where each section rule meets the rails */
  .section,
  .site-footer,
  .changelog-section {
    position: relative;
  }

  .section::before,
  .site-footer::before,
  .changelog-section::before {
    content: "";
    position: absolute;
    z-index: 102;
    top: -5px;
    left: 50%;
    width: calc(var(--max-width) + 9px);
    height: 9px;
    transform: translateX(-50%);
    background:
      linear-gradient(var(--mark) 0 0) 0 4px / 9px 1px no-repeat,
      linear-gradient(var(--mark) 0 0) 4px 0 / 1px 9px no-repeat,
      linear-gradient(var(--mark) 0 0) 100% 4px / 9px 1px no-repeat,
      linear-gradient(var(--mark) 0 0) calc(100% - 4px) 0 / 1px 9px no-repeat;
    pointer-events: none;
  }
}

/* ---------- header ---------- */
.site-header {
  border-bottom-color: var(--rule);
}

.brand {
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-tag {
  letter-spacing: 0;
}

.nav-link {
  font-weight: 450;
}

.nav-link.active {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 -1px 0 var(--ink);
  border-radius: 0;
}

/* ---------- hero: a datasheet title, then the spec beside the part ---------- */
.hero {
  padding: 96px 0 0;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  grid-template-rows: auto auto auto 1fr auto;
  column-gap: 64px;
}

.hero-content {
  display: contents;
}

.hero-eyebrow,
.hero h1 {
  grid-column: 1 / -1;
}

.hero-eyebrow .status-dot,
.changelog-hero .status-dot {
  display: none;
}

.hero-eyebrow {
  justify-self: start;
  color: var(--ink-2);
  font-weight: 450;
  margin-bottom: 28px;
}

.hero h1 {
  max-width: none;
  margin-bottom: 48px;
  text-wrap: balance;
}

.hero h1 .text-accent {
  color: inherit;
  white-space: nowrap;
}

.hero-subtitle,
.hero-cta {
  grid-column: 1;
}

.hero-subtitle,
.hero-cta {
  align-self: start;
}

.hero-cta {
  margin-bottom: 0;
}

.hero-subtitle {
  margin: 0 0 32px;
  max-width: 600px;
  font-size: 1.06rem;
  line-height: 1.62;
}

/* the part, drawn in its own toolpath */
.hero .container::before {
  content: "% N20O1001(SENSOR BRACKET VMC) N30G21G17G40G49G80G90 N40T1M06(FACE 50) N50G54G00X-30.0Y4.0S3200M03 N60G43H01Z30.0M08 N70G01X170.0Y4.0F2400 N80G01X-30.0Y22.0F2400 N90G01X170.0Y40.0F2400 N100G01X-30.0Y58.0F2400 N110G01X170.0Y76.0F2400 N120G00Z30.0 N130T2M06(ROUGH 12) N140G00X31.0Y26.0S8000M03 N150G43H02Z5.0 N160G01Z-2.0F600 N170G01X109.0Y26.0F1800 N180G01X31.0Y30.5 N190G01X109.0Y35.0F1800 N200G01X31.0Y39.5 N210G01X109.0Y44.0F1800 N220G01X31.0Y48.5 N230G01X109.0Y53.0F1800 N240G01X31.0Y57.5 N250G01X109.0Y62.0F1800 N260G01X31.0Y64.0 N270G00Z5.0X31.0Y26.0 N280G01Z-4.5F600 N290G01X109.0Y26.0F1800 N300G01X31.0Y30.5 N310G01X109.0Y35.0F1800 N320G01X31.0Y39.5 N330G01X109.0Y44.0F1800 N340G01X31.0Y48.5 N350G01X109.0Y53.0F1800 N360G01X31.0Y57.5 N370G01X109.0Y62.0F1800 N380G01X31.0Y64.0 N390G00Z5.0X31.0Y26.0 N400G01Z-7.0F600 N410G01X109.0Y26.0F1800 N420G01X31.0Y30.5 N430G01X109.0Y35.0F1800 N440G01X31.0Y39.5 N450G01X109.0Y44.0F1800 N460G01X31.0Y48.5 N470G01X109.0Y53.0F1800 N480G01X31.0Y57.5 N490G01X109.0Y62.0F1800 N500G01X31.0Y64.0 N510G00Z5.0X31.0Y26.0 N520G01Z-9.5F600 N530G01X109.0Y26.0F1800 N540G01X31.0Y30.5 N550G01X109.0Y35.0F1800 N560G01X31.0Y39.5 N570G01X109.0Y44.0F1800 N580G01X31.0Y48.5 N590G01X109.0Y53.0F1800 N600G01X31.0Y57.5 N610G01X109.0Y62.0F1800 N620G01X31.0Y64.0 N630G00Z5.0X31.0Y26.0 N640G01Z-12.0F600 N650G01X109.0Y26.0F1800 N660G01X31.0Y30.5 N670G01X109.0Y35.0F1800 N680G01X31.0Y39.5 N690G01X109.0Y44.0F1800 N700G01X31.0Y48.5 N710G01X109.0Y53.0F1800 N720G01X31.0Y57.5 N730G01X109.0Y62.0F1800 N740G01X31.0Y64.0 N750G00Z5.0X31.0Y26.0 N760T3M06(SPOT 10) N770G98G81X12.0Y12.0Z-2.0R3.0F300 N780X128.0 N790Y78.0 N800X12.0 N810G80 N820T4M06(DRILL 9) N830G98G83X12.0Y12.0Z-26.0R3.0Q4.0F260 N840X128.0 N850Y78.0 N860X12.0 N870G80 N880G00Z30.0M09 N890M30 % % N20O1001(SENSOR BRACKET VMC) N30G21G17G40G49G80G90 N40T1M06(FACE 50) N50G54G00X-30.0Y4.0S3200M03 N60G43H01Z30.0M08 N70G01X170.0Y4.0F2400 N80G01X-30.0Y22.0F2400 N90G01X170.0Y40.0F2400 N100G01X-30.0Y58.0F2400 N110G01X170.0Y76.0F2400 N120G00Z30.0 N130T2M06(ROUGH 12) N140G00X31.0Y26.0S8000M03 N150G43H02Z5.0 N160G01Z-2.0F600 N170G01X109.0Y26.0F1800 N180G01X31.0Y30.5 N190G01X109.0Y35.0F1800 N200G01X31.0Y39.5 N210G01X109.0Y44.0F1800 N220G01X31.0Y48.5 N230G01X109.0Y53.0F1800 N240G01X31.0Y57.5 N250G01X109.0Y62.0F1800 N260G01X31.0Y64.0 N270G00Z5.0X31.0Y26.0 N280G01Z-4.5F600 N290G01X109.0Y26.0F1800 N300G01X31.0Y30.5 N310G01X109.0Y35.0F1800 N320G01X31.0Y39.5 N330G01X109.0Y44.0F1800 N340G01X31.0Y48.5 N350G01X109.0Y53.0F1800 N360G01X31.0Y57.5 N370G01X109.0Y62.0F1800 N380G01X31.0Y64.0 N390G00Z5.0X31.0Y26.0 N400G01Z-7.0F600 N410G01X109.0Y26.0F1800 N420G01X31.0Y30.5 N430G01X109.0Y35.0F1800 N440G01X31.0Y39.5 N450G01X109.0Y44.0F1800 N460G01X31.0Y48.5 N470G01X109.0Y53.0F1800 N480G01X31.0Y57.5 N490G01X109.0Y62.0F1800 N500G01X31.0Y64.0 N510G00Z5.0X31.0Y26.0 N520G01Z-9.5F600 N530G01X109.0Y26.0F1800 N540G01X31.0Y30.5 N550G01X109.0Y35.0F1800 N560G01X31.0Y39.5 N570G01X109.0Y44.0F1800 N580G01X31.0Y48.5 N590G01X109.0Y53.0F1800 N600G01X31.0Y57.5 N610G01X109.0Y62.0F1800 N620G01X31.0Y64.0 N630G00Z5.0X31.0Y26.0 N640G01Z-12.0F600 N650G01X109.0Y26.0F1800 N660G01X31.0Y30.5 N670G01X109.0Y35.0F1800 N680G01X31.0Y39.5 N690G01X109.0Y44.0F1800 N700G01X31.0Y48.5 N710G01X109.0Y53.0F1800 N720G01X31.0Y57.5 N730G01X109.0Y62.0F1800 N740G01X31.0Y64.0 N750G00Z5.0X31.0Y26.0 N760T3M06(SPOT 10) N770G98G81X12.0Y12.0Z-2.0R3.0F300 N780X128.0 N790Y78.0 N800X12.0 N810G80 N820T4M06(DRILL 9) N830G98G83X12.0Y12.0Z-26.0R3.0Q4.0F260 N840X128.0 N850Y78.0 N860X12.0 N870G80 N880G00Z30.0M09 N890M30 % % N20O1001(SENSOR BRACKET VMC) N30G21G17G40G49G80G90 N40T1M06(FACE 50) N50G54G00X-30.0Y4.0S3200M03 N60G43H01Z30.0M08 N70G01X170.0Y4.0F2400 N80G01X-30.0Y22.0F2400 N90G01X170.0Y40.0F2400 N100G01X-30.0Y58.0F2400 N110G01X170.0Y76.0F2400 N120G00Z30.0 N130T2M06(ROUGH 12) N140G00X31.0Y26.0S8000M03 N150G43H02Z5.0 N160G01Z-2.0F600 N170G01X109.0Y26.0F1800 N180G01X31.0Y30.5 N190G01X109.0Y35.0F1800 N200G01X31.0Y39.5 N210G01X109.0Y44.0F1800 N220G01X31.0Y48.5 N230G01X109.0Y53.0F1800 N240G01X31.0Y57.5 N250G01X109.0Y62.0F1800 N260G01X31.0Y64.0 N270G00Z5.0X31.0Y26.0 N280G01Z-4.5F600 N290G01X109.0Y26.0F1800 N300G01X31.0Y30.5 N310G01X109.0Y35.0F1800 N320G01X31.0Y39.5 N330G01X109.0Y44.0F1800 N340G01X31.0Y48.5 N350G01X109.0Y53.0F1800 N360G01X31.0Y57.5 N370G01X109.0Y62.0F1800 N380G01X31.0Y64.0 N390G00Z5.0X31.0Y26.0 N400G01Z-7.0F600 N410G01X109.0Y26.0F1800 N420G01X31.0Y30.5 N430G01X109.0Y35.0F1800 N440G01X31.0Y39.5 N450G01X109.0Y44.0F1800 N460G01X31.0Y48.5 N470G01X109.0Y53.0F1800 N480G01X31.0Y57.5 N490G01X109.0Y62.0F1800 N500G01X31.0Y64.0 N510G00Z5.0X31.0Y26.0 N520G01Z-9.5F600 N530G01X109.0Y26.0F1800 N540G01X31.0Y30.5 N550G01X109.0Y35.0F1800 N560G01X31.0Y39.5 N570G01X109.0Y44.0F1800 N580G01X31.0Y48.5 N590G01X109.0Y53.0F1800 N600G01X31.0Y57.5 N610G01X109.0Y62.0F1800 N620G01X31.0Y64.0 N630G00Z5.0X31.0Y26.0 N640G01Z-12.0F600 N650G01X109.0Y26.0F1800 N660G01X31.0Y30.5 N670G01X109.0Y35.0F1800 N680G01X31.0Y39.5 N690G01X109.0Y44.0F1800 N700G01X31.0Y48.5 N710G01X109.0Y53.0F1800 N720G01X31.0Y57.5 N730G01X109.0Y62.0F1800 N740G01X31.0Y64.0 N750G00Z5.0X31.0Y26.0 N760T3M06(SPOT 10) N770G98G81X12.0Y12.0Z-2.0R3.0F300 N780X128.0 N790Y78.0 N800X12.0 N810G80 N820T4M06(DRILL 9)";
  content: "% N20O1001(SENSOR BRACKET VMC) N30G21G17G40G49G80G90 N40T1M06(FACE 50) N50G54G00X-30.0Y4.0S3200M03 N60G43H01Z30.0M08 N70G01X170.0Y4.0F2400 N80G01X-30.0Y22.0F2400 N90G01X170.0Y40.0F2400 N100G01X-30.0Y58.0F2400 N110G01X170.0Y76.0F2400 N120G00Z30.0 N130T2M06(ROUGH 12) N140G00X31.0Y26.0S8000M03 N150G43H02Z5.0 N160G01Z-2.0F600 N170G01X109.0Y26.0F1800 N180G01X31.0Y30.5 N190G01X109.0Y35.0F1800 N200G01X31.0Y39.5 N210G01X109.0Y44.0F1800 N220G01X31.0Y48.5 N230G01X109.0Y53.0F1800 N240G01X31.0Y57.5 N250G01X109.0Y62.0F1800 N260G01X31.0Y64.0 N270G00Z5.0X31.0Y26.0 N280G01Z-4.5F600 N290G01X109.0Y26.0F1800 N300G01X31.0Y30.5 N310G01X109.0Y35.0F1800 N320G01X31.0Y39.5 N330G01X109.0Y44.0F1800 N340G01X31.0Y48.5 N350G01X109.0Y53.0F1800 N360G01X31.0Y57.5 N370G01X109.0Y62.0F1800 N380G01X31.0Y64.0 N390G00Z5.0X31.0Y26.0 N400G01Z-7.0F600 N410G01X109.0Y26.0F1800 N420G01X31.0Y30.5 N430G01X109.0Y35.0F1800 N440G01X31.0Y39.5 N450G01X109.0Y44.0F1800 N460G01X31.0Y48.5 N470G01X109.0Y53.0F1800 N480G01X31.0Y57.5 N490G01X109.0Y62.0F1800 N500G01X31.0Y64.0 N510G00Z5.0X31.0Y26.0 N520G01Z-9.5F600 N530G01X109.0Y26.0F1800 N540G01X31.0Y30.5 N550G01X109.0Y35.0F1800 N560G01X31.0Y39.5 N570G01X109.0Y44.0F1800 N580G01X31.0Y48.5 N590G01X109.0Y53.0F1800 N600G01X31.0Y57.5 N610G01X109.0Y62.0F1800 N620G01X31.0Y64.0 N630G00Z5.0X31.0Y26.0 N640G01Z-12.0F600 N650G01X109.0Y26.0F1800 N660G01X31.0Y30.5 N670G01X109.0Y35.0F1800 N680G01X31.0Y39.5 N690G01X109.0Y44.0F1800 N700G01X31.0Y48.5 N710G01X109.0Y53.0F1800 N720G01X31.0Y57.5 N730G01X109.0Y62.0F1800 N740G01X31.0Y64.0 N750G00Z5.0X31.0Y26.0 N760T3M06(SPOT 10) N770G98G81X12.0Y12.0Z-2.0R3.0F300 N780X128.0 N790Y78.0 N800X12.0 N810G80 N820T4M06(DRILL 9) N830G98G83X12.0Y12.0Z-26.0R3.0Q4.0F260 N840X128.0 N850Y78.0 N860X12.0 N870G80 N880G00Z30.0M09 N890M30 % % N20O1001(SENSOR BRACKET VMC) N30G21G17G40G49G80G90 N40T1M06(FACE 50) N50G54G00X-30.0Y4.0S3200M03 N60G43H01Z30.0M08 N70G01X170.0Y4.0F2400 N80G01X-30.0Y22.0F2400 N90G01X170.0Y40.0F2400 N100G01X-30.0Y58.0F2400 N110G01X170.0Y76.0F2400 N120G00Z30.0 N130T2M06(ROUGH 12) N140G00X31.0Y26.0S8000M03 N150G43H02Z5.0 N160G01Z-2.0F600 N170G01X109.0Y26.0F1800 N180G01X31.0Y30.5 N190G01X109.0Y35.0F1800 N200G01X31.0Y39.5 N210G01X109.0Y44.0F1800 N220G01X31.0Y48.5 N230G01X109.0Y53.0F1800 N240G01X31.0Y57.5 N250G01X109.0Y62.0F1800 N260G01X31.0Y64.0 N270G00Z5.0X31.0Y26.0 N280G01Z-4.5F600 N290G01X109.0Y26.0F1800 N300G01X31.0Y30.5 N310G01X109.0Y35.0F1800 N320G01X31.0Y39.5 N330G01X109.0Y44.0F1800 N340G01X31.0Y48.5 N350G01X109.0Y53.0F1800 N360G01X31.0Y57.5 N370G01X109.0Y62.0F1800 N380G01X31.0Y64.0 N390G00Z5.0X31.0Y26.0 N400G01Z-7.0F600 N410G01X109.0Y26.0F1800 N420G01X31.0Y30.5 N430G01X109.0Y35.0F1800 N440G01X31.0Y39.5 N450G01X109.0Y44.0F1800 N460G01X31.0Y48.5 N470G01X109.0Y53.0F1800 N480G01X31.0Y57.5 N490G01X109.0Y62.0F1800 N500G01X31.0Y64.0 N510G00Z5.0X31.0Y26.0 N520G01Z-9.5F600 N530G01X109.0Y26.0F1800 N540G01X31.0Y30.5 N550G01X109.0Y35.0F1800 N560G01X31.0Y39.5 N570G01X109.0Y44.0F1800 N580G01X31.0Y48.5 N590G01X109.0Y53.0F1800 N600G01X31.0Y57.5 N610G01X109.0Y62.0F1800 N620G01X31.0Y64.0 N630G00Z5.0X31.0Y26.0 N640G01Z-12.0F600 N650G01X109.0Y26.0F1800 N660G01X31.0Y30.5 N670G01X109.0Y35.0F1800 N680G01X31.0Y39.5 N690G01X109.0Y44.0F1800 N700G01X31.0Y48.5 N710G01X109.0Y53.0F1800 N720G01X31.0Y57.5 N730G01X109.0Y62.0F1800 N740G01X31.0Y64.0 N750G00Z5.0X31.0Y26.0 N760T3M06(SPOT 10) N770G98G81X12.0Y12.0Z-2.0R3.0F300 N780X128.0 N790Y78.0 N800X12.0 N810G80 N820T4M06(DRILL 9) N830G98G83X12.0Y12.0Z-26.0R3.0Q4.0F260 N840X128.0 N850Y78.0 N860X12.0 N870G80 N880G00Z30.0M09 N890M30 % % N20O1001(SENSOR BRACKET VMC) N30G21G17G40G49G80G90 N40T1M06(FACE 50) N50G54G00X-30.0Y4.0S3200M03 N60G43H01Z30.0M08 N70G01X170.0Y4.0F2400 N80G01X-30.0Y22.0F2400 N90G01X170.0Y40.0F2400 N100G01X-30.0Y58.0F2400 N110G01X170.0Y76.0F2400 N120G00Z30.0 N130T2M06(ROUGH 12) N140G00X31.0Y26.0S8000M03 N150G43H02Z5.0 N160G01Z-2.0F600 N170G01X109.0Y26.0F1800 N180G01X31.0Y30.5 N190G01X109.0Y35.0F1800 N200G01X31.0Y39.5 N210G01X109.0Y44.0F1800 N220G01X31.0Y48.5 N230G01X109.0Y53.0F1800 N240G01X31.0Y57.5 N250G01X109.0Y62.0F1800 N260G01X31.0Y64.0 N270G00Z5.0X31.0Y26.0 N280G01Z-4.5F600 N290G01X109.0Y26.0F1800 N300G01X31.0Y30.5 N310G01X109.0Y35.0F1800 N320G01X31.0Y39.5 N330G01X109.0Y44.0F1800 N340G01X31.0Y48.5 N350G01X109.0Y53.0F1800 N360G01X31.0Y57.5 N370G01X109.0Y62.0F1800 N380G01X31.0Y64.0 N390G00Z5.0X31.0Y26.0 N400G01Z-7.0F600 N410G01X109.0Y26.0F1800 N420G01X31.0Y30.5 N430G01X109.0Y35.0F1800 N440G01X31.0Y39.5 N450G01X109.0Y44.0F1800 N460G01X31.0Y48.5 N470G01X109.0Y53.0F1800 N480G01X31.0Y57.5 N490G01X109.0Y62.0F1800 N500G01X31.0Y64.0 N510G00Z5.0X31.0Y26.0 N520G01Z-9.5F600 N530G01X109.0Y26.0F1800 N540G01X31.0Y30.5 N550G01X109.0Y35.0F1800 N560G01X31.0Y39.5 N570G01X109.0Y44.0F1800 N580G01X31.0Y48.5 N590G01X109.0Y53.0F1800 N600G01X31.0Y57.5 N610G01X109.0Y62.0F1800 N620G01X31.0Y64.0 N630G00Z5.0X31.0Y26.0 N640G01Z-12.0F600 N650G01X109.0Y26.0F1800 N660G01X31.0Y30.5 N670G01X109.0Y35.0F1800 N680G01X31.0Y39.5 N690G01X109.0Y44.0F1800 N700G01X31.0Y48.5 N710G01X109.0Y53.0F1800 N720G01X31.0Y57.5 N730G01X109.0Y62.0F1800 N740G01X31.0Y64.0 N750G00Z5.0X31.0Y26.0 N760T3M06(SPOT 10) N770G98G81X12.0Y12.0Z-2.0R3.0F300 N780X128.0 N790Y78.0 N800X12.0 N810G80 N820T4M06(DRILL 9)" / "";
  grid-column: 2;
  grid-row: 3 / span 2;
  align-self: start;
  display: block;
  width: 100%;
  aspect-ratio: 641 / 436;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 8.5px;
  letter-spacing: 0;
  word-break: break-all;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  -webkit-mask-image: var(--part-mask), linear-gradient(#000 0 0);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center, 0 0;
  -webkit-mask-size: contain, 100% 100%;
  -webkit-mask-composite: source-in;
  mask-image: var(--part-mask), linear-gradient(#000 0 0);
  mask-repeat: no-repeat;
  mask-position: center, 0 0;
  mask-size: contain, 100% 100%;
  mask-composite: intersect;
  animation: part-print 1.5s steps(30, end) 0.25s both;
}

/* its edges and dimensions, drawn over the shaded faces */
.hero .container::after {
  content: "";
  grid-column: 2;
  grid-row: 3 / span 2;
  align-self: start;
  display: block;
  width: 100%;
  aspect-ratio: 641 / 436;
  background: var(--ink);
  pointer-events: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='641' height='436' viewBox='0 0 640.5 436.0'%3E%3Cdefs%3E%3CclipPath id='op'%3E%3Cpath d='M276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z'/%3E%3C/clipPath%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='640.5' height='436.0'%3E%3Crect width='640.5' height='436.0' fill='black'/%3E%3Cpath d='M265.1 20.4L574.2 198.9L375.5 313.6L66.3 135.1ZM276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.4'/%3E%3Cpath d='M574.2 198.9L574.2 255.0L375.5 369.8L66.3 191.2L66.3 135.1M375.5 313.6L375.5 369.8' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.4'/%3E%3Cg clip-path='url(%23op)'%3E%3Cpath d='M165.7 172.1L276.1 108.4L474.8 223.1M276.1 77.8L276.1 108.4' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3C/g%3E%3Cellipse cx='265.1' cy='51.0' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cellipse cx='521.2' cy='198.9' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cellipse cx='119.3' cy='135.1' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cellipse cx='375.5' cy='283.0' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cpath d='M59.7 195.1L35.4 209.1M368.8 373.6L344.6 387.6M35.4 209.1L344.6 387.6' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='0.9'/%3E%3Ccircle cx='35.4' cy='209.1' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ccircle cx='344.6' cy='387.6' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ctext x='180.0' y='318.3' fill='white' fill-opacity='0.75' font-family='-apple-system,Helvetica,Arial,sans-serif' font-size='12' text-anchor='middle'%3E140%3C/text%3E%3Cpath d='M580.8 258.8L605.1 272.8M382.1 373.6L406.4 387.6M605.1 272.8L406.4 387.6' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='0.9'/%3E%3Ccircle cx='605.1' cy='272.8' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ccircle cx='406.4' cy='387.6' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ctext x='519.8' y='348.2' fill='white' fill-opacity='0.75' font-family='-apple-system,Helvetica,Arial,sans-serif' font-size='12' text-anchor='middle'%3E90%3C/text%3E%3Cpath d='M375.5 377.4L375.5 396.5M375.5 321.3L375.5 340.4M375.5 396.5L375.5 340.4' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='0.9'/%3E%3Ccircle cx='375.5' cy='396.5' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ccircle cx='375.5' cy='340.4' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ctext x='391.5' y='372.5' fill='white' fill-opacity='0.75' font-family='-apple-system,Helvetica,Arial,sans-serif' font-size='12' text-anchor='middle'%3E22%3C/text%3E%3C/mask%3E%3C/defs%3E%3Crect width='640.5' height='436.0' fill='white' mask='url(%23m)'/%3E%3C/svg%3E"), linear-gradient(#000 0 0);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center, 0 0;
  -webkit-mask-size: contain, 100% 100%;
  -webkit-mask-composite: source-in;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='641' height='436' viewBox='0 0 640.5 436.0'%3E%3Cdefs%3E%3CclipPath id='op'%3E%3Cpath d='M276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z'/%3E%3C/clipPath%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='640.5' height='436.0'%3E%3Crect width='640.5' height='436.0' fill='black'/%3E%3Cpath d='M265.1 20.4L574.2 198.9L375.5 313.6L66.3 135.1ZM276.1 77.8L474.8 192.5L364.4 256.3L165.7 141.5Z' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.4'/%3E%3Cpath d='M574.2 198.9L574.2 255.0L375.5 369.8L66.3 191.2L66.3 135.1M375.5 313.6L375.5 369.8' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.4'/%3E%3Cg clip-path='url(%23op)'%3E%3Cpath d='M165.7 172.1L276.1 108.4L474.8 223.1M276.1 77.8L276.1 108.4' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3C/g%3E%3Cellipse cx='265.1' cy='51.0' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cellipse cx='521.2' cy='198.9' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cellipse cx='119.3' cy='135.1' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cellipse cx='375.5' cy='283.0' rx='14.1' ry='8.1' fill='none' stroke='white' stroke-linejoin='round' stroke-linecap='round' stroke-width='1.1'/%3E%3Cpath d='M59.7 195.1L35.4 209.1M368.8 373.6L344.6 387.6M35.4 209.1L344.6 387.6' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='0.9'/%3E%3Ccircle cx='35.4' cy='209.1' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ccircle cx='344.6' cy='387.6' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ctext x='180.0' y='318.3' fill='white' fill-opacity='0.75' font-family='-apple-system,Helvetica,Arial,sans-serif' font-size='12' text-anchor='middle'%3E140%3C/text%3E%3Cpath d='M580.8 258.8L605.1 272.8M382.1 373.6L406.4 387.6M605.1 272.8L406.4 387.6' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='0.9'/%3E%3Ccircle cx='605.1' cy='272.8' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ccircle cx='406.4' cy='387.6' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ctext x='519.8' y='348.2' fill='white' fill-opacity='0.75' font-family='-apple-system,Helvetica,Arial,sans-serif' font-size='12' text-anchor='middle'%3E90%3C/text%3E%3Cpath d='M375.5 377.4L375.5 396.5M375.5 321.3L375.5 340.4M375.5 396.5L375.5 340.4' fill='none' stroke='white' stroke-opacity='0.55' stroke-width='0.9'/%3E%3Ccircle cx='375.5' cy='396.5' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ccircle cx='375.5' cy='340.4' r='1.6' fill='white' fill-opacity='0.75'/%3E%3Ctext x='391.5' y='372.5' fill='white' fill-opacity='0.75' font-family='-apple-system,Helvetica,Arial,sans-serif' font-size='12' text-anchor='middle'%3E22%3C/text%3E%3C/mask%3E%3C/defs%3E%3Crect width='640.5' height='436.0' fill='white' mask='url(%23m)'/%3E%3C/svg%3E"), linear-gradient(#000 0 0);
  mask-repeat: no-repeat;
  mask-position: center, 0 0;
  mask-size: contain, 100% 100%;
  mask-composite: intersect;
  animation: part-print 1.5s steps(30, end) 0.25s both;
}

@keyframes part-print {
  from {
    -webkit-mask-size: contain, 100% 0%;
    mask-size: contain, 100% 0%;
  }
  to {
    -webkit-mask-size: contain, 100% 100%;
    mask-size: contain, 100% 100%;
  }
}

/* with JavaScript the drawing becomes the part in 3D (landing-part.js), in the same place */
.part-3d {
  display: none;
}

.hero.has-part-3d .container::before,
.hero.has-part-3d .container::after {
  content: none;
}

.hero.has-part-3d .part-3d {
  display: block;
  position: relative;
  grid-column: 2;
  grid-row: 3 / span 2;
  align-self: start;
  min-width: 0;
  margin: 0;
}

.part-3d canvas {
  display: block;
  width: 100%;
  aspect-ratio: 641 / 436;
  /* the tool comes down out of the page, not from a hard edge */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%);
  mask-image: linear-gradient(to bottom, transparent, #000 22%);
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.part-3d.is-dragging canvas {
  cursor: grabbing;
}

.part-caption {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  font: 11px/1.4 var(--font-mono);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
}

.part-caption [data-part-block] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}

.part-hint {
  position: absolute;
  top: 0;
  right: 0;
  font: 11px/1 var(--font-mono);
  color: var(--ink-3);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.part-3d:hover .part-hint {
  opacity: 1;
  transform: none;
}

.hero-showcase {
  grid-column: 1 / -1;
  margin-top: 88px;
  margin-bottom: 112px;
  border-color: var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.window-chrome {
  padding: 10px 14px;
  background: var(--bg-raised);
}

.chrome-dots span {
  width: 10px;
  height: 10px;
  background: var(--rule-strong);
  border: 0;
}

.chrome-title {
  color: var(--ink-3);
  font-weight: 450;
}

.verified-pill {
  background: transparent;
  border: 0;
  color: var(--ok);
  font-weight: 500;
}

/* ---------- section heads: numbered like a datasheet ---------- */
main {
  counter-reset: sheet;
}

.section {
  padding: 104px 0;
  border-top-color: var(--rule);
}

.section-header {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 64px;
  align-items: end;
  margin-bottom: 64px;
}

.section-kicker {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-weight: 450;
  margin-bottom: 20px;
}

.section-kicker::before {
  counter-increment: sheet;
  content: counter(sheet, decimal-leading-zero);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.section-header h2 {
  margin: 0;
}

.section-header p {
  max-width: 520px;
  font-size: 1rem;
}

/* ---------- grids run rail to rail, ruled, no boxes ---------- */
.compare-grid,
.problems-grid,
.controllers-grid,
.examples-grid,
.lesson-index {
  --cell-rules: 1px 0 0 var(--rule), 0 1px 0 var(--rule), 1px 1px 0 var(--rule);
  gap: 1px;
  margin-inline: calc(-1 * var(--gutter));
  background: transparent;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: clip;
}

/* each cell rules its own right and bottom edge, so a short last row stays open */
.compare-card,
.problem-card,
.controller-card,
.example-card,
.lesson-link {
  background: var(--bg);
  border: 0;
  border-radius: 0;
  box-shadow: var(--cell-rules);
}

.compare-card,
.problem-card,
.controller-card {
  padding: 32px var(--gutter);
}

.compare-card.featured {
  background: var(--bg-raised);
  box-shadow: inset 0 2px 0 var(--ink), var(--cell-rules);
}

.compare-label {
  font-weight: 500;
  font-size: 13px;
}

.mini-snippet {
  border-radius: var(--radius-sm);
}

.problems-title {
  font-weight: 500;
  letter-spacing: -0.03em;
}

.problems-grid {
  counter-reset: problem;
}

.problem-card::before {
  counter-increment: problem;
  content: counter(sheet) "." counter(problem);
  display: block;
  margin-bottom: 20px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.problem-card h4,
.controller-card h3,
.compare-card h3 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* gallery: plates on the sheet */
.gallery-grid {
  gap: 48px 24px;
}

.gallery-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.gallery-media {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
}

.gallery-card:hover .gallery-media {
  border-color: var(--ink-3);
}

.gallery-body {
  padding: 16px 0 0;
}

.gallery-body h3 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

.gallery-tag {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--ink-3);
  font-weight: 450;
}

.gallery-link {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- tutorial ---------- */
.tutorial-sidebar {
  border-radius: 0;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  padding-right: 24px;
}

.progress-track {
  height: 2px;
  background: var(--rule);
  border-radius: 0;
}

.progress-fill {
  background: var(--ink);
  border-radius: 0;
}

.toc-link {
  border-radius: 6px;
  font-weight: 450;
}

.toc-link.active {
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

.toc-num {
  font-variant-numeric: tabular-nums;
}

.lesson-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  padding: 48px 0;
}

.lesson-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.lesson-header h3 {
  font-weight: 500;
  letter-spacing: -0.03em;
}

.lesson-meta {
  color: var(--ink-3);
}

.code-block {
  border-radius: var(--radius-md);
  border-color: var(--rule-strong);
}

.code-header {
  background: var(--bg-raised);
}

.callout {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-raised);
}

/* lesson index: the nine lessons, linking into tutorial.html */
.lesson-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lesson-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 20px var(--gutter);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background var(--transition);
}

.lesson-link:hover {
  background: var(--bg-raised);
  color: var(--ink);
}

.lesson-link .toc-num {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

.section-actions {
  display: flex;
  gap: 12px;
  margin-top: 36px;
}

/* tutorial.html: the lessons with the page title on top */
.tutorial-page {
  padding-top: 72px;
  border-top: 0;
}

.tutorial-page::before,
.tutorial-page .section-kicker::before {
  display: none;
}

.tutorial-page .section-header {
  display: block;
  max-width: 900px;
}

.tutorial-page .section-header h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: var(--h1-size);
  line-height: var(--h1-leading);
  letter-spacing: var(--h1-tracking);
  font-weight: var(--h1-weight);
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- icons: IBM Carbon, inline ---------- */
.lightbox-btn {
  gap: 6px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ---------- controllers ---------- */
.controller-flavor {
  font-weight: 500;
}

.example-card {
  padding: 22px var(--gutter);
}

.example-card strong {
  font-weight: 500;
}

.example-card:hover {
  background: var(--bg-raised);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg);
}

.footer-cta-band h2 {
  font-weight: 500;
  text-wrap: balance;
}

/* ---------- changelog ---------- */
.changelog-hero {
  border-bottom: 1px solid var(--rule);
}

.changelog-hero h1 {
  font-weight: 500;
  letter-spacing: -0.042em;
}

.filter-pill {
  border-radius: 999px;
  font-weight: 450;
}

.filter-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.release-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  padding-inline: 0;
}

.release-entry.latest .release-card {
  box-shadow: inset 0 2px 0 var(--ink);
}

.release-version {
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .hero .container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    column-gap: 40px;
  }
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

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

  .hero .container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .hero.has-part-3d .part-3d {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, 440px);
    margin: 0 0 32px;
  }

  .hero .container::before,
  .hero .container::after {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, 440px);
    margin: 0 0 32px;
  }

  .hero h1 {
    margin-bottom: 28px;
  }

  .section-header {
    display: block;
  }

  .section-header h2 {
    margin-bottom: 16px;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 40px;
  }

  .hero .container::before {
    font-size: 6px;
    line-height: 7px;
  }

  .lesson-index {
    grid-template-columns: minmax(0, 1fr);
  }

  .tutorial-page {
    padding-top: 40px;
  }

  .hero-showcase {
    margin-top: 56px;
    margin-bottom: 72px;
  }

  .section {
    padding: 72px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .tutorial-sidebar {
    border-right: 0;
    padding-right: 0;
  }

  .gallery-grid {
    gap: 36px;
  }
}

/* =====================================================================
   MOTION: the sheet assembles itself, and answers the pointer.
   All of it is decoration. Reduced motion stills it (base.css), and the
   hidden states need .motion, which landing.js sets only when motion is
   allowed, so without JavaScript nothing waits to appear.
   ===================================================================== */

.part-caption {
  white-space: pre;
}

.count {
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* the title prints in from the top, like the part beside it */
@keyframes print-in {
  from {
    opacity: 0;
    transform: translateY(26px);
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(-10% -4% -24% -4%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-eyebrow {
    animation: rise 700ms var(--ease) backwards;
  }

  .hero h1 {
    animation: print-in 1100ms 80ms var(--ease) backwards;
  }

  .hero-subtitle {
    animation: rise 800ms 260ms var(--ease) backwards;
  }

  .hero-cta {
    animation: rise 800ms 360ms var(--ease) backwards;
  }

  .part-3d {
    animation: rise 900ms 200ms var(--ease) backwards;
  }

  .changelog-hero-inner > *,
  .tutorial-page .section-header > *,
  .tutorial-page .tutorial-layout {
    animation: rise 800ms var(--ease) backwards;
  }

  .changelog-hero-inner > :nth-child(2),
  .tutorial-page .section-header > :nth-child(2) {
    animation-delay: 90ms;
  }

  .changelog-hero-inner > :nth-child(3),
  .tutorial-page .section-header > :nth-child(3) {
    animation-delay: 180ms;
  }

  .changelog-hero-inner > :nth-child(n + 4),
  .tutorial-page .tutorial-layout {
    animation-delay: 270ms;
  }
}

/* ---------- scroll: cells rise row by row, rules draw across ---------- */
@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

.motion .reveal:not(.is-in) {
  opacity: 0;
}

.motion .reveal.is-in {
  animation: reveal-rise 800ms calc(var(--i, 0) * 80ms) var(--ease) backwards;
}

.motion .rule-draw {
  border-top-color: transparent;
  background-image: linear-gradient(var(--rule), var(--rule));
  background-repeat: no-repeat;
  background-origin: border-box;
  background-position: 0 0;
  background-size: 0 1px;
  transition: background-size 1400ms var(--ease);
}

.motion .rule-draw.is-in {
  background-size: 100% 1px;
}

.motion .rule-draw::before {
  opacity: 0;
  transition: opacity 500ms 600ms var(--ease);
}

.motion .rule-draw.is-in::before {
  opacity: 1;
}

/* the screenshot stands up as it scrolls in */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes stand-up {
      from {
        transform: perspective(1800px) rotateX(16deg) scale(0.95);
      }
    }

    .hero-showcase {
      transform-origin: 50% 100%;
      animation: stand-up linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 42%;
    }

    @keyframes read-progress {
      to {
        transform: scaleX(1);
      }
    }

    .site-header::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 1px;
      background: var(--ink);
      transform: scaleX(0);
      transform-origin: 0 50%;
      pointer-events: none;
      animation: read-progress linear both;
      animation-timeline: scroll(root);
    }
  }
}

/* ---------- the rail marker: which sheet you are on ---------- */
.rail-marker {
  display: none;
}

@keyframes num-flip {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (min-width: 1260px) {
  .rail-marker {
    display: block;
    position: fixed;
    z-index: 103;
    top: 0;
    left: calc(50% - var(--max-width) / 2);
    width: 1px;
    height: 56px;
    background: var(--ink);
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms var(--ease), transform 180ms linear;
  }

  .rail-marker.is-on {
    opacity: 1;
  }

  .rail-marker-num {
    position: absolute;
    top: -1px;
    right: 8px;
    font: 500 11px/1 var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  .rail-marker-num.flip {
    animation: num-flip 420ms var(--ease);
  }
}

/* ---------- header ---------- */
.nav-links .nav-link {
  position: relative;
}

.nav-links .nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 320ms var(--ease);
}

.nav-links .nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.nav-links .nav-link.active::after {
  content: none;
}

@keyframes icon-turn {
  from {
    opacity: 0;
    transform: rotate(-120deg) scale(0.4);
  }
}

.theme-anim .theme-toggle svg {
  animation: icon-turn 480ms var(--ease);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

.mobile-menu-btn {
  position: relative;
}

.mobile-menu-btn svg {
  transition: opacity 200ms var(--ease), transform 320ms var(--ease);
}

.mobile-menu-btn .icon-close {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.mobile-menu-btn[aria-expanded="true"] .icon-menu {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.mobile-menu-btn[aria-expanded="true"] .icon-close {
  opacity: 1;
  transform: none;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.mobile-drawer.open {
  animation: drawer-in 240ms var(--ease);
}

.mobile-drawer.open > * {
  animation: rise 420ms var(--ease) backwards;
}

.mobile-drawer.open > :nth-child(2) { animation-delay: 30ms; }
.mobile-drawer.open > :nth-child(3) { animation-delay: 60ms; }
.mobile-drawer.open > :nth-child(4) { animation-delay: 90ms; }
.mobile-drawer.open > :nth-child(5) { animation-delay: 120ms; }
.mobile-drawer.open > :nth-child(6) { animation-delay: 150ms; }

/* ---------- links and buttons ---------- */
.arr,
.ext {
  display: inline-block;
  transition: transform 260ms var(--ease);
}

a:hover > .arr,
a:focus-visible > .arr {
  transform: translateX(3px);
}

a:hover > .ext,
a:focus-visible > .ext {
  transform: translate(2px, -2px);
}

/* a scan line crosses the primary button */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.4) 50%, transparent 62%);
  mix-blend-mode: difference;
  transform: translateX(-100%);
  pointer-events: none;
}

.btn-primary:hover::after {
  transform: translateX(100%);
  transition: transform 900ms cubic-bezier(0.45, 0, 0.25, 1);
}

@keyframes pop {
  40% {
    transform: scale(1.08);
  }
}

.copy-btn.copied {
  animation: pop 320ms var(--ease);
}

/* ---------- cells: crop marks lock on under the pointer ---------- */
.compare-card,
.problem-card,
.controller-card,
.example-card,
.lesson-link {
  position: relative;
}

.compare-card::after,
.problem-card::after,
.controller-card::after,
.example-card::after,
.lesson-link::after {
  --b: 10px;
  content: "";
  position: absolute;
  inset: 7px;
  background:
    linear-gradient(var(--ink) 0 0) 0 0 / var(--b) 1px,
    linear-gradient(var(--ink) 0 0) 0 0 / 1px var(--b),
    linear-gradient(var(--ink) 0 0) 100% 0 / var(--b) 1px,
    linear-gradient(var(--ink) 0 0) 100% 0 / 1px var(--b),
    linear-gradient(var(--ink) 0 0) 0 100% / var(--b) 1px,
    linear-gradient(var(--ink) 0 0) 0 100% / 1px var(--b),
    linear-gradient(var(--ink) 0 0) 100% 100% / var(--b) 1px,
    linear-gradient(var(--ink) 0 0) 100% 100% / 1px var(--b);
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 200ms var(--ease), transform 360ms var(--ease);
  pointer-events: none;
}

.compare-card:hover::after,
.problem-card:hover::after,
.controller-card:hover::after,
.example-card:hover::after,
.lesson-link:hover::after,
.example-card:focus-visible::after,
.lesson-link:focus-visible::after {
  opacity: 1;
  transform: none;
}

.problem-card::before {
  transition: color 220ms var(--ease);
}

.problem-card:hover::before {
  color: var(--ink);
}

.controller-flavor::before {
  transition: transform 420ms var(--ease);
}

.controller-card:hover .controller-flavor::before {
  transform: rotate(45deg) scale(0.9);
}

.lesson-link .arr {
  margin-left: auto;
  color: var(--ink-3);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 200ms var(--ease), transform 320ms var(--ease), color 200ms var(--ease);
}

.lesson-link:hover .arr,
.lesson-link:focus-visible .arr {
  opacity: 1;
  color: var(--ink);
  transform: none;
}

@media (hover: none) {
  .lesson-link .arr {
    opacity: 0.6;
    transform: none;
  }
}

/* ---------- gallery: plates lean towards the pointer ---------- */
.gallery-media {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 600ms var(--ease), border-color var(--transition);
}

.gallery-media.is-tilting {
  transition-duration: 120ms, 160ms;
}

.gallery-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}

.gallery-media.is-tilting::after {
  opacity: 1;
}

@media print {
  .motion .reveal {
    opacity: 1 !important;
    animation: none !important;
  }

  .rail-marker {
    display: none !important;
  }
}
