/* =========================================================
   NexusAI Lab â€” Design System
   Dark, precise, citation-friendly
   ========================================================= */
:root {
  --bg: #070b14;
  --bg-elevated: #0d1424;
  --bg-soft: #111a2e;
  --panel: rgba(17, 26, 46, 0.72);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e8eefc;
  --text-muted: #9aa8c7;
  --heading: #f7faff;
  --primary: #5b8cff;
  --primary-2: #22d3ee;
  --primary-ink: #061018;
  --accent: #a78bfa;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --container: 1120px;
  --narrow: 760px;
  --font: "Inter", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(34, 211, 238, 0.12), transparent 55%),
    var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
code, pre { font-family: var(--mono); }
code {
  background: rgba(91, 140, 255, 0.12);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.92em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}
.narrow { width: min(var(--narrow), calc(100% - 2rem)); margin-inline: auto; }
.muted { color: var(--text-muted); }
.lead { font-size: 1.125rem; color: var(--text-muted); }
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-2);
  margin: 0 0 0.75rem;
}
.text-gradient {
  background: linear-gradient(120deg, #fff 10%, #7dd3fc 40%, #a78bfa 75%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-link { font-weight: 600; color: var(--primary-2); }
.row-between { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.75);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--heading);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.logo-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800;
  color: #041018;
  background: linear-gradient(135deg, var(--primary-2), var(--primary) 55%, var(--accent));
  box-shadow: 0 8px 24px rgba(91, 140, 255, 0.35);
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(91, 140, 255, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--text-muted); font-size: 0.72rem; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.35rem 0.2rem;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--heading); }
.nav-cta { margin-left: 0.35rem; }
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text); border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c5cff);
  color: #fff;
  box-shadow: 0 10px 30px rgba(91, 140, 255, 0.28);
}
.btn-secondary {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-strong);
  color: var(--heading);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.875rem; }
.btn-lg { padding: 0.9rem 1.45rem; font-size: 1rem; }

/* Sections */
.section { padding: 4.5rem 0; }
.section-alt {
  background: linear-gradient(180deg, rgba(17,26,46,0.55), rgba(17,26,46,0.15));
  border-block: 1px solid var(--border);
}
.section-head { margin-bottom: 2rem; max-width: 720px; }
.section-head.row-between { max-width: none; }
.page-hero { padding: 4rem 0 1rem; }
.stack-lg { display: grid; gap: 1.5rem; }

/* Hero */
.hero {
  position: relative;
  padding: 4.5rem 0 3rem;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: -20% 20% auto;
  height: 420px;
  background: radial-gradient(closest-side, rgba(91,140,255,0.25), transparent);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}
.hero-stats div {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.hero-stats dt { font-size: 1.35rem; font-weight: 800; color: var(--heading); }
.hero-stats dd { margin: 0; color: var(--text-muted); font-size: 0.85rem; }

.entity-card, .panel, .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.entity-card { padding: 1.4rem 1.5rem; }
.entity-card h2 { font-size: 1rem; color: var(--primary-2); margin-bottom: 1rem; }
.entity-card p { margin-bottom: 0.55rem; font-size: 0.95rem; }

/* Cards */
.card-grid {
  display: grid;
  gap: 1rem;
}
.card-grid.services-grid,
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 1.35rem 1.4rem; transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: rgba(91,140,255,0.45); transform: translateY(-2px); }
.card h3 a, .post-card h2 a, .post-card h3 a { color: var(--heading); text-decoration: none; }
.card h3 a:hover, .post-card h2 a:hover { color: var(--primary-2); }
.card-icon {
  width: 42px; height: 42px; border-radius: 12px;
  margin-bottom: 0.9rem;
  background:
    linear-gradient(135deg, rgba(34,211,238,0.2), rgba(91,140,255,0.25));
  border: 1px solid var(--border);
}
.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-2);
  background: rgba(34,211,238,0.1);
  border: 1px solid rgba(34,211,238,0.25);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  margin-bottom: 0.75rem;
}
.meta { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.5rem; }

