/* ============================================================
   Robotic Forums — styles.css
   Clean / light / modern. Brand: indigo #4f46e5 → cyan #06b6d4
   ============================================================ */

/* Self-hosted Plus Jakarta Sans (variable, latin). Replaces the Google Fonts request. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fd;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e6eaf3;
  --line-strong: #d8def0;

  --brand: #4f46e5;
  --brand-700: #4338ca;
  --brand-500: #6366f1;
  --cyan: #06b6d4;
  --grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #06b6d4 100%);

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 10px 30px -12px rgba(30, 27, 75, .18);
  --shadow-lg: 0 24px 60px -20px rgba(30, 27, 75, .28);

  --container: 1140px;
  --header-h: 68px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Prevent long unbreakable tokens (URLs, r/longname) from blowing out grid/flex layouts */
.card, .topic-card, .term, .hero-copy { min-width: 0; }
.card-name, .card p, .topic-card h3, .topic-card p, .term dt, .term dd,
.article-body, .article-lead, .guide-card h3 { overflow-wrap: break-word; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 14px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--brand-500); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--brand-700); }
.btn-light:hover { color: var(--brand-700); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; }
.brand-name { font-size: 1.2rem; letter-spacing: -0.03em; }
.brand-accent { color: var(--brand); }

.site-nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-menu a {
  display: inline-block; padding: 9px 14px; border-radius: 10px;
  color: var(--ink-soft); font-weight: 600; font-size: .98rem;
}
.nav-menu a:hover { color: var(--ink); background: var(--bg-alt); }
.nav-menu .nav-cta { color: #fff; background: var(--brand); }
.nav-menu .nav-cta:hover { color: #fff; background: var(--brand-700); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  align-items: center; justify-content: center; background: none; border: 1px solid var(--line-strong);
  border-radius: 10px; cursor: pointer;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 9vw, 104px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(6, 182, 212, .12), transparent 60%);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); background: #eef2ff; padding: 7px 14px; border-radius: 999px; margin: 0 0 18px;
}
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); font-weight: 800; margin-bottom: .35em; }
.hero-sub { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 36ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; list-style: none; margin: 0; padding: 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.hero-stats span { font-size: .9rem; color: var(--muted); }

/* hero art */
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.hero-svg { width: 100%; max-width: 440px; position: relative; z-index: 2; }
.blob { position: absolute; border-radius: 50%; filter: blur(34px); z-index: 1; opacity: .55; }
.blob-1 { width: 280px; height: 280px; background: #c7d2fe; top: 0; right: 6%; }
.blob-2 { width: 220px; height: 220px; background: #a5f3fc; bottom: 4%; left: 4%; }
.float-a { animation: floaty 6s ease-in-out infinite; transform-origin: center; }
.float-b { animation: floaty 7.5s ease-in-out infinite reverse; transform-origin: center; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(36px, 5vw, 56px); }
.section-head h2, .intro h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }
.intro h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.intro p { color: var(--ink-soft); font-size: 1.12rem; }
.intro em { color: var(--ink); font-style: italic; }

/* ---------- communities ---------- */
.cat-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin: 40px 0 18px; }
.cat-title:first-of-type { margin-top: 0; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); flex: none; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-name { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); background: #eef2ff; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.card p { color: var(--ink-soft); font-size: .96rem; margin: 0; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.card-stat { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.card-stat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; flex: none; }
.card-link { font-weight: 700; font-size: .92rem; color: var(--brand); white-space: nowrap; }
.card:hover .card-link { color: var(--brand-700); }
.dir-note { text-align: center; color: var(--muted); margin-top: 36px; font-size: .98rem; }

/* ---------- guides ---------- */
.guides { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.guide summary, .faq-item summary {
  display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none;
  padding: 20px 24px; font-weight: 700; font-size: 1.12rem; color: var(--ink);
}
.guide summary::-webkit-details-marker, .faq-item summary::-webkit-details-marker { display: none; }
.guide summary::after, .faq-item summary::after {
  content: "+"; margin-left: auto; font-size: 1.5rem; font-weight: 400; color: var(--brand); transition: transform .2s ease;
}
.guide[open] summary::after, .faq-item[open] summary::after { content: "\2013"; }
.guide-num { font-size: .95rem; font-weight: 800; color: #fff; background: var(--grad); width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.guide-body, .faq-body { padding: 0 24px 22px; color: var(--ink-soft); }
.guide-body p:last-child, .faq-body p:last-child { margin-bottom: 0; }
.guide-body strong { color: var(--ink); }

/* ---------- glossary ---------- */
.glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 0; }
.term { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.term dt { font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.term dd { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* ---------- faq ---------- */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-item summary { font-size: 1.06rem; }
.faq-body p { margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--grad); color: #fff; padding: clamp(56px, 8vw, 88px) 0; text-align: center; }
.cta-inner { max-width: 640px; }
.cta-band h2 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.cta-band p { color: rgba(255, 255, 255, .9); font-size: 1.12rem; margin-bottom: 28px; }

/* ---------- footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 56px 0 28px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.footer-brand .brand, .footer-brand .brand:hover { color: #fff; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: #94a3b8; max-width: 38ch; margin-top: 14px; font-size: .98rem; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.footer-cols h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-cols a { color: #cbd5e1; font-size: .96rem; }
.footer-cols a:hover { color: #fff; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); }
.footer-bottom p { color: #64748b; font-size: .86rem; margin: 0; }

/* ---------- robotics & AI section ---------- */
.ai-section { background: linear-gradient(180deg, #f3f1ff 0%, #eef6ff 100%); border-block: 1px solid var(--line); }
.ai-lead { max-width: 760px; margin: 0 auto clamp(32px, 5vw, 48px); text-align: center; }
.ai-lead h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 800; }
.ai-lead p { color: var(--ink-soft); font-size: 1.1rem; }
.ai-lead p:last-child { margin-bottom: 0; }
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: clamp(34px, 5vw, 52px); }
.topic-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 22px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.topic-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: #fff; }
.topic-ic svg { width: 24px; height: 24px; }
.topic-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.01em; }
.topic-card p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.ai-comm-title { text-align: center; font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin: 0 0 22px; }

/* ---------- homepage guide teasers ---------- */
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.guide-card .guide-num { margin-bottom: 4px; }
.guide-card h3 { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.read-time { font-size: .8rem; color: var(--muted); }

/* ---------- guide article pages ---------- */
.page-top { background: linear-gradient(180deg, #f3f1ff, transparent); border-bottom: 1px solid var(--line); }
.breadcrumb { padding: 18px 0 0; font-size: .9rem; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumb li::after { content: "/"; margin-left: 8px; color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--ink-soft); font-weight: 600; }
.article { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 56px) 0 clamp(48px, 7vw, 80px); }
.article-head { margin-bottom: 32px; }
.article-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; }
.article-lead { font-size: 1.2rem; color: var(--ink-soft); }
.article-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 800; margin: 1.6em 0 .5em; }
.article-body p { font-size: 1.06rem; color: #334155; }
.article-body strong { color: var(--ink); }
.takeaways { background: #eef2ff; border: 1px solid #dfe3ff; border-radius: var(--r); padding: 22px 26px; margin: 28px 0; }
.takeaways h2 { font-size: 1.1rem !important; margin: 0 0 12px !important; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-700); }
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin-bottom: 8px; color: #334155; }
.takeaways li:last-child { margin-bottom: 0; }
.related-guides { margin-top: 48px; }
.related-guides h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-art { order: -1; min-height: 260px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* 6-item nav doesn't fit on tablet — collapse to hamburger here */
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 12px 16px 18px; transform: translateY(-130%); transition: transform .28s ease; visibility: hidden;
  }
  .nav-menu.open { transform: translateY(0); visibility: visible; }
  .nav-menu a { padding: 12px 14px; font-size: 1.02rem; }
  .nav-menu .nav-cta { text-align: center; margin-top: 6px; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .glossary { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-stats { gap: 20px; }
}
@media (max-width: 460px) {
  .card-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

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