:root {
  --bg:        #0a1124;
  --bg-card:   #0d1530;
  --bg-sidebar:#080e1e;
  --border:    #1a2540;
  --text:      #eec49a;
  --text-dim:  #a6896b;
  --accent:    #F6A73B;
  --green:     #FAD32F;
  --blue:      #F35645;
  --secondary: #d4a87a;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  --font-sans: "Inter", system-ui, sans-serif;
  --sidebar-w: 280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-inner {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100%;
}

/* Prompt line above name */
.prompt-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-bottom: 0.4rem;
  opacity: 0.6;
}
.prompt-user  { color: var(--green); }
.prompt-at    { color: var(--text-dim); }
.prompt-host  { color: var(--blue); }
.prompt-sep   { color: var(--text-dim); }
.prompt-path  { color: var(--blue); }
.prompt-dollar{ color: var(--text-dim); }

.site-name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8e8e8;
  letter-spacing: 0.01em;
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.site-role {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
}

/* Sidebar nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.sidebar-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  padding: 0.2rem 0;
  transition: color 0.15s;
}
.sidebar-nav a:hover { color: var(--accent); text-decoration: none; }

/* Sidebar about */
.sidebar-about p {
  font-size: 0.82rem;
  color: var(--secondary);
  line-height: 1.6;
}
.sidebar-about p + p { margin-top: 0.75rem; }

/* Sidebar crates */
.sidebar-crates {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.sidebar-crates .dim {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.sidebar-crates a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green);
}
.sidebar-crates a:hover { text-decoration: underline; }

/* ── Content ── */
.content {
  width: 780px;
  flex-shrink: 0;
  min-width: 0;
  padding: 3rem 3.5rem 4rem;
}

.content-section { margin-bottom: 3.5rem; }

/* Section labels — terminal prompt style */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.section-label .prompt-path { color: var(--blue); }
.section-label .prompt-dollar { color: var(--text-dim); }

/* About section */
#about p + p { margin-top: 1rem; }

/* ── Projects ── */
.project {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: none; }

.project h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: #e8e8e8;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.proj-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(246, 167, 59, 0.4));
}

.project-tagline {
  font-size: 0.88rem;
  color: var(--secondary);
  margin-bottom: 1rem;
  font-style: italic;
}

.project p + p { margin-top: 0.85rem; }
.project strong { color: #e8e8e8; }

.project-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--secondary);
  margin-top: 1rem !important;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
}
.project-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ── Code blocks ── */
pre.inline-code {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #d4d4d4;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

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

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── Publications ── */
.pub-group { margin-bottom: 2rem; }

.pub-group-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--green);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.pub-list li em { color: var(--text); font-style: italic; }

.pub-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.pub-list li a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pub-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
footer .dim { color: var(--text-dim); }

/* ── Terminal panel ── */
.terminal-panel {
  flex: 1;
  min-width: 260px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(160deg, rgba(10,17,36,0.92) 0%, rgba(6,10,24,0.97) 100%);
  border-left: 1px solid rgba(250, 211, 47, 0.35);
  box-shadow: -2px 0 24px rgba(246, 167, 59, 0.12), -1px 0 6px rgba(250, 211, 47, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 1rem;
  overflow: hidden;
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(10, 17, 36, 0.6);
  border-bottom: 1px solid rgba(250, 211, 47, 0.2);
  flex-shrink: 0;
}

.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot-red    { background: #ff5f57; }
.term-dot-yellow { background: #febc2e; }
.term-dot-green  { background: #28c840; }

.term-title {
  margin-left: 0.4rem;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.term-line { color: var(--text); line-height: 1.5; word-break: break-word; }
.term-line a { color: var(--accent); }
.term-cmd { opacity: 0.5; }

.term-splash {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: inherit;
  line-height: 1.5;
  white-space: pre;
  margin-bottom: 0.15rem;
}

.term-map {
  color: #F6A73B;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: pre;
  opacity: 0.85;
}

.t-dim   { color: var(--text-dim); }
.t-acc   { color: var(--accent); }
.t-green { color: var(--green); }
.t-err   { color: #c0392b; }

.term-input-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  background: rgba(6, 10, 24, 0.7);
  flex-shrink: 0;
}

.term-prompt-str { color: var(--green); white-space: nowrap; }

.term-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.term-input {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  caret-color: var(--accent);
  min-width: 0;
}

.term-ghost {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: transparent; /* typed portion invisible */
  white-space: pre;
}

@media (max-width: 1100px) { .terminal-panel { display: none; } }

/* ── Responsive: collapse sidebar on small screens ── */
@media (max-width: 768px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-inner { padding: 1.5rem; gap: 1.25rem; }
  .sidebar-crates { margin-top: 0; }
  .content { padding: 2rem 1.25rem 3rem; }
}
