/* ============================================================
   AI Vending Hub - Design System
   =============================
   ONE source of truth for the whole site.

   Palette (locked across every page):
   - Primary      #165dff  (the ONLY accent; buttons, links, highlights)
   - Primary dark #1249cc  (hover / pressed states)
   - Ink          #0f172a  (headlines)
   - Body         #475569  (paragraphs, muted text)
   - Line         #e2e8f0  (borders, dividers)
   - Fill         #f8fafc  (light section backgrounds)
   - Blue wash    #eef4ff  (tinted surfaces, table headers)

   Type:
   - Display / headings: "Inter", tight tracking
   - Body: "Inter", relaxed leading
   - Data / labels: "JetBrains Mono", uppercase micro-labels

   Shape system (locked):
   - Buttons / inputs: 10px radius
   - Cards / images: 16px radius
   - Chips / tags: full pill

   Motion:
   - Hover feedback on every interactive element
   - Scroll-reveal via IntersectionObserver (respects reduced motion)
   ============================================================ */

:root {
  --brand: #165dff;
  --brand-dark: #1249cc;
  --brand-deep: #0b2f8a;
  --ink: #0f172a;
  --body: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --fill: #f8fafc;
  --wash: #eef4ff;
  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-input: 10px;
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 20px 48px rgba(15, 23, 42, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

/* Headings: balanced wrapping + tight tracking */
h1, h2, h3, h4, h5 {
  text-wrap: balance;
  letter-spacing: -0.02em;
}

h1, h2, h3 {
  color: var(--ink);
}

::selection {
  background: rgba(22, 93, 255, 0.16);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Links inside body copy */
.prose a,
article a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(22, 93, 255, 0.35);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
.prose a:hover,
article a:hover {
  color: var(--brand-dark);
  text-decoration-color: var(--brand);
}

/* ---------- Buttons (site-wide, one shape) ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-btn);
  background: var(--brand);
  color: #fff;
  padding: 0.72rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(22, 93, 255, 0.24);
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 10px 28px rgba(22, 93, 255, 0.3);
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.72rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease,
    transform 0.12s ease;
  white-space: nowrap;
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--wash);
}
.btn-outline:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.02rem;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-btn);
  background: #fff;
  color: var(--brand-dark);
  padding: 1rem 2.1rem;
  font-size: 1.02rem;
  font-weight: 700;
  box-shadow: 0 14px 36px rgba(9, 35, 110, 0.3);
  transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.btn-white:hover {
  background: #f2f6ff;
  box-shadow: 0 16px 40px rgba(9, 35, 110, 0.36);
}
.btn-white:active {
  transform: translateY(1px);
}

/* Text link with arrow (used under section headers) */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 600;
  transition: gap 0.16s ease, color 0.16s ease;
}
.link-arrow:hover {
  gap: 0.65rem;
  color: var(--brand-dark);
}

/* ---------- Section header pattern (editorial, left-aligned) ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.section-kicker {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}
.section-sub {
  max-width: 42ch;
  color: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  margin-top: 0.7rem;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 2.5rem;
  }
}

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: var(--wash);
  color: var(--brand-dark);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.72rem;
  border: 1px solid rgba(22, 93, 255, 0.14);
}

/* ---------- Cards: border + soft shadow, consistent radius ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

/* Article card: image + body */
.article-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.article-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}
.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--fill);
}
.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.article-card:hover .thumb img {
  transform: scale(1.045);
}
.article-card .body {
  padding: 1.25rem;
}
.article-card h3 {
  margin-top: 0.7rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color 0.15s ease;
}
.article-card:hover h3 {
  color: var(--brand-dark);
}
.article-card p.summary {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--body);
}
.article-card p.meta {
  margin-top: 0.8rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Blueprint grid texture (hero / CTA backgrounds) ---------- */
.grid-pattern {
  background-image:
    linear-gradient(to right, rgba(22, 93, 255, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 93, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
}
.grid-pattern-soft {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- Forms (lead modal + contact page) ---------- */
.field-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.field-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-input);
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input::placeholder {
  color: #94a3b8;
}
.field-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.15);
}

/* ---------- Article / content images ---------- */
.content-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  margin: 1.75rem 0;
}

/* ---------- Data tables ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  background: var(--wash);
  color: var(--ink);
  font-weight: 700;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
}
.data-table td {
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
  vertical-align: top;
  color: var(--body);
}
.data-table tr:nth-child(even) td {
  background: var(--fill);
}

/* ---------- FAQ (borderless list style) ---------- */
details.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 1.15rem 0.25rem;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
details.faq-item summary::-webkit-details-marker {
  display: none;
}
details.faq-item summary::after {
  content: "+";
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  color: var(--brand);
  transition: transform 0.2s ease;
}
details.faq-item[open] summary::after {
  transform: rotate(45deg);
}
details.faq-item p {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--body);
  max-width: 62ch;
}

