/* binhAI — design tokens (light default, dark via prefers-color-scheme or [data-theme]) */
:root{
  --bg:#FAFAFA; --surface:#FFFFFF; --surface-2:#F4F4F5; --text:#0A0A0B; --text-2:#3F3F46; --muted:#52525B;
  --border:#E4E4E7; --border-strong:#D4D4D8;
  --accent:#4338CA; --accent-hover:#3730A3; --on-accent:#FFFFFF; --accent-soft:#EEF2FF; --accent-text:#4338CA;
  --ok:#15803D; --code-bg:#F4F4F5;
  --shadow:0 1px 2px rgba(10,10,11,.04),0 4px 16px rgba(10,10,11,.04);
  --shadow-hover:0 2px 4px rgba(10,10,11,.06),0 12px 32px rgba(10,10,11,.08);
  --radius:14px; --radius-sm:10px;
  --font:"Be Vietnam Pro",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --ease:cubic-bezier(.2,.8,.2,1);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0B0B0F; --surface:#131318; --surface-2:#1A1A20; --text:#F4F4F5; --text-2:#D4D4D8; --muted:#A1A1AA;
    --border:#27272A; --border-strong:#3F3F46;
    --accent:#818CF8; --accent-hover:#A5B4FC; --on-accent:#0B0B0F; --accent-soft:rgba(129,140,248,.12); --accent-text:#A5B4FC;
    --ok:#4ADE80; --code-bg:#1A1A20;
    --shadow:0 1px 2px rgba(0,0,0,.4); --shadow-hover:0 8px 28px rgba(0,0,0,.45);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0B0B0F; --surface:#131318; --surface-2:#1A1A20; --text:#F4F4F5; --text-2:#D4D4D8; --muted:#A1A1AA;
  --border:#27272A; --border-strong:#3F3F46;
  --accent:#818CF8; --accent-hover:#A5B4FC; --on-accent:#0B0B0F; --accent-soft:rgba(129,140,248,.12); --accent-text:#A5B4FC;
  --ok:#4ADE80; --code-bg:#1A1A20;
  --shadow:0 1px 2px rgba(0,0,0,.4); --shadow-hover:0 8px 28px rgba(0,0,0,.45);
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:80px}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:16px;line-height:1.65;
  -webkit-font-smoothing:antialiased;min-height:100dvh;display:flex;flex-direction:column}
main{flex:1}
img,iframe{max-width:100%}
a{color:var(--accent-text);text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:var(--accent-hover)}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px}
h1,h2,h3{line-height:1.2;letter-spacing:-.02em;margin:0;color:var(--text)}
p{margin:0}
.container{width:100%;max-width:1120px;margin:0 auto;padding:0 20px}
@media(min-width:768px){.container{padding:0 32px}}
.muted{color:var(--muted)} .small{font-size:14px}
.i{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.skip{position:absolute;left:-9999px;top:8px;z-index:100;background:var(--accent);color:var(--on-accent);padding:10px 14px;border-radius:8px}
.skip:focus{left:12px}

/* Header */
.site-header{position:sticky;top:0;z-index:40;background:color-mix(in srgb,var(--bg) 85%,transparent);
  backdrop-filter:saturate(180%) blur(12px);-webkit-backdrop-filter:saturate(180%) blur(12px);border-bottom:1px solid var(--border)}
.nav{display:flex;align-items:center;gap:16px;height:64px}
.logo{display:inline-flex;align-items:center;gap:10px;font-weight:700;font-size:19px;letter-spacing:-.02em;color:var(--text);text-decoration:none}
.logo b{color:var(--accent-text);font-weight:700}
.logo-mark{width:30px;height:30px;border-radius:9px;background:var(--text);color:var(--bg);display:grid;place-items:center;font-size:17px;font-weight:700}
.nav-links{display:none;gap:4px;margin-left:24px}
.nav-links a{color:var(--text-2);text-decoration:none;font-size:15px;font-weight:500;padding:8px 12px;border-radius:8px;transition:background .2s var(--ease),color .2s var(--ease)}
.nav-links a:hover{background:var(--surface-2);color:var(--text)}
@media(min-width:768px){.nav-links{display:flex}}
.nav-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.lang{display:flex;align-items:center;gap:2px;padding:4px 4px 4px 10px;border:1px solid var(--border);border-radius:999px;color:var(--muted);background:var(--surface)}
.lang .i{width:16px;height:16px;margin-right:4px}
.lang a{min-width:40px;min-height:32px;display:grid;place-items:center;font-size:13px;font-weight:600;color:var(--muted);text-decoration:none;border-radius:999px;transition:background .2s var(--ease),color .2s var(--ease)}
.lang a:hover{color:var(--text)}
.lang a[aria-current="true"]{background:var(--text);color:var(--bg)}
.icon-btn{width:44px;height:44px;display:grid;place-items:center;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);cursor:pointer;transition:background .2s var(--ease),border-color .2s var(--ease)}
.icon-btn:hover{background:var(--surface-2);border-color:var(--border-strong)}
.theme-toggle .i-moon{display:none}
:root[data-theme="dark"] .theme-toggle .i-sun{display:none}
:root[data-theme="dark"] .theme-toggle .i-moon{display:block}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .theme-toggle .i-sun{display:none}
  :root:not([data-theme="light"]) .theme-toggle .i-moon{display:block}
}

