/* ============================================
   Terminal Theme — macOS style
   ============================================ */

:root {
  --term-bg: #0F0F11;
  --term-fg: #e4e4e7;
  --term-fg-dim: #a1a1aa;
  --term-fg-bright: #ffffff;
  --term-accent: #10b981;
  --term-accent-hover: #34d399;
  --term-red: #ef4444;
  --term-yellow: #eab308;
  --term-green: #10b981;
  --term-titlebar-bg: #1C1C1E;
  --term-chrome-bg: #09090b;
  --term-sidebar-bg: #111113;
  --term-code-bg: #18181b;
  --term-selection: #3f3f46;
  --term-muted: #52525b;
  --term-border: rgba(255,255,255,0.07);
  --font-mono: "IBM Plex Mono", "Fira Mono", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  background-color: var(--term-chrome-bg);
  font-family: var(--font-mono);
  font-size: 15px; line-height: 1.6;
  color: var(--term-fg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--term-selection); color: var(--term-fg-bright); }

/* --- Terminal Window --- */
.terminal-window {
  max-width: 72rem;
  margin: 2rem auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 24px 80px rgba(0,0,0,0.7);
  background: var(--term-bg);
  position: relative;
  z-index: 1;
}

/* Subtle scanline */
.terminal-window::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg,rgba(0,0,0,0.025) 0px,rgba(0,0,0,0.025) 1px,transparent 1px,transparent 2px);
  pointer-events: none; z-index: 10;
}

/* --- Title Bar --- */
.terminal-titlebar {
  background: var(--term-titlebar-bg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--term-border);
  position: relative; z-index: 1;
}
.titlebar-dots { display: flex; gap: 7px; flex-shrink: 0; }
.titlebar-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
  transition: opacity 0.15s;
}
.titlebar-dot:hover { opacity: 0.8; cursor: pointer; }
.dot-close   { background: rgba(239,68,68,0.85); }
.dot-minimize{ background: rgba(234,179,8,0.85); }
.dot-maximize{ background: rgba(16,185,129,0.85); }

.titlebar-title {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: #71717a;
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
}

