@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700&display=swap');

:root {
  --text-color: rgba(255, 255, 255, 0.9);
  --dim-text-color: rgba(255, 255, 255, 0.35);
  --background-color: #0c0c0c;
  --cursor-color: rgba(255, 255, 255, 0.85);
  --link-color: #83a6ff;
  --error-color: #ff735a;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 255, 255, 0.15);
}

/* Gradient orbs */
.orb-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  width: 50vmax;
  height: 50vmax;
  top: -30vmax;
  left: 50%;
  opacity: 0.7;
}

.orb-1 {
  background: #ebdf8733;
  animation: orbit 8s linear infinite;
}

.orb-2 {
  background: #00c8ff22;
  animation: rorbit 12s linear infinite;
}

.orb-3 {
  background: #feb6ff22;
  animation: rorbit 10s linear infinite;
}

@keyframes orbit {
  0%   { transform: rotate(0deg) translateX(12vmin) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(12vmin) rotate(-360deg); }
}

@keyframes rorbit {
  0%   { transform: rotate(360deg) translateX(12vmin) rotate(-360deg); }
  100% { transform: rotate(0deg) translateX(12vmin) rotate(0deg); }
}

/* Terminal */
.terminal {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  max-width: 760px;
}

/* Prompt */
.prompt {
  margin-top: 1em;
  white-space: pre-wrap;
  word-break: break-word;
}

.dim {
  color: var(--dim-text-color);
}

/* Input line */
.prompt-input-line {
  display: flex;
  align-items: baseline;
  margin-top: 1em;
  white-space: pre;
}

.prompt-input-wrap {
  position: relative;
  display: inline;
}

.prompt-input {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  padding: 0;
  outline: none;
  caret-color: transparent;
  width: 20ch;
  min-width: 1ch;
}

/* Cursor that follows text */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  background: var(--cursor-color);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Output */
.output {
  white-space: pre-wrap;
  word-break: break-word;
}

.output p {
  margin-bottom: 0.6em;
}

.output p:last-child {
  margin-bottom: 0;
}

/* ls grid */
.ls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13ch, 1fr));
  gap: 0.15em 2ch;
  margin: 0.4em 0;
}

.ls-item {
  cursor: pointer;
  color: var(--text-color);
  transition: color 0.1s;
}

.ls-item:hover {
  color: var(--link-color);
}

/* Diary/content rendered */
.diary-content {
  margin: 0.6em 0;
  line-height: 1.7;
}

.diary-content p {
  margin-bottom: 0.6em;
}

.diary-content p:last-child {
  margin-bottom: 0;
}

.diary-content strong {
  font-weight: 700;
  color: var(--text-color);
}

/* Header */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.5em;
}

.terminal-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.terminal-title {
  font-weight: 400;
  font-size: 0.9em;
}

/* Typewriter animation */
.typewriter {
  overflow: hidden;
}

.typewriter-char {
  opacity: 0;
  animation: char-appear 0.02s forwards;
}

@keyframes char-appear {
  to { opacity: 1; }
}

/* Auth */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--background-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-terminal {
  max-width: 400px;
  width: 100%;
  padding: 1.5rem;
}

.auth-terminal .prompt {
  margin-top: 0.6em;
}

.auth-input {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
  margin-left: 1ch;
  outline: none;
  caret-color: var(--cursor-color);
  width: auto;
}

.auth-input::placeholder {
  color: var(--dim-text-color);
}

.auth-error {
  color: var(--error-color);
  margin-top: 0.6em;
}

/* Scanline overlay - subtle */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Mobile */
@media (max-width: 640px) {
  html { font-size: 13px; }
  .terminal { padding: 1rem; }
  .ls-grid { grid-template-columns: repeat(auto-fill, minmax(12ch, 1fr)); }
}
