/* ============================================================
    Tema teal sedang — top bar horizontal (beda layout)
   ============================================================ */
:root {
  --bg-0: #1a1e2a;
  --bg-1: #1e2230;
  --surface: #252a38;
  --surface-border: rgba(95, 184, 165, 0.22);
  --text: #dfe3eb;
  --text-dim: #8a90a0;
  --accent-1: #5fb8a5;
  --accent-2: #7fc8b8;
  --accent-3: #a0d8cc;
  --warn: #d96060;
  --radius: 10px;
  --font: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
}

a { color: inherit; text-decoration: none; }

/* ========================================
   Top Bar — horizontal sticky header
   ======================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 30, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
}

.tb-top {
  display: flex;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 24px 8px;
}
.tb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tb-avatar {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1rem;
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  flex-shrink: 0;
}
.tb-info { display: flex; flex-direction: column; gap: 1px; }
.tb-name {
  font-size: 0.88rem; font-weight: 700;
  color: var(--accent-2);
}
.tb-npm {
  font-size: 0.68rem; color: var(--text-dim);
  font-family: var(--mono);
}

.tb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 10px;
}
.tb-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: all 0.14s ease;
}
.tb-nav a:hover {
  color: var(--text);
  background: rgba(95, 184, 165, 0.07);
}
.tb-nav a.active {
  color: var(--bg-0);
  font-weight: 600;
  background: var(--accent-1);
}
.tb-nav a .p-badge {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 5px;
  font-size: 0.65rem; font-weight: 700;
  background: rgba(95, 184, 165, 0.12);
  color: var(--accent-1);
}
.tb-nav a.active .p-badge {
  background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   Container
   ======================================== */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.page-head { margin-bottom: 22px; }
.page-head .eyebrow {
  display: inline-block;
  font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent-1); margin-bottom: 10px;
  padding: 4px 10px; border: 1px solid var(--surface-border); border-radius: 999px;
}
.page-head h1 { margin: 0 0 8px; font-size: 1.9rem; line-height: 1.15; }
.page-head h1 span {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head p { margin: 0; color: var(--text-dim); max-width: 60ch; }

/* ========================================
   Card — garis atas aksen, rounded, beda dari keduanya
   ======================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-top: 3px solid var(--accent-1);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ---------- Split card: input kiri, output kanan ---------- */
.card-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.card-split .split-left,
.card-split .split-right {
  min-width: 0;
}
.card-split .toggle { grid-column: 1 / -1; }
.card-split .btn { grid-column: 1 / -1; justify-self: start; }
.card-split .split-right {
  border-left: 1px solid var(--surface-border);
  padding-left: 24px;
}
@media (max-width: 700px) {
  .card-split {
    grid-template-columns: 1fr;
  }
  .card-split .toggle,
  .card-split .btn { grid-column: 1; }
  .card-split .split-right {
    border-left: none;
    border-top: 1px solid var(--surface-border);
    padding-left: 0;
    padding-top: 20px;
  }
}

/* ---------- Mode toggle ---------- */
.toggle {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--surface-border);
  margin-bottom: 16px;
}
.toggle button {
  border: 0; cursor: pointer;
  padding: 7px 16px;
  border-radius: 6px;
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  transition: all 0.14s ease;
}
.toggle button.active {
  color: var(--bg-0);
  background: var(--accent-1);
}

