/* ===================================================
   PORTFOLIO — Antoine Domisse · Thème VS Code
   =================================================== */

/* ---------- VARIABLES : thème sombre ---------- */
:root,
[data-theme="dark"] {
  --bg-titlebar:       #3c3c3c;
  --bg-activity:       #333333;
  --bg-sidebar:        #252526;
  --bg-editor:         #1e1e1e;
  --bg-editor-soft:    #252526;
  --bg-tab-active:     #1e1e1e;
  --bg-tab-inactive:   #2d2d2d;
  --bg-statusbar:      #007acc;
  --bg-hover:          #2a2d2e;
  --bg-selected:       #094771;
  --bg-modal-backdrop: rgba(0,0,0,0.65);
  --bg-modal:          #252526;
  --bg-card:           #2d2d30;

  --fg-primary:        #cccccc;
  --fg-secondary:      #969696;
  --fg-muted:          #6a6a6a;
  --fg-statusbar:      #ffffff;
  --fg-title:          #cccccc;

  --border:            #1e1e1e;
  --border-light:      #3c3c3c;
  --border-strong:     #4a4a4a;
  --accent:            #007acc;
  --accent-hover:      #1991e8;
  --accent-soft:       rgba(0,122,204,0.18);

  --syn-keyword:       #569cd6;
  --syn-string:        #ce9178;
  --syn-number:        #b5cea8;
  --syn-comment:       #6a9955;
  --syn-fn:            #dcdcaa;
  --syn-type:          #4ec9b0;
  --syn-key:           #9cdcfe;
  --syn-tag:           #569cd6;
  --syn-attr:          #9cdcfe;
  --syn-punct:         #d4d4d4;
  --syn-property:      #9cdcfe;

  --git-added:    #487e02;
  --git-modified: #e2c08d;
  --git-deleted:  #c74e39;

  --br-main:     #58a6ff;
  --br-feature:  #f0883e;
  --br-project:  #a371f7;

  --status-ok:   #3fb950;
}

/* ---------- VARIABLES : thème clair ---------- */
[data-theme="light"] {
  --bg-titlebar:       #dddddd;
  --bg-activity:       #2c2c2c;
  --bg-sidebar:        #f3f3f3;
  --bg-editor:         #ffffff;
  --bg-editor-soft:    #f8f8f8;
  --bg-tab-active:     #ffffff;
  --bg-tab-inactive:   #ececec;
  --bg-statusbar:      #007acc;
  --bg-hover:          #e8e8e8;
  --bg-selected:       #cce5ff;
  --bg-modal-backdrop: rgba(0,0,0,0.45);
  --bg-modal:          #ffffff;
  --bg-card:           #f8f8f8;

  --fg-primary:        #333333;
  --fg-secondary:      #616161;
  --fg-muted:          #888888;
  --fg-statusbar:      #ffffff;
  --fg-title:          #333333;

  --border:            #d4d4d4;
  --border-light:      #e7e7e7;
  --border-strong:     #c0c0c0;
  --accent:            #007acc;
  --accent-hover:      #005a9e;
  --accent-soft:       rgba(0,122,204,0.10);

  --syn-keyword:       #0000ff;
  --syn-string:        #a31515;
  --syn-number:        #098658;
  --syn-comment:       #008000;
  --syn-fn:            #795e26;
  --syn-type:          #267f99;
  --syn-key:           #0451a5;
  --syn-tag:           #800000;
  --syn-attr:          #ff0000;
  --syn-punct:         #000000;
  --syn-property:      #001080;

  --git-added:    #587c0c;
  --git-modified: #895503;
  --git-deleted:  #ad0707;

  --br-main:     #0969da;
  --br-feature:  #bc4c00;
  --br-project:  #8250df;

  --status-ok:   #1f883d;
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  background: #000;
  color: var(--fg-primary);
  overflow: hidden;
}
button, input { font-family: inherit; }
button { cursor: pointer; }

.window {
  display: grid;
  grid-template-rows: 36px 1fr 22px;
  height: 100vh;
}

/* ===================================================
   TITLE BAR
   =================================================== */
.titlebar {
  background: var(--bg-titlebar);
  color: var(--fg-title);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 12px;
  user-select: none;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.title-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}
