/* =========================================================
   KriptoEngine — Neumorphic / Soft UI Theme
   Kanvas: Lavender pastel (#E9EDF5)
   Aksen:  Violet lembut (#8C7EFF) & Peach lembut (#FFA588)
   Prinsip: bentuk "timbul" dari kanvas yang sama, tanpa garis tegas.
   ========================================================= */

:root {
  --bg: #E9EDF5;
  --shadow-light: #FFFFFF;
  --shadow-dark: #B7C0D6;

  --text-dark: #333A4D;
  --text-muted: #7B8299;
  --text-faint: #A1A8BC;

  --violet: #8C7EFF;
  --violet-text: #5A4FE0;
  --violet-shadow-l: #C9C3FF;
  --violet-shadow-d: #5F54C4;

  --peach: #FFA588;
  --peach-text: #D9603D;
  --peach-shadow-l: #FFD5C4;
  --peach-shadow-d: #CC6C4E;

  --border-soft: rgba(183, 192, 214, 0.4);

  --font-heading: 'Sora', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;

  --raised: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  --raised-sm: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  --pressed: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
  --pressed-sm: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text-dark);
  font-family: var(--font-body);
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
}

/* Ambient pastel glow — dekorasi lembut, tidak mengganggu keterbacaan */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}
body::before { width: 460px; height: 460px; background: var(--violet-shadow-l); top: -140px; right: -140px; }
body::after  { width: 420px; height: 420px; background: var(--peach-shadow-l); bottom: -120px; left: -160px; }

a { text-decoration: none; color: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-violet { color: var(--violet-text); }
.text-peach { color: var(--peach-text); }
.hidden { display: none !important; }

:focus-visible { outline: 3px solid var(--violet-text); outline-offset: 3px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* --- Eyebrow / label pill --- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-code); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-text);
  background: var(--bg); padding: 9px 18px; border-radius: 999px;
  box-shadow: var(--pressed-sm); margin-bottom: 18px;
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet); box-shadow: 0 0 0 3px var(--violet-shadow-l);
}
.eyebrow.peach { color: var(--peach-text); }
.eyebrow.peach::before { background: var(--peach); box-shadow: 0 0 0 3px var(--peach-shadow-l); }

/* --- Navbar (pill mengambang) --- */
.navbar { background: transparent; padding: 22px 0; position: sticky; top: 0; z-index: 100; }
.nav-wrapper {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg); border-radius: 999px; padding: 10px 12px 10px 22px;
  box-shadow: var(--raised-sm);
}
.logo { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--text-dark); }
.logo-icon {
  width: 36px; height: 36px; border-radius: 11px; background: var(--bg);
  box-shadow: var(--pressed-sm); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-code); font-size: 0.68rem; font-weight: 700; color: var(--violet-text);
}
.nav-links { display: flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 999px; padding: 5px; box-shadow: var(--pressed-sm); }
.nav-links a {
  font-family: var(--font-code); font-weight: 600; font-size: 0.78rem;
  padding: 10px 16px; border-radius: 999px; color: var(--text-muted); transition: all 0.2s ease; white-space: nowrap;
}
.nav-links a:hover { color: var(--violet-text); }
.nav-links a.active { background: var(--bg); box-shadow: var(--raised-sm); color: var(--violet-text); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
  padding: 15px 30px; border-radius: 16px; cursor: pointer; border: none;
  background: var(--bg); transition: all 0.15s ease;
}
.btn-primary { color: #fff; background: var(--violet); box-shadow: var(--raised-sm), 0 8px 18px -8px rgba(90, 79, 224, 0.6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light), 0 10px 20px -8px rgba(90, 79, 224, 0.6); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--pressed-sm); }
.btn-outline { color: var(--text-dark); box-shadow: var(--raised-sm); }
.btn-outline:hover { color: var(--violet-text); }
.btn-outline:active { box-shadow: var(--pressed-sm); }

/* --- Tags (dipakai lintas halaman) --- */
.tag { display: inline-block; font-family: var(--font-code); font-size: 0.68rem; font-weight: 600; padding: 6px 13px; border-radius: 999px; margin-bottom: 12px; background: var(--bg); box-shadow: var(--pressed-sm); }
.tag-blue { color: var(--violet-text); }
.tag-yellow { color: var(--peach-text); }

/* --- Kartu generik (dipakai halaman modul) --- */
.module-item { background: var(--bg); border-radius: var(--radius); padding: 32px; box-shadow: var(--raised); }
.border-blue { border-left: 5px solid var(--violet); }
.border-yellow { border-left: 5px solid var(--peach); }
.tech-spec { font-family: var(--font-code); font-size: 0.75rem; color: var(--text-muted); }

/* --- Bit toggle / simulator (komponen sinyal khas KriptoEngine) --- */
.bit-toggle {
  width: 100%; aspect-ratio: 1; max-width: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-code); font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: box-shadow 0.15s ease, color 0.15s ease;
  background: var(--bg); user-select: none; margin: 0 auto;
}
.bit-toggle.off { box-shadow: var(--raised-sm); color: var(--text-faint); }
.bit-toggle.on { box-shadow: var(--pressed-sm); color: var(--violet-text); }
.bit-group.ciphertext .bit-toggle.on { color: var(--peach-text); }

