/* Shared styles for the blog: the listing (blog/index.html) and every post
   (blog/<slug>/index.html). Tokens, header, hero and footer match the lab
   home and the research page. */
:root{
  --ink:#0E141F;
  --ink-2:#161e2b;
  --paper:#F7F8F5;
  --paper-2:#eef0ec;
  --cyan:#00A7C7;
  --cyan-deep:#00788f;
  --amber:#F59E0B;
  --line-d:rgba(247,248,245,0.14);
  --line-l:rgba(17,24,39,0.12);
  --sans:'Hanken Grotesk',system-ui,-apple-system,sans-serif;
  --grotesk:'Hanken Grotesk',var(--sans);
  --serif:'Newsreader',Georgia,serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{background:var(--paper);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased;line-height:1.6;}
::selection{background:var(--cyan);color:var(--ink);}
a{color:inherit;text-decoration:none;}
img,svg{display:block;}
button{font-family:inherit;}
[hidden]{display:none !important;}
.wrap{max-width:1120px;margin:0 auto;padding:0 40px;}

/* ---------- header ---------- */
header.site{position:absolute;top:0;left:0;right:0;z-index:5;}
.topbar{display:flex;align-items:center;justify-content:space-between;padding-top:22px;padding-bottom:22px;}
.brand{display:flex;align-items:center;gap:12px;color:var(--paper);}
.brand .word{font-family:var(--serif);font-weight:500;font-size:22px;letter-spacing:-0.01em;}
.topnav{display:flex;align-items:center;gap:22px;}
.topnav a.navlink{font-size:13.5px;color:rgba(247,248,245,0.66);transition:color .15s;}
.topnav a.navlink:hover,.topnav a.navlink[aria-current="page"]{color:var(--paper);}
.langswitch{display:inline-flex;align-items:center;border:1px solid var(--line-d);border-radius:999px;overflow:hidden;}
.langswitch button{appearance:none;background:transparent;border:0;cursor:pointer;font-family:var(--mono);font-size:11px;letter-spacing:0.06em;color:rgba(247,248,245,0.55);padding:6px 12px;transition:color .15s,background .15s;}
.langswitch button[aria-pressed="true"]{background:var(--paper);color:var(--ink);}
.langswitch button:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;}

/* ---------- hero ---------- */
.hero{position:relative;background:var(--ink);color:var(--paper);overflow:hidden;}
.hero #field{position:absolute;inset:0;opacity:.85;}
.hero .veil{position:absolute;inset:0;background:radial-gradient(62% 56% at 32% 44%,rgba(14,20,31,0.86),rgba(14,20,31,0) 72%);}
.hero .veil2{position:absolute;inset:0;background:linear-gradient(180deg,rgba(14,20,31,0) 55%,rgba(14,20,31,0.6) 100%);}
.hero-inner{position:relative;padding:150px 0 84px;max-width:760px;}
h1.hero-main{font-family:var(--serif);font-weight:500;font-size:clamp(38px,5.2vw,62px);line-height:1.06;letter-spacing:-0.02em;margin:0;max-width:18ch;text-wrap:balance;}
.hero-body{margin:26px 0 0;max-width:52ch;}
.hero-body p{font-size:17.5px;line-height:1.65;color:rgba(247,248,245,0.7);margin:0;text-wrap:pretty;}
.hero-links{display:flex;flex-wrap:wrap;gap:10px 22px;margin-top:28px;}
.hero-links a{display:inline-flex;align-items:center;gap:8px;font-family:var(--mono);font-size:12px;color:rgba(247,248,245,0.6);transition:color .15s;}
.hero-links a:hover{color:var(--paper);}

