/* ==========================================================================
   Pussy888 Malaysia Technical & Statistical Reference Index (planestupid.com)
   Zero-dependency, Core Web Vitals optimized static stylesheet
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-dark: #0f172a;
  --bg-dark-elevated: #1e293b;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-on-dark: #f8fafc;
  --text-on-dark-muted: #cbd5e1;

  --brand-gold: #d97706;
  --brand-gold-light: #fef3c7;
  --brand-gold-border: #fcd34d;
  --accent-blue: #1d4ed8;
  --accent-blue-soft: #eff6ff;
  --accent-emerald: #047857;
  --accent-emerald-soft: #ecfdf5;
  --accent-red: #b91c1c;
  --accent-red-soft: #fef2f2;

  --border-light: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);

  --container-max: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.68;
}

a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-gold);
}

h1, h2, h3, h4 {
  color: var(--text-main);
  line-height: 1.28;
  margin-top: 0;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  font-weight: 700;
  margin-top: 2.4rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-light);
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin-top: 1.6rem;
  margin-bottom: 0.55rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.1rem;
}

ul, ol {
  margin-top: 0;
  margin-bottom: 1.2rem;
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.45rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-gold);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Top Utility Bar */
.topbar {
  background: #090e1a;
  color: var(--text-on-dark-muted);
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.45rem 0;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #fbbf24;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-on-dark);
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-on-dark-muted);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  background: var(--bg-dark-elevated);
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.72rem;
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fbbf24;
}

/* Hero Banner */
.hero {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-on-dark);
  padding: 3rem 0 2.75rem;
  border-bottom: 3px solid var(--brand-gold);
}

.hero-compact {
  padding: 2.1rem 0 2rem;
}

.hero h1 {
  color: #ffffff;
  max-width: 860px;
}

.hero-eyebrow {
  display: inline-block;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-on-dark-muted);
  max-width: 800px;
  margin-bottom: 1.4rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.83rem;
  color: #94a3b8;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-meta strong {
  color: #e2e8f0;
}

/* KPI Stat Strip */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Breadcrumbs */
.breadcrumbs {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 0.6rem 0;
  font-size: 0.84rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.breadcrumbs li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
}

.breadcrumbs li + li::before {
  content: "/";
  color: #94a3b8;
}

.breadcrumbs a {
  color: var(--text-body);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* Main Content Layout */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 2.25rem;
  padding: 2.25rem 0 3.5rem;
  align-items: start;
}

.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
}

.article-card > h2:first-child {
  margin-top: 0;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.side-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.side-box-title {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  margin: 0 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-gold);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  color: var(--text-body);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
}

.toc-list a:hover {
  color: var(--brand-gold);
  text-decoration: underline;
}

.spec-dl {
  margin: 0;
  font-size: 0.86rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border-light);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-row dt {
  color: var(--text-muted);
  font-weight: 500;
}

.spec-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

/* Hub Cards Grid */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 1.15rem;
  margin: 1.5rem 0;
}

.hub-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-gold);
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

.hub-card h3 {
  margin-top: 0;
  font-size: 1.06rem;
}

.hub-card h3 a {
  text-decoration: none;
  color: var(--text-main);
}

.hub-card h3 a:hover {
  color: var(--accent-blue);
}

.hub-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.hub-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-decoration: none;
}

/* Callouts */
.callout {
  border-radius: var(--radius-md);
  padding: 1.05rem 1.25rem;
  margin: 1.35rem 0;
  border-left: 4px solid var(--accent-blue);
  background: var(--accent-blue-soft);
  font-size: 0.94rem;
}

.callout-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  display: block;
}

.callout-warn {
  border-left-color: var(--brand-gold);
  background: var(--brand-gold-light);
}

.callout-danger {
  border-left-color: var(--accent-red);
  background: var(--accent-red-soft);
}

.callout-success {
  border-left-color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
}

/* Data Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0 1.6rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg-surface);
}

.data-table th,
.data-table td {
  padding: 0.78rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  background: var(--bg-dark);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-low {
  background: #dcfce7;
  color: #166534;
}

.badge-med {
  background: #fef3c7;
  color: #92400e;
}

.badge-high {
  background: #fee2e2;
  color: #991b1b;
}

/* Interactive Tool / Calculator Panels */
.tool-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.6rem 0;
}

.tool-panel h3 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-field input,
.form-field select {
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--text-main);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg-dark);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--brand-gold);
  color: #0f172a;
}

.calc-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.calc-metric {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.calc-metric span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.calc-metric strong {
  font-size: 1.2rem;
  color: var(--text-main);
}

/* Filter Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.filter-bar input,
.filter-bar select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: #fff;
}

.filter-bar input {
  flex: 1 1 220px;
}

/* Interactive Security Audit Checklist */
.checklist-box {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.checklist-box li {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.checklist-box input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-emerald);
  flex-shrink: 0;
}

/* FAQ Native Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.2rem;
}

.faq-item summary {
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-gold);
  flex-shrink: 0;
}

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

.faq-answer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-body);
  font-size: 0.95rem;
}

/* Step Cards */
.steps-list {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.steps-list li {
  counter-increment: step-counter;
  position: relative;
  padding: 1rem 1.15rem 1rem 3.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
}

.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--bg-dark);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  padding: 3rem 0 2rem;
  border-top: 3px solid var(--brand-gold);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.45rem;
}

.footer-links a {
  color: var(--text-on-dark-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: #fbbf24;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 960px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    width: 100%;
    padding-bottom: 0.85rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .header-inner {
    flex-wrap: wrap;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0.85rem;
  }

  .article-card {
    padding: 1.35rem 1.15rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
