:root {
  --bg: #0B0B0D;
  --surface: #141416;
  --surface-hover: #1A1A1D;
  --border: #232327;
  --text: #F2F1ED;
  --text-muted: #8C8B92;
  --accent: #E7B65C;
  --accent-soft: rgba(231, 182, 92, 0.12);
  --accent-soft-2: rgba(231, 182, 92, 0.28);
  --danger: #E4626F;
  --success: #6FCF97;
  --radius: 14px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

body { background: transparent; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
}

.bg-video__overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,11,13,0.82);
  z-index: -1;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% -10%, rgba(231,182,92,0.07), transparent 40%),
                     radial-gradient(circle at 90% 10%, rgba(231,182,92,0.04), transparent 35%);
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-soft-2); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11,11,13,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

.brand__mark {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

.brand__name {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand__badge { color: var(--accent); }

.searchwrap {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color .15s ease;
}

.searchwrap:focus-within {
  border-color: var(--accent-soft-2);
}

.searchwrap__icon { color: var(--text-muted); flex-shrink: 0; }

#tool-search {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100%;
}

#tool-search::placeholder { color: var(--text-muted); }

.contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 10px;
  transition: color .15s ease, border-color .15s ease;
  flex-shrink: 0;
}

.contact:hover { color: var(--accent); border-color: var(--accent-soft-2); }

/* ---------- Main / Hero ---------- */
main {
  flex: 1;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px 60px;
  position: relative;
  z-index: 1;
}

.view--hidden { display: none; }

.hero {
  padding: 64px 0 40px;
  max-width: 640px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Tool grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card:hover {
  border-color: var(--accent-soft-2);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.card__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__title {
  font-weight: 600;
  font-size: 1rem;
}

.card__desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.card.hidden { display: none; }

/* ---------- Tool panel ---------- */
.backbtn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 24px 0 10px;
}

.backbtn:hover { color: var(--accent); }

.panel {
  padding-bottom: 20px;
}

.panel__title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.panel__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.field {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.field input[type="text"],
.field input[type="url"],
.field select {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.field input:focus, .field select:focus { border-color: var(--accent-soft-2); }

.field input[type="file"] {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.btn {
  background: var(--accent);
  color: #0B0B0D;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: filter .15s ease;
  flex-shrink: 0;
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; cursor: wait; }

.btn--ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}

.result-area {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-msg {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.status-msg--error { color: var(--danger); border-color: rgba(228,98,111,0.3); background: rgba(228,98,111,0.06); }
.status-msg--ok { color: var(--success); border-color: rgba(111,207,151,0.3); background: rgba(111,207,151,0.06); }

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
}

.result-card img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: #000;
}

.result-card__body { flex: 1; min-width: 0; }

.result-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.result-card__meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin: 0 0 10px;
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.chip:hover { border-color: var(--accent-soft-2); color: var(--accent); }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.list-item:last-child { border-bottom: none; }

.iframe-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.badge-verified-inline {
  display: inline-flex;
  color: var(--accent);
  vertical-align: -2px;
  margin-left: 4px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 24px 20px 36px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  position: relative;
  z-index: 1;
}

.footer strong { color: var(--text); }
.footer .dot { margin: 0 8px; }
.footer a:hover { color: var(--accent); }

.dev-card {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  text-align: left;
}

.dev-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.dev-card__name {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dev-card__badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.dev-card__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dev-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 0.68rem;
}

.dev-card__links a {
  color: var(--accent);
  opacity: 0.85;
}

.dev-card__links a:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 560px) {
  .topbar__inner { gap: 10px; }
  .contact span { display: none; }
  .searchwrap { max-width: none; }
}

/* ---------- Robot mascot ---------- */
.robot-mascot {
  position: fixed;
  width: 84px;
  height: 90px;
  z-index: 50;
  cursor: pointer;
  transition: left 1.1s cubic-bezier(.4,0,.2,1), top 1.1s cubic-bezier(.4,0,.2,1), transform .25s ease;
  animation: robot-bob 3.2s ease-in-out infinite;
  user-select: none;
}

.robot-mascot:hover { transform: scale(1.08); }
.robot-mascot:active { transform: scale(0.95); }

.robot-mascot__svg { width: 100%; height: 100%; overflow: visible; }

.robot-glow { transition: stroke .3s ease, fill .3s ease; filter: drop-shadow(0 0 4px currentColor); }
.robot-eye, .robot-mouth { transition: d .25s ease, stroke .3s ease; }

.robot-arm { transform-origin: 8px 77px; transition: transform .3s ease; }
.robot-arm--wave { animation: robot-wave 0.5s ease-in-out infinite; }

.robot-mascot--marah { animation: robot-bob 3.2s ease-in-out infinite, robot-shake .35s ease-in-out 3; }
.robot-mascot--ngambek .robot-head { transform: rotate(-8deg) translateX(-3px); }
.robot-mascot--ngambek { opacity: 0.82; }

.robot-mascot__bubble {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.robot-mascot__bubble--show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes robot-bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -6px; }
}

@keyframes robot-wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-24deg); }
}

@keyframes robot-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 560px) {
  .robot-mascot { width: 64px; height: 70px; }
}

/* ---------- Dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.dash-card__value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
}

.dash-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.dash-chart {
  width: 100%;
  height: 180px;
  display: block;
}

.dash-routes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