/* Buttons & chips */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 20px;border-radius:999px;font:600 15px/1 var(--font);
  text-decoration:none;cursor:pointer;border:1px solid transparent;transition:background .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease),transform .15s var(--ease)}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--accent);color:var(--on-accent)}
.btn-primary:hover{background:var(--accent-hover);color:var(--on-accent)}
.btn-ghost{background:var(--surface);color:var(--text);border-color:var(--border)}
.btn-ghost:hover{background:var(--surface-2);color:var(--text);border-color:var(--border-strong)}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--accent-text);background:var(--accent-soft);padding:4px 10px;border-radius:999px}
.chip .i{width:14px;height:14px}

/* Hero */
.hero{padding:56px 0 40px;border-bottom:1px solid var(--border)}
@media(min-width:1024px){.hero{padding:88px 0 72px}}
.hero-grid{display:grid;gap:48px;align-items:center}
@media(min-width:1024px){.hero-grid{grid-template-columns:1.15fr .85fr}}
.eyebrow{display:inline-flex;align-items:center;gap:8px;font:500 13px/1 var(--mono);color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:20px}
.dot{width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 4px color-mix(in srgb,var(--ok) 20%,transparent)}
.hero h1{font-size:clamp(38px,6vw,64px);font-weight:700;letter-spacing:-.035em;max-width:13ch}
.accent{color:var(--accent-text)}
.lead{font-size:18px;color:var(--text-2);max-width:58ch;margin-top:20px}
.hero-cta{display:flex;flex-wrap:wrap;gap:12px;margin-top:32px}
.hero-art{display:none}
@media(min-width:1024px){.hero-art{display:block}}
.term{background:#0B0B0F;border:1px solid #27272A;border-radius:var(--radius);box-shadow:var(--shadow-hover);overflow:hidden}
.term-bar{display:flex;gap:6px;padding:12px 14px;border-bottom:1px solid #27272A}
.term-bar span{width:10px;height:10px;border-radius:50%;background:#3F3F46}
.term pre{margin:0;padding:22px 20px;font:500 14px/1.9 var(--mono);color:#E4E4E7;white-space:pre-wrap}
.c-mute{color:#71717A}.c-acc{color:#A5B4FC}.c-ok{color:#4ADE80}

/* Sections */
.section{padding:64px 0}
@media(min-width:1024px){.section{padding:88px 0}}
.section-alt{background:var(--surface);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.section-head{display:flex;align-items:end;justify-content:space-between;margin-bottom:28px}
.section-head h2{font-size:clamp(24px,3vw,32px);font-weight:700}

/* Cards */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.post-grid{display:grid;gap:20px}
@media(min-width:768px){.post-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.post-grid{grid-template-columns:repeat(3,1fr)}}
.post-card{position:relative;padding:24px;display:flex;flex-direction:column;gap:12px;transition:border-color .2s var(--ease),box-shadow .2s var(--ease),transform .2s var(--ease)}
.post-card:hover{border-color:var(--border-strong);box-shadow:var(--shadow-hover);transform:translateY(-2px)}
.post-card h3{font-size:20px;font-weight:600}
.post-card h3 a{color:var(--text);text-decoration:none}
.post-card p{color:var(--text-2);font-size:15px}
.stretched::after{content:"";position:absolute;inset:0;border-radius:var(--radius)}
.post-card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.read-more{margin-top:auto;display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--accent-text)}
@media(min-width:768px){
  .post-card.featured{grid-column:1/-1;padding:36px}
  .post-card.featured h3{font-size:clamp(24px,3vw,34px);font-weight:700;letter-spacing:-.025em;max-width:24ch}
  .post-card.featured p{font-size:17px;max-width:62ch}
}
.topic-grid{list-style:none;margin:0;padding:0;display:grid;gap:16px}
@media(min-width:640px){.topic-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.topic-grid{grid-template-columns:repeat(4,1fr)}}
.topic{padding:22px;display:flex;flex-direction:column;gap:14px;box-shadow:none}
.topic h3{font-size:17px;font-weight:600}
.topic p{color:var(--muted);font-size:14px;margin-top:4px}
.topic-icon{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-text)}
.topic-count{margin-top:auto;font:500 12px/1 var(--mono);color:var(--muted);text-transform:uppercase;letter-spacing:.05em}

/* About */
.about{max-width:760px}
.about h2{font-size:clamp(24px,3vw,32px)}
.checks{list-style:none;padding:0;margin:28px 0 0;display:grid;gap:12px}
.checks li{display:flex;align-items:center;gap:12px;color:var(--text-2)}
.checks .i{color:var(--ok);width:20px;height:20px}

/* Article */
.article{max-width:760px;padding-top:32px;padding-bottom:72px}
@media(min-width:768px){.article{padding-top:48px}}
.breadcrumb{display:flex;gap:8px;font-size:14px;color:var(--muted);margin-bottom:28px}
.breadcrumb a{color:var(--muted);text-decoration:none}
.breadcrumb a:hover{color:var(--text)}
.article-head h1{font-size:clamp(30px,5vw,46px);font-weight:700;letter-spacing:-.03em;margin:16px 0 16px}
.article-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;font-size:14px;color:var(--muted)}
.lang-link{display:inline-flex;align-items:center;gap:6px;font-weight:500}
.lang-link .i{width:15px;height:15px}
.tldr{margin:32px 0;padding:20px 22px;border-radius:var(--radius);background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 25%,transparent)}
.tldr-label{font:600 12px/1 var(--mono);text-transform:uppercase;letter-spacing:.08em;color:var(--accent-text);margin-bottom:10px}
.tldr p:last-child{font-size:17px;color:var(--text)}
.video{margin:0 0 40px;display:flex;justify-content:center}
.video iframe{width:100%;max-width:640px;aspect-ratio:640/390;height:auto;border-radius:var(--radius);background:var(--surface-2);border:1px solid var(--border)!important}
.prose{font-size:17px;line-height:1.75;color:var(--text-2)}
.prose h2{font-size:24px;font-weight:700;margin:44px 0 16px}
.prose ul{padding-left:22px;margin:16px 0}
.prose li{margin:10px 0}
.prose li::marker{color:var(--accent-text)}
.prose strong{color:var(--text);font-weight:600}
.prose code{font:500 .86em var(--mono);background:var(--code-bg);border:1px solid var(--border);padding:2px 6px;border-radius:6px;color:var(--text)}
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);margin:20px 0}
table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.6}
th,td{text-align:left;vertical-align:top;padding:14px 16px;border-bottom:1px solid var(--border)}
tr:last-child td{border-bottom:none}
th{font-size:13px;font-weight:600;color:var(--muted);background:var(--surface-2);text-transform:uppercase;letter-spacing:.04em}
td:first-child{min-width:150px}
.callout{margin:28px 0;padding:18px 20px;border-left:3px solid var(--accent);background:var(--surface);border-radius:0 var(--radius-sm) var(--radius-sm) 0;border-top:1px solid var(--border);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}
.callout-title{font-weight:600;color:var(--text);margin-bottom:6px}
.article-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;margin-top:56px;padding-top:28px;border-top:1px solid var(--border)}

