/* ===========================================================
   Rashid Alyassi — clean monochrome terminal theme
   Palette: Anthropic / Claude warm greys (from claude.com),
   dark surface, minimal accent. Flat and modern.
   =========================================================== */

:root {
  /* Anthropic "gray" ramp — warm, not cool/purple */
  --bg: #141413;          /* page background (gray-950) */
  --screen: #1a1918;      /* terminal surface (gray-900) — a step lighter than the page */
  --surface-2: #1f1e1d;   /* title bar (gray-850) */
  --fg: #f5f4ed;          /* primary text (gray-100) */
  --fg-dim: #9c9a92;      /* secondary text (gray-450) */
  --muted: #87867f;       /* muted / meta (gray-500) */
  --border: #30302e;      /* borders (gray-750) */
  --accent: #c2c0b6;      /* subtle light accent (gray-350) */
  --accent-1: #58b0a0;    /* prompt host — teal */
  --accent-2: #d9a441;    /* prompt path / link icons / cursor — amber */
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(0.75rem, 3vw, 1.5rem);
}

/* CRT overlay disabled — kept in markup for easy re-enable */
.crt { display: none; }

/* ---------- terminal window ---------- */
.terminal {
  width: 100%;
  max-width: 880px;
  background: var(--screen);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--fg-dim);
}
/* Linux/GNOME-style window controls: subtle round buttons with symbols */
.dots { display: inline-flex; gap: 0.45rem; }
.dots i {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 9px;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}
.dots i:nth-child(1)::before { content: "\2013"; } /* minimize */
.dots i:nth-child(2)::before { content: "\25A1"; } /* maximize */
.dots i:nth-child(3)::before { content: "\2715"; } /* close */
.dots i:hover { background: rgba(255, 255, 255, 0.16); color: var(--fg); }
.dots i:nth-child(3):hover { background: #b5524a; color: #fff; }
.titlebar .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.04em;
}
.titlebar .clock, .titlebar .cpu { font-variant-numeric: tabular-nums; }
.titlebar .cpu { color: var(--fg-dim); }

.screen {
  padding: clamp(1rem, 4vw, 1.5rem);
}

/* ---------- banner ---------- */
.banner {
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;   /* centers each word on its own */
  animation: banner-print 0.75s ease both;  /* boots in top→bottom on load */
}
@keyframes banner-print {
  0%   { clip-path: inset(0 0 100% 0); opacity: 0.4; }
  100% { clip-path: inset(0 0 0 0);    opacity: 1; }
}
.banner-word {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1;
  font-size: clamp(6px, 1.9vw, 15px);
  white-space: pre;
  /* clean static greyscale fill — brushed-metal look on the block art */
  background: linear-gradient(135deg, #faf9f5, #d1cfc5 55%, #9c9a92);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---------- terminal session blocks ---------- */
.block { margin: 0 0 0.85rem; }
.line { margin: 0 0 0.35rem; }
/* prompt: user@host bright, : and $ dim, ~ path accent */
.prompt { font-weight: 700; }
.prompt .ph { color: var(--accent-1); } /* user@host — teal */
.prompt .pc { color: var(--muted); }    /* the : and $ */
.prompt .pp { color: var(--accent-2); } /* the ~ path — amber */
.typed { color: var(--fg); }

/* outputs are revealed by JS after the command "types"; without JS they stay visible */
.output { padding-left: 0.25rem; }
.js .output { opacity: 0; transition: opacity 0.35s ease; }
.js .output.show { opacity: 1; }

.name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  line-height: 1.1;
  margin: 0.2rem 0 0;
  color: #faf9f5;
  letter-spacing: -0.01em;
}
.tagline { margin: 0.25rem 0 0; color: var(--fg-dim); letter-spacing: 0.04em; }
.bio { margin: 0.5rem 0 0; max-width: 60ch; color: #c2c0b6; }
.muted { color: var(--muted); }

/* ---------- links ---------- */
.links { list-style: none; margin: 0; padding: 0; }
.links li { margin: 0.25rem 0; }
.link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--fg);
  padding: 0.25rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all 0.12s ease;
}
.link .ico { color: var(--accent-2); font-weight: 700; }
.link .lbl { min-width: 5.5rem; }
.link .url { color: var(--muted); font-size: 0.9em; }
.link:hover, .link:focus-visible {
  background: rgba(88, 176, 160, 0.10);
  border-color: rgba(88, 176, 160, 0.5);
  outline: none;
}
.link:hover .url, .link:focus-visible .url { color: var(--fg-dim); }

