/* social-robotics.com - "research journal from the near future"
   Dark by default, paper-light for readers who prefer it. */
:root {
  --bg: #0b0d10;
  --bg-2: #101318;
  --surface: #12161c;
  --ink: #e9ece8;
  --muted: #8b939c;
  --faint: #5a626b;
  --line: #222831;
  --line-2: #2d3440;
  --accent: #c8ff3d;
  --accent-ink: #0b0d10;
  --accent-soft: rgba(200, 255, 61, 0.08);
  --research: #5fd3ff;
  --research-soft: rgba(95, 211, 255, 0.1);
  --warn: #ff6b4a;
  --grid: rgba(255, 255, 255, 0.025);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1160px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f1ea;
    --bg-2: #ebe8df;
    --surface: #fbfaf6;
    --ink: #15171a;
    --muted: #5b6068;
    --faint: #8a8f96;
    --line: #d9d5ca;
    --line-2: #c9c4b7;
    --accent: #3b7d00;
    --accent-ink: #ffffff;
    --accent-soft: rgba(59, 125, 0, 0.08);
    --research: #0a6c91;
    --research-soft: rgba(10, 108, 145, 0.08);
    --warn: #c2410c;
    --grid: rgba(0, 0, 0, 0.035);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Status bar + header */
.statusbar { border-bottom: 1px solid var(--line); font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.statusbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 9px; padding-bottom: 9px; }
.statusbar .live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 0; box-shadow: 0 0 10px var(--accent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .statusbar .live::before { animation: none; } }

header.site { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 15px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase; }
.brand img { width: 26px; height: 26px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font: 500 12.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; border: 1px solid transparent; border-radius: 2px; }
nav a:hover { color: var(--ink); border-color: var(--line-2); }
nav a[aria-current] { color: var(--accent); border-color: var(--accent); }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; }
.kicker { font: 600 12px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.kicker::before { content: "// "; color: var(--faint); }

.hero { padding: 88px 0 64px; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(42px, 7vw, 84px); margin: 0 0 24px; max-width: 15ch; }
.hero p { font-size: 20px; color: var(--muted); max-width: 62ch; margin: 0; }
.hero.split .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-art img { width: 100%; aspect-ratio: 3/4; object-fit: cover; filter: grayscale(1) contrast(1.1); border: 1px solid var(--line-2); transition: filter .4s; }
.hero-art img:nth-child(2) { margin-top: 40px; }
.hero-art img:hover { filter: none; }

section { padding: 64px 0; border-top: 1px solid var(--line); }
section > .wrap > h2, .sec-title { font-size: clamp(30px, 4vw, 42px); margin: 0 0 10px; }
.sec-label { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; display: block; }
.lede { color: var(--muted); margin: 0 0 32px; max-width: 66ch; font-size: 18px; }
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(28px, 3.4vw, 38px); margin: 64px 0 14px; position: relative; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 23px; margin: 36px 0 6px; }
.prose li { margin-bottom: 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose ul li::marker { content: "\25B8  "; color: var(--accent); }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent); font: 500 22px/1.45 var(--serif); color: var(--ink); }
.prose .grid { margin: 24px 0; }

/* Figures */
.fig { margin: 36px 0; }
.fig img { width: 100%; height: auto; border: 1px solid var(--line-2); filter: grayscale(.85) contrast(1.05); transition: filter .5s ease; background: var(--bg-2); }
.fig:hover img { filter: none; }
.fig figcaption { margin-top: 10px; font: 400 13px/1.55 var(--mono); color: var(--muted); display: flex; gap: 12px; }
.fig .fig-n { color: var(--accent); white-space: nowrap; font-weight: 700; }
.fig.right { float: right; width: 44%; margin: 6px 0 24px 32px; }
.fig.left { float: left; width: 44%; margin: 6px 32px 24px 0; }
.fig.wide { margin-left: -8%; margin-right: -8%; }
.fig.small { max-width: 360px; }
.clear { clear: both; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 32px 0; }
.figs .fig { margin: 0; }
.figs .fig img { aspect-ratio: 4/5; object-fit: cover; }