/* ---------- Form ---------- */
.field { margin-bottom: 13px; }
.field label {
  display: block; font-size: 0.78rem; color: var(--text-dim);
  margin-bottom: 5px; font-weight: 500;
}
.grid { display: grid; gap: 13px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

input, textarea, select {
  width: 100%;
  font-family: var(--font); font-size: 0.9rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--surface-border);
  border-radius: 7px;
  padding: 10px 12px;
  outline: none;
  transition: border 0.14s;
}
textarea { resize: vertical; min-height: 88px; font-family: var(--mono); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-1);
}
select {
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-1) 50%),
    linear-gradient(135deg, var(--accent-1) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.matrix-grid { display: grid; gap: 9px; max-width: 280px; }
.matrix-grid input { text-align: center; font-family: var(--mono); }

/* ---------- Button ---------- */
.btn {
  border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 0.9rem;
  color: var(--bg-0);
  padding: 11px 22px;
  border-radius: 7px;
  background: var(--accent-1);
  box-shadow: 0 3px 12px rgba(95, 184, 165, 0.25);
  transition: transform 0.12s, box-shadow 0.14s, filter 0.14s;
}
.btn:hover {
  transform: translateY(-1px); filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(95, 184, 165, 0.35);
}
.btn:active { transform: translateY(0); }

/* ---------- Result ---------- */
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 8px;
}
.result-head span { font-size: 0.78rem; color: var(--text-dim); }
.btn-copy {
  border: 1px solid var(--surface-border); cursor: pointer;
  background: rgba(95, 184, 165, 0.08); color: var(--accent-1);
  font-family: var(--font); font-size: 0.75rem; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; transition: all 0.14s;
}
.btn-copy:hover { background: rgba(95, 184, 165, 0.18); }

.result {
  min-height: 54px;
  padding: 13px;
  border-radius: 7px;
  font-family: var(--mono); font-size: 0.9rem; line-height: 1.55;
  word-break: break-word; white-space: pre-wrap;
  color: var(--accent-1);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--surface-border);
}
.result.placeholder { color: var(--text-dim); font-family: var(--font); }
.result.error { color: var(--warn); border-color: rgba(217, 96, 96, 0.4); font-family: var(--font); }
.meta {
  margin-top: 11px; font-size: 0.76rem; color: var(--text-dim);
  font-family: var(--mono);
}
.meta b { color: var(--accent-1); }

/* ========================================
   Landing cards — bulat lebih, garis ganda hover
   ======================================== */
.hero { text-align: center; padding: 22px 0 6px; }
.hero h1 { font-size: 2.1rem; margin: 0 0 10px; }
.hero h1 span {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-dim); max-width: 56ch; margin: 0 auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-top: 26px;
}
.cipher-card {
  display: block;
  padding: 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: all 0.18s ease;
}
.cipher-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.cipher-card .ico {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.95rem;
  color: var(--accent-1);
  border: 2px solid var(--accent-1);
  margin-bottom: 10px;
  background: transparent;
}
.cipher-card:hover .ico {
  background: var(--accent-1);
  color: var(--bg-0);
}
.cipher-card h3 { margin: 0 0 3px; font-size: 0.92rem; }
.cipher-card p { margin: 0; font-size: 0.75rem; color: var(--text-dim); line-height: 1.4; }
.cipher-card .go {
  margin-top: 9px; font-size: 0.73rem;
  color: var(--text-dim); font-weight: 500;
  transition: color 0.14s;
}
.cipher-card:hover .go { color: var(--accent-1); }

/* ========================================
   Steps
   ======================================== */
.steps {
  margin-top: 20px;
  display: none;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
}
.step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.step:first-child { border-top: none; }
.step .num { color: var(--accent-1) !important; font-weight: 700; font-size: 0.76rem; }
.step .formula { color: #ffffff !important; word-break: break-word; }
.step .char { color: var(--accent-1) !important; font-weight: 800; justify-self: end; font-size: 0.92rem; }

/* ========================================
   Footer
   ======================================== */
.foot {
  text-align: center; padding: 26px 20px 46px;
  color: var(--text-dim); font-size: 0.73rem;
}
.foot b { color: var(--text); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
  .tb-top { padding: 10px 14px 6px; }
  .tb-nav { padding: 0 14px 8px; }
  .tb-nav a { padding: 6px 9px; font-size: 0.75rem; }
  .container { padding: 22px 14px 60px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.5rem; }
}