/* ---------- shared ---------- */
.btn{display:inline-flex;align-items:center;gap:9px;font-family:var(--grotesk);font-weight:600;font-size:14px;padding:11px 18px;border-radius:10px;border:0;cursor:pointer;transition:transform .12s,background .15s,border-color .15s,color .15s;line-height:1;}
.btn:active{transform:translateY(.5px);}
.btn.ghost{background:transparent;border:1px solid rgba(17,24,39,0.22);color:var(--ink);font-weight:500;}
.btn.ghost:hover{background:rgba(17,24,39,0.04);border-color:rgba(17,24,39,0.45);}
.btn:focus-visible{outline:2px solid var(--cyan);outline-offset:3px;}
.arrow{display:inline-flex;align-items:center;gap:8px;font-family:var(--grotesk);font-weight:600;font-size:14px;color:var(--cyan-deep);transition:color .15s;}
.arrow:hover{color:var(--ink);}
.tag{display:inline-block;border:1px solid var(--line-l);background:var(--paper);color:rgba(17,24,39,0.62);border-radius:6px;padding:4px 9px;font-family:var(--mono);font-size:11px;letter-spacing:0.02em;}
a.tag:hover{border-color:var(--cyan);color:var(--cyan-deep);}
.meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 0;font-size:13px;color:rgba(17,24,39,0.5);}
.meta > * + *::before{content:"·";margin:0 9px;color:rgba(17,24,39,0.3);}
.lang-badge{border:1px solid var(--line-l);border-radius:5px;padding:1px 6px;font-size:12px;color:rgba(17,24,39,0.6);}
.meta > .lang-badge{margin-left:10px;}
.meta > .lang-badge::before{content:none;}
.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,16px);opacity:0;pointer-events:none;background:var(--ink);color:var(--paper);font-family:var(--mono);font-size:12px;letter-spacing:0.06em;padding:11px 16px;border-radius:999px;border:1px solid var(--line-d);transition:opacity .2s,transform .2s;z-index:60;}
.toast.show{opacity:1;transform:translate(-50%,0);}

/* ---------- listing ---------- */
section.tools{padding:56px 0 0;}
.chips{display:flex;flex-wrap:wrap;gap:8px;}
.chip{appearance:none;cursor:pointer;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line-l);background:#fff;color:rgba(17,24,39,0.72);border-radius:999px;padding:7px 12px 7px 13px;font-family:var(--mono);font-size:11.5px;letter-spacing:0.02em;transition:border-color .15s,background .15s,color .15s;}
.chip .n{font-size:10px;color:rgba(17,24,39,0.42);background:var(--paper-2);border-radius:999px;padding:1px 7px;}
.chip:hover{border-color:rgba(17,24,39,0.35);}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--paper);border-color:var(--ink);}
.chip[aria-pressed="true"] .n{background:rgba(247,248,245,0.14);color:rgba(247,248,245,0.8);}
.chip:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;}
.count{font-size:14px;color:rgba(17,24,39,0.45);margin:40px 0 0;display:flex;align-items:center;gap:12px;}
.count b{color:var(--ink);font-weight:600;}
.count::after{content:"";flex:1;height:1px;background:var(--line-l);}
section.list{padding:0 0 112px;}
.posts{display:flex;flex-direction:column;}
.post-card{display:grid;grid-template-columns:200px 1fr;gap:40px;padding:34px 0;border-bottom:1px solid var(--line-l);}
.post-card .when{font-size:13.5px;color:rgba(17,24,39,0.5);padding-top:6px;}
.post-card .when time{display:block;color:rgba(17,24,39,0.75);font-weight:500;}
.post-card h2{font-family:var(--serif);font-weight:500;font-size:30px;line-height:1.18;letter-spacing:-0.014em;margin:0 0 12px;text-wrap:balance;}
.post-card h2 a{transition:color .15s;}
.post-card h2 a:hover{color:var(--cyan-deep);}
.post-card h2 a:focus-visible{outline:2px solid var(--cyan);outline-offset:3px;border-radius:3px;}
.post-card .excerpt{font-size:16px;line-height:1.62;color:rgba(17,24,39,0.7);margin:0;max-width:64ch;text-wrap:pretty;}
.post-card .foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:18px;}
.post-card .foot .arrow{margin-right:10px;}
.post-card .tags{display:flex;flex-wrap:wrap;gap:7px;}
.post-card .tags .chip{padding:4px 9px;border-radius:6px;font-size:11px;background:var(--paper);}
.empty{border:1px dashed var(--line-l);border-radius:14px;padding:48px 24px;text-align:center;color:rgba(17,24,39,0.55);font-size:15px;margin-top:28px;}
.empty .btn{margin-top:14px;}

