/* ------------------------------------------------------------------
   APTO Robotics — blog stylesheet
   Shared by blog/index.html and every blog/<slug>/index.html.
   Tokens mirror the landing page (index.html) so both feel like one site.
   ------------------------------------------------------------------ */
:root {
  --bg: oklch(0.13 0.008 260);
  --bg-2: oklch(0.16 0.01 260);
  --ink: oklch(0.97 0.004 90);
  --ink-dim: oklch(0.72 0.01 250);
  --ink-mute: oklch(0.52 0.015 250);
  --accent: oklch(0.82 0.11 220);
  --accent-warm: oklch(0.78 0.09 60);
  --danger: oklch(0.72 0.14 30);
  --hair: color-mix(in oklch, var(--ink) 10%, transparent);
  --hair-strong: color-mix(in oklch, var(--ink) 18%, transparent);
  --glass: color-mix(in oklch, var(--ink) 6%, transparent);
  --glass-2: color-mix(in oklch, var(--ink) 10%, transparent);
  --measure: 72ch;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter Tight", "Noto Sans JP", -apple-system, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0; }
img, video { max-width: 100%; height: auto; display: block; }

/* ---------- NAV (same pill as the LP, links point back to the LP) ---------- */
.nav-wrap {
  position: fixed; top: 18px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; pointer-events: none; padding: 0 12px;
}
.nav {
  pointer-events: auto; display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 18px;
  background: color-mix(in oklch, var(--bg) 55%, transparent);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--hair); border-radius: 999px;
  box-shadow: inset 0 1px 0 color-mix(in oklch, var(--ink) 10%, transparent), 0 20px 60px -20px rgba(0,0,0,.7);
  max-width: calc(100vw - 24px);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px; padding-right: 14px; margin-right: 4px;
  border-right: 1px solid var(--hair); font-weight: 500; letter-spacing: -0.02em; font-size: 14px; white-space: nowrap;
}
.nav-brand .nav-logo { height: 22px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .96; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 999px;
  font-size: 13px; color: var(--ink-dim); transition: background .25s ease, color .25s ease; white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--glass); color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px 10px 16px;
  border-radius: 999px; font-size: 13px; background: var(--ink); color: var(--bg); font-weight: 500;
  transition: transform .25s ease; white-space: nowrap; margin-left: 4px;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta .arr { width: 14px; height: 14px; display: inline-block; }
@media (max-width: 900px) {
  .nav-links a:not(.nav-keep) { display: none; }
  .nav-wrap { top: 12px; }
  .nav { width: 100%; max-width: none; padding: 8px 10px 8px 16px; border-radius: 18px; justify-content: space-between; }
}

/* ---------- PAGE FRAME ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 150px 32px 80px; }
@media (max-width: 700px) { .page { padding: 120px 20px 60px; } }

.kicker {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; width: 24px; height: 1px; background: var(--ink-mute); }
.kicker a:hover { color: var(--ink); }

.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-mute); margin-bottom: 28px; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: .5; }

/* ---------- BLOG INDEX ---------- */
.blog-head { max-width: 60ch; margin-bottom: 64px; }
.blog-head h1 { margin: 16px 0 0; font-size: clamp(32px, 4vw, 56px); font-weight: 500; letter-spacing: -.025em; line-height: 1.05; }
.blog-head h1 .it { font-style: italic; font-weight: 400; color: var(--ink-dim); }
.blog-head p { color: var(--ink-dim); font-size: 17px; line-height: 1.65; margin: 20px 0 0; }

.post-list { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.post-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--hair);
  background: linear-gradient(180deg, color-mix(in oklch, var(--ink) 4%, transparent), transparent 80%);
  transition: border-color .25s ease, transform .25s ease;
}
.post-card:hover { border-color: var(--hair-strong); transform: translateY(-2px); }
.post-card .cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 24px 26px 28px; }
.post-card .meta { display: flex; gap: 12px; align-items: center; font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.post-card .meta .date { color: var(--ink-mute); }
.post-card h3 { margin: 12px 0 10px; font-size: 22px; font-weight: 500; letter-spacing: -.015em; line-height: 1.25; }
.post-card p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.6; }
.post-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tag { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); border: 1px solid var(--hair); border-radius: 999px; padding: 4px 9px; }
.post-card > a.cover-link { position: absolute; inset: 0; z-index: 1; }