/* ---------- Mobile menu ---------- */
#mobile-menu {
  transition: opacity 0.15s ease;
}

/* ---------- Scroll reveal (progressive enhancement) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Design pass 2026-08 — US-market industry-media polish
   (appended overrides; base tokens above stay the source of truth)
   ============================================================ */

/* ---------- Sticky header: elevation on scroll ---------- */
.site-header {
  transition: box-shadow 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease;
  border-bottom-color: rgba(226, 232, 240, 0.8);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03), 0 12px 32px rgba(15, 23, 42, 0.08);
}

/* ---------- Nav links: soft pill on hover / active ---------- */
.nav-link {
  position: relative;
  padding: 0.42rem 0.7rem;
  border-radius: 10px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-link:hover {
  color: var(--brand);
  background: var(--wash);
}
.nav-link.active {
  color: var(--brand-dark);
  background: var(--wash);
  font-weight: 700;
}

/* ---------- Mobile menu: smooth expand (toggle .open) ---------- */
#mobile-menu {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease, padding 0.24s ease;
}
#mobile-menu.open {
  max-height: 520px;
  opacity: 1;
  padding-top: 0.5rem;
  padding-bottom: 1.25rem;
}
@media (min-width: 1280px) {
  #mobile-menu {
    display: none;
  }
}

/* ---------- Announcement bar (above header) ---------- */
.announcement-bar a {
  transition: color 0.15s ease;
}

/* ---------- Image frames: consistent editorial treatment ---------- */
.img-frame {
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--fill);
  box-shadow: var(--shadow-soft);
}
.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-media {
  position: relative;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Content images inside articles */
.content-img {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

/* ---------- Section rhythm: tighter editorial headers ---------- */
.section-kicker {
  letter-spacing: 0.18em;
}
.section-title {
  letter-spacing: -0.035em;
}
.section-head {
  margin-bottom: 2.25rem;
}

/* ---------- Article cards: stronger hierarchy ---------- */
.article-card .thumb {
  position: relative;
}
.article-card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0) 55%,
    rgba(15, 23, 42, 0.18) 100%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}
.article-card:hover .thumb::after {
  opacity: 1;
}
.article-card .body {
  padding: 1.3rem 1.35rem 1.45rem;
}
.article-card h3 {
  margin-top: 0.6rem;
  font-size: 1.1rem;
  line-height: 1.32;
}
.article-card .summary {
  margin-top: 0.5rem;
}

/* ---------- Company cards: cleaner hover ---------- */
.card {
  border-color: var(--line);
}

/* ---------- Footer: social + legal link polish ---------- */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  transition: color 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease;
}
.social-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
}
.footer-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cbd5e1;
}
.footer-link {
  color: #94a3b8;
  transition: color 0.15s ease;
}
.footer-link:hover {
  color: #fff;
}

/* ---------- Lead modal: reassurance row ---------- */
.modal-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.modal-note i {
  color: var(--brand);
}

/* ---------- FAQ hover affordance ---------- */
details.faq-item summary:hover {
  color: var(--brand-dark);
}

/* ---------- Stats strip divider (home / listing heroes) ---------- */
.stat-block {
  padding: 2rem 1.5rem 2rem 0;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.stat-label {
  margin-top: 0.4rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--body);
}

/* ---------- Scroll reveal stagger ---------- */
.reveal.in-view {
  opacity: 1;
  transform: none;
}
@media (min-width: 640px) {
  .reveal[data-delay="1"] { transition-delay: 0.06s; }
  .reveal[data-delay="2"] { transition-delay: 0.12s; }
  .reveal[data-delay="3"] { transition-delay: 0.18s; }
}

/* ---------- Compact form fields (lead modal) ---------- */
.field-input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  border-radius: 8px;
}

/* ---------- CTA 深色卡片上的次级按钮（与 btn-white 同尺寸） ---------- */
.btn-light-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  padding: 1rem 2.1rem;
  font-size: 1.02rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.btn-light-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.65);
}


/* ---------- Back to top button (site-wide, injected by include.js) ---------- */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 10px 24px rgba(22, 93, 255, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.15s ease;
  cursor: pointer;
  border: none;
}
.back-to-top:hover {
  background: var(--brand-dark);
}
.back-to-top:active {
  transform: scale(0.95);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .back-to-top.visible {
    transition: none;
  }
}