.titlebar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.titlebar-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #71717a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  transition: background 0.15s, color 0.15s;
}
.titlebar-btn:hover { background: rgba(255,255,255,0.1); color: #a1a1aa; }

/* --- Tab Bar --- */
.terminal-tabbar {
  background: var(--term-bg);
  border-bottom: 1px solid var(--term-border);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  position: relative; z-index: 1;
}
.terminal-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  color: #a1a1aa;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.terminal-tab.active {
  background: rgba(255,255,255,0.06);
  color: #d4d4d8;
}
.terminal-tab:not(.active):hover {
  background: rgba(255,255,255,0.03);
  color: #a1a1aa;
}
.tab-icon { color: var(--term-accent); flex-shrink: 0; }
.tab-close {
  margin-left: 6px;
  background: none; border: none; padding: 0;
  color: #52525b; cursor: pointer;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.tab-close:hover { color: #a1a1aa; }
.tab-new {
  background: none; border: none; padding: 5px 10px;
  color: #52525b; cursor: pointer;
  display: flex; align-items: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.tab-new:hover { background: rgba(255,255,255,0.05); color: #a1a1aa; }

/* --- Navigation --- */
.terminal-nav {
  padding: 10px 20px;
  border-bottom: 1px solid var(--term-border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px;
  background: var(--term-bg);
}
.terminal-nav a {
  color: #52525b; text-decoration: none;
  white-space: nowrap; font-size: 13px;
  transition: color 0.15s;
}
.terminal-nav a::before { content: "$ "; color: #3f3f46; }
.terminal-nav a:hover, .terminal-nav a.active { color: #d4d4d8; }

/* --- Body Grid --- */
.terminal-body {
  display: grid;
  grid-template-areas: "main" "sidebar";
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 50rem) {
  .terminal-body {
    grid-template-areas: "main sidebar";
    grid-template-columns: minmax(0, 1fr) 18rem;
  }
}

/* --- Main Content --- */
.terminal-main {
  grid-area: main;
  padding: 24px 28px;
  overflow-wrap: break-word; min-width: 0; overflow-x: hidden;
}

/* --- Sidebar --- */
.terminal-sidebar {
  grid-area: sidebar;
  padding: 24px 20px;
  background: var(--term-sidebar-bg);
  color: var(--term-fg-dim);
  border-top: 1px solid var(--term-border);
}
@media (min-width: 50rem) {
  .terminal-body {
    background: linear-gradient(to right, var(--term-bg) calc(100% - 18rem), var(--term-sidebar-bg) calc(100% - 18rem));
  }
  .terminal-sidebar {
    border-top: none;
    border-left: 1px solid var(--term-border);
    position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  }
}

/* --- Footer --- */
.terminal-footer-wrapper {
  padding: 10px 20px;
  border-top: 1px solid var(--term-border);
  color: #3f3f46;
  font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 4px 16px;
}
.terminal-footer-wrapper a:link,
.terminal-footer-wrapper a:visited { color: #52525b; }
.terminal-footer-wrapper a:hover { color: #a1a1aa; }
.footer-text { display: inline; }

/* --- Status Bar --- */
.terminal-statusbar {
  background: var(--term-titlebar-bg);
  border-top: 1px solid var(--term-border);
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #52525b;
  font-family: var(--font-mono);
}
.statusbar-left, .statusbar-right {
  display: flex; align-items: center; gap: 8px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--term-accent);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.status-sep { color: #27272a; }

/* --- Blinking cursor --- */
.cursor, .type-cursor {
  display: inline-block;
  width: 0.55em; height: 1.15em;
  background: var(--term-accent);
  vertical-align: text-bottom;
  animation: blink-block 1s step-end infinite;
  color: transparent; overflow: hidden; line-height: 0;
}
@keyframes blink-block { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- Typography --- */
h1,h2,h3,h4,h5,h6 { font-weight: 600; margin: 1.5rem 0 0.5rem 0; color: var(--term-accent); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.15rem; }
h4,h5,h6 { font-size: 1rem; }
h1:first-child { margin-top: 0; }
h1::before { content: "# "; } h2::before { content: "## "; }
h3::before { content: "### "; } h4::before { content: "#### "; }
h1::before,h2::before,h3::before,h4::before,h5::before,h6::before { color: var(--term-muted); }
h1+h2,h2+h3,h3+h4,h4+h5,h5+h6 { margin-top: 0; }
p { margin: 0 0 1.5rem 0; }
a:link, a:visited { color: var(--term-accent); text-decoration: none; }
a:hover, a:active { color: var(--term-accent-hover); }
ul { margin: 0 0 1.5rem 0; padding-left: 1.25rem; }
ol { margin: 0 0 1.5rem 0; padding-left: 1.75rem; }
ul ul, ul ol, ol ul, ol ol { margin: 0; }
ul li::marker { content: '\203A\00A0'; color: var(--term-muted); }
ol li::marker { color: var(--term-muted); }
dt { margin: 0; font-weight: bold; }
dd { margin: 0 0 0 1.5rem; font-style: italic; }
dd + dt { margin-top: 1.5rem; }
dl { margin: 0 0 1.5rem 0; }
blockquote { position: relative; margin: 0 0 1.5rem 1.5rem; color: var(--term-fg-dim); }
blockquote::before { position: absolute; left: -1.5rem; content: ">"; color: var(--term-muted); }
code, kbd, samp {
  background: var(--term-code-bg); font-family: var(--font-mono);
  color: var(--term-fg-bright); padding: 2px 5px; border-radius: 4px; font-size: 0.9em;
}
pre {
  overflow-x: auto; padding: 1.5rem; margin: 0 0 1.5rem 0;
  border: 1px solid var(--term-border); border-radius: 8px;
  font-family: var(--font-mono); white-space: pre-wrap; word-wrap: break-word;
}
pre code { padding: 0; background: transparent !important; color: inherit; }
pre:not([class]) > code:not([class]) { color: var(--term-fg); }
pre:not([class]):not(.shell-ls) { background: #0a0a0a; }
.highlight { background: #0a0a0a !important; border-radius: 8px; border: 1px solid var(--term-border); }
.highlight pre { background: transparent !important; border: none; border-radius: 0; }
.highlight span { background: transparent !important; }
b, strong { font-weight: 600; color: var(--term-fg-bright); }
em, i { color: var(--term-fg); }
mark { background-color: var(--term-selection); color: var(--term-fg-bright); }
hr { border: 0; margin-bottom: 1.5rem; }
hr::after { content: '---'; color: var(--term-muted); }
sup { vertical-align: baseline; position: relative; top: -0.25rem; font-size: unset; }
sub { vertical-align: baseline; position: relative; top: 0.25rem; font-size: unset; }
table { border-spacing: 0; margin: 0 0 1.5rem 0; overflow-wrap: anywhere; }
th, td { padding: 4px 12px; vertical-align: top; border-bottom: 1px solid var(--term-border); }
th:first-child, td:first-child { padding-left: 0; }
th { text-align: inherit; color: var(--term-fg-bright); }
img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--term-border); }

/* --- Sidebar Components --- */
.sidebar-parrot {
    height: 1.1em;
    width: auto;
    border: none;
    flex-shrink: 0;
}
.sidebar-name { color: var(--term-fg-bright); font-weight: 600; }
.sidebar-name::before { content: none; }
.sidebar-desc { margin-top: 0.5rem; color: var(--term-fg-dim); }
.sidebar-desc p { margin: 0; }
.sidebar-links { list-style: none; padding: 0; margin: 1rem 0 0 0; }
.sidebar-links li { margin-bottom: 0.35rem; }
.sidebar-links li::before { content: none; }
.sidebar-links a { color: var(--term-fg-dim); text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 0.5em; }
.sidebar-links a:hover { color: var(--term-fg-bright); }
.sidebar-links i { width: 1.2em; text-align: center; margin-right: 0.3em; }
.sidebar-links svg { display: inline-block; width: 14px; height: 14px; vertical-align: middle; margin-right: 0.4em; stroke: currentColor; }
.sidebar-content { margin-top: 1rem; }
.sidebar-content p { font-size: 14px; color: var(--term-fg-dim); }
.shell-line-sm { margin-bottom: 0.25rem; }
.shell-prompt-sm { color: var(--term-accent); font-size: 13px; font-weight: 700; }
.shell-cmd-sm { color: var(--term-fg); font-size: 13px; }
.sidebar-identity { margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; }
.post-meta-inline { color: var(--term-muted); font-size: 14px; margin-top: 0.25rem; }

/* --- Shell Session --- */
.shell-session { font-size: 14px; line-height: 1.5; }
.shell-line { margin-top: 1.5rem; margin-bottom: 0.25rem; }
.shell-line:first-child { margin-top: 0; }

/* PS1 prompt — matches the aura.build aesthetic */
.ps1 { font-weight: 500; margin-right: 0.5em; }
.ps1-user { color: #34d399; }        /* emerald-400 */
.ps1-sep  { color: #52525b; }        /* zinc-600 */
.ps1-dir  { color: #60a5fa; }        /* blue-400 */

.shell-cmd { color: var(--term-fg-bright); }
.shell-output { color: var(--term-fg-dim); margin-bottom: 0.5rem; }
.shell-output > p { margin: 0; }

pre.shell-skills {
  background: transparent; border: none; padding: 0; margin: 0;
  font-size: 14px; line-height: 1.8; color: var(--term-fg-dim);
}
pre.shell-ls {
  background: transparent; border: none; padding: 0; margin: 0;
  font-size: 14px; line-height: 1.5; color: var(--term-fg-dim); overflow-x: auto;
}
.shell-dir { color: #60a5fa; font-weight: 700; }
a.shell-file { color: var(--term-fg); text-decoration: none; }
a.shell-file:hover { color: var(--term-accent-hover); text-decoration: underline; }

.shell-readme { margin: 1rem 0 1.5rem 0; }
.readme-entry { margin-bottom: 0.75rem; }
a.readme-title:link, a.readme-title:visited { color: #f59e0b; text-decoration: none; font-weight: 600; }
a.readme-title:hover, a.readme-title:active { color: var(--term-accent); }
.readme-date { color: var(--term-muted); font-size: 13px; }
.readme-desc { color: var(--term-fg-dim); font-size: 13px; }

/* --- Single Post --- */
.post-header h1 { color: var(--term-accent); }
.post-content { margin-top: 1.5rem; }
.post-content img { max-width: 100%; border-radius: 8px; border: 1px solid var(--term-border); margin: 1.5rem 0; display: block; }
.post-content img + em { display: block; text-align: center; font-size: 12px; color: var(--term-muted); margin-top: -1rem; margin-bottom: 1.5rem; }

/* --- Responsive --- */
@media (max-width: 50rem) {
  .terminal-window {
    margin: 0; border-radius: 0;
    border-left: none; border-right: none; min-height: 100vh;
  }
  .terminal-main { padding: 16px; }
  .terminal-sidebar { padding: 16px; }
  .titlebar-title { font-size: 11px; }
  .titlebar-actions { display: none; }
  .terminal-statusbar { display: none; }
}