/* 404 */
.notfound{padding:96px 20px;max-width:760px}
.notfound h1{font-size:clamp(32px,5vw,48px)}

/* Footer */
.site-footer{border-top:1px solid var(--border);padding:40px 0;background:var(--surface)}
.footer-grid{display:grid;gap:20px}
@media(min-width:768px){.footer-grid{grid-template-columns:1fr auto;align-items:end}.footer-meta{text-align:right}}
.site-footer p{margin-top:8px}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}

/* fixes: about alignment + stacked table on small screens */
.about{max-width:1120px}
.about>*{max-width:760px}
@media(max-width:600px){
  .table-wrap table,.table-wrap tbody,.table-wrap tr,.table-wrap td{display:block;width:100%}
  .table-wrap thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .table-wrap tr{padding:14px 16px;border-bottom:1px solid var(--border)}
  .table-wrap tr:last-child{border-bottom:none}
  .table-wrap td{padding:0;border:none;min-width:0}
  .table-wrap td:first-child{margin-bottom:4px;color:var(--text)}
}

/* batch 2: 5 topics, code blocks, ordered lists, link rows */
@media(min-width:1024px){.topic-grid{grid-template-columns:repeat(5,1fr)}}
.prose ol{padding-left:22px;margin:16px 0}
.prose ol li::marker{color:var(--accent-text);font-weight:600}
.prose pre{margin:20px 0;padding:18px 20px;background:#0B0B0F;color:#E4E4E7;border:1px solid var(--border);border-radius:var(--radius);overflow-x:auto;font:500 14px/1.7 var(--mono)}
.prose pre code{background:none;border:none;padding:0;color:inherit;font-size:inherit}
.prose em{color:var(--text)}
.links{margin-top:28px;font-size:15px}
@media(max-width:600px){
  .table-wrap td[data-label]:not(:first-child)::before{content:attr(data-label);display:block;font:600 11px/1.4 var(--mono);text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-top:8px}
  .table-wrap td[data-label=""]::before{display:none}
}
.video.vertical iframe{max-width:360px;aspect-ratio:9/16}
.video-link{margin:0 0 40px;padding:28px 20px;border:1px dashed var(--border-strong);border-radius:var(--radius);display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;background:var(--surface)}