/* ---------- publications (kept for when re-enabled) ---------- */
.pubs { margin-top: 0.25rem; }
.pubs-head {
  color: var(--fg-dim);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}
.pubs-head a { color: var(--accent); }
.pub {
  padding: 0.55rem 0 0.55rem 0.9rem;
  border-left: 2px solid var(--border);
  margin: 0 0 0.55rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.pub:hover { border-left-color: var(--accent); background: rgba(255, 255, 255, 0.03); }
.pub-title { margin: 0; }
.pub-title a { color: var(--fg); text-decoration: none; }
.pub-title a:hover { color: #fff; text-decoration: underline; }
.pub-meta { color: var(--muted); font-size: 0.88rem; margin: 0.15rem 0 0; }
.pub-cite {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.4rem;
}

/* ---------- cursor + footer ---------- */
.footer-prompt { margin: 0.75rem 0 0; }
.js .footer-prompt { opacity: 0; transition: opacity 0.3s; }
.js .footer-prompt.show { opacity: 1; }
.cursor {
  color: var(--accent-2);
  /* "phase" blink: hold solid, smooth fade out, hold off, smooth fade back in */
  animation: cursor-blink 1.2s ease-in-out infinite;
}
@keyframes cursor-blink {
  0%, 38%  { opacity: 1; }
  50%, 88% { opacity: 0; }
  100%     { opacity: 1; }
}

.page-footer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.page-footer a { color: var(--fg-dim); }

/* ---------- interactive terminal (REPL) ---------- */
#terminal { margin: 1.25rem 0 0; }
.js #terminal { opacity: 0; transition: opacity 0.4s ease; }
.js #terminal.show { opacity: 1; }
.term-log { display: flex; flex-direction: column; gap: 0.55rem; }
.term-echo { margin: 0; }
.term-cmd { color: var(--fg); }
.term-out {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg-dim);
  line-height: 1.7;
}
.term-out a { color: var(--accent-1); text-decoration: none; }
.term-out a:hover { color: var(--accent-2); text-decoration: underline; }
.term-out code, .term-hint code { color: var(--accent-2); }
.term-err { color: #d98a72; }
.nf-k { color: var(--accent-1); }
.nf-accent { color: var(--accent-2); font-weight: 700; }

.term-input-line {
  position: relative;
  margin: 0.7rem 0 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  cursor: text;            /* whole bar is the click target */
}
.term-input-line:focus-within { border-color: var(--accent-1); } /* teal when active */
.term-typed { color: var(--fg); white-space: pre-wrap; word-break: break-word; }
.term-field {
  position: absolute;
  inset: 0;                /* covers the entire bar interior, so any click focuses it */
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: inherit;
  cursor: text;
}
.term-field:focus { outline: none; }

.term-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.8rem 0 0; }
.term-chip {
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.term-chip:hover { border-color: var(--accent-1); color: var(--fg); }
.term-chip-accent { border-color: var(--accent-1); color: var(--accent-1); }
.term-hint { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.85rem; }
.term-entry { display: flex; flex-direction: column; gap: 0.4rem; }
.ls-dir { color: var(--accent-1); }
.ls-app { color: var(--accent-2); font-weight: 700; }

/* ---------- crowdnav demo widget ---------- */
.cn-widget {
  margin: 0.5rem 0 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #141413;
}
.cn-stage { line-height: 0; }
.cn-canvas { width: 100%; display: block; }
.cn-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.cn-btn {
  font: inherit;
  font-size: 0.8rem;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.cn-btn:hover { border-color: var(--accent-1); color: var(--fg); }
.cn-slider { display: inline-flex; align-items: center; gap: 6px; }
.cn-slider input[type="range"] { accent-color: var(--accent-1); width: 120px; vertical-align: middle; }
.cn-hud { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- accessibility: cut the motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cursor, .banner { animation: none; }
}
