/* ============================================================
   KankBowo — Interactive terminal mode
   Warna mengikuti token situs utama agar identitasnya sama.
   ============================================================ */

:root {
  --bg: #0a0d0a;
  --fg: #d6d6d6;
  --green: #5fd75f;
  --green-dim: #4e9a06;
  --blue: #3daee9;
  --yellow: #c4a000;
  --red: #e34234;
  --muted: #6b6b6b;
  --mono: 'JetBrains Mono', ui-monospace, 'Ubuntu Mono', 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---- slim navigation bar above the console ---- */
.tty-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 18px;
  background: #070a07;
  border-bottom: 1px solid #1b241b;
  font-size: 12.5px;
}
.tty-bar__label { color: var(--muted); }
.tty-bar a {
  color: var(--blue);
  text-decoration: none;
  border: 1px solid #1b241b;
  border-radius: 6px;
  padding: 4px 9px;
  transition: color .16s ease, border-color .16s ease;
}
.tty-bar a:hover { color: var(--green); border-color: var(--green-dim); }
.tty-bar__spacer { margin-left: auto; }

/* ---- CRT wrapper: subtle scanlines + vignette + flicker ---- */
.crt-wrap {
  position: relative;
  min-height: calc(100vh - 44px);
  padding: 22px 20px 40px;
  overflow-x: hidden;
}
.crt-wrap::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(255, 255, 255, .028) 0px,
    rgba(255, 255, 255, .028) 1px,
    transparent 1px,
    transparent 3px);
  z-index: 5;
  mix-blend-mode: overlay;
}
.crt-wrap::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .55) 100%);
  z-index: 6;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: .94; }
  94% { opacity: 1; }
  97% { opacity: .97; }
}

#terminal {
  animation: flicker 7s infinite;
  max-width: 900px;
  margin: 0 auto;
  min-height: calc(100vh - 100px);
  position: relative;
  z-index: 1;
  cursor: text;
}

#output {
  white-space: pre-wrap;
  word-break: break-word;
  padding-bottom: 6px;
}

#output .line { opacity: 0; animation: reveal .05s forwards; }
@keyframes reveal { to { opacity: 1; } }

/* ---- semantic text roles ---- */
.k-user, .k-host { color: var(--green); font-weight: 700; }
.k-at, .k-sep { color: var(--fg); }
.k-path { color: var(--blue); font-weight: 700; }
.k-cmd { color: #fff; }
.k-boot-ok { color: var(--green-dim); }
.k-boot-warn { color: var(--yellow); }
.k-boot-tag { color: var(--muted); }
.k-heading { color: var(--blue); font-weight: 700; }
.k-accent { color: var(--green); font-weight: 700; }
.k-muted { color: var(--muted); }
.k-err { color: var(--red); }
.k-warn { color: var(--yellow); }
.k-link { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.k-link:hover { color: #7cd4ff; }
.k-tag {
  color: #111;
  background: var(--green);
  padding: 0 6px;
  border-radius: 2px;
  margin-right: 4px;
  display: inline-block;
  font-size: .85em;
}
.k-ascii { color: var(--green); font-weight: 700; }
.ascii-block { white-space: pre; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 1em; line-height: 1.15; }
.k-divider { color: var(--muted); }

@media (max-width: 520px) {
  .ascii-block { font-size: .62em; }
}

/* ---- input line ---- */
.input-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  position: relative;
}

.prompt { white-space: pre; flex-shrink: 0; }
.typed { color: #fff; white-space: pre-wrap; word-break: break-word; }

.cursor {
  color: var(--green);
  animation: blink 1s steps(1) infinite;
  margin-left: 1px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Input tetap di atas area ketik (jangan off-screen: mobile keyboard butuh fokus in-viewport) */
.cmd-input {
  position: absolute;
  opacity: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  outline: none;
  font-size: 16px; /* cegah auto-zoom di iOS Safari */
}

::selection { background: var(--green-dim); color: #000; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #1c261c; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

@media (max-width: 600px) {
  html, body { font-size: 12.5px; }
  .crt-wrap { padding: 14px 12px 28px; }
  .tty-bar { padding: 8px 12px; font-size: 11.5px; }
}

@media (max-width: 380px) {
  html, body { font-size: 11px; }
}