/* Split / compare */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.split.tight { gap: 1.25rem; margin-top: 1.25rem; }
.panel { padding: 1.5rem; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
.compare-table thead th { color: var(--primary-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.compare-table tbody th { color: var(--heading); width: 22%; }

.check-list { list-style: none; padding: 0; }
.check-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45rem;
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 0 0 3px rgba(34,211,238,0.12);
}
.mini-list { color: var(--text-muted); }

/* FAQ */
.faq-list { display: grid; gap: 0.75rem; max-width: 820px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  padding: 0.2rem 1rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--heading);
  padding: 0.9rem 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-a { color: var(--text-muted); padding-bottom: 0.9rem; }

/* CTA */
.cta-band {
  padding: 3rem 0 4.5rem;
}
.cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.75rem 1.75rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(91,140,255,0.35);
  background:
    linear-gradient(120deg, rgba(91,140,255,0.18), rgba(167,139,250,0.12) 50%, rgba(34,211,238,0.1));
}
.cta-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Service detail / demos */
.service-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.code-panel {
  background: #050914;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
.code-panel pre {
  margin: 0;
  padding: 1.25rem 1.35rem;
  color: #c7d2fe;
  font-size: 0.85rem;
  line-height: 1.55;
}
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1rem 1rem 3.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  background: rgba(255,255,255,0.02);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.9rem; top: 1rem;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #041018;
}

/* Prose */
.prose h2 { margin-top: 2.25rem; }
.prose h3 { margin-top: 1.5rem; }
.prose a { text-decoration: underline; }
.callout {
  border-left: 3px solid var(--primary-2);
  background: rgba(34,211,238,0.08);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
}
.post-header { margin-bottom: 1.5rem; }
.post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-faq { margin-top: 2.5rem; }

/* Forms */
.form, .form label, .login-card label, .admin-panel label {
  display: grid;
  gap: 0.35rem;
}
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; align-items: end; }
label span { font-size: 0.875rem; color: var(--text-muted); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: rgba(5, 9, 20, 0.65);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(91,140,255,0.45);
  border-color: var(--primary);
}
.field-error { color: var(--danger); font-style: normal; font-size: 0.85rem; }
.form-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.75rem; }
.hp { position: absolute; left: -10000px; opacity: 0; height: 0; overflow: hidden; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.25rem;
  align-items: start;
}
.contact-aside { display: grid; gap: 1rem; }
.blog-filters, .admin-filters {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.blog-filters input, .blog-filters select { max-width: 280px; }
.pagination { display: flex; gap: 0.4rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination a {
  min-width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
}
.pagination a.is-active, .pagination a:hover {
  color: #fff; border-color: var(--primary); background: rgba(91,140,255,0.2);
}

/* Alerts */
.alert {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.alert-success { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.35); color: #bbf7d0; }
.alert-error { background: rgba(251,113,133,0.12); border-color: rgba(251,113,133,0.35); color: #fecdd3; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  background: rgba(0,0,0,0.25);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.footer-brand p { color: var(--text-muted); font-size: 0.95rem; }
.site-footer h3 { font-size: 0.9rem; color: var(--heading); margin-bottom: 0.75rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--text-muted); text-decoration: none; display: inline-block; padding: 0.2rem 0; }
.footer-links a:hover { color: var(--heading); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .split, .card-grid.services-grid, .card-grid.three,
  .card-grid.two, .contact-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: rgba(7,11,20,0.97);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav.is-open { display: flex; }
  .site-nav .btn { width: 100%; }
  .form-row.two, .form-row.three { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
}

/* === v1 production additions === */
.service-toc { margin-bottom: 0.5rem; }
.toc-links { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; margin-top: 0.75rem; }
.toc-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid transparent;
}
.toc-links a:hover { color: var(--heading); border-bottom-color: var(--primary-2); }
.post-cover {
  margin: 1.25rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-cover img { width: 100%; height: auto; display: block; }
.related-posts { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.6rem 0.75rem; text-align: left; }
.prose th { background: rgba(255,255,255,0.03); color: var(--heading); }
.prose img { border-radius: 12px; margin: 1rem 0; }
.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(167,139,250,0.08);
  color: var(--text-muted);
}
.icon-svg {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  margin-bottom: 0.9rem;
  background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(91,140,255,0.25));
  border: 1px solid var(--border);
  color: var(--primary-2);
}
.icon-svg svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.form.is-submitting { opacity: 0.7; pointer-events: none; }
.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(13,20,36,0.9);
  color: var(--heading);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 40;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.footer-meta a { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}

/* === GEO/REO media figures === */
.hero-with-media { position: relative; isolation: isolate; }
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  filter: saturate(1.05) contrast(1.05);
}
.hero-with-media .hero-glow,
.hero-with-media .hero-grid { position: relative; z-index: 1; }
.hero-with-media .hero-copy,
.hero-with-media .entity-card {
  text-shadow: 0 1px 18px rgba(7, 11, 20, 0.55);
}
.section-media-band { padding-top: 0.5rem; padding-bottom: 1rem; }
.media-figure {
  margin: 0 0 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.media-figure img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: attr(width) / attr(height);
}
.media-figure figcaption {
  padding: 0.65rem 0.9rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(13, 20, 36, 0.65);
}
.media-figure--wide { margin-bottom: 0; }
.media-figure--hero-shot img { max-height: 420px; object-fit: cover; width: 100%; }
.media-figure--card {
  margin: -0.15rem -0.15rem 1rem;
  border-radius: calc(var(--radius) - 4px);
  border: 0;
}
.media-figure--card figcaption { display: none; }
.media-figure--service {
  max-width: 280px;
  margin: 0 0 1rem;
}
.media-figure--demo { margin: 0.75rem 0 1.25rem; }
.media-figure--diagram { margin: 1rem 0 1.5rem; }
.card-media {
  margin: -0.15rem -0.15rem 1rem;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #050914;
  aspect-ratio: 1 / 1;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.service-card .card-media { max-height: 180px; aspect-ratio: 16 / 10; }
.service-detail-media { margin-bottom: 0.5rem; }
.demo-card .media-figure--card img,
.demo-card .card-media img { max-height: 220px; object-fit: cover; }
@media (max-width: 960px) {
  .media-figure--hero-shot img { max-height: 240px; }
  .media-figure--service { max-width: 100%; }
}

/* === REO blog + page banners === */
.post-card .card-media {
  aspect-ratio: 16 / 9;
  max-height: none;
  margin: -1rem -1rem 1rem;
  display: block;
}
.post-card .card-media img { transition: transform .35s ease; }
.post-card:hover .card-media img { transform: scale(1.03); }
.post-cover {
  margin: 1.25rem 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-cover img { width: 100%; height: auto; display: block; }
.post-cover figcaption {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.media-figure--page-banner { margin: 0 0 1rem; }
.media-figure--page-banner img {
  max-height: 280px;
  width: 100%;
  object-fit: cover;
}
.media-figure--page-banner figcaption { display: none; }
.service-detail { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .service-detail {
    grid-template-columns: 220px 1fr;
    gap: 1.5rem 2rem;
    align-items: start;
  }
  .service-detail-media { grid-row: 1 / span 2; }
  .service-detail-head { grid-column: 2; }
}

/* === Design system polish (v1.1) === */

/* Focus visibility (a11y) */
:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.85);
  outline-offset: 3px;
}
.btn:focus-visible,
.site-nav a:focus-visible,
.brand:focus-visible {
  outline-offset: 4px;
}

/* Selection */
::selection {
  background: rgba(91, 140, 255, 0.35);
  color: #fff;
}

/* Section utilities */
.section-flush-top { padding-top: 0; }
.footer-links--spaced { margin-top: 1rem; }

/* Picture inside media chrome */
.card-media picture,
.media-figure picture,
.hero-bg picture,
.post-cover picture {
  display: contents;
}
.hero-bg picture { display: block; width: 100%; height: 100%; }
.hero-bg picture img,
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* FAQ chevron + open state */
.faq-item summary {
  position: relative;
  padding-right: 2rem;
}
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 0.15rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--primary-2);
  border-bottom: 2px solid var(--primary-2);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
  opacity: 0.85;
}
.faq-item[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}
.faq-item[open] {
  border-color: rgba(91, 140, 255, 0.35);
  background: rgba(91, 140, 255, 0.04);
}