.title-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.traffic-lights { display: flex; gap: 6px; align-items: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
.menu { display: flex; gap: 4px; margin-left: 4px; }
.menu span {
  padding: 3px 8px;
  border-radius: 3px;
  cursor: default;
}
.menu span:hover { background: var(--bg-hover); }
.title-center {
  flex: 1;
  text-align: center;
  opacity: 0.7;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Title bar buttons */
.title-btn {
  background: transparent;
  border: none;
  color: var(--fg-title);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  text-decoration: none;
  height: 26px;
  transition: background 0.12s;
}
.title-btn:hover { background: var(--bg-hover); }
.title-btn.icon-btn { padding: 4px 6px; }
.title-btn.search-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  min-width: 260px;
  justify-content: flex-start;
}
[data-theme="light"] .title-btn.search-btn { background: rgba(0,0,0,0.05); }
.title-btn.search-btn:hover { background: rgba(255,255,255,0.1); }
[data-theme="light"] .title-btn.search-btn:hover { background: rgba(0,0,0,0.07); }
.cmd-hint {
  opacity: 0.7;
  font-size: 11px;
  margin-right: auto;
}
.cmd-shortcut {
  opacity: 0.5;
  font-size: 10.5px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  border: 1px solid var(--border-light);
}
.title-divider {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  margin: 0 4px;
}
[data-theme="dark"]  .icon-sun  { display: inline; }
[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: inline; }

/* ===================================================
   BODY GRID
   =================================================== */
.body {
  display: grid;
  grid-template-columns: 48px 290px 1fr;
  overflow: hidden;
}

/* ===================================================
   ACTIVITY BAR
   =================================================== */
.activity-bar {
  background: var(--bg-activity);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}
.activity-icon {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #858585;
  cursor: pointer;
  transition: color 0.12s;
}
.activity-icon:hover { color: #ffffff; }
.activity-icon.active { color: #ffffff; }
.activity-icon.active .indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
}
.activity-icon .badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.3;
  border: 1px solid var(--bg-activity);
}
.activity-spacer { flex: 1; }
.activity-icon.bottom .profile-pic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  transition: filter 0.12s, transform 0.12s;
}
.activity-icon.bottom:hover .profile-pic { transform: scale(1.06); filter: brightness(1.15); }
.logo-mark { display: block; }
.activity-icon.bottom .status-dot {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--status-ok);
  border: 2px solid var(--bg-activity);
}

/* ===================================================
   SIDEBAR
   =================================================== */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 10px 16px 8px;
  color: var(--fg-secondary);
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}

/* --- Explorer tree --- */
.section-label {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  padding: 6px 16px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tree { padding: 0; margin: 0; list-style: none; }
.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 12px;
  cursor: pointer;
  color: var(--fg-primary);
  white-space: nowrap;
  user-select: none;
  font-size: 13px;
  position: relative;
  line-height: 1.4;
}
.tree-item:hover { background: var(--bg-hover); }
.tree-item.active { background: var(--bg-selected); }
.tree-item .chevron {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-secondary);
  transition: transform .15s;
  flex-shrink: 0;
}
.tree-item.folder.open > .chevron { transform: rotate(90deg); }
.tree-item .file-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tree-item .git-flag {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  padding-right: 6px;
}
.git-flag.M { color: var(--git-modified); }
.git-flag.A { color: var(--git-added); }
.tree-children { padding-left: 12px; list-style: none; margin: 0; }
.tree-children.collapsed { display: none; }

