/* Interactive terminal (home page) */

.term {
  background: var(--ph-0);
  border: 1px solid var(--accent-40);
  border-radius: 6px;
  box-shadow: 0 0 12px var(--accent-08);
  padding: 1em;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.92em;
  text-align: left;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-40) transparent;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.4em;
}

.term-line a {
  color: var(--accent);
}

.term-dim {
  color: var(--fg-dim);
}

.term-err {
  color: var(--err);
}

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

.term-dir {
  color: var(--accent);
  font-weight: bold;
  text-decoration: none;
}

.term-dir:hover {
  text-decoration: underline;
}

.term-prompt-row {
  display: flex;
  align-items: baseline;
  margin-top: 0.2em;
}

.term-prompt {
  white-space: nowrap;
  cursor: text;
}

.term-user {
  color: var(--accent);
}

.term-path {
  color: var(--amber);
}

.term-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
  caret-color: var(--accent);
  padding: 0;
}

/* Chips: tappable commands for touch users */
.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.8em;
}

.term-chip {
  background: none;
  border: 1px solid var(--accent-40);
  border-radius: 999px;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82em;
  padding: 0.25em 0.9em;
  cursor: pointer;
  transition: background 0.15s;
}

.term-chip:hover {
  background: var(--accent-15);
}

@media (max-width: 700px) {
  .term {
    min-height: 200px;
    max-height: 320px;
    font-size: 0.85em;
  }
}

/* Projects page terminal */
.term-tall {
  max-height: 65vh;
  min-height: 380px;
}

.proj-stars {
  color: var(--amber);
}

.term-cat-body {
  color: var(--fg);
}

/* Narrow screens: drop the permissions column so ls rows fit one line */
@media (max-width: 480px) {
  .proj-perm {
    display: none;
  }
}

/* Home MOTD: login-style status block of living signals */
.term-motd {
  display: none;
  margin-top: 1em;
  background: var(--ph-1);
  border: 1px solid var(--accent-08);
  border-radius: 6px;
  padding: 0.7em 1em;
  font-size: 0.88em;
  box-shadow: var(--bezel);
}

.term-motd.visible {
  display: block;
}

.term-motd-line {
  min-height: 1.5em;
}

.term-motd-label {
  color: var(--fg-dim);
}

.term-motd-value {
  color: var(--fg);
}

a.term-motd-value {
  color: var(--accent);
  text-decoration: none;
}

a.term-motd-value:hover {
  text-decoration: underline;
}

/* README rendering inside cat output */
.term-cat-body img {
  max-width: 100%;
  border-radius: 4px;
  display: block;
  margin: 0.5em 0;
}

.term-cat-body h1,
.term-cat-body h2,
.term-cat-body h3 {
  color: var(--accent);
  font-size: 1.05em;
  margin: 0.8em 0 0.3em;
}

.term-cat-body pre {
  background: var(--ph-1);
  border: 1px solid var(--accent-08);
  border-radius: 4px;
  padding: 0.6em;
  overflow-x: auto;
}

.term-cat-body code {
  color: var(--amber);
}

/* Clickable command mentions */
.term-cmd {
  text-decoration: none;
  cursor: pointer;
}

.term-cmd:hover {
  text-decoration: underline;
}

/* Site-wide command palette (Ctrl/Cmd+K) */
.term-overlay-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, 0.75);
  z-index: 2000;
}

.term-overlay-backdrop.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1em 0;
}

.term-overlay {
  width: 100%;
  max-width: 640px;
  max-height: 60vh;
  min-height: 0;
  box-shadow: 0 0 24px var(--accent-15), 0 12px 48px rgba(0, 0, 0, 0.6);
  animation: palette-in 0.12s ease-out;
}

@keyframes palette-in {
  from { transform: translateY(-8px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .term-overlay { animation: none; }
}

.nav-term-btn {
  background: none;
  border: 1px solid var(--accent-40);
  color: var(--accent);
  font-family: "Fira Code", monospace;
  font-size: 0.85em;
  border-radius: 4px;
  padding: 0.15em 0.5em;
  cursor: pointer;
}

.nav-term-btn:hover {
  background: var(--accent-15);
}

/* rm -rf /: the show */
@keyframes meltdown-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2px, -1px) rotate(0.15deg); }
  50% { transform: translate(-2px, 1px) rotate(-0.2deg); }
  75% { transform: translate(1px, 2px) rotate(0.1deg); }
  100% { transform: translate(-1px, -1px) rotate(0deg); }
}

body.melting {
  animation: meltdown-shake 0.25s linear infinite;
}

.meltdown-blackout {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.6s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
}

.meltdown-blackout.on {
  opacity: 1;
}

.meltdown-panic {
  font-family: "Fira Code", monospace;
  color: var(--err);
  font-size: 0.95em;
  max-width: 560px;
  padding: 1em;
  line-height: 1.8;
}

.meltdown-panic.recovery {
  color: var(--accent);
  text-shadow: var(--bloom);
}

@media (prefers-reduced-motion: reduce) {
  body.melting { animation: none; }
  .meltdown-blackout { transition: none; }
}

.meltdown-continue {
  color: var(--fg-dim);
}

.meltdown-blink {
  animation: blink-cursor 1s steps(2, start) infinite;
}

/* Day-card photo thumbs in the scrollback */
.term-day-photos {
  display: flex;
  gap: 6px;
  padding: 4px 0;
}

.term-day-photos img {
  height: 64px;
  width: auto;
  border-radius: 4px;
  border: 1px solid var(--accent-08);
  display: block;
}

.term-day-photos a:hover img {
  border-color: var(--accent-40);
}
