/* Robotic Systems — library. Tokens come from the client's Figma theme. */
:root {
  --bg: #2b2b2b;
  --chrome: #1c1c1c;
  --surface: #333333;
  --surface-warm: #403f3c;
  --line: #4a4a4a;
  --line-soft: #3a3a3a;
  --text: #ffffff;
  --text-2: #bcbbba;
  --muted: #838280;
  --accent: #c9a832;
  --on-accent: #1c1c1c;
  --display: "Roboto Flex", Roboto, system-ui, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--display);
  font-variation-settings: "opsz" 16;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono, .kicker, .telemetry dt, .badge, .chip, .link-button, .chrome__nav a {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.muted { color: var(--muted); }

/* Chrome ------------------------------------------------------------------ */
.chrome { background: var(--chrome); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.chrome__inner {
  max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px;
}
.chrome__logo img { width: 92px; height: auto; }
.chrome__nav { display: flex; gap: 24px; }
.chrome__nav a { text-decoration: none; color: var(--text-2); transition: color .2s var(--ease); }
.chrome__nav a:hover { color: var(--accent); }
.chrome__user { display: flex; align-items: center; gap: 16px; }
.chrome__user form { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-transform: none; letter-spacing: 0.02em; font-size: 13px;
}
.chip__dot { width: 6px; height: 6px; background: var(--accent); }
.link-button {
  background: none; border: 0; padding: 6px 0; color: var(--accent); cursor: pointer;
  text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s var(--ease);
}
.link-button:hover { border-bottom-color: var(--accent); }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; border-radius: 2px;
  transition: transform .15s var(--ease), filter .2s var(--ease);
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }

/* Hero -------------------------------------------------------------------- */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(40px, 6vw, 80px);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: end;
}
.kicker { color: var(--accent); margin: 0 0 20px; }
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.display {
  margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.5rem, 6.4vw, 5.6rem); line-height: 0.92; letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "wdth" 100;
  text-wrap: balance;
}
.display--md { font-size: clamp(2rem, 4.6vw, 3.9rem); line-height: 0.96; }
.lead { color: var(--text-2); font-size: clamp(1.02rem, 1.4vw, 1.2rem); max-width: 56ch; margin: 24px 0 0; }
.section-code {
  margin: 0 0 8px; font: 900 clamp(4rem, 12vw, 9rem)/0.8 var(--display); letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1px var(--accent);
}

.telemetry {
  margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); max-width: 640px;
}
.telemetry div { background: var(--chrome); padding: 12px 14px; }
.telemetry dt { color: var(--muted); font-size: 11px; }
.telemetry dd { margin: 4px 0 0; font: 500 1.35rem/1.1 var(--mono); color: var(--text); }
.telemetry--compact dd { font-size: 0.95rem; }

.frame { position: relative; margin: 0; border: 1px solid var(--line); background: var(--chrome); }
.frame::before, .frame::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--accent); pointer-events: none;
}
.frame::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.frame::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.hero__art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero--section .hero__art img { aspect-ratio: 3 / 2; }

/* Blocks ------------------------------------------------------------------ */
.block { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(48px, 7vw, 96px); }
.block__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 2px solid var(--text); padding-top: 14px; margin-bottom: 8px;
}
.block__title { margin: 0; font: 800 clamp(1.4rem, 2.4vw, 2rem)/1 var(--display); text-transform: uppercase; letter-spacing: -0.02em; }

.index { list-style: none; margin: 0; padding: 0; }
.index li { border-bottom: 1px solid var(--line); }
.index__row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 90px 200px; gap: 24px; align-items: center;
  padding: 18px 0; text-decoration: none; transition: background .25s var(--ease);
}
.index__row:hover { background: rgba(201, 168, 50, 0.05); }
.index__row:hover .index__title { color: var(--accent); }
.index__code { font: 300 2.6rem/1 var(--mono); color: var(--accent); }
.index__title { display: block; font: 800 1.35rem/1.15 var(--display); text-transform: uppercase; letter-spacing: -0.01em; transition: color .2s var(--ease); }
.index__summary { display: block; color: var(--text-2); margin-top: 6px; max-width: 62ch; font-size: 15px; }
.index__count { color: var(--muted); text-align: right; }
.index__thumb img { width: 200px; aspect-ratio: 8 / 5; object-fit: cover; border: 1px solid var(--line); filter: saturate(.9); }

.feed { display: grid; }
.row {
  display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; gap: 24px; align-items: start;
  padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.row:hover .row__title { color: var(--accent); }
.row__thumb img { width: 240px; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line); }
.row__meta { display: block; color: var(--muted); margin-bottom: 8px; font-size: 11px; }
.row__title { display: block; font: 800 1.25rem/1.2 var(--display); text-transform: uppercase; letter-spacing: -0.01em; transition: color .2s var(--ease); }
.row__intro { display: block; color: var(--text-2); margin-top: 8px; font-size: 15px; max-width: 70ch; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 5px 8px;
  border: 1px solid var(--accent); color: var(--accent); font-size: 10px;
}
.row--locked .row__thumb img { filter: grayscale(.6) brightness(.8); }
.empty { color: var(--muted); padding: 32px 0; }