/* ---------- post ---------- */
.post-hero .hero-inner{padding:140px 0 76px;max-width:820px;}
.post-hero h1.hero-main{font-size:clamp(34px,4.6vw,56px);max-width:22ch;}
.post-hero .dek{font-family:var(--serif);font-size:21px;line-height:1.5;color:rgba(247,248,245,0.72);margin:24px 0 0;max-width:46ch;text-wrap:pretty;}
.back{display:inline-flex;align-items:center;gap:8px;font-family:var(--mono);font-size:12px;letter-spacing:0.02em;color:rgba(247,248,245,0.6);margin-bottom:30px;transition:color .15s;}
.back:hover{color:var(--paper);}
.post-hero .meta{color:rgba(247,248,245,0.55);margin-top:30px;}
.post-hero .meta > * + *::before{color:rgba(247,248,245,0.3);}
.post-hero .meta .author{color:rgba(247,248,245,0.85);font-weight:500;}
.lang-note{max-width:720px;margin:36px auto 0;padding:12px 16px;border:1px solid var(--line-l);border-radius:10px;background:#fff;font-size:14px;color:rgba(17,24,39,0.62);}

.article{max-width:720px;margin:0 auto;padding:64px 0 24px;font-family:var(--serif);font-size:20px;line-height:1.68;color:rgba(17,24,39,0.86);}
.article > :first-child{margin-top:0;}
.article p{margin:0 0 24px;text-wrap:pretty;}
.article h2{font-family:var(--grotesk);font-weight:600;font-size:27px;line-height:1.2;letter-spacing:-0.02em;color:var(--ink);margin:56px 0 18px;text-wrap:balance;}
.article h3{font-family:var(--grotesk);font-weight:600;font-size:20px;line-height:1.3;letter-spacing:-0.01em;color:var(--ink);margin:40px 0 12px;}
.article a{color:var(--cyan-deep);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:rgba(0,120,143,0.35);transition:text-decoration-color .15s;}
.article a:hover{text-decoration-color:currentColor;}
.article strong{font-weight:600;color:var(--ink);}
.article ul,.article ol{margin:0 0 24px;padding-left:1.3em;}
.article li{margin:0 0 10px;padding-left:4px;}
.article li::marker{color:rgba(17,24,39,0.4);}
.article blockquote{margin:32px 0;padding:2px 0 2px 24px;border-left:2px solid var(--cyan);font-style:italic;color:rgba(17,24,39,0.72);}
.article blockquote p:last-child{margin-bottom:0;}
.article code{font-family:var(--mono);font-size:0.78em;background:var(--paper-2);border:1px solid var(--line-l);border-radius:5px;padding:1px 6px;}
.article pre{font-family:var(--mono);font-size:14px;line-height:1.6;background:var(--ink);color:rgba(247,248,245,0.86);border-radius:12px;padding:20px 22px;margin:28px 0;overflow-x:auto;}
.article pre code{background:none;border:0;padding:0;font-size:inherit;color:inherit;}
.article figure{margin:36px 0;}
.article figure img{width:100%;height:auto;border-radius:10px;border:1px solid var(--line-l);}
.article figcaption{font-family:var(--sans);font-size:14px;color:rgba(17,24,39,0.55);margin-top:10px;}
.article hr{border:0;border-top:1px solid var(--line-l);margin:48px 0;}
.article .table-wrap{margin:32px 0;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line-l);border-radius:12px;background:#fff;}
.article table{width:100%;border-collapse:collapse;font-family:var(--sans);font-size:15px;line-height:1.5;}
.article th,.article td{text-align:left;vertical-align:top;padding:13px 16px;border-bottom:1px solid var(--line-l);}
.article th{font-weight:600;font-size:13px;color:rgba(17,24,39,0.55);background:var(--paper-2);white-space:nowrap;}
.article tbody tr:last-child td{border-bottom:0;}
.article td:first-child{min-width:220px;color:rgba(17,24,39,0.72);}
.article td:not(:first-child){color:var(--ink);font-weight:500;}
.article p.sources{font-family:var(--sans);font-size:15px;line-height:1.7;color:rgba(17,24,39,0.5);border-top:1px solid var(--line-l);padding-top:22px;margin-top:44px;}
.article p.sources a{font-weight:500;}

.post-foot{max-width:720px;margin:0 auto;padding:28px 0 112px;}
.post-foot .row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:18px;border-top:1px solid var(--line-l);padding-top:26px;}
.post-foot .tags{display:flex;flex-wrap:wrap;gap:7px;}
.post-foot .actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px 22px;}