/* File / folder icon colors via currentColor */
.icon-md      { color: #519aba; }
.icon-json    { color: #cbcb41; }
.icon-html    { color: #e44d26; }
.icon-img     { color: #a074c4; }
.icon-folder  { color: #dcb67a; }
.icon-vscode  { color: #519aba; }

/* --- Search view --- */
.search-view { padding: 10px 14px; }
.search-input {
  width: 100%;
  background: var(--bg-editor);
  border: 1px solid var(--border-strong);
  color: var(--fg-primary);
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 12px;
  margin-bottom: 10px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-result {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  line-height: 1.4;
}
.search-result:hover { background: var(--bg-hover); }
.search-result .file { color: var(--accent); font-weight: 500; }
.search-result mark {
  background: rgba(234,179,8,0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
.search-empty { padding: 10px; font-size: 12px; color: var(--fg-muted); }

/* --- Git sidebar --- */
.branch-list { padding: 4px 0; }
.branch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 18px;
  font-size: 13px;
  cursor: pointer;
}
.branch-item:hover { background: var(--bg-hover); }
.branch-item.current { color: var(--accent); font-weight: 600; }
.branch-item .br-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.git-changes-list { padding: 2px 0 10px; }
.git-change {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 14px 3px 18px;
  font-size: 13px;
  cursor: default;
}
.git-change:hover { background: var(--bg-hover); }
.git-change .status {
  width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
}
.status.A { color: var(--git-added); }
.status.M { color: var(--git-modified); }
.status.D { color: var(--git-deleted); }

/* --- Extensions sidebar --- */
.ext-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: default;
}
.ext-item:hover { background: var(--bg-hover); }
.ext-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  font-family: "Cascadia Code", "Consolas", monospace;
}
.ext-name { font-weight: 600; font-size: 13px; }
.ext-publisher { font-size: 11px; color: var(--fg-muted); margin-top: 2px; }
.ext-desc { font-size: 11.5px; color: var(--fg-secondary); margin-top: 4px; line-height: 1.4; }
.ext-installed {
  font-size: 10px;
  color: var(--status-ok);
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

/* --- Run/Settings/Profile sidebars (generic block) --- */
.run-block { padding: 14px 16px; font-size: 13px; line-height: 1.6; }
.run-block h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; color: var(--fg-secondary); letter-spacing: 0.05em; font-weight: 700; }
.run-block p { margin: 0 0 10px; color: var(--fg-secondary); font-size: 12.5px; }
.run-block p a { color: var(--accent); text-decoration: none; }
.run-block p a:hover { text-decoration: underline; }
.run-cfg {
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin-bottom: 6px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.run-cfg .play { color: var(--status-ok); flex-shrink: 0; }
.run-cfg:hover { border-color: var(--accent); }

.run-block code {
  background: rgba(127,127,127,0.18);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 11.5px;
}

/* ===================================================
   MAIN / EDITOR
   =================================================== */
.main {
  display: flex;
  flex-direction: column;
  background: var(--bg-editor);
  overflow: hidden;
}

/* --- Tab bar with scroll buttons --- */
.tab-bar-wrap {
  display: flex;
  align-items: stretch;
  background: var(--bg-tab-inactive);
  border-bottom: 1px solid var(--border);
  height: 35px;
  flex-shrink: 0;
}
.tab-scroll-btn {
  background: var(--bg-tab-inactive);
  border: none;
  width: 28px;
  color: var(--fg-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.tab-scroll-btn:hover { color: var(--fg-primary); background: var(--bg-hover); }
.tab-scroll-btn.visible { display: flex; }
.tab-scroll-btn.left  { border-right: 1px solid var(--border); border-left: none; }
.tab-scroll-btn.right { border-left:  1px solid var(--border); border-right: none; }

.tab-bar {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
/* SUPPRESSION TOTALE de la scrollbar horizontale sur la tab-bar */
.tab-bar::-webkit-scrollbar { display: none; width: 0; height: 0; }

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  font-size: 13px;
  color: var(--fg-secondary);
  border-right: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  position: relative;
  height: 35px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 220px;
}
.tab .file-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tab .tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.tab:hover { color: var(--fg-primary); }
.tab.active {
  background: var(--bg-tab-active);
  color: var(--fg-primary);
}
.tab.active::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}
.tab .close {
  width: 18px; height: 18px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  flex-shrink: 0;
  color: var(--fg-primary);
}
.tab:hover .close, .tab.active .close { opacity: 0.85; }
.tab .close:hover { background: var(--bg-hover); opacity: 1; }

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 5px 14px;
  font-size: 12px;
  color: var(--fg-secondary);
  background: var(--bg-editor);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-height: 26px;
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
}
.breadcrumbs::-webkit-scrollbar { height: 0; }
.breadcrumbs span.separator { opacity: 0.5; padding: 0 2px; }
.breadcrumbs .file-icon { width: 14px; height: 14px; display: inline-flex; }

/* --- Editor body --- */
.editor {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px 60px;
  font-size: 14px;
  line-height: 1.65;
}

/* ===================================================
   WELCOME PAGE
   =================================================== */
.welcome {
  max-width: 940px;
  margin: 0 auto;
  padding-top: 14px;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.welcome .hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}
.welcome .hero img,
.welcome .hero .logo-mark {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 30px rgba(0,122,204,0.20);
  flex-shrink: 0;
}
.welcome .hero img { border: 3px solid var(--accent); }
.welcome h1 {
  font-weight: 300;
  font-size: 36px;
  margin: 0 0 4px;
  line-height: 1.15;
}
.welcome h1 .accent { color: var(--accent); font-weight: 600; }
.welcome .subtitle { color: var(--fg-secondary); margin: 0 0 12px; font-size: 16px; }
.welcome .tagline {
  margin: 8px 0 0;
  font-size: 13px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.welcome .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11.5px;
}
.welcome .pill .status-dot-inline { background: var(--status-ok); }
.welcome .columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.welcome .col h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
  color: var(--fg-secondary);
  font-weight: 700;
}
.welcome .quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 0 -10px;
  color: var(--fg-primary);
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.12s;
}
.welcome .quick-link:hover { background: var(--bg-hover); color: var(--accent); }
.welcome .quick-link .ql-num {
  font-family: "Cascadia Code", "Consolas", monospace;
  color: var(--fg-muted);
  font-size: 11.5px;
  width: 32px;
}
.welcome .quick-link .ql-arrow {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.12s;
  color: var(--accent);
}
.welcome .quick-link:hover .ql-arrow { opacity: 1; }
.welcome .hint {
  margin-top: 30px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: var(--fg-primary);
  font-size: 13px;
  line-height: 1.55;
}
.welcome .hint strong { color: var(--accent); }
.welcome .hint code {
  background: rgba(127,127,127,0.18);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.9em;
}

/* ===================================================
   MARKDOWN PREVIEW
   =================================================== */
.md-preview {
  max-width: 880px;
  margin: 0 auto;
  color: var(--fg-primary);
  animation: fadeIn 0.3s ease;
}
.md-preview h1 {
  font-size: 28px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
  margin: 0 0 18px;
  font-weight: 600;
  line-height: 1.25;
}
.md-preview h2 {
  font-size: 20px;
  margin: 28px 0 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
  font-weight: 600;
}
.md-preview h3 { font-size: 16px; margin: 20px 0 10px; font-weight: 600; }
.md-preview h4 { font-size: 14px; margin: 16px 0 6px; font-weight: 600; color: var(--fg-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.md-preview p  { margin: 0 0 14px; }
.md-preview ul, .md-preview ol { margin: 0 0 14px; padding-left: 24px; }
.md-preview li { margin: 4px 0; }
.md-preview li > p { margin: 0; }
.md-preview code {
  background: rgba(127,127,127,0.18);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.9em;
}
.md-preview pre {
  background: var(--bg-editor-soft);
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12.5px;
  line-height: 1.55;
}
.md-preview blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 14px;
  margin: 0 0 14px;
  color: var(--fg-secondary);
  background: var(--accent-soft);
  border-radius: 0 4px 4px 0;
  font-style: italic;
}
.md-preview a { color: var(--accent); text-decoration: none; }
.md-preview a:hover { text-decoration: underline; }
.md-preview hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 22px 0;
}
.md-preview img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  display: block;
  margin: 10px auto;
}
.md-preview table {
  border-collapse: collapse;
  margin: 0 0 14px;
  width: 100%;
  font-size: 13px;
}
.md-preview th, .md-preview td {
  border: 1px solid var(--border-light);
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
}
.md-preview th { background: rgba(127,127,127,0.08); font-weight: 600; }

/* Hero block at top of some markdown files */
.md-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 24px 26px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%);
  border-radius: 8px;
  margin-bottom: 26px;
  border: 1px solid var(--border-light);
}
.md-hero img,
.md-hero .logo-mark {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
}
.md-hero img { border: 3px solid var(--accent); }
.md-hero h2 { margin: 0 0 4px; border: 0; padding: 0; font-size: 20px; }
.md-hero p { margin: 0; color: var(--fg-secondary); font-size: 13.5px; }

/* Skill / project tags */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
  line-height: 1.4;
}
.tag-soft {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(168,85,247,0.12);
  color: #c084fc;
  border: 1px solid #c084fc;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
  line-height: 1.4;
}
[data-theme="light"] .tag-soft { color: #7c3aed; border-color: #7c3aed; background: rgba(124,58,237,0.08); }
.tag-level {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-card);
  color: var(--fg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  font-family: "Cascadia Code", "Consolas", monospace;
}
.tag-level.n4 { color: var(--status-ok); border-color: var(--status-ok); }
.tag-level.n3 { color: var(--accent); border-color: var(--accent); }
.tag-level.n2 { color: var(--git-modified); border-color: var(--git-modified); }
.tag-level.n1 { color: var(--fg-muted); }

/* Project image */
.proj-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

/* Section blocks (for hard-skills, soft-skills layouts) */
.skill-block {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 16px;
}
.skill-block .skill-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}
.skill-block .skill-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.skill-block .skill-meta {
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.skill-block .skill-meta strong { color: var(--fg-secondary); }

/* Section indicator (numbered sections) */
.section-number {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 10px;
  vertical-align: middle;
}

/* ===================================================
   CODE VIEW (JSON / HTML)
   =================================================== */
.code-view {
  display: grid;
  grid-template-columns: 50px 1fr;
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  background: var(--bg-editor);
  max-width: 1100px;
  margin: 0 auto;
}
.code-view .gutter {
  color: var(--fg-muted);
  text-align: right;
  padding-right: 14px;
  user-select: none;
  border-right: 1px solid var(--border-light);
  white-space: pre;
}
.code-view .lines {
  padding-left: 16px;
  white-space: pre;
  overflow-x: auto;
}
.code-view .keyword { color: var(--syn-keyword); }
.code-view .string  { color: var(--syn-string); }
.code-view .number  { color: var(--syn-number); }
.code-view .comment { color: var(--syn-comment); font-style: italic; }
.code-view .key     { color: var(--syn-key); }
.code-view .tag     { color: var(--syn-tag); }
.code-view .attr    { color: var(--syn-attr); }
.code-view .punct   { color: var(--syn-punct); }
.code-view .fn      { color: var(--syn-fn); }

/* Image viewer */
.image-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 30px 20px;
  min-height: calc(100vh - 200px);
}
.image-viewer img {
  max-width: 70%;
  max-height: 65vh;
  border-radius: 10px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.4);
  border: 1px solid var(--border-light);
}
.image-meta {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: var(--fg-muted);
  text-align: center;
}
.image-meta a { color: var(--accent); text-decoration: none; }