/* ---------- ARTICLE ---------- */
.article-head { max-width: 900px; margin: 0 auto 56px; }
.article-head h1 { margin: 18px 0 20px; font-size: clamp(30px, 4vw, 54px); font-weight: 500; letter-spacing: -.025em; line-height: 1.08; }
.article-head .lede { color: var(--ink-dim); font-size: 18px; line-height: 1.6; margin: 0 0 24px; max-width: 64ch; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.byline b { color: var(--ink-dim); font-weight: 500; }
.notice { display: inline-flex; gap: 10px; align-items: center; margin-top: 18px; padding: 8px 12px; border: 1px solid var(--hair); border-radius: 10px; font-size: 12.5px; color: var(--ink-dim); background: var(--glass); }
.notice .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent-warm); }

.hero-fig { max-width: 1100px; margin: 0 auto 64px; }
.hero-fig img, .hero-fig video { width: 100%; border-radius: 20px; border: 1px solid var(--hair); }

.article-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; max-width: 1100px; margin: 0 auto; align-items: start; }
@media (max-width: 1000px) { .article-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

.toc { position: sticky; top: 110px; font-size: 13px; }
.toc .kicker { margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; border-left: 1px solid var(--hair); }
.toc li a { display: block; padding: 2px 0 2px 14px; color: var(--ink-mute); border-left: 1px solid transparent; margin-left: -1px; transition: color .2s ease, border-color .2s ease; }
.toc li a:hover, .toc li a.active { color: var(--ink); border-left-color: var(--accent); }
.toc li.sub a { padding-left: 26px; font-size: 12px; }
@media (max-width: 1000px) { .toc { position: static; } .toc ol { display: none; } .toc details[open] ol { display: grid; margin-top: 12px; } .toc summary { cursor: pointer; color: var(--ink-dim); } }
@media (min-width: 1001px) { .toc summary { display: none; } .toc details > ol { display: grid; } }

.article { max-width: var(--measure); font-size: 17px; line-height: 1.7; color: var(--ink-dim); }
.article > * + * { margin-top: 1.15em; }
.article h2, .article h3, .article h4 { color: var(--ink); font-weight: 500; letter-spacing: -.02em; line-height: 1.2; scroll-margin-top: 110px; }
.article h2 { font-size: clamp(26px, 2.6vw, 34px); margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--hair); }
.article h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.article h3 { font-size: 21px; margin-top: 2em; }
.article h2 .num { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .14em; color: var(--accent); display: block; margin-bottom: 10px; }
.article strong { color: var(--ink); font-weight: 500; }
.article a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.article a:hover { text-decoration-color: var(--accent); }
.article ul, .article ol { padding-left: 1.3em; }
.article li + li { margin-top: .45em; }
.article code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .86em; background: var(--glass); border: 1px solid var(--hair); border-radius: 6px; padding: .12em .4em; color: var(--ink); }
.article pre { background: var(--bg-2); border: 1px solid var(--hair); border-radius: 14px; padding: 18px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.article pre code { background: none; border: 0; padding: 0; }
.article blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--ink-dim); font-style: italic; }
.article hr { border: 0; border-top: 1px solid var(--hair); margin: 2.4em 0; }

