:root {
  --bg: #0b1120;
  --panel: #111827;
  --panel-alt: #1e293b;
  --code-bg: #020617;
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --emerald: #34d399;
  --amber: #fbbf24;
  --border: #334155;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.72;
  font-size: 1.02rem;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.94);
  padding: 1rem 1.5rem;
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--cyan);
  letter-spacing: 0.04em;
}

.tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

main {
  max-width: 1040px;
  margin: 2.25rem auto 4rem;
  padding: 0 1.5rem;
}

.hero {
  background: linear-gradient(145deg, #111827 0%, #1e293b 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  margin-bottom: 2rem;
}

.eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--cyan);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(1.8rem, 3.3vw, 2.45rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #ffffff;
}

.subtitle {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 82ch;
}

.section-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.35rem);
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--cyan);
}

p {
  margin-bottom: 1.1rem;
  color: #cbd5e1;
}

ul, ol {
  margin: 0 0 1.25rem 1.5rem;
  color: #cbd5e1;
}

li {
  margin-bottom: 0.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--panel-alt);
  color: var(--cyan);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}

pre.code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--code-bg);
  color: #e2e8f0;
  border: 1px solid var(--border);
  padding: 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0.85rem 0 1.25rem;
}

/* Sandbox Interactive Simulator */
.sandbox-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.preset-btn {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 0.95rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
}

.sandbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.sandbox-box {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.15rem;
}

.sandbox-box h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald);
  margin-bottom: 0.6rem;
}

/* Responsive table per modern-web-guidance */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(540px, 80vh);
  container-type: inline-size;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  --label-2: "Primary Industry Ecosystem";
  --label-3: "Data Structure & Rules";
  --label-4: "Common Failure Mode";
  --label-5: "PIMplify Automated Resolution";
}

caption {
  text-align: left;
  font-weight: 700;
  padding: 0.9rem 1.1rem;
  background: var(--panel-alt);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

thead th {
  background: var(--panel-alt);
  color: var(--cyan);
  text-align: left;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border);
}

tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--panel);
  color: #ffffff;
  text-align: left;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  color: #cbd5e1;
}

@container (width < 600px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-block-end: 1.25rem;
    border: 1px solid var(--border);
  }

  tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--panel-alt);
  }

  td:nth-child(2)::before {
    content: var(--label-2) ": ";
    font-weight: 600;
    color: var(--cyan);
  }
  td:nth-child(3)::before {
    content: var(--label-3) ": ";
    font-weight: 600;
    color: var(--cyan);
  }
  td:nth-child(4)::before {
    content: var(--label-4) ": ";
    font-weight: 600;
    color: var(--cyan);
  }
  td:nth-child(5)::before {
    content: var(--label-5) ": ";
    font-weight: 600;
    color: var(--cyan);
  }
}

.checklist-grid {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 1rem 1.15rem;
  border-radius: 8px;
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  margin-top: 0.3rem;
  width: 18px;
  height: 18px;
  accent-color: var(--emerald);
}

.audit-output {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 8px;
  padding: 1.35rem;
  margin-top: 1.25rem;
}

.audit-output h3 {
  margin-top: 0;
  color: var(--emerald);
}

.accordion-group {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

details.disclosure {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

details.disclosure summary {
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
}

details.disclosure p {
  margin-top: 0.85rem;
  margin-bottom: 0;
}

.read-more-btn {
  background: var(--panel-alt);
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.deep-dive-wrapper {
  margin-top: 1rem;
  background: var(--panel-alt);
  border-left: 3px solid var(--cyan);
  padding: 1.1rem 1.25rem;
  border-radius: 0 8px 8px 0;
}

footer {
  max-width: 1040px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
