/* Design tokens and base */
:root {
  --navy: #0A1426;
  --graphite: #151C27;
  --card-dark: #1F2734;
  --line: #263042;
  --steel: #DDE3EA;
  --surface: #F2F4F7;
  --ink: #141A24;
  --muted: #4A5566;
  --blue: #0060C8;
  --signal: #4D9BFF;
  --amber: #F2B233;
  --border: #CBD2DB;
  --display: Archivo,system-ui,sans-serif;
  --body: Inter,system-ui,sans-serif;
  --mono: 'JetBrains Mono',monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.6 var(--body);
}

a {
  color: var(--blue);
  font-weight: 600;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: #fff;
  padding: 8px;
  z-index: 9;
}

.skip:focus {
  top: 12px;
}

/* Navigation */
header,footer {
  background: var(--navy);
  color: #e8ecf1;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 10px max(24px,calc((100vw - 1320px)/2));
  gap: 28px;
  border-bottom: 1px solid #22304A;
}

.brand {
  height: 38px;
  display: flex;
}

.brand img,footer img {
  width: auto;
  height: 34px;
}

nav {
  display: flex;
  align-items: center;
  gap: 23px;
  margin-left: auto;
}

nav a {
  color: #c9d1dc;
  text-decoration: none;
  white-space: nowrap;
}

nav a[aria-current=page] {
  color: white;
  border-bottom: 2px solid var(--signal);
  padding: 20px 0;
}