/* ---------- footer ---------- */
footer.site{background:var(--ink);color:var(--paper);}
.foot-grid{display:flex;justify-content:space-between;gap:48px;flex-wrap:wrap;padding-top:72px;padding-bottom:28px;}
.foot-brand{max-width:340px;}
.foot-brand .row{display:flex;align-items:center;gap:11px;margin-bottom:16px;}
.foot-brand .word{font-family:var(--serif);font-weight:500;font-size:21px;letter-spacing:-0.01em;}
.foot-brand p{font-size:15px;line-height:1.55;color:rgba(247,248,245,0.62);margin:0 0 14px;}
.foot-brand a.mail{font-family:var(--mono);font-size:13px;color:var(--cyan);}
.foot-brand a.mail:hover{text-decoration:underline;}
.foot-links{display:flex;gap:56px;flex-wrap:wrap;}
.foot-links .col h4{font-family:var(--mono);font-size:12px;color:rgba(247,248,245,0.6);margin:0 0 14px;font-weight:500;}
.foot-links .col a{display:block;font-size:14px;color:rgba(247,248,245,0.68);margin-bottom:10px;transition:color .15s;}
.foot-links .col a:hover{color:var(--paper);}
.foot-bottom{border-top:1px solid var(--line-d);padding-top:22px;padding-bottom:40px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;}
.foot-bottom span{font-family:var(--mono);font-size:11px;letter-spacing:0.08em;color:rgba(247,248,245,0.4);}

/* ---------- responsive ---------- */
@media (max-width:900px){
  .hero-inner{padding:128px 0 72px;}
  .post-hero .hero-inner{padding:124px 0 64px;}
  .post-card{grid-template-columns:1fr;gap:10px;padding:28px 0;}
  .post-card .when{padding-top:0;display:flex;gap:10px;}
  .post-card .when time{display:inline;}
  section.list{padding-bottom:88px;}
  .lang-note{margin-left:0;margin-right:0;}
}
@media (max-width:600px){
  /* horizontal longhands only: the `padding` shorthand would clobber the
     vertical padding of .topbar/.foot-grid */
  .wrap{padding-left:22px;padding-right:22px;}
  .topnav{gap:14px;}
  .topnav a.navlink{display:none;}
  .post-card h2{font-size:25px;}
  .post-hero .dek{font-size:18.5px;}
  .article{font-size:18.5px;padding-top:48px;}
  .article h2{font-size:23px;margin-top:44px;}
  .article .table-wrap{overflow:visible;border:0;background:transparent;border-radius:0;}
  .article table,.article tbody,.article tr,.article td{display:block;width:100%;}
  .article thead{display:none;}
  .article tr{border:1px solid var(--line-l);border-radius:12px;background:#fff;padding:6px 0;margin-bottom:12px;}
  .article td,.article tbody tr:last-child td{border-bottom:0;padding:7px 16px;min-width:0;}
  .article td::before{content:attr(data-label);display:block;font-size:12px;font-weight:500;color:rgba(17,24,39,0.45);margin-bottom:1px;}
  .article pre{font-size:13px;padding:16px;margin-left:-6px;margin-right:-6px;}
  .post-foot{padding-bottom:88px;}
  .foot-grid{gap:36px;}
}