/* --- Step accordion (halaman kalkulator per-algoritma) --- */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { border-radius: 16px; background: var(--bg); box-shadow: var(--raised-sm); overflow: hidden; transition: box-shadow 0.2s ease; }
.step-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; cursor: pointer; user-select: none; }
.step-title { display: flex; align-items: center; font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: var(--text-dark); }
.step-body { display: none; padding: 0 22px 22px; }
.step.open { box-shadow: var(--pressed-sm); }
.step.open .step-body { display: block; }
.step-note { color: var(--text-muted); font-size: 0.85rem; margin: 14px 0 8px; font-weight: 500; }

/* --- Notasi matematis --- */
.eq-line { font-family: var(--font-code); font-size: 0.88rem; color: var(--text-dark); padding: 10px 6px; word-break: break-word; line-height: 1.8; }
.eq-line + .eq-line { border-top: 1px dashed var(--border-soft); }
.mvar { font-family: var(--font-heading); font-style: italic; font-weight: 600; color: var(--violet-text); margin: 0 2px; }
.eq-line sub, .eq-line sup, .mx-label sub { font-family: var(--font-code); font-size: 0.75em; }

.op { font-weight: 700; margin: 0 8px; display: inline-block; color: var(--text-muted); }
.op-gold { color: var(--peach-text); }
.op-arrow { color: var(--violet-text); }

.mx { display: inline-flex; align-items: stretch; vertical-align: middle; margin: 0 6px; }
.mx .bracket { width: 8px; }
.mx .bracket.left { border-top: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint); border-left: 2px solid var(--text-faint); border-radius: 6px 0 0 6px; }
.mx .bracket.right { border-top: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint); border-right: 2px solid var(--text-faint); border-radius: 0 6px 6px 0; }
.mx .state-grid { padding: 6px 8px; }
.cell-sm { min-width: 38px !important; height: 32px !important; font-size: 0.78rem !important; }
.grid1 { grid-template-columns: repeat(1, 1fr); }

.mx-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.mx-label { font-family: var(--font-heading); font-style: italic; font-weight: 600; font-size: 0.88rem; color: var(--text-muted); }

.eq-block { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 18px 0; padding: 22px; background: var(--bg); border-radius: 16px; box-shadow: var(--pressed-sm); }
.eq-block .op { font-size: 1.2rem; margin: 0; }

.mx-row { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 18px; }
.mx-center { margin: 18px 0; }

.subbox-grid { display: grid; gap: 10px; margin: 14px 0 10px; }
.subbox-cell { font-family: var(--font-code); font-size: 0.82rem; color: var(--text-dark); background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; box-shadow: var(--raised-sm); }
.subbox-cell .op-arrow { margin: 0 4px; font-weight: 700; }

.state-grid { display: inline-grid; gap: 8px; font-family: var(--font-code); }
.state-grid .cell { background: var(--bg); border-radius: 10px; min-width: 46px; height: 42px; display: flex; align-items: center; justify-content: center; color: var(--violet-text); font-size: 0.88rem; font-weight: 600; box-shadow: var(--pressed-sm); }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.grid2 { grid-template-columns: repeat(2, 1fr); }

/* --- Footer --- */
.site-footer { padding: 40px 0 70px; color: var(--text-muted); font-size: 0.85rem; }
.footer-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; background: var(--bg); border-radius: 20px; padding: 22px 30px; box-shadow: var(--pressed-sm); }
.footer-right a { color: var(--violet-text); font-weight: 600; }

@media (max-width: 640px) {
  .nav-wrapper { flex-direction: column; align-items: stretch; gap: 10px; border-radius: 24px; padding: 14px; }
  .nav-links { justify-content: space-between; }
  .nav-links a { padding: 9px 10px; font-size: 0.7rem; }
}