/* KAIN – Konsortium AI Negara. Brand: steel blue from the KAIN logo, with the purple→cyan
   gradient of the Malaysia AI Ecosystem Map as the accent. No inline styles anywhere (CSP). */
:root {
  --brand: #3a5f7d;
  --brand-dark: #2f4f6b;
  --brand-soft: #9bb0bf;
  --accent-1: #7c5cff;
  --accent-2: #38c6e0;
  --gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --bg: #ffffff;
  --bg-alt: #f3f6f9;
  --surface: #ffffff;
  --text: #1c2a36;
  --muted: #5a6b79;
  --border: #dde5ec;
  --link: #2d6b96;
  --focus: #7c5cff;
  --shadow: 0 1px 2px rgba(20, 40, 60, 0.06), 0 6px 20px rgba(20, 40, 60, 0.06);
  --radius: 14px;
  --font-head: "Rubik", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1820;
  --bg-alt: #15212c;
  --surface: #1a2834;
  --text: #e6edf3;
  --muted: #9fb0bf;
  --border: #2a3b4a;
  --link: #7cc4ea;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.65 var(--font-body); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3, .h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--brand); color: #fff; padding: 0.6rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.center { text-align: center; margin-top: 2rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { font: 600 0.8rem/1.4 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-1); margin-bottom: 0.6rem; }
:root[data-theme="dark"] .eyebrow { color: #a996ff; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 720px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; padding: 0.75rem 1.3rem; border-radius: 999px; font: 600 0.95rem/1.2 var(--font-body); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--shadow); }
:root[data-theme="dark"] .btn-primary { background: #4f7fa5; }
.btn-ghost { border-color: var(--brand); color: var(--brand); background: transparent; }
:root[data-theme="dark"] .btn-ghost { border-color: var(--brand-soft); color: var(--text); }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
button:disabled { opacity: 0.6; cursor: wait; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand img { display: block; width: 132px; height: auto; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--bg-alt); color: var(--brand); }
:root[data-theme="dark"] .main-nav a:hover, :root[data-theme="dark"] .main-nav a[aria-current="page"] { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
.nav-toggle { display: none; }
.header-cta { margin-left: 0.5rem; }

/* Breadcrumbs */
.crumbs { max-width: 1180px; margin: 0 auto; padding: 1rem 20px 0; font-size: 0.85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 0.4rem; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section.alt { background: var(--bg-alt); }
.page-hero { padding: clamp(2rem, 6vw, 4rem) 0 0.5rem; }
.page-hero h1 { max-width: 900px; }
.prose { max-width: 760px; }
.prose p, .prose li { font-size: 1.05rem; }
.prose p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6rem) 0; background: radial-gradient(ellipse at 85% 10%, rgba(56, 198, 224, 0.18), transparent 55%), radial-gradient(ellipse at 10% 90%, rgba(124, 92, 255, 0.14), transparent 55%), var(--bg); }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead strong { color: var(--text); }
.stat-row { display: flex; flex-wrap: wrap; gap: 2rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.stat-row strong { display: block; font: 700 1.9rem/1.1 var(--font-head); color: var(--brand); }
:root[data-theme="dark"] .stat-row strong { color: #8fc3e6; }
.stat-row span { font-size: 0.85rem; color: var(--muted); }
.hero-report { display: block; max-width: 340px; margin-left: auto; text-decoration: none; color: var(--text); font-weight: 600; text-align: center; }
.hero-report img { display: block; border-radius: 10px; box-shadow: 0 24px 60px rgba(30, 50, 80, 0.25); transition: transform 0.25s ease; margin-bottom: 1rem; }
.hero-report:hover img { transform: translateY(-4px); }

/* Map */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.chip { display: inline-block; padding: 0.35rem 0.85rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); font-size: 0.85rem; text-decoration: none; font-family: var(--font-body); cursor: pointer; }
a.chip:hover, button.chip:hover { border-color: var(--brand-soft); }
.chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.map-figure { margin: 0; }
.map-figure img { display: block; width: 100%; max-width: 900px; margin: 0 auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.map-figure figcaption { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 0.75rem; }

/* CTA band */
.cta-band { background: var(--gradient); color: #fff; padding: 3rem 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { margin-bottom: 0.3rem; }
.cta-band p { margin: 0; max-width: 640px; opacity: 0.95; }

/* Logo wall + member grid */
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.logo-wall a { display: flex; align-items: center; justify-content: center; height: 84px; padding: 0.8rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; transition: box-shadow 0.15s; }
.logo-wall a:hover { box-shadow: var(--shadow); }
.logo-wall img { max-height: 56px; width: auto; object-fit: contain; }
.directory-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; }
.directory-controls select, .directory-controls input, .search-input { font: inherit; padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 0; }
.directory-controls input { flex: 1 1 240px; }
.directory-controls p { margin: 0; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0 0 2rem; }
.member-grid.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.member-card a { display: flex; flex-direction: column; height: 100%; padding: 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: box-shadow 0.15s, transform 0.15s; }
.member-card a:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.member-logo { display: flex; align-items: center; justify-content: center; height: 80px; margin-bottom: 0.7rem; background: #fff; border-radius: 8px; padding: 0.5rem; }
.member-logo img { max-height: 64px; max-width: 100%; object-fit: contain; }
.logo-fallback { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; background: var(--gradient); color: #fff; font: 700 1.2rem var(--font-head); }
.member-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.member-cats { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.empty-state { padding: 2rem; text-align: center; color: var(--muted); }
.member-head { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.member-logo-lg { width: 180px; height: 120px; margin: 0; border: 1px solid var(--border); }
.member-logo-lg img { max-height: 100px; }
.member-logo-lg .logo-fallback { width: 80px; height: 80px; font-size: 1.8rem; }

/* Cards, founders, FAQ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.card h3 { color: var(--brand); }
:root[data-theme="dark"] .card h3 { color: #8fc3e6; }
.card p:last-child { margin-bottom: 0; }
.founders { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
.founder { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1rem; }
.founder img { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; margin-bottom: 1rem; }
.founder h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.founder-org { font-weight: 600; color: var(--brand); margin: 0; }
:root[data-theme="dark"] .founder-org { color: #8fc3e6; }
.founder-role { color: var(--muted); margin: 0 0 0.5rem; font-size: 0.9rem; }
.founder-links { font-size: 0.9rem; margin: 0; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.faq summary { cursor: pointer; font-weight: 600; font-family: var(--font-head); }
.faq details p { margin: 0.75rem 0 0; color: var(--muted); }

/* News */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.news-list { display: grid; gap: 1rem; margin-bottom: 2rem; }
.news-card { display: flex; gap: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; height: 100%; }
.news-grid .news-card { flex-direction: column; }
.news-img { width: 180px; height: 130px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.news-grid .news-img { width: 100%; height: 170px; }
.news-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.news-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { color: var(--link); text-decoration: underline; }
.news-body p:last-child { margin-bottom: 0; color: var(--muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }

/* Report */
.report-head { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; }
.report-cover { max-width: 320px; border-radius: 10px; box-shadow: 0 24px 60px rgba(30, 50, 80, 0.25); justify-self: end; }
.check-list { padding-left: 1.2rem; }
.check-list li { margin-bottom: 0.5rem; }
.download-ready { background: var(--surface); border: 2px solid var(--accent-2); border-radius: var(--radius); padding: 2rem; text-align: center; }

/* Forms */
.lead-form { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.form-row { display: grid; gap: 0.35rem; }
.form-row label { font-weight: 500; font-size: 0.92rem; }
.lead-form input, .lead-form textarea { font: inherit; padding: 0.7rem 0.85rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; }
.lead-form button { justify-self: start; }
.form-status { margin: 0; color: var(--muted); font-size: 0.9rem; }
.hp { position: absolute; left: -9999px; }
.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: start; }
.form-thanks { background: var(--surface); border: 2px solid var(--accent-2); border-radius: var(--radius); padding: 2rem; }

/* Search */
.search-input { width: 100%; font-size: 1.1rem; }
.search-results { list-style: none; padding: 0; margin: 1.5rem 0; }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.search-results a { font-weight: 600; font-size: 1.05rem; }
.search-results p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* Footer */
.site-footer { background: #13212d; color: #c5d2dd; padding: 3.5rem 0 1.5rem; margin-top: 0; }
.site-footer a { color: #e6edf3; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.footer-grid img { width: 140px; height: auto; margin-bottom: 1rem; }
.footer-grid p { max-width: 340px; font-size: 0.92rem; }
.footer-h { font-size: 1rem; color: #fff; margin-bottom: 0.8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; font-size: 0.92rem; }
.footer-grid ul a { text-decoration: none; }
.footer-grid ul a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid #2a3b4a; margin-top: 2.5rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* Responsive */
@media (max-width: 960px) {
  .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); display: none; margin: 0; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding: 0.75rem 20px 1rem; }
  .main-nav a { padding: 0.75rem; }
  .header-actions { margin-left: auto; }
  .hero-inner, .report-head, .contact-grid { grid-template-columns: 1fr; }
  .hero-report, .report-cover { margin: 0 auto; justify-self: center; max-width: 260px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .news-card { flex-direction: column; }
  .news-img { width: 100%; height: 180px; }
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .stat-row { gap: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