.github,.button {
  border: 1px solid #4A5568;
  border-radius: 8px;
  padding: 9px 15px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.menu {
  display: none;
  margin-left: auto;
  background: none;
  color: white;
  border: 1px solid #4A5568;
  border-radius: 7px;
  min-height: 44px;
  padding: 0 12px;
  font: 600 13px var(--mono);
}

/* Typography and shared controls */
h1,h2,h3 {
  font-family: var(--display);
  line-height: 1.12;
  margin: 0 0 16px;
}

.status {
  font: 12px var(--mono);
  border: 1px solid #4A5568;
  padding: 7px 12px;
  border-radius: 99px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.status i {
  width: 8px;
  height: 8px;
  background: var(--amber);
  display: block;
  flex-shrink: 0;
}

.actions {
  display: flex!important;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.button {
  background: var(--signal);
  color: var(--navy);
  border: 0;
  font-weight: 700;
}

.button.secondary {
  background: transparent;
  color: white;
  border: 1px solid #4A5568;
}

.button.ink {
  color: var(--ink);
  border-color: var(--ink);
}

/* Copyable commands */
.code {
  background: #060D1A;
  color: #dce5ee;
  text-align: left;
  border-radius: 8px;
  position: relative;
  padding: 14px 16px;
  margin: 22px auto;
  max-width: 700px;
  overflow: auto;
}

.code b {
  display: block;
  padding-right: 64px;
  font: 12px var(--mono);
  color: #aab6c5;
}

.code pre {
  margin: 9px 0 0;
  font: 13px/1.7 var(--mono);
  white-space: pre;
}

.copy {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 1px solid #4A5568;
  background: #151C27;
  color: white;
  border-radius: 5px;
  padding: 5px 8px;
}

/* Shared section layouts */
.container,.content {
  max-width: 1200px;
  padding-left: 32px;
  padding-right: 32px;
  margin: auto;
}

.section {
  padding: 88px 0;
}

.dark {
  background: var(--graphite);
  color: #e8ecf1;
}

.section h2,.paths h2 {
  font-size: 38px;
}

/* Homepage hero */
.hero {
  background-color: var(--navy);
  background-image: radial-gradient(#1c2638 1px,transparent 1px);
  background-size: 16px 16px;
  color: #e8ecf1;
  padding: 48px 0 80px;
}

.hero-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

.hero-logo {
  display: block;
  width: min(480px,100%);
  height: auto;
  filter: drop-shadow(0 12px 28px #00000066);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(0,1fr);
  align-items: center;
  gap: 48px;
}

.hero-copy,
.hero-install {
  min-width: 0;
}

.hero .status {
  margin-bottom: 32px;
  border-color: #364152;
  border-radius: 6px;
  line-height: 1.6;
}

.hero h1 {
  font-size: clamp(40px,4.2vw,58px);
  letter-spacing: -.035em;
  line-height: 1.06;
  margin-bottom: 24px;
}

.hero h1 span {
  color: var(--signal);
}

.hero-lead {
  max-width: 540px;
  margin: 0 0 28px;
  color: #c9d1dc;
  font-size: 18px;
}

.hero .actions {
  justify-content: flex-start;
  margin: 0;
}

.hero-install {
  background: #060D1A;
  border: 1px solid #364152;
  border-radius: 12px;
  box-shadow: 0 24px 64px #00000040;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--graphite);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  color: #b8c0cc;
  font: 12px var(--mono);
}

.terminal-lights {
  display: flex;
  gap: 6px;
}

.terminal-lights i {
  width: 7px;
  height: 7px;
  background: #4a5568;
  border-radius: 50%;
}

.terminal-lights i:first-child {
  background: var(--amber);
}

.hero-install .code {
  border-radius: 0;
  margin: 0;
  padding: 24px 20px;
  max-width: none;
}

.hero-install .code pre {
  margin-top: 20px;
  line-height: 2;
}

.hero-install .copy {
  top: 16px;
  right: 16px;
  min-height: 44px;
  min-width: 56px;
}

.hero-install .install-note {
  margin: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  color: #b8c0cc;
  font-size: 13px;
}

.hero a:not(.button),
.workflow-section a,
.dark a:not(.button),
.home-paths a {
  color: var(--signal);
}

.hero :focus-visible,
.workflow-section :focus-visible,
.dark :focus-visible,
.home-paths :focus-visible {
  outline-color: var(--signal);
}

/* Five-step workflow */
.workflow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 12px;
  padding: 0;
  margin: 34px 0 0;
}

.workflow li {
  border: 1px solid #364152;
  background: #1F2734;
  border-radius: 10px;
  padding: 19px;
  min-height: 190px;
}

.workflow .inspection {
  border-style: dashed;
  border-color: #4D9BFF;
}

.workflow b {
  font: 13px var(--mono);
  color: var(--signal);
}

.workflow h3 {
  font-size: 21px;
  margin: 28px 0 8px;
}

.workflow p {
  font-size: 14px;
  color: #b8c0cc;
  margin: 0;
}

.workflow-section {
  padding-top: 48px;
  background: var(--navy);
  border-top: 1px solid var(--line);
  color: #e8ecf1;
}

.workflow-section .workflow {
  gap: 0;
  margin-top: 40px;
}

.workflow-section .workflow li {
  position: relative;
  min-height: 0;
  padding: 0 24px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.workflow-section .workflow li::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 36px;
  right: 0;
  border-top: 1px solid #364152;
}

.workflow-section .workflow li:last-child::before {
  display: none;
}

.workflow-section .workflow b {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #4a5568;
  border-radius: 50%;
}

.workflow-section .inspection b {
  color: var(--amber);
  border-style: dashed;
  border-color: var(--amber);
}

.workflow-section .workflow h3 {
  margin: 20px 0 10px;
}

/* Shop floor and adoption paths */
.shop {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 16px;
  margin-top: 32px;
}

.shop article {
  background: #1F2734;
  border: 1px solid #364152;
  border-top: 3px solid #4D9BFF;
  border-radius: 9px;
  padding: 20px;
}

.shop article:nth-child(2) {
  border-top-color: #4A5568;
}

.shop article:nth-child(3) {
  border-top-color: #F2B233;
}

.shop small {
  font: 12px var(--mono);
  color: #B8C0CC;
}

.shop-section .shop article {
  padding: 0 24px 0 20px;
  background: transparent;
  border: 0;
  border-left: 2px solid #364152;
  border-radius: 0;
}

.shop-section .shop article:first-child {
  border-left-color: var(--signal);
}

.shop-section .shop article:nth-child(3) {
  border-left-color: var(--amber);
}

.paths,.tray {
  padding: 72px 0;
}

.paths {
  background: #151C27;
  color: #e8ecf1;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 20px;
  margin-top: 28px;
}

.path-grid article {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid #364152;
  background: #1F2734;
  padding: 27px;
  border-radius: 11px;
}

.path-grid h2,.path-grid h3 {
  font-size: 28px;
}

.home-paths {
  background: var(--navy);
}

.home-paths .path-grid {
  gap: 48px;
}

.home-paths .path-grid article {
  border: 0;
  border-top: 1px solid #364152;
  border-radius: 0;
  padding: 24px 0 0;
  background: transparent;
}

.home-paths .path-grid p {
  max-width: 480px;
  color: #c9d1dc;
}

/* Resource cards and shop log */
.tray {
  background: #dde3ea;
}

.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 14px;
  margin: 28px 0;
}

.resource {
  background: #fff;
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 10px;
}

.resource h3 {
  font: 600 15px var(--mono);
  margin: 15px 0 7px;
  overflow-wrap: anywhere;
}

.resource p {
  font-size: 14px;
  color: var(--muted);
  min-height: 68px;
}

.tag {
  font: 600 11px var(--mono);
  background: #e9edf2;
  border-radius: 4px;
  padding: 4px 6px;
}

.tag.blue {
  background: #e1ecfa;
  color: #00438f;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: #1F2734;
  padding: 20px;
  border-radius: 10px;
}

/* Interior page headers */
.page-head {
  background-color: var(--graphite);
  background-image: radial-gradient(#263042 1px,transparent 1px);
  background-size: 16px 16px;
  color: #e8ecf1;
  padding: 50px max(32px,calc((100vw - 1240px)/2));
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.page-head>div {
  max-width: 720px;
}

.page-head h1 {
  font-size: 44px;
}

.page-head p {
  font-size: 17px;
  margin: 0;
  color: #b8c0cc;
}

.search input {
  height: 48px;
  width: 300px;
  border: 0;
  border-radius: 10px;
  padding: 0 15px;
  font: 15px var(--body);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0,0,0,0);
  overflow: hidden;
}

/* Library filters and results */
.toolbar {
  background: var(--steel);
  padding: 12px max(32px,calc((100vw - 1320px)/2));
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tabs button,.filter-toggle {
  border: 1px solid #a9b3c0;
  background: transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  font: 600 13px var(--body);
}

.tabs button.active {
  background: var(--ink);
  color: white;
}

.filter-toggle {
  display: none;
}

.library {
  max-width: 1320px;
  margin: auto;
  padding: 24px 32px 68px;
  display: grid;
  grid-template-columns: 180px minmax(280px,1fr) minmax(360px,1.2fr);
  gap: 18px;
}

.filters {
  font-size: 14px;
}

.filters fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}

.filters legend {
  font: 12px var(--mono);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.library-list {
  display: grid;
  gap: 8px;
}

.resource-row {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  column-gap: 8px;
}

.resource-row small {
  grid-column: 2/4;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.resource-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.resource-row em {
  font: 11px var(--mono);
  font-style: normal;
}

.resource-row.selected {
  background: #e1ecfa;
  box-shadow: inset 4px 0 #0060c8;
}

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

/* Artifact details */
.artifact {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.artifact-title {
  background: #151C27;
  color: #fff;
  padding: 25px;
}

.artifact-title h1 {
  font: 600 24px var(--mono);
  margin: 18px 0 3px;
  overflow-wrap: anywhere;
}

.artifact-title p {
  color: #b8c0cc;
  margin: 0;
  font: 13px var(--mono);
}

.artifact-body {
  padding: 25px;
}

.artifact-body .lead {
  font-size: 17px;
}

.artifact dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px;
  font-size: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.artifact dt {
  font: 600 12px var(--mono);
  color: var(--muted);
}

.artifact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.technical-details {
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.technical-details summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  font-weight: 600;
}

.technical-details dl {
  border: 0;
  margin-top: 0;
}

.install-tabs [role=tablist] {
  display: flex;
  gap: 4px;
  background: #e9edf2;
  padding: 4px;
  border-radius: 8px;
  margin-top: 22px;
}

.install-tabs [role=tab] {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 8px;
  font: 600 12px var(--body);
}

.install-tabs [role=tab][aria-selected=true] {
  background: white;
  border: 1px solid var(--border);
}

.callout {
  background: #fdf4de;
  border: 1px solid #e9c46a;
  padding: 11px;
  border-radius: 7px;
  color: #3e2f00;
  font-size: 13px;
}

.detail-page {
  max-width: 760px;
  margin: auto;
  padding: 28px 20px 70px;
}

.back {
  display: inline-block;
  margin-bottom: 15px;
}

/* Guides and content pages */
.content {
  padding-top: 50px;
  padding-bottom: 80px;
  max-width: 1240px;
}

.content h2 {
  font-size: 30px;
  margin-top: 45px;
}

.content li {
  margin: 9px 0;
}

.content .path-grid article {
  background: #fff;
  border-color: var(--border);
}

.content .path-grid article p {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

th,td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  background: #e9edf2;
}

.comparison {
  border-left: 4px solid var(--amber);
  background: #fff;
  padding: 16px 20px;
}

.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tracks article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.tracks h2 {
  margin-top: 0;
}

.tracks a,.updates a {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 14px 0;
  text-decoration: none;
}

.coming {
  margin-top: 35px;
  border: 1px dashed #4A5568;
  padding: 20px;
}

.coming span {
  display: inline-block;
  border: 1px dashed #4A5568;
  border-radius: 20px;
  padding: 5px 10px;
  margin: 4px;
  font: 12px var(--mono);
}

.article {
  max-width: 1200px;
  margin: auto;
  padding: 48px 32px 88px;
}

.article>h1 {
  font-size: 44px;
}

.reading {
  font-size: 18px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.reading > :where(p, ul, ol, dl, blockquote) {
  max-width: 75ch;
}

.reading code {
  font-family: var(--mono);
}

.reading :not(pre) > code {
  font-size: .9em;
}

.reading img {
  max-width: 100%;
  height: auto;
}

.reading .table-scroll {
  max-width: 100%;
  margin: 24px 0;
  overflow: auto;
}

.reading .table-scroll:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.reading table {
  display: table;
  margin: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.reading th,
.reading td {
  vertical-align: top;
  font-size: 16px;
  line-height: 1.6;
  padding: 14px;
}

.reading table code {
  font-size: 1em;
  white-space: nowrap;
}

.reading pre {
  max-width: 100%;
  overflow: auto;
  overflow-wrap: normal;
  background: #060D1A;
  color: #e8ecf1;
  padding: 20px;
  font: 16px/1.7 var(--mono);
}

.updates {
  max-width: 860px;
}

.updates code {
  font: 13px var(--mono);
}

/* Footer */
footer {
  border-top: 1px solid #22304A;
  border-bottom: 0;
  min-height: 140px;
  flex-wrap: wrap;
}

footer p {
  font-size: 13px;
  color: #b8c0cc;
}

footer p a {
  color: #c9d1dc;
}

footer nav {
  margin-left: auto;
}

/* Tablet */
@media(max-width:1023px) {
  .hero-grid {
    grid-template-columns: minmax(0,1fr);
    gap: 36px;
  }
  .hero-copy {
    max-width: 680px;
  }
  .hero h1 {
    font-size: clamp(40px,6vw,58px);
  }
  .hero-install {
    width: 100%;
    max-width: 680px;
  }
  .workflow-section .workflow {
    grid-template-columns: repeat(5,minmax(0,1fr));
  }
  .workflow-section .workflow li {
    padding-right: 16px;
  }
  .workflow-section .workflow h3 {
    font-size: 18px;
  }
  header {
    min-height: 60px;
    padding: 8px 16px;
    position: relative;
  }
  .brand img {
    height: 28px;
  }
  header nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--navy);
    z-index: 3;
    padding: 14px 16px 22px;
    border-top: 1px solid #22304A;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  header nav.open {
    display: flex;
  }
  header nav a {
    padding: 11px;
  }
  header nav a[aria-current=page] {
    padding: 11px;
    border-bottom: 0;
    border-left: 2px solid var(--signal);
  }
  .menu {
    display: block;
  }
  .library {
    grid-template-columns: 180px 1fr;
  }
  .detail-panel {
    display: none;
  }
  .workflow {
    grid-template-columns: repeat(3,1fr);
  }
  .shop {
    grid-template-columns: repeat(2,1fr);
  }
}

/* Mobile */
@media(max-width:759px) {
  body {
    font-size: 15px;
  }
  .hero {
    padding: 32px 0 40px;
  }
  .hero-brand {
    margin-bottom: 28px;
  }
  .hero h1 {
    font-size: clamp(32px,7vw,46px);
  }
  .hero-lead {
    font-size: 16px;
  }
  .container,.content {
    padding-left: 16px;
    padding-right: 16px;
  }
  .section,.paths,.tray {
    padding: 36px 0;
  }
  .section h2,.paths h2 {
    font-size: 26px;
  }
  .workflow {
    display: block;
    margin-top: 20px;
  }
  .workflow li {
    display: grid;
    grid-template-columns: 40px 1fr;
    margin-bottom: 8px;
    min-height: 0;
    padding: 14px;
  }
  .workflow h3 {
    margin: 0;
    font-size: 18px;
  }
  .workflow p {
    grid-column: 2;
  }
  .workflow-section .workflow li {
    grid-template-columns: 36px minmax(0,1fr);
    column-gap: 16px;
    margin-bottom: 0;
    padding: 0 0 28px;
  }
  .workflow-section .workflow li:last-child {
    padding-bottom: 0;
  }
  .workflow-section .workflow li::before {
    top: 36px;
    left: 18px;
    right: auto;
    bottom: 0;
    border-top: 0;
    border-left: 1px solid #364152;
  }
  .workflow-section .workflow h3 {
    align-self: center;
    margin: 0;
  }
  .workflow-section .workflow p {
    margin-top: 4px;
  }
  .shop {
    gap: 8px;
    margin-top: 18px;
  }
  .shop article {
    padding: 14px;
  }
  .shop article h3 {
    font-size: 17px;
  }
  .shop article p {
    font-size: 13px;
  }
  .path-grid,.split,.tracks {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .path-grid article {
    padding: 20px;
  }
  .home-paths .path-grid {
    gap: 32px;
  }
  .resources {
    grid-template-columns: 1fr;
  }
  .page-head {
    padding: 32px 16px;
    display: block;
  }
  .page-head h1 {
    font-size: 32px;
  }
  .search {
    margin-top: 20px;
    display: block;
  }
  .search input {
    width: 100%;
  }
  .toolbar {
    padding: 10px 16px;
    overflow: auto;
  }
  .tabs {
    min-width: max-content;
  }
  .filter-toggle {
    display: block;
  }
  .library {
    display: block;
    padding: 20px 16px 45px;
  }
  .filters {
    display: none;
    margin: 12px 0;
    background: #fff;
    padding: 14px;
    border: 1px solid var(--border);
  }
  .filters.open {
    display: block;
  }
  .resource-row {
    padding: 13px;
  }
  .resource-row em {
    display: none;
  }
  .artifact dl {
    grid-template-columns: 1fr;
  }
  .artifact dt {
    margin-top: 7px;
  }
  .detail-page {
    padding: 20px 16px 50px;
  }
  .content {
    padding-top: 28px;
    padding-bottom: 50px;
  }
  .content h2 {
    font-size: 24px;
    margin-top: 32px;
  }
  .article {
    padding: 27px 16px 55px;
  }
  .article>h1 {
    font-size: 32px;
  }
  .reading {
    font-size: 17px;
  }
  .actions {
    justify-content: flex-start;
  }
  .actions .button {
    width: 100%;
  }
  footer {
    padding: 25px 16px;
    display: block;
  }
  footer nav {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .code {
    font-size: 12px;
  }
  table {
    display: block;
    overflow: auto;
  }
}

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