:root {
  --bg: #0a0e0a;
  --bg-soft: #0f1410;
  --fg: #c8e6c9;
  --fg-dim: #7a9c7d;
  --green: #00ff88;
  --green-soft: #1aff9c33;
  --amber: #ffb86c;
  --red: #ff5577;
  --blue: #79c0ff;
  --muted: #4a5a4c;
  --mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", Menlo,
    Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, #0e3a2122 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #003a2a22 0%, transparent 60%),
    var(--bg);
  position: relative;
  overflow-x: hidden;
}

a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: var(--green); color: #5eff9f; }

.scanlines {
  pointer-events: none;
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 10;
  mix-blend-mode: overlay;
}
.crt-flicker {
  pointer-events: none;
  position: fixed; inset: 0;
  background: rgba(0,255,136,0.012);
  z-index: 9;
  animation: flicker 3.2s infinite steps(8, end);
}
@keyframes flicker {
  0%,100% { opacity: .6; }
  50% { opacity: 1; }
}

.terminal {
  max-width: 1024px;
  margin: 40px auto;
  background: var(--bg-soft);
  border: 1px solid #1c2a1f;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px #00000080,
    0 30px 80px -20px #00ff8814,
    0 0 120px -40px #00ff8820 inset;
  overflow: hidden;
}

.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #16201a, #0f1611);
  border-bottom: 1px solid #1c2a1f;
  font-size: 12px;
  color: var(--fg-dim);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
.term-bar .title { margin-left: 10px; }

.term-body {
  padding: 22px 26px 8px;
}

.ascii {
  color: var(--green);
  text-shadow: 0 0 12px #00ff8855;
  font-size: 13px;
  line-height: 1.1;
  margin: 4px 0 6px;
  overflow-x: auto;
}

.ar-name {
  font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  color: var(--green);
  text-shadow: 0 0 10px #00ff8855;
  font-size: 22px;
  margin: 0 0 22px;
  letter-spacing: 0.5px;
}

.ar-inline {
  font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  color: var(--fg);
  font-size: 1.05em;
  margin: 0 4px;
}

.line { margin: 4px 0; }
.prompt { color: var(--green); font-weight: 700; }
.path   { color: var(--blue); }

.cursor {
  color: var(--green);
  animation: blink 1s steps(2, start) infinite;
  margin-left: 1px;
}
@keyframes blink { to { visibility: hidden; } }

.output {
  margin: 6px 0 18px;
  padding: 8px 14px;
  background: #0c120e;
  border-left: 2px solid var(--green);
  white-space: pre-wrap;
  color: var(--fg);
  border-radius: 0 6px 6px 0;
  overflow-x: auto;
}

.k       { color: var(--amber); }
.h       { color: var(--green); font-weight: 700; }
.b       { color: #d8ffe6; font-weight: 700; }
.muted   { color: var(--muted); font-style: italic; }
.hl      { color: var(--green); }

.md.output { line-height: 1.65; }

.cmds {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 22px;
}
.cmds button {
  font-family: var(--mono);
  font-size: 13px;
  background: #0d1610;
  color: var(--green);
  border: 1px solid #1f3a28;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s ease;
}
.cmds button:hover {
  background: #112417;
  border-color: var(--green);
  box-shadow: 0 0 14px -2px #00ff8855;
  transform: translateY(-1px);
}
.cmds button.active {
  background: #163322;
  border-color: var(--green);
  color: #c8ffd9;
}

.block.hidden, .hidden { display: none; }
.block { animation: bootIn .25s ease-out; }
@keyframes bootIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.badges img { height: 22px; }

.pub-meta {
  padding: 8px 0 14px;
  border-bottom: 1px dashed #1c2a1f;
  margin-bottom: 12px;
  white-space: pre-line;
  line-height: 1.7;
}

.pub {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed #1c2a1f;
  align-items: start;
}
.pub:last-child { border-bottom: none; }
.pub-fig {
  width: 72px;
  height: 86px;
  color: var(--green);
  border: 1px solid #1f3a28;
  border-radius: 4px;
  background: #0a120c;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  filter: drop-shadow(0 0 6px #00ff8833);
  overflow: hidden;
}
.pub-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  min-height: 0;
}
.pub-icon svg { width: 100%; height: 100%; display: block; }
.pub-figure {
  margin-top: 12px;
  padding: 8px;
  border: 1px solid #1f3a28;
  border-radius: 4px;
  background: #050a07;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px -8px #00ff8844 inset;
}
.pub-figure img {
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  display: block;
  border-radius: 2px;
}
@media (max-width: 560px) {
  .pub-figure img { max-height: 240px; }
}
.pub-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--amber);
  text-align: center;
  padding: 3px 2px;
  border-top: 1px dashed #1f3a28;
  background: #100c06;
  text-transform: uppercase;
}
.pub-type[data-t="journal"]      { color: var(--green); background: #0b1a0f; }
.pub-type[data-t="conference"]   { color: var(--amber); }
.pub-type[data-t="workshop"]     { color: var(--blue);  }
.pub-type[data-t="patent"]       { color: #ff9eb5; background: #1a0c11; }
.pub-type[data-t="dissertation"] { color: #d8ffe6; background: #0c2014; }
.pub-main { min-width: 0; }
.pub-head {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: baseline;
}
.pub-year   { color: var(--amber); font-weight: 700; }
.pub-title  { color: var(--green); font-weight: 700; line-height: 1.35; }
.pub-cites  { color: var(--amber); font-size: 12px; white-space: nowrap; }
.pub-authors{ color: var(--fg-dim); font-size: 13px; margin-top: 4px; }
.pub-authors b { color: #d8ffe6; }
.pub-venue  { color: var(--muted); font-size: 13px; font-style: italic; }
.pub-summary{
  color: var(--fg);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 6px;
  padding-left: 10px;
  border-left: 2px solid #1f3a28;
}

@media (max-width: 560px) {
  .pub { grid-template-columns: 60px 1fr; gap: 10px; }
  .pub-fig { width: 56px; height: 72px; }
  .pub-icon { padding: 4px; }
  .pub-type { font-size: 7.5px; letter-spacing: 0.8px; }
  .pub-head { grid-template-columns: 44px 1fr auto; gap: 6px; }
}

.disclaimer {
  border-left-color: var(--amber);
  background: #1a140c;
  color: #ffdcaa;
}

.repo {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #1c2a1f;
}
.repo:last-child { border-bottom: none; }
.repo .name { color: var(--green); font-weight: 700; }
.repo .lang { color: var(--blue); font-size: 12px; }
.repo .stars { color: var(--amber); font-size: 12px; }
.repo .desc { color: var(--fg-dim); font-size: 13px; }

.post {
  padding: 8px 0;
  border-bottom: 1px dashed #1c2a1f;
}
.post:last-child { border-bottom: none; }
.post .title { color: var(--green); font-weight: 700; }
.post .meta  { color: var(--muted); font-size: 12px; }
.post .snip  { color: var(--fg-dim); font-size: 13px; margin-top: 4px; }

.footer-line { color: var(--fg-dim); margin-top: 24px; }

.term-foot {
  padding: 10px 18px;
  border-top: 1px solid #1c2a1f;
  background: #0c1310;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

::selection { background: var(--green-soft); color: #eaffef; }

@media (max-width: 720px) {
  body { font-size: 13.5px; }
  .terminal { margin: 0; border-radius: 0; }
  .ascii { font-size: 8px; }
  .term-body { padding: 16px 14px 4px; }
  .cmds button { font-size: 12px; padding: 6px 9px; }
}