.article .table-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--hair); border-radius: 14px; }
.article table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.article th, .article td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.article th { font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); font-weight: 500; background: var(--glass); }
.article tr:last-child td { border-bottom: 0; }
.article td strong { color: var(--ink); }
.article td.num, .article th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* figures — all media is centered; .narrow shrinks to ~2/3 of the column */
.article figure { margin: 2.2em auto; }
.article figure.narrow { max-width: 68%; }
.article figure.portrait { max-width: 420px; }
@media (max-width: 600px) { .article figure.narrow, .article figure.portrait { max-width: 100%; } }
.article figure img, .article figure video, .article figure .frame { width: 100%; margin-inline: auto; border-radius: 16px; border: 1px solid var(--hair); background: var(--bg-2); }
.article figure.light img { background: #fff; padding: 12px; }
.article figcaption { margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink-mute); }
.article figcaption b { color: var(--ink-dim); font-weight: 500; }
.article figure .cols { display: grid; gap: 10px; }
.article figure .cols.two { grid-template-columns: 1fr 1fr; }
.article figure .cols.three { grid-template-columns: 1fr 1fr 1fr; }
.article figure .cols img, .article figure .cols video { border-radius: 12px; }
.article figure .cols .lbl { margin-top: 6px; font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); text-align: center; }
@media (max-width: 600px) { .article figure .cols.two, .article figure .cols.three { grid-template-columns: 1fr; } }

/* placeholder for images still to be shot / picked */
.article figure.todo .frame {
  aspect-ratio: 16 / 9; display: grid; place-content: center; text-align: center; padding: 20px;
  border: 1px dashed var(--hair-strong); color: var(--ink-mute); font-size: 13px; line-height: 1.5;
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in oklch, var(--ink) 3%, transparent) 14px 15px);
}
.article figure.todo .frame b { display: block; font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-warm); margin-bottom: 8px; }
.article figure.todo .frame code { font-size: 11.5px; }

/* callouts */
.callout { border: 1px solid var(--hair); border-radius: 16px; padding: 18px 22px; background: linear-gradient(180deg, color-mix(in oklch, var(--ink) 4%, transparent), transparent); }
.callout .k { font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }
.callout.warn .k { color: var(--accent-warm); }
.callout p { margin: 0; font-size: 15.5px; }
.callout ul { margin: 0; font-size: 15.5px; }

.footnotes { font-size: 14px; color: var(--ink-mute); border-top: 1px solid var(--hair); padding-top: 20px; margin-top: 3em; }
.footnotes ol { padding-left: 1.2em; }
sup.fn a { text-decoration: none; font-family: "JetBrains Mono", monospace; font-size: .7em; color: var(--accent); }

/* ---------- AUTHOR CARD ---------- */
.author-card {
  margin: 3.5em 0 0; padding: 22px 24px;
  display: flex; gap: 18px; align-items: flex-start;
  border: 1px solid var(--hair); border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in oklch, var(--ink) 4%, transparent), transparent);
}
.author-card .avatar {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--hair-strong); display: grid; place-content: center;
  background: var(--glass-2); font-family: "JetBrains Mono", monospace;
  font-size: 20px; letter-spacing: .06em; color: var(--ink-dim);
}
.author-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card .k { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); }
.author-card h4 { margin: 4px 0 2px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.author-card h4 a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.author-card h4 a:hover { text-decoration-color: var(--accent); }
.author-card .role { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-mute); }
.author-card .bio { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-dim); }

.article-foot { max-width: 1100px; margin: 72px auto 0; padding-top: 32px; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.article-foot p { margin: 0; color: var(--ink-dim); font-size: 15px; max-width: 56ch; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: transform .25s ease, background .25s ease, border-color .25s ease; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: inset 0 1px 0 color-mix(in oklch, #fff 60%, transparent), 0 10px 30px -10px color-mix(in oklch, var(--ink) 40%, transparent); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: var(--glass); border: 1px solid var(--hair); color: var(--ink); }
.btn-ghost:hover { border-color: var(--hair-strong); background: var(--glass-2); }
.btn .arr { width: 14px; height: 14px; }

/* ---------- FOOTER (compact) ---------- */
footer { border-top: 1px solid var(--hair); padding: 40px 32px; margin-top: 60px; }
.foot-base { max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; color: var(--ink-mute); font-size: 11.5px; font-family: "JetBrains Mono", monospace; gap: 12px; flex-wrap: wrap; }
.foot-base a:hover { color: var(--ink); }
