/* Materi Stack Modern — gaya bersama (dark + aksen, selaras 3-alur-nodejs-react) */

:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent2: #a78bfa;
  --danger: #fb7185;
  --warn: #fbbf24;
  --ok: #34d399;
  --code-bg: #0b1220;
  --code-border: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg), #020617);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

header {
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 0;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

section {
  background: rgba(255, 255, 255, 0.03);
  padding: 18px;
  margin: 16px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

section > h2:first-child,
section > h3:first-child {
  margin-top: 0;
}

h2 {
  color: var(--accent);
  margin-top: 0;
}

h3 {
  color: var(--accent2);
  margin-top: 0.85rem;
  margin-bottom: 6px;
}

section > h2 + h3 {
  margin-top: 0.35rem;
}

p {
  color: var(--text);
  margin: 0 0 0.65rem;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  padding-left: 20px;
  color: var(--text);
}

li {
  margin-bottom: 0.35rem;
}

hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}

/* Inline vs blok kode */
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--code-bg);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #d1d5db;
  border: 1px solid var(--code-border);
}

pre {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--code-bg);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  color: #d1d5db;
  border: 1px solid var(--code-border);
  margin: 0.5rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-right: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}

.step {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 10px 0;
}

.note {
  background: rgba(52, 211, 153, 0.08);
  border-left: 3px solid var(--ok);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
  color: var(--text);
}

.warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
  color: var(--text);
}

.text-warn {
  color: var(--warn);
}

.danger,
li.danger {
  color: var(--danger);
  font-weight: 500;
}

.callout {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-left: 3px solid var(--ok);
  padding: 12px 14px;
  border-radius: 8px;
  margin: 12px 0;
}

.callout p {
  margin: 0 0 0.35rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

.analogy .sub-label {
  margin-top: 0;
}

footer.section-foot > .sub-label:first-of-type {
  margin-top: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.label,
.sub-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.85rem 0 0.35rem;
}

.sub-label:first-child,
.label:first-child {
  margin-top: 0;
}

.part {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1.25rem 0 0.35rem;
}

.part:first-of-type {
  margin-top: 0;
}

.compare {
  display: grid;
  gap: 1rem;
  margin: 0.75rem 0;
}

@media (min-width: 640px) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.compare-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.compare-card strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--accent2);
}

.compare-card pre {
  margin: 0;
}

.abbr-list {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.1rem;
  columns: 1;
}

@media (min-width: 520px) {
  .abbr-list {
    columns: 2;
    column-gap: 1.5rem;
  }
}

.abbr-list li {
  break-inside: avoid;
}

dl.roles {
  margin: 0.5rem 0 0;
}

dl.roles dt {
  font-weight: 600;
  margin-top: 0.85rem;
  color: var(--accent);
}

dl.roles dt:first-child {
  margin-top: 0;
}

dl.roles dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

dl.roles dd ul {
  margin-top: 0.35rem;
  color: var(--text);
}

.analogy {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.analogy ul {
  margin-bottom: 0;
}

footer.section-foot {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
  text-align: left;
}

footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer h2 {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.footer-note {
  margin-bottom: 0.5rem;
}

.footer-note--spaced {
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.9rem;
}

th {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.2);
}

tr:last-child td {
  border-bottom: none;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 800px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Index: daftar materi */
.index-hero h1 {
  font-size: 2rem;
}

.materi-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.materi-list li {
  margin-bottom: 12px;
}

.materi-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.materi-list a:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.materi-list .num {
  display: inline-block;
  min-width: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

.materi-list .title {
  font-weight: 600;
  color: var(--text);
}

.materi-list .desc {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Halaman demo JS (0-index) */
#hasil {
  margin-top: 8px;
}

#hasil .output {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  color: var(--text);
}

#hasil .section-title {
  color: var(--accent2);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

/* Komentar dalam blok perintah/shell (diganti dari class .ket lama) */
.shell-comment {
  color: var(--warn);
}