/* Article ----------------------------------------------------------------- */
.article { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 0; }
.article__head { max-width: 980px; }
.article__cover { margin: 40px 0 0; }
.article__cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.article__grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding: 48px 0 72px; }
.toc { position: sticky; top: 104px; align-self: start; }
.toc ol { list-style: none; margin: 12px 0 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 14px; color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1.35; }
.toc li a:hover { color: var(--accent); }
.prose { max-width: 70ch; font-size: 17px; }
.prose__h2 { font: 800 1.5rem/1.15 var(--display); text-transform: uppercase; letter-spacing: -0.015em; margin: 48px 0 12px; scroll-margin-top: 96px; }
.prose__h2:first-child { margin-top: 0; }
.prose__p p { margin: 0 0 16px; color: #e6e5e3; }
.prose__p a { color: var(--accent); }
.prose__p ul, .prose__p ol { padding-left: 1.2em; color: #e6e5e3; }
.prose__figure { margin: 32px 0; }
.prose__figure figcaption { padding: 10px 14px; color: var(--muted); border-top: 1px solid var(--line); text-transform: none; letter-spacing: 0.02em; }
.callout { margin: 28px 0; padding: 16px 20px; background: var(--surface-warm); border-left: 3px solid var(--accent); }
.callout--warning { border-left-color: #d9822b; }
.callout--note { border-left-color: var(--muted); }
.callout__label { margin: 0 0 6px; color: var(--accent); font-size: 11px; }
.callout--warning .callout__label { color: #e09a50; }
.callout--note .callout__label { color: var(--text-2); }
.callout__text p { margin: 0; }
.checklist, .steps, .specs { margin: 32px 0; border: 1px solid var(--line); background: var(--chrome); }
.checklist__title, .steps__title, .specs__title { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--accent); font-size: 12px; font-weight: 500; }
.checklist ul { list-style: none; margin: 0; padding: 8px 16px; }
.checklist li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.checklist li:last-child { border-bottom: 0; }
.checklist__box { width: 14px; height: 14px; border: 1px solid var(--accent); margin-top: 6px; }
.steps ol { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 56px 1fr; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps__n { padding: 14px 0 0 16px; color: var(--accent); font-size: 14px; }
.steps li > div { padding: 12px 16px 12px 0; }
.steps li p { margin: 0; color: var(--text-2); }
.steps__head { color: var(--text) !important; font-weight: 700; margin-bottom: 4px !important; }
.specs dl { margin: 0; }
.specs dl div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.specs dl div:last-child { border-bottom: 0; }
.specs dt, .specs dd { margin: 0; padding: 10px 16px; }
.specs dt { color: var(--text-2); }
.specs dd { font-family: var(--mono); font-size: 14px; border-left: 1px solid var(--line); }

/* Gate (login) ------------------------------------------------------------ */
.gate {
  max-width: var(--max); margin: 0 auto; padding: clamp(48px, 9vw, 120px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: center;
}
.gate__copy .button { margin-top: 32px; margin-right: 20px; }
.gate__copy .link-button { display: inline-block; margin-top: 32px; }
.gate__art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* Footer ------------------------------------------------------------------ */
.footer { background: var(--chrome); border-top: 1px solid var(--line); }
.footer__inner {
  max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter);
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; color: var(--muted);
}
.footer__inner p { margin: 0; }
.footer__note { text-transform: none; letter-spacing: 0.02em; max-width: 46ch; text-align: right; }

/* Motion ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > *, .hero__art { animation: rise .7s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: .06s; }
  .hero__copy > :nth-child(3) { animation-delay: .12s; }
  .hero__copy > :nth-child(4) { animation-delay: .18s; }
  .hero__art { animation-delay: .1s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* Small screens ----------------------------------------------------------- */
@media (max-width: 900px) {
  .hero, .gate { grid-template-columns: 1fr; align-items: start; }
  .index__row { grid-template-columns: 64px minmax(0, 1fr); }
  .index__count, .index__thumb { display: none; }
  .index__code { font-size: 2rem; }
  .row { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
  .row__thumb img { width: 120px; }
  .row .badge { grid-column: 2; justify-self: start; }
  .article__grid { grid-template-columns: 1fr; }
  .toc { display: none; }
  .telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__note { text-align: left; }
}
@media (max-width: 560px) {
  .chrome__inner { grid-template-columns: auto 1fr; gap: 12px; }
  .chrome__nav { display: none; }
  .chrome__user { justify-self: end; }
  .chip { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row { grid-template-columns: 1fr; }
  .row__thumb img { width: 100%; }
  .row .badge { grid-column: 1; }
  .row__intro { display: none; }
}