/* Entity card polish */
.entity-card {
  position: relative;
  overflow: hidden;
}
.entity-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary), var(--accent));
  border-radius: 3px 0 0 3px;
}

/* Compare table scroll on narrow */
.compare-panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { min-width: 420px; }

/* Sticky header height safe area */
.site-header { padding-top: env(safe-area-inset-top, 0); }

/* Tablet: 2-col service grid */
@media (min-width: 640px) and (max-width: 960px) {
  .card-grid.services-grid,
  .card-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Large desktop breathing room */
@media (min-width: 1280px) {
  :root { --container: 1180px; }
}

/* Reduced motion already handled; ensure picture transforms respect it */
@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after { transition: none; }
  .post-card:hover .card-media img { transform: none; }
}

/* Print: clean citation-friendly pages */
@media print {
  .site-header, .site-footer, .back-to-top, .nav-toggle, .cta-band, .hero-bg, .hero-glow {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
  }
  h1, h2, h3, .heading { color: #000; }
  a { color: #000; text-decoration: underline; }
  .card, .panel, .entity-card {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    break-inside: avoid;
  }
}

/* Smooth card media placeholder to avoid CLS flash */
.card-media,
.media-figure {
  background:
    radial-gradient(600px 200px at 30% 20%, rgba(91,140,255,0.12), transparent 60%),
    #050914;
}

/* Nav CTA never wraps awkwardly */
.nav-cta { white-space: nowrap; }

/* Lead text max measure for readability */
.lead { max-width: 62ch; }
.section-head .lead { max-width: 68ch; }

/* Buttons: active press */
.btn:active { transform: translateY(0); }

/* Admin-parity: status success tint reusable */
.badge-success {
  background: rgba(52,211,153,0.15);
  color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}
/* =========================================================
   Layout fix: services / demos / capability pages (v1.2)
   Prevent single-character column collapse; CEO-friendly blocks
   ========================================================= */

.split,
.service-card-block__top,
.service-card-block__meta,
.demo-points,
.demo-two,
.journey,
.journey__track {
  min-width: 0;
}

.split > *,
.split-col,
.service-card-block__intro,
.service-card-block__visual,
.meta-box,
.journey__step,
.journey__text {
  min-width: 0;
  max-width: 100%;
}

/* --- Service detail cards --- */
.service-card-block {
  display: block;
  padding: 1.75rem;
  overflow: hidden;
}
.service-card-block__top {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.service-card-block__visual {
  width: 100%;
}
.service-card-block__visual .media-figure,
.service-card-block__visual .media-figure--service {
  max-width: 100%;
  margin: 0;
}
.service-card-block__tagline {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
}
.service-card-block__summary {
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 1rem;
}
.service-card-block__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 1rem;
}
.meta-inline {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.service-card-block__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.meta-box h3 {
  margin-top: 0;
  margin-bottom: 0.65rem;
  font-size: 1rem;
}
.meta-box__sub {
  margin-top: 1.25rem !important;
}
.meta-box p {
  margin: 0;
  color: var(--text-muted);
}

/* Chip list (service highlights) */
.chip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-list li {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--heading);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* --- Demo blocks (full-width, no narrow sidebar) --- */
.demo-block {
  padding: 1.75rem;
  overflow: hidden;
}
.demo-block__head {
  margin-bottom: 1.25rem;
  max-width: 72ch;
}
.demo-block__head h2 {
  margin: 0.5rem 0 0.65rem;
}
.demo-block > .media-figure--demo,
.demo-block .media-figure--demo {
  margin: 0 0 1.25rem;
  max-width: 100%;
}
.demo-block .media-figure--demo img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
}
.demo-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.demo-point {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  min-width: 0;
}
.demo-point h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}
.demo-point p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: normal;
}
.demo-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  margin-bottom: 1.5rem;
}
.demo-two__col {
  min-width: 0;
}
.demo-two__col h3 {
  margin-top: 0;
}
.demo-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Journey steps â€” always horizontal text, full width cards */
.journey {
  margin: 0.5rem 0 0.25rem;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(5, 9, 20, 0.45);
  clear: both;
  width: 100%;
  box-sizing: border-box;
}
.journey__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}
.journey__track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}
.journey__step {
  flex: 1 1 160px;
  min-width: 148px;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  box-sizing: border-box;
}
.journey__num {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  color: #041018;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}
.journey__text {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.journey__text strong {
  display: block;
  color: var(--heading);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.journey__text span {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.journey__note {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* legacy flow-* (if any cached markup) */
.flow-panel, .demo-block__aside, .demo-block__body { display: block; width: 100%; }
.flow-steps { list-style: none; margin: 0; padding: 0; }
.flow-steps > li {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 0.75rem !important;
  padding: 0.75rem 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.flow-num {
  flex: 0 0 2rem;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
  color: #041018;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}
.flow-body {
  flex: 1 1 auto !important;
  min-width: 12rem !important;
  width: auto !important;
  max-width: 100% !important;
  display: block !important;
}
.flow-body strong, .flow-body span {
  display: block !important;
  white-space: normal !important;
  writing-mode: horizontal-tb !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}
/* Capability / AI visibility page */
.capability-hero {
  overflow: hidden;
  padding: 0;
}
.capability-hero .media-figure {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}
.capability-hero .media-figure img {
  max-height: 360px;
  object-fit: cover;
  width: 100%;
}
.capability-hero__copy {
  padding: 1.5rem 1.75rem 1.75rem;
  max-width: 72ch;
}
.capability-hero__copy h2 {
  margin-top: 0;
}
.capability-grid .capability-card {
  position: relative;
  padding-top: 1.35rem;
}
.cap-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary-2);
  margin-bottom: 0.5rem;
}
.engage-band {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem;
}
.engage-band__copy {
  flex: 1 1 280px;
  max-width: 62ch;
}
.engage-band__copy h2 {
  margin: 0.35rem 0 0.65rem;
}
.engage-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cta-panel__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  justify-content: center;
}

/* Lists: never collapse to vertical glyphs */
.check-list li,
.mini-list li,
.steps li,
.flow-body,
.service-card-block__summary,
.demo-block p,
.meta-box p {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

/* Kill legacy broken service-detail grid if cached markup remains */
.service-detail {
  display: block !important;
  grid-template-columns: none !important;
}
.service-detail-media {
  max-width: 220px;
  margin-bottom: 1rem;
}
.service-detail .split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .service-card-block__top,
  .service-card-block__meta,
  .demo-points,
  .demo-two,
  .service-detail .split {
    grid-template-columns: 1fr;
  }
  .service-card-block__visual {
    max-width: 240px;
  }
  .journey__step {
    flex: 1 1 100%;
  }
  .demo-block .media-figure--demo img {
    max-height: 240px;
  }
  .cta-panel__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .service-card-block,
  .demo-block {
    padding: 1.15rem;
  }
  .chip-list li {
    white-space: normal;
  }
}

/* =========================================================
   v1.3 hard lock ¡ª journey / flow text always horizontal
   ========================================================= */
.journey,
.journey__track,
.journey__step,
.journey__text,
.flow-panel,
.flow-steps,
.flow-steps > li,
.flow-body {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}
.journey__step,
.flow-steps > li {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.journey__track {
  display: flex !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}
.journey__text,
.flow-body {
  flex: 1 1 auto !important;
  min-width: 10rem !important;
  max-width: 100% !important;
  width: auto !important;
}
.journey__text strong,
.journey__text span,
.flow-body strong,
.flow-body span,
.journey__note {
  display: block !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  writing-mode: horizontal-tb !important;
}
.demo-block__body {
  display: block !important;
  grid-template-columns: none !important;
  width: 100% !important;
}
