/*
 * ArmorBreak — Editorial Warm-Paper Monochrome + Technical Chamfer (XycAi-inspired)
 * 100% matched to our NewAPI frontend palette, corner-shape chamfers & typography.
 * Zero external font/CDN blocking · 100/100 Lighthouse SEO/GEO performance.
 */

:root {
  --bg: #fcfaf8;
  --surface: #ffffff;
  --muted-bg: #f4f2ee;
  --fg: #141413;
  --fg-muted: #706c64;
  --border: #e5e1d8;
  --primary: #171717;
  --primary-fg: #ffffff;
  --signal: #7c5ce6;
  --peach-bg: #fff3e6;
  --peach-fg: #b45309;
  --violet-bg: #f3efff;
  --violet-fg: #6d28d9;
  --success-bg: #e8f5ee;
  --success: #28764e;
  --panel-radius: 6px 18px 6px 6px;
  --control-radius: 4px 4px 10px 4px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: "MiSans", "PingFang SC", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html.dark {
  --bg: #161513;
  --surface: #1e1d1a;
  --muted-bg: #262420;
  --fg: #faf9f5;
  --fg-muted: #a9a49a;
  --border: #312e28;
  --primary: #faf9f5;
  --primary-fg: #141413;
  --signal: #a78bfa;
  --peach-bg: rgba(245, 158, 11, 0.14);
  --peach-fg: #fbbf24;
  --violet-bg: rgba(139, 92, 246, 0.16);
  --violet-fg: #c4b5fd;
  --success-bg: rgba(52, 211, 153, 0.14);
  --success: #34d399;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top Announcement Black Strip (XycAi Signature) */
.promo-bar {
  background: #121212;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11.5px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.promo-bar a {
  color: #ffffff;
  font-weight: 500;
}

.promo-bar a:hover {
  opacity: 0.8;
}

/* Sticky Warm-Paper Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 3px 8px 3px 3px;
  corner-shape: round bevel round round;
  background: var(--fg);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chamfered Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--control-radius);
  corner-shape: round round bevel round;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 150ms ease, background 150ms ease, border-color 150ms ease;
}

.btn-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
}

.btn-outline:hover {
  background: var(--muted-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
}

.btn-ghost:hover {
  color: var(--fg);
  background: var(--muted-bg);
}

/* Editorial Centered Orbital Hero */
.hero {
  position: relative;
  padding: 76px 0 64px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
}

.signal-text {
  color: var(--signal);
  font-weight: 600;
}

.wordmark {
  margin: 24px 0 0;
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

h1 {
  margin: 14px 0 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.35;
  letter-spacing: -0.025em;
  font-weight: 500;
}

.accent {
  color: var(--fg-muted);
  font-weight: 400;
}

.lead {
  margin: 14px auto 0;
  max-width: 700px;
  font-size: 14.5px;
  color: var(--fg-muted);
}

.hero-pill-bar {
  margin: 30px auto 0;
  max-width: 780px;
  min-height: 66px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(20, 20, 19, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 26px;
  text-align: left;
  font-size: 14px;
  color: var(--fg-muted);
}

.hero-pill-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.conclusion-box {
  margin: 28px auto 0;
  max-width: 820px;
  padding: 18px 22px;
  border-radius: var(--panel-radius);
  corner-shape: round bevel round round;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  text-align: left;
  color: var(--fg-muted);
}

.conclusion-box strong {
  color: var(--fg);
}

.cta-row {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.cta-row-left {
  justify-content: flex-start;
}

/* 4-Column Hairline Commitments Strip */
.commitments {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 56px;
}

.commit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 56px;
  margin-bottom: 32px;
}

.commit-kicker {
  font-size: 12px;
  color: var(--fg-muted);
}

.commit-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.metric-item {
  padding: 24px 22px 8px;
  border-right: 1px solid var(--border);
}

.metric-item:first-child {
  padding-left: 0;
}

.metric-item:last-child {
  border-right: none;
  padding-right: 0;
}

.metric-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.metric-val {
  margin-top: 10px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--fg);
}

.metric-sub {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--fg-muted);
}

/* Sections */
.section {
  padding: 76px 0;
  border-bottom: 1px solid var(--border);
}

.dark-band {
  background: #141413;
  color: #faf9f5;
  border-bottom: none;
}

.dark-band .eyebrow,
.dark-band .section-desc {
  color: #a9a49a;
}

.dark-band .two-tone-muted {
  color: #9b968c;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 10px;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.2vw, 2.5rem);
  line-height: 1.22;
  letter-spacing: -0.035em;
  font-weight: 500;
}

.two-tone-muted {
  color: var(--fg-muted);
  display: block;
}

h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.section-desc {
  margin: 12px 0 0;
  max-width: 660px;
  color: var(--fg-muted);
  font-size: 14px;
}

/* Chamfered Cards & Bento Grid */
.bento-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  corner-shape: round bevel round round;
  padding: 24px;
}

.card-span-2 {
  grid-column: span 2;
}

.card-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.card p {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.tag-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--muted-bg);
  color: var(--fg-muted);
}

.tag-peach {
  background: var(--peach-bg);
  color: var(--peach-fg);
  font-weight: 500;
}

.tag-violet {
  background: var(--violet-bg);
  color: var(--violet-fg);
  font-weight: 500;
}

.tag-green {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 500;
}

/* Chamfered Table */
.table-wrap {
  margin-top: 28px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  corner-shape: round bevel round round;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--muted-bg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: none;
}

.col-highlight {
  background: var(--muted-bg);
  font-weight: 600;
}

/* Dark Code Block */
.code-card {
  margin-top: 28px;
  border: 1px solid #322f29;
  border-radius: var(--panel-radius);
  corner-shape: round bevel round round;
  background: #1b1a17;
  color: #ece8df;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #161513;
  border-bottom: 1px solid #2d2b26;
  font-family: var(--mono);
  font-size: 12px;
  color: #a9a49a;
}

.code-card .btn-outline {
  border-color: #3f3c35;
  color: #faf9f5;
}

.code-card .btn-outline:hover {
  background: #2a2824;
}

pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
}

/* FAQ */
.faq-list {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  corner-shape: round bevel round round;
  background: var(--surface);
  overflow: hidden;
}

details.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
}

details.faq-item:last-child {
  border-bottom: none;
}

details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--fg-muted);
  font-size: 18px;
}

details.faq-item[open] summary::after {
  content: "−";
}

.faq-body {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.faq-body strong {
  color: var(--fg);
}

/* Article prose */
.article-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
}

.prose h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
}

.prose h2 {
  margin-top: 40px;
  margin-bottom: 12px;
  font-size: 21px;
}

.prose p,
.prose li {
  font-size: 14.5px;
  color: var(--fg-muted);
}

.prose strong {
  color: var(--fg);
}

.prose ul,
.prose ol {
  padding-left: 20px;
}

/* Minimal 5-Track Editorial Footer */
.site-footer {
  padding: 56px 0 40px;
  background: var(--bg);
  font-size: 13px;
  color: var(--fg-muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 36px;
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-item {
    padding: 20px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .card-span-2 {
    grid-column: span 1;
  }
}