/* Buttons and tiles */
.cta { margin-top: 32px !important; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: 12px 20px; border-radius: 2px; font: 700 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.btn::after { content: "  \2192"; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { background: var(--surface); padding: 24px; position: relative; }
.tile h3 { margin: 0 0 8px; font-size: 22px; }
.tile p { margin: 0; color: var(--muted); font-size: 15.5px; }
.tile .yr { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: .06em; margin-bottom: 8px; }
a.tile.link { text-decoration: none; color: inherit; transition: background .2s; }
a.tile.link::after { content: "\2197"; position: absolute; top: 18px; right: 20px; font-family: var(--mono); color: var(--faint); transition: color .2s, transform .2s; }
a.tile.link:hover { background: var(--bg-2); }
a.tile.link:hover::after { color: var(--accent); transform: translate(2px, -2px); }
.tile-img { margin: -24px -24px 18px; aspect-ratio: 16/9; overflow: hidden; border-bottom: 1px solid var(--line); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); transition: filter .4s, transform .6s; }
a.tile.link:hover .tile-img img { filter: none; transform: scale(1.03); }
.note { color: var(--muted); margin-top: 32px; font-size: 15px; }
.next { margin-top: 64px; padding: 22px 0; border-top: 1px solid var(--line); display: flex; gap: 14px; align-items: baseline; font: 600 16px/1.3 var(--sans); }
.next span { color: var(--faint); font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; }

/* News + blog lists */
.news-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.news-head a, #updated { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.news-head a { color: var(--accent); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cols h3 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--faint); margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.item { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.item .meta { display: flex; gap: 12px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.item .src { color: var(--accent); }
.item.research .src { color: var(--research); }
.item h3 { font: 600 17px/1.4 var(--sans); margin: 0 0 6px; letter-spacing: 0; }
.item h3 a { color: var(--ink); text-decoration: none; }
.item h3 a:hover { color: var(--accent); }
.item p { margin: 0; font-size: 14.5px; color: var(--muted); }
.empty { color: var(--muted); font: 400 14px/1.5 var(--mono); }
.empty::before { content: "> "; color: var(--accent); }
.more { display: inline-block; margin-top: 18px; font: 600 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.post-list { display: grid; gap: 1px; max-width: 860px; background: var(--line); border: 1px solid var(--line); }
.post-card { background: var(--surface); padding: 22px 24px; }
.post-card time { font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.post-card h3 { margin: 8px 0 6px; font-size: 26px; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { margin: 0; color: var(--muted); }
.post { max-width: 740px; }
.post h1 { font-size: clamp(36px, 5vw, 56px); margin: 6px 0 16px; }
.post .lede { font-size: 20px; }
.entry { border-top: 1px solid var(--line); padding: 26px 0 8px; }
.entry h2 { font-size: 25px; margin: 0 0 10px; }
.entry p { margin: 0 0 12px; }
.entry .via { font: 500 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.disclosure { margin-top: 40px; padding: 16px 18px; border: 1px dashed var(--line-2); font: 400 13px/1.6 var(--mono); color: var(--muted); }
.review { max-width: 740px; background: var(--accent-soft); border: 1px solid var(--accent); padding: 20px 22px; margin-bottom: 36px; }
.review p { margin: 0 0 14px; }
.review p:last-child { margin: 0; }

/* Learn hub */
.guide { display: grid; gap: 1px; max-width: 900px; background: var(--line); border: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: start; background: var(--surface); padding: 24px; text-decoration: none; color: inherit; transition: background .2s; }
.step:hover { background: var(--bg-2); }
.step > span { font: 700 14px/1 var(--mono); color: var(--accent); border: 1px solid var(--accent); padding: 8px 0; text-align: center; }
.step h3 { margin: 0 0 6px; font-size: 24px; }
.step p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Robots directory */
.robots { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.robot { background: var(--surface); padding: 24px; }
.robot .yr { font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.robot h3 { margin: 8px 0 10px; font-size: 28px; }
.robot p { margin: 0 0 12px; font-size: 15.5px; }
.robot .lesson { color: var(--muted); font: 400 13px/1.55 var(--mono); margin: 0; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.robot .lesson::before { content: "LESSON  "; color: var(--accent); font-weight: 700; }
.robot .fig { margin: -24px -24px 18px; }
.robot .fig img { border: 0; border-bottom: 1px solid var(--line); aspect-ratio: 4/3; object-fit: cover; }
.robot .fig figcaption { display: none; }

/* Glossary */
.glossary dt { font: 600 21px/1.3 var(--serif); margin-top: 26px; scroll-margin-top: 90px; }
.glossary dd { margin: 6px 0 0; color: var(--muted); padding-left: 16px; border-left: 1px solid var(--line-2); }
.glossary dt:target { color: var(--accent); }

/* History / timeline */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.toc a { font: 500 12px/1 var(--mono); letter-spacing: .04em; padding: 8px 12px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; background: var(--surface); }
.toc a:hover { color: var(--accent); border-color: var(--accent); }
.legend { color: var(--muted); font: 400 13px/1.5 var(--mono); margin: 0 0 40px; }
.tag { display: inline-block; font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--research); background: var(--research-soft); border: 1px solid color-mix(in srgb, var(--research) 40%, transparent); padding: 3px 7px; vertical-align: 2px; margin-left: 6px; font-style: normal; }
.tag.magic { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.era-head { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; margin-bottom: 18px; }
.era-n { font: 700 54px/0.9 var(--mono); color: transparent; -webkit-text-stroke: 1px var(--accent); }
.era-head h2 { font-size: clamp(30px, 4vw, 44px); margin: 0 0 8px; }
.era-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.era-body .side .fig { margin: 0 0 28px; position: sticky; top: 90px; }
.timeline { list-style: none; padding: 0; margin: 0; max-width: 760px; border-left: 1px solid var(--line-2); }
.timeline li { display: grid; grid-template-columns: 108px 1fr; gap: 18px; padding: 14px 0 14px 22px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 23px; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--accent); }
.timeline li:hover::before { background: var(--accent); }
.timeline b { font: 700 13.5px/1.6 var(--mono); color: var(--accent); white-space: nowrap; }
.timeline span { font-size: 16px; }

footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font: 400 13px/1.6 var(--mono); }
.foot p { margin: 0 0 10px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .hero.split .wrap, .era-body { grid-template-columns: 1fr; }
  .era-body .side .fig { position: static; max-width: 420px; }
  .fig.right, .fig.left { float: none; width: auto; margin: 28px 0; }
  .fig.wide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .statusbar .live { display: none; }
  .cols { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 40px; }
  header.site { position: static; }
  header.site .wrap { flex-direction: column; align-items: flex-start; padding-top: 14px; padding-bottom: 12px; gap: 10px; }
  nav a { padding: 6px 8px; font-size: 11.5px; }
  .era-head { grid-template-columns: 1fr; gap: 6px; }
  .era-n { font-size: 38px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .step { grid-template-columns: 44px 1fr; gap: 14px; padding: 20px; }
  .robots { grid-template-columns: 1fr; }
  .hero-art img:nth-child(2) { margin-top: 20px; }
}

/* Blog archive by year */
.year-block { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 32px; margin-bottom: 56px; }
.year-label { position: sticky; top: 90px; align-self: start; }
.year-label span { display: block; font: 700 44px/1 var(--mono); color: transparent; -webkit-text-stroke: 1px var(--accent); }
.year-label small { display: block; margin-top: 8px; font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 760px) {
  .year-block { grid-template-columns: 1fr; gap: 12px; }
  .year-label { position: static; }
}

.features { margin-bottom: 64px; }
.features .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.refs { font: 400 13.5px/1.6 var(--mono); color: var(--muted); padding-left: 22px; }
.refs li { margin-bottom: 10px; }
.post.prose { max-width: 740px; }
.features .sec-label { margin-top: 36px; }
.features .grid { margin-bottom: 8px; }
.features + .sec-title { margin-top: 24px; }
