/* ============================================================
   Tema gelap elegan (aksen emas, judul serif)
   ============================================================ */
:root {
  --bg: #14151c;
  --bg-soft: #191b24;
  --surface: #1d1f2a;
  --ink: #ece8df;
  --muted: #9b968c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #d6a84a;        /* satu aksen: emas hangat */
  --accent-soft: rgba(214, 168, 74, 0.14);
  --accent-deep: #c2922f;
  --danger: #e08379;
  --radius: 14px;
  --font: 'Mulish', system-ui, -apple-system, Segoe UI, sans-serif;
  --head: 'Playfair Display', Georgia, serif;
  --mono: 'Space Mono', ui-monospace, Consolas, monospace;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(700px 380px at 50% -10%, rgba(214, 168, 74, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 28px;
  background: rgba(20, 21, 28, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--head); font-weight: 700; font-size: 1.2rem;
  letter-spacing: 0.3px; margin-right: auto; color: var(--ink);
}
.brand .logo {
  width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 8px;
  font-family: var(--head); font-weight: 700; font-size: 1rem;
  background: var(--accent); color: #1a1304;
}

.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 9px;
  font-size: 0.88rem; font-weight: 600; color: var(--muted);
  border: 1px solid transparent; transition: all 0.15s ease;
}
.nav-links a .badge {
  width: 20px; height: 20px;
  display: grid; place-items: center; border-radius: 5px;
  font-size: 0.68rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.07); color: var(--muted);
  font-family: var(--mono);
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft);
  border-color: rgba(214, 168, 74, 0.3); }
.nav-links a.active .badge { background: var(--accent); color: #1a1304; }

/* ---------- Layout ---------- */
.container { max-width: 840px; margin: 0 auto; padding: 46px 22px 72px; }

.page-head { margin-bottom: 26px; }
.page-head .eyebrow {
  display: inline-block; font-size: 0.7rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
  margin-bottom: 12px; font-family: var(--mono);
}
.page-head h1 {
  font-family: var(--head); margin: 0 0 10px; font-size: 2.2rem;
  line-height: 1.15; font-weight: 700; color: var(--ink);
}
.page-head h1 span { color: var(--accent); font-style: italic; }
.page-head p { margin: 0; color: var(--muted); max-width: 62ch; font-size: 0.96rem; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

/* ---------- Toggle ---------- */
.toggle {
  display: inline-flex; padding: 4px; gap: 3px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--bg-soft); margin-bottom: 22px;
}
.toggle button {
  border: 0; cursor: pointer; padding: 9px 22px; border-radius: 8px;
  font-family: var(--font); font-size: 0.88rem; font-weight: 700;
  color: var(--muted); background: transparent; transition: all 0.15s ease;
}
.toggle button.active { color: #1a1304; background: var(--accent); }

/* ---------- Form ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.74rem; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px; font-weight: 700;
}
.grid { display: grid; gap: 18px; }
.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.95rem; color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 96px; font-family: var(--mono); font-size: 0.9rem; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 168, 74, 0.16);
}
select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.matrix-grid { display: grid; gap: 10px; max-width: 310px; }
.matrix-grid input { text-align: center; font-family: var(--mono); }

/* ---------- Button ---------- */
.btn {
  border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.92rem;
  color: #1a1304; padding: 13px 28px; border-radius: 10px;
  background: var(--accent); transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: translateY(1px); }

/* ---------- Result ---------- */
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 10px;
}
.result-head span {
  font-size: 0.74rem; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.btn-copy {
  border: 1px solid var(--line-strong); cursor: pointer;
  background: transparent; color: var(--accent);
  font-family: var(--font); font-size: 0.78rem; font-weight: 700;
  padding: 6px 14px; border-radius: 8px; transition: all 0.15s;
}
.btn-copy:hover { background: var(--accent-soft); border-color: var(--accent); }
.result {
  min-height: 60px; padding: 16px;
  border-radius: 10px; background: #121319;
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.92rem; line-height: 1.6;
  color: #f0d9a8; word-break: break-word; white-space: pre-wrap;
}
.result.placeholder { color: var(--muted); font-family: var(--font); }
.result.error { color: var(--danger); background: #241619;
  border-color: rgba(224, 131, 121, 0.4); font-family: var(--font); }
.meta { margin-top: 12px; font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.meta b { color: var(--accent); font-weight: 700; }

/* ---------- Landing ---------- */
.hero { padding: 22px 0 6px; }
.hero h1 { font-family: var(--head); font-size: 2.8rem; margin: 0 0 14px;
  font-weight: 700; }
.hero h1 span { color: var(--accent); font-style: italic; }
.hero p { color: var(--muted); max-width: 58ch; margin: 0; font-size: 1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 16px; margin-top: 36px; }
.cipher-card {
  display: block; padding: 24px;
  border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cipher-card:hover { transform: translateY(-4px); border-color: rgba(214, 168, 74, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4); }
.cipher-card .ico {
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--head); font-weight: 700; font-size: 1.2rem;
  color: var(--accent); background: var(--accent-soft); margin-bottom: 16px;
}
.cipher-card h3 { font-family: var(--head); margin: 0 0 7px; font-size: 1.15rem;
  font-weight: 700; }
.cipher-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }
.cipher-card .go { margin-top: 16px; font-size: 0.8rem; color: var(--accent);
  font-weight: 700; }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 30px 20px 48px; color: var(--muted);
  font-size: 0.82rem; border-top: 1px solid var(--line); margin-top: 12px; }
.foot b { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 2.1rem; }
  .nav { padding: 11px 16px; }
  .brand .full { display: none; }
}

/* ---------- Rincian langkah (HASIL PROSES) ---------- */
.steps { margin-top: 16px; display: flex; flex-direction: column; }
.step {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center;
  padding: 9px 2px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.84rem;
}
.step .num { color: var(--muted); text-align: right; font-size: 0.78rem; }
.step .formula { color: var(--ink); word-break: break-word; }
.step .char { color: var(--accent); font-weight: 700; justify-self: end; }

/* ---------- Field kunci Polyalphabetic ---------- */
.keys { display: flex; flex-direction: column; gap: 8px; }
.key-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.key-label {
  font-family: var(--mono); font-size: 0.76rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