/* ===================================================
   GIT GRAPH
   =================================================== */
.git-graph-view {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 13px;
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease;
}
.gg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}
.gg-header h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.gg-meta { font-size: 12px; color: var(--fg-secondary); display: flex; gap: 14px; }
.gg-meta strong { color: var(--accent); }

.gg-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--fg-secondary);
}
.gg-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
}

.gg-row {
  display: grid;
  grid-template-columns: 1fr 100px 170px;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  cursor: default;
  gap: 14px;
  height: 56px;
}
.gg-row:hover { background: var(--bg-hover); }
.gg-cell-msg {
  font-size: 13.5px;
  color: var(--fg-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gg-cell-msg .tag-ref {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
  text-transform: lowercase;
  font-family: "Cascadia Code", "Consolas", monospace;
}
.tag-ref.head    { background: var(--accent); color: #fff; }
.tag-ref.main    { background: rgba(88,166,255,0.22); color: var(--br-main); border: 1px solid currentColor; }
.tag-ref.branch  { background: rgba(163,113,247,0.20); color: var(--br-project); border: 1px solid currentColor; }
.gg-cell-hash {
  font-family: "Cascadia Code", "Consolas", monospace;
  color: var(--syn-number);
  font-size: 12px;
}
.gg-cell-meta {
  font-size: 11.5px;
  color: var(--fg-muted);
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.gg-cell-meta .author { color: var(--fg-secondary); }
.gg-row.head .gg-circle { box-shadow: 0 0 0 4px var(--accent-soft); }

.gg-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0 24px;
}
.gg-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 14px;
}
.gg-stat-card .val { font-size: 22px; font-weight: 700; color: var(--accent); }
.gg-stat-card .lbl { font-size: 11px; color: var(--fg-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* ===================================================
   STATUS BAR
   =================================================== */
.statusbar {
  background: var(--bg-statusbar);
  color: var(--fg-statusbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 12px;
  user-select: none;
}
.status-left, .status-right { display: flex; gap: 2px; align-items: center; }
.status-item {
  padding: 0 8px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}
.status-item[data-action] { cursor: pointer; }
.status-item:hover { background: rgba(255,255,255,0.12); }
.status-availability { color: #fff; }
.status-dot-inline {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-ok);
  display: inline-block;
}

/* ===================================================
   MODAL (WELCOME)
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(2px);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  width: min(640px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.open .modal-card { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  width: 30px; height: 30px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--bg-hover); color: var(--fg-primary); }
.modal-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 30px 14px;
  border-bottom: 1px solid var(--border-light);
}
.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}
.modal-avatar.logo-mark { border: none; }
.modal-hero h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.modal-hero .subtitle { color: var(--fg-secondary); font-size: 13px; margin: 0; }
.modal-body { padding: 18px 30px; font-size: 13.5px; line-height: 1.6; }
.modal-body p { margin: 0 0 14px; }
.modal-body code {
  background: rgba(127,127,127,0.18);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.88em;
}
.modal-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.tip {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--border-light);
}
.tip-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tip strong { color: var(--fg-primary); display: block; margin-bottom: 3px; }
.tip span { color: var(--fg-secondary); }
.modal-footer {
  padding: 16px 30px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
}
.modal-check { font-size: 12.5px; color: var(--fg-secondary); cursor: pointer; user-select: none; }
.modal-check input { margin-right: 6px; vertical-align: middle; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ===================================================
   COMMAND PALETTE
   =================================================== */
.palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.palette-box {
  width: min(620px, 92vw);
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.palette-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  color: var(--fg-primary);
  padding: 12px 16px;
  font-size: 14px;
}
.palette-input:focus { outline: none; }
.palette-results { max-height: 50vh; overflow-y: auto; }
.palette-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.palette-item:hover, .palette-item.selected { background: var(--bg-selected); color: #fff; }
.palette-item .pal-desc { margin-left: auto; font-size: 11px; color: var(--fg-muted); }
.palette-item.selected .pal-desc { color: rgba(255,255,255,0.7); }

/* ===================================================
   PROFILE PAGE
   =================================================== */
.profile-page {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease;
}
.profile-card {
  display: flex;
  gap: 30px;
  align-items: center;
  padding: 30px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  margin-bottom: 22px;
}
.profile-card img,
.profile-card .logo-mark {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 30px rgba(0,122,204,0.25);
  flex-shrink: 0;
}
.profile-card img { border: 4px solid var(--accent); }
.profile-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; }
.profile-card .role { color: var(--accent); font-weight: 600; margin: 0 0 12px; font-size: 14px; }
.profile-card .bio { color: var(--fg-secondary); margin: 0; line-height: 1.55; font-size: 13.5px; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.profile-stat {
  text-align: center;
  padding: 16px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.profile-stat .num { font-size: 24px; font-weight: 700; color: var(--accent); }
.profile-stat .lbl { font-size: 11px; color: var(--fg-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--fg-primary);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.12s, color 0.12s;
}
.profile-link:hover { border-color: var(--accent); color: var(--accent); }

/* ===================================================
   SCROLLBARS (global)
   =================================================== */
::-webkit-scrollbar { width: 14px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(127,127,127,0.4);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 7px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(127,127,127,0.7); background-clip: padding-box; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1000px) {
  .body { grid-template-columns: 48px 240px 1fr; }
  .editor { padding: 18px 22px 40px; }
  .welcome .columns, .modal-tips { grid-template-columns: 1fr; }
  .welcome .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .gg-row { grid-template-columns: 1fr 80px; }
  .gg-cell-meta { display: none; }
  .gg-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .title-btn.search-btn { min-width: 200px; }
  .menu span:nth-child(n+4) { display: none; } /* hide last menu items on small screens */
}
@media (max-width: 700px) {
  .body { grid-template-columns: 40px 0 1fr; }
  .sidebar { display: none; }
  .menu { display: none; }
  .title-center { display: none; }
  .title-btn.search-btn { display: none; }
  .cmd-shortcut { display: none; }
  .profile-card { flex-direction: column; text-align: center; }
}
