/* ============================================================
   AI Services Malaysia — page-scoped stylesheet
   Self-contained layout for /ai-services-malaysia/
   Uses AINNA design tokens where available; falls back to local vars.
   Supports both light and [data-theme="dark"] modes.
   ============================================================ */

/* ── Local variables ── */
:root {
  --asm-bg: #ffffff;
  --asm-bg-1: #f8fafc;
  --asm-bg-2: #f1f5f9;
  --asm-text: #0f172a;
  --asm-text-muted: #475569;
  --asm-text-sub: #64748b;
  --asm-border: rgba(15, 23, 42, 0.08);
  --asm-border-strong: rgba(15, 23, 42, 0.14);
  --asm-accent: #ff7a1a;
  --asm-accent-2: #ffb347;
  --asm-accent-text: #ffffff;
  --asm-card: rgba(241, 245, 249, 0.78);
  --asm-card-solid: #f8fafc;
  --asm-radius: 18px;
  --asm-radius-sm: 12px;
  --asm-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  --asm-shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.11);
  --asm-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --asm-max-width: 1200px;
  --asm-topbar-height: 62px;
}

[data-theme="dark"] {
  --asm-bg: #02040a;
  --asm-bg-1: #080c14;
  --asm-bg-2: #0e1623;
  --asm-text: #f8fafc;
  --asm-text-muted: #94a3b8;
  --asm-text-sub: #64748b;
  --asm-border: rgba(255, 255, 255, 0.09);
  --asm-border-strong: rgba(255, 255, 255, 0.15);
  --asm-accent: #ff8a1d;
  --asm-accent-2: #ffb86b;
  --asm-card: rgba(255, 255, 255, 0.035);
  --asm-card-solid: rgba(255, 255, 255, 0.05);
  --asm-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  --asm-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ── Base ── */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.ainna-theme {
  background: var(--asm-bg);
  color: var(--asm-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid var(--asm-border);
}

[data-theme="dark"] .topbar {
  background: rgba(2, 4, 10, 0.82);
}

.topbar-inner {
  max-width: var(--asm-max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar a {
  color: var(--asm-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--asm-transition);
}

.topbar a:hover {
  color: var(--asm-accent);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ── Layout wrapper ── */
.page-wrap {
  position: relative;
  z-index: 1;
}

.section {
  padding: clamp(64px, 8vw, 110px) 20px;
  border-bottom: 1px solid var(--asm-border);
}

.section:last-of-type {
  border-bottom: none;
}

.section > div:first-child {
  max-width: var(--asm-max-width);
  margin: 0 auto;
}

/* ── Typography helpers ── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--asm-accent);
  margin-bottom: 12px;
}

.section-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--asm-accent);
  box-shadow: 0 0 10px var(--asm-accent);
}

.section-sub {
  color: var(--asm-text-muted);
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 680px;
  margin-top: 10px;
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: clamp(72px, 10vh, 120px) 20px clamp(48px, 6vh, 80px);
  max-width: var(--asm-max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(38px, 5.5vw, 72px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 8px 0 18px;
}

.hero-lead {
  font-size: clamp(17px, 1.9vw, 21px);
  color: var(--asm-text-muted);
  max-width: 820px;
  line-height: 1.6;
}

/* ── Direct answer block ── */
.direct-answer {
  background: var(--asm-card);
  border: 1px solid var(--asm-border);
  border-radius: var(--asm-radius);
  padding: 26px;
  margin-top: 28px;
  max-width: 900px;
}

[data-theme="dark"] .direct-answer {
  background: var(--asm-card-solid);
}

.direct-answer h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 0 0 10px;
}

.direct-answer p {
  color: var(--asm-text-muted);
}

.list-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 16px;
}

.list-links a {
  color: var(--asm-accent);
  font-weight: 600;
  text-decoration: none;
}

.list-links a:hover {
  text-decoration: underline;
}

/* ── KPI row ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.kpi {
  background: var(--asm-card);
  border: 1px solid var(--asm-border);
  border-radius: var(--asm-radius-sm);
  padding: 20px 22px;
  text-align: center;
}

[data-theme="dark"] .kpi {
  background: var(--asm-card-solid);
}

.kpi strong {
  display: block;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 800;
  color: var(--asm-text);
  margin-bottom: 4px;
}

.kpi span {
  font-size: 13px;
  color: var(--asm-text-muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--asm-transition);
}

.btn-primary {
  background: var(--asm-accent);
  color: var(--asm-accent-text);
  border-color: var(--asm-accent);
  box-shadow: 0 4px 14px rgba(255, 122, 26, 0.22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 122, 26, 0.32);
}

.btn-ghost {
  background: var(--asm-card);
  color: var(--asm-text);
  border-color: var(--asm-border-strong);
}

.btn-ghost:hover {
  border-color: var(--asm-accent);
  color: var(--asm-accent);
}

/* ── Grids ── */
.grid-3,
.deploy-grid,
.industry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

/* ── Cards ── */
.card {
  background: var(--asm-card);
  border: 1px solid var(--asm-border);
  border-radius: var(--asm-radius);
  padding: 24px;
  transition: all var(--asm-transition);
}

[data-theme="dark"] .card {
  background: var(--asm-card-solid);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--asm-shadow-hover);
  border-color: var(--asm-border-strong);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}

.card p {
  color: var(--asm-text-muted);
  font-size: 15px;
  margin: 0;
}

.card a {
  color: var(--asm-accent);
  font-weight: 600;
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

.ind-card .icon {
  font-size: 20px;
  color: var(--asm-accent);
  margin-bottom: 8px;
  display: block;
}

/* ── Evidence pills ── */
.evidence-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--asm-card);
  border: 1px solid var(--asm-border);
  font-size: 13px;
  color: var(--asm-text-muted);
}

[data-theme="dark"] .pill {
  background: var(--asm-card-solid);
}

/* ── Q&A ── */
.qa-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.qa-item {
  background: var(--asm-card);
  border: 1px solid var(--asm-border);
  border-radius: var(--asm-radius-sm);
  padding: 20px 22px;
}

[data-theme="dark"] .qa-item {
  background: var(--asm-card-solid);
}

.qa-item h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}

.qa-item p {
  color: var(--asm-text-muted);
  font-size: 15px;
  margin: 0;
}

/* ── CTA box ── */
.cta-box {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.10), rgba(255, 122, 26, 0.03));
  border: 1px solid rgba(255, 122, 26, 0.22);
  border-radius: var(--asm-radius);
  padding: clamp(28px, 4vw, 44px);
  text-align: center;
  max-width: var(--asm-max-width);
  margin: 0 auto;
}

.cta-box h2 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 10px;
}

.cta-box > p {
  color: var(--asm-text-muted);
  max-width: 620px;
  margin: 0 auto 20px;
}

.cta-box .btn {
  margin-top: 8px;
}

/* ── ng-card shim used in evidence section ── */
.ng-card {
  background: var(--asm-card);
  border: 1px solid var(--asm-border);
  border-radius: var(--asm-radius);
  padding: 28px;
  max-width: var(--asm-max-width);
  margin: 0 auto;
}

[data-theme="dark"] .ng-card {
  background: var(--asm-card-solid);
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .kpi-row,
  .grid-3,
  .deploy-grid,
  .industry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .topbar-nav {
    width: 100%;
    gap: 12px;
  }
  .kpi-row,
  .grid-3,
  .deploy-grid,
  .industry-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 40px;
  }
  .direct-answer,
  .ng-card {
    padding: 20px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
