/* SIS Computer Science — stylesheet tunggal
   Dipakai oleh: gerbang login, halaman indeks, dan slide.
   Tanpa CDN, tanpa font eksternal: tetap jalan tanpa internet. */

:root {
  --ink: #12161c;
  --ink-soft: #4a5568;
  --paper: #ffffff;
  --paper-2: #f6f7f9;
  --line: #dfe3e8;
  --accent: #1f5fbf;
  --accent-soft: #eaf1fc;
  --code-bg: #11151b;
  --code-ink: #e6edf3;
  --ok: #1a7f4b;
  --warn: #a3411a;
  --radius: 10px;
  --step: clamp(1rem, 1.6vw, 1.35rem);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
h3 { font-size: clamp(1.05rem, 1.8vw, 1.25rem); }
p { margin: 0 0 .9em; }
ul, ol { margin: 0 0 .9em; padding-left: 1.3em; }
li { margin: .25em 0; }
a { color: var(--accent); }

.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.error { color: var(--warn); min-height: 1.2em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- gerbang login ---------- */
body.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(1200px 600px at 10% -10%, #dbe7fb 0%, transparent 60%),
    var(--paper-2);
}
.gate-card {
  width: min(30rem, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 10px 30px rgba(18, 22, 28, .06);
}
.gate-form { display: grid; gap: .9rem; margin-top: 1rem; }
.gate-form label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.gate-form select,
.gate-form input {
  font: inherit;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-height: 44px;
}
.gate-form button {
  font: inherit;
  font-weight: 650;
  padding: .7rem 1rem;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.gate-form button:hover { background: #174a97; }
.gate-form button:focus-visible,
.gate-form input:focus-visible,
.gate-form select:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }

/* ---------- halaman indeks ---------- */
.wrap { width: min(68rem, 100%); margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); }
.section-title { margin-top: 2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin: 1rem 0 0; padding: 0; list-style: none; }
.card {
  display: block;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--accent); background: var(--accent-soft); }
.card .n { font-size: .8rem; color: var(--ink-soft); font-weight: 700; letter-spacing: .04em; }
.card .t { font-weight: 650; display: block; margin-top: .15rem; }

/* ---------- slide ---------- */
body.deck {
  background: var(--paper-2);
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.deck-top {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem clamp(.75rem, 2vw, 1.25rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.deck-top .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-top .spacer { flex: 1; }
.deck-top button {
  font: inherit;
  font-size: .8rem;
  padding: .35rem .6rem;
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  cursor: pointer;
}
.deck-top button:hover { border-color: var(--accent); color: var(--accent); }

.slides { position: relative; }
.slide {
  display: none;
  width: min(64rem, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem);
  min-height: 60vh;
}
.slide.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.slide .kicker {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .18rem .55rem;
  margin-bottom: .7rem;
}

.deck-bottom {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem clamp(.75rem, 2vw, 1.25rem);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--ink-soft);
}
.progress { flex: 1; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* kode */
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  tab-size: 4;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
p code, li code, td code {
  background: #eef1f5;
  color: #1d2430;
  padding: .08em .35em;
  border-radius: 5px;
  font-size: .9em;
}

/* tabel */
table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper); font-weight: 650; }

/* kotak */
.note, .task, .check {
  border-left: 3px solid var(--accent);
  background: var(--paper);
  padding: .7rem .9rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1rem;
}
.task { border-left-color: var(--ok); }
.check { border-left-color: var(--warn); }
.note strong, .task strong, .check strong { display: block; margin-bottom: .2em; }

.two-col { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }

@media (max-width: 640px) {
  html, body { font-size: 16px; }
  .deck-top .title { display: none; }
  .slide { min-height: 70vh; padding: 1rem; }
  pre { font-size: .78rem; padding: .75rem; }
}

@media print {
  body.deck { display: block; }
  .deck-top, .deck-bottom { display: none; }
  .slide { display: block !important; page-break-after: always; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .slide.active { animation: none; }
  .progress > i { transition: none; }
}