:root {
  --ink: #101820;
  --ink-soft: #26323d;
  --paper: #f5f7f9;
  --surface: #ffffff;
  --surface-strong: #edf3f7;
  --line: #d7e0e7;
  --muted: #61707d;
  --blue: #2f80ed;
  --cyan: #00a7c8;
  --green: #2eb872;
  --yellow: #f2c94c;
  --red: #eb5757;
  --shadow: 0 22px 70px rgba(16, 24, 32, 0.13);
  --radius: 8px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 24, 32, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 32, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
}

body.nav-open {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

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

.zoomable-image {
  cursor: zoom-in;
}

.zoomable-image:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(100%, var(--container));
  min-height: 72px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
  color: var(--ink);
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.brand span {
  display: grid;
  line-height: 1;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
}

.language-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.language-option {
  min-width: 34px;
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

a.language-option:hover,
.language-option.is-active {
  color: var(--ink);
  background: var(--surface-strong);
}

.nav-link {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 720;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

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

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

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(520px, 78vh, 780px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background: var(--ink);
}

.hero--short {
  min-height: clamp(380px, 54vh, 560px);
}

.hero-media,
.hero::after {
  position: absolute;
  inset: 0;
}

.hero-media {
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media--diagram {
  object-fit: cover;
  object-position: center;
  padding: 0;
  transform: scale(1.08);
  background: #f7fafc;
}

.hero-media--contain {
  object-fit: contain;
  padding: 6vh;
  background: #fff;
}

.hero::after {
  content: "";
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 13, 20, 0.94), rgba(6, 13, 20, 0.62) 42%, rgba(6, 13, 20, 0.18)),
    linear-gradient(0deg, rgba(6, 13, 20, 0.84), transparent 44%);
}

.hero-content {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 88px 22px 56px;
}

.hero-logo {
  width: 112px;
  height: 112px;
  margin-bottom: 24px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.page-title h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.7;
}

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

.doc-intro {
  padding: clamp(56px, 7vw, 88px) 22px clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.doc-intro h1 {
  max-width: 980px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
}

.doc-intro p {
  max-width: 840px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.75;
}

.doc-intro .eyebrow {
  color: var(--blue);
}

.toc {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.toc strong {
  color: var(--ink);
}

.toc ol {
  margin: 4px 0 0;
  padding-left: 1.35rem;
  columns: 2;
  column-gap: 42px;
}

.toc li {
  break-inside: avoid;
  margin: 6px 0;
  color: var(--muted);
}

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

.toc a:hover {
  color: var(--blue);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-weight: 780;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(47, 128, 237, 0.24);
}

.button--ghost {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

.button--light {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.section {
  padding: clamp(64px, 8vw, 112px) 22px;
}

.section--tight {
  padding-top: clamp(42px, 6vw, 72px);
  padding-bottom: clamp(42px, 6vw, 72px);
}

.section--ink {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(47, 128, 237, 0.18), transparent 36%),
    linear-gradient(315deg, rgba(46, 184, 114, 0.18), transparent 30%),
    var(--ink);
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.55fr);
  align-items: end;
  gap: 32px;
  margin-bottom: 34px;
}

.section-heading > *,
.article > *,
.text-card,
.timeline-panel > * {
  min-width: 0;
}

.section-heading h2,
.article h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.section-heading p,
.lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.75;
}

.section--ink .section-heading p,
.section--ink .lead,
.section--ink .muted {
  color: rgba(255, 255, 255, 0.74);
}

.section--ink .article-copy p,
.section--ink .article-copy li {
  color: rgba(255, 255, 255, 0.78);
}

.section--ink .article-copy h3 {
  color: #fff;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.feature-card,
.media-card,
.stat-card,
.person-card,
.text-card,
.quote-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(16, 24, 32, 0.08);
}

.feature-card,
.stat-card,
.text-card,
.quote-panel {
  padding: 22px;
}

a.feature-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.feature-card h3,
.text-card h3,
.stat-card h3,
.person-card h3,
.article h3 {
  margin: 0 0 12px;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.feature-card p,
.text-card p,
.stat-card p,
.person-card p,
.article p,
.article li,
.contact-list {
  color: var(--muted);
  line-height: 1.72;
}

.feature-card p,
.text-card p,
.stat-card p,
.person-card p {
  margin: 0;
}

.text-card p + p,
.text-card ol + p,
.timeline-copy p + p {
  margin-top: 14px;
}

code {
  padding: 0.12em 0.32em;
  border-radius: 4px;
  background: rgba(47, 128, 237, 0.12);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.metric {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1;
}

.media-card {
  overflow: hidden;
}

.media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe7ed;
}

.media-card figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.media-card--wide img {
  aspect-ratio: 16 / 9;
}

.media-card--diagram img {
  object-fit: contain;
  background: #fff;
}

.media-card--padded img {
  padding: clamp(18px, 3vw, 34px);
}

.media-card--natural img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.video-frame {
  overflow: hidden;
  width: min(100%, 980px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1117;
  box-shadow: var(--shadow);
}

.video-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-fallback {
  max-width: 980px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.video-fallback a {
  color: var(--blue);
  font-weight: 750;
}

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

.gallery .media-card {
  grid-column: span 6;
}

.gallery .media-card--large {
  grid-column: span 8;
}

.gallery .media-card--small {
  grid-column: span 4;
}

.gallery .media-card--full {
  grid-column: 2 / span 10;
}

.timeline {
  position: relative;
  display: grid;
  gap: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(var(--blue), var(--green), var(--yellow));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 20px;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.timeline-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 8px;
}

.timeline-copy {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.timeline-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.timeline-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.mini-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef3f7;
}

.article {
  display: grid;
  gap: 28px;
}

.article-block {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(320px, 0.38fr);
  gap: 28px;
  align-items: start;
}

.article-block--flip {
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
}

.debugger-hardware {
  grid-template-columns: minmax(0, 0.62fr) minmax(320px, 0.38fr);
  align-items: center;
}

.debugger-hardware .article-copy {
  max-width: 720px;
}

.debugger-hardware .chips {
  margin-top: 16px;
}

.schematic-grid {
  align-items: stretch;
  max-width: 1120px;
  margin: 8px auto 0;
}

.schematic-grid .media-card {
  display: grid;
  grid-template-rows: 1fr auto;
}

.article-copy {
  min-width: 0;
}

.article h2,
.article h3 {
  scroll-margin-top: 92px;
}

.article h4 {
  margin: 0 0 12px;
  font-size: 1.02rem;
  color: var(--ink);
}

.article p {
  margin: 0 0 16px;
}

.article ul,
.article ol {
  margin: 0 0 16px;
  padding-left: 1.25rem;
}

.article li + li {
  margin-top: 8px;
}

.formula {
  overflow-x: auto;
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius);
  background: #eef8fb;
  color: var(--ink);
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.formula-group {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.formula-group .formula {
  margin: 0;
}

.eq {
  display: inline-flex;
  align-items: center;
  gap: 0.55ch;
  min-width: max-content;
}

.sym {
  font-style: italic;
}

.frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  vertical-align: middle;
  line-height: 1.18;
  margin: 0 0.12em;
}

.frac > .num {
  width: 100%;
  padding: 0 0.35em 0.16em;
  border-bottom: 1.5px solid currentColor;
}

.frac > .den {
  width: 100%;
  padding: 0.16em 0.35em 0;
}

.frac.compact {
  font-size: 0.9em;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 850;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.source-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.7;
}

.source-list a {
  color: var(--blue);
  font-weight: 750;
}

.command-block {
  overflow-x: auto;
  padding: 18px;
  border-radius: var(--radius);
  background: #0b1117;
  color: #dce7ef;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}

.command-block code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1;
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li + li {
  margin-top: 10px;
}

.contact-list a {
  color: var(--blue);
  font-weight: 750;
}

.person-card {
  overflow: hidden;
}

.person-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 24%;
  background: #e9eff4;
}

.person-card div {
  padding: 16px;
}

.person-card p {
  color: var(--blue);
  font-weight: 760;
}

.sponsor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.sponsor-row img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.site-footer {
  padding: 34px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: clamp(18px, 4vw, 54px);
  background: rgba(5, 10, 15, 0.88);
  backdrop-filter: blur(10px);
}

.image-lightbox.is-open {
  display: grid;
}

.lightbox-panel {
  width: min(100%, 1280px);
  max-height: 90vh;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.lightbox-image {
  width: 100%;
  height: 100%;
  max-height: calc(90vh - 64px);
  object-fit: contain;
  background: #0b1117;
}

.lightbox-caption {
  margin: 0;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 201;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.footer-inner {
  width: min(100%, var(--container));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.muted {
  color: var(--muted);
}

.accent-blue {
  color: var(--blue);
}

.accent-green {
  color: var(--green);
}

.accent-yellow {
  color: var(--yellow);
}

@media (max-width: 1020px) {
  .language-switcher {
    order: 2;
    margin-left: auto;
  }

  .nav-links {
    order: 4;
    position: fixed;
    inset: 72px 0 auto;
    display: none;
    max-height: calc(100vh - 72px);
    overflow: auto;
    padding: 16px 22px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    margin-left: 0;
  }

  .nav-open .nav-links {
    display: grid;
    gap: 6px;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-toggle {
    order: 3;
    display: block;
  }

  .section-heading,
  .article-block,
  .article-block--flip,
  .timeline-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .nav-shell {
    min-height: 64px;
    padding: 0 16px;
  }

  .nav-links {
    inset: 64px 0 auto;
    max-height: calc(100vh - 64px);
  }

  .brand small {
    display: none;
  }

  .hero,
  .hero--short {
    min-height: 560px;
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(6, 13, 20, 0.94), rgba(6, 13, 20, 0.64) 58%, rgba(6, 13, 20, 0.38)),
      linear-gradient(90deg, rgba(6, 13, 20, 0.68), transparent);
  }

  .hero-content {
    padding: 74px 18px 42px;
  }

  .hero-logo {
    width: 86px;
    height: 86px;
  }

  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery .media-card,
  .gallery .media-card--large,
  .gallery .media-card--small,
  .gallery .media-card--full {
    grid-column: auto;
  }

  .timeline::before {
    left: 17px;
  }

  .timeline-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  .timeline-marker {
    width: 36px;
    height: 36px;
    font-size: 0.84rem;
  }

  .timeline-copy {
    padding: 20px;
  }

  .mini-gallery {
    grid-template-columns: 1fr;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .toc ol {
    columns: 1;
  }

  .command-block {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .sponsor-row,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
