/* A calm, keyboard-friendly writing workspace inspired by Notion's reading flow. */
:root {
  --surface: #0f1720;
  --surface-raised: #16212d;
  --surface-hover: #1d2b39;
  --line: #2b3b4b;
  --text: #dce6ef;
  --muted: #9aabba;
  --accent: #63d9bd;
  --accent-ink: #08231f;
  --page: #121c26;
}

* { box-sizing: border-box; }
html { background: var(--surface); }
body {
  background: var(--surface);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .002em;
}

::selection { background: rgba(99, 217, 189, .32); color: #fff; }
a { color: var(--accent); }
a:hover { color: #9af0dc; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 5px;
}

.sidebar, .sidebar-toggle { background: var(--surface); }
.sidebar {
  width: 288px;
  padding: 20px 12px 32px;
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.sidebar > h1 { margin: 0 8px 20px; font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
.sidebar > h1 a { color: #edf5fb; }
.sidebar-nav { padding: 6px 0; }
.sidebar ul { margin: 4px 0 12px; }
.sidebar ul li { margin: 1px 0; }
.sidebar ul li a, .sidebar ul li p, .sidebar > h1 a {
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 8px;
  transition: background .15s ease, color .15s ease;
}
.sidebar ul li a:hover, .sidebar ul li a.active { background: var(--surface-hover); color: #f5fbff; }
.sidebar-nav a[href="#/notes/rambreaker"],
.sidebar-nav a[href="#/notes/rambreaker"]:hover,
.sidebar-nav a[href="#/notes/rambreaker"].active { color: #ff7885 !important; }
.sidebar ul li strong { color: #f0f6fb; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.sidebar .app-sub-sidebar li:before { color: #698094; }

.search { margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--line) !important; }
.search .input-wrap { position: relative; }
.search input {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 38px 10px 12px;
}
.search input::placeholder { color: #9aabba; opacity: 1; }
.search input:focus { box-shadow: 0 0 0 3px rgba(99, 217, 189, .16); border-color: var(--accent); }
.search .matching-post, .search { border-color: var(--line) !important; }
.search .matching-post { padding: 10px 4px; border-bottom: 1px solid rgba(43, 59, 75, .7); }
.search .matching-post h2 { font-size: 14px; color: #edf5fb; }
.search .matching-post[href^="#/notes/rambreaker?"] h2 { color: #ff7885; }
.search .matching-post p { color: var(--muted); }
.search .search-keyword { color: var(--accent-ink); background: var(--accent); border-radius: 2px; padding: 0 2px; }
.search .clear-button { display: none !important; }
.live-search-result { border-radius: 7px; }
.live-search-result:hover, .live-search-result:focus-visible { background: var(--surface-hover); }
.search-result__inline { display: none; }
.search-preview {
  position: fixed;
  z-index: 120;
  width: 290px;
  max-width: calc(100vw - 16px);
  max-height: 170px;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .38);
  color: var(--text);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.45;
}
.search-preview[hidden] { display: none; }
.search-preview strong { display: block; margin-bottom: 6px; color: #f4f8fc; font-size: 12px; line-height: 1.35; }
.search-preview p { margin: 0; color: #c9d6e1; }
.search-preview mark, .search-jump-match { color: #17212c !important; background: #ffe189; border-radius: 2px; padding: 0 2px; }
.search-tools { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.note-category-filter {
  min-width: 0;
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-raised);
  font: inherit;
  font-size: 12px;
}
.search-result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.live-search-result { display: block; text-decoration: none; }
.search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.search-clear:hover { color: var(--accent); background: var(--surface-hover); }

.sidebar-nav li.sidebar-category > p {
  margin: 24px 8px 7px;
  padding: 0;
}
.sidebar-nav li.sidebar-category > p.sidebar-category-toggle {
  cursor: pointer;
}
.sidebar-nav li.sidebar-category > p strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8ee8d3;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
}
.sidebar-nav li.sidebar-category > p strong:before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}
.sidebar-nav li.sidebar-category > p strong:after {
  margin-left: auto;
  color: var(--muted);
  content: '+';
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}
.sidebar-nav li.sidebar-category:not(.sidebar-category--collapsed) > p strong:after { content: '−'; }
.sidebar-nav li.sidebar-category--collapsed > ul { display: none; }
.sidebar-nav li.sidebar-category[data-category="reference"] > p strong { color: #9fb4ff; }
.sidebar-nav li.sidebar-category[data-category="my-tools"] > p strong { color: #b8e9da; }

.content { left: 288px; background: var(--surface); }
.markdown-section {
  max-width: 960px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 72px 72px 120px;
  color: var(--text);
}
.markdown-section > :first-child { margin-top: 0; }
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4,
.markdown-section strong, .markdown-section .anchor span { color: #f4f8fc; }
.markdown-section h1 {
  margin: 0 0 28px;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.12;
}
.markdown-section h1 .rambreaker-title { color: #ff7885 !important; text-shadow: 0 0 30px rgba(255, 95, 115, .18); }
.markdown-section h2 { margin-top: 56px; font-size: 1.6rem; letter-spacing: -.025em; }
.markdown-section h3 { margin-top: 36px; font-size: 1.2rem; }
.markdown-section p, .markdown-section li { color: #c9d6e1; }
.markdown-section .search-jump-target {
  outline: 2px solid rgba(255, 225, 137, .75);
  outline-offset: 5px;
  border-radius: 3px;
  background: rgba(255, 225, 137, .09);
  scroll-margin-top: 24px;
}
::highlight(note-search-match) { color: #17212c; background: #ffe189; }
.markdown-section p { margin: 0 0 20px; }
.markdown-section li { margin: 5px 0; }
.markdown-section ul, .markdown-section ol { padding-left: 1.45em; }
.markdown-section hr { border-color: var(--line); margin: 44px 0; }
.markdown-section blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  color: #c9d9e6;
  background: rgba(99, 217, 189, .07);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.markdown-section code { color: #9af0dc; background: #1a2938; border-radius: 5px; padding: .16em .38em; }
.markdown-section pre {
  position: relative;
  padding: 20px;
  background: #172432;
  border: 1px solid #293b4d;
  border-radius: 9px;
  box-shadow: none;
}
.markdown-section pre > code { color: #e0eaf2; background: transparent; padding: 0; }
.docsify-copy-code-button { background: #2a3b4b !important; border-radius: 6px 0 0 6px !important; }
.markdown-section table { display: table; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.markdown-section th, .markdown-section td { border-color: var(--line); padding: 10px 12px; }
.markdown-section th { color: #f1f7fc; background: #1a2836; }
.markdown-section tr:nth-child(2n) { background: #172330; }
.markdown-section img { max-width: 100%; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }

.pdf-note {
  margin: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b131b;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .24);
}
.pdf-note__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 11px 13px;
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 12px;
}
.pdf-note__label { color: var(--accent); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.pdf-note__hint { flex: 1 1 220px; }
.pdf-note__bar a {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.pdf-note__bar a:hover { border-color: var(--accent); color: var(--accent); }
.pdf-note__frame {
  display: block;
  width: 100%;
  height: min(78vh, 920px);
  min-height: 560px;
  border: 0;
  background: #fff;
}
.pdf-note__caption { margin: 0 !important; padding: 10px 13px 12px; color: var(--muted) !important; font-size: 12px; }

.workspace-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -34px 0 24px;
  color: var(--muted);
  font-size: 13px;
}
.workspace-bar__badge { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.workspace-bar__divider { width: 1px; height: 15px; background: var(--line); }
.workspace-bar__edit { margin-left: auto; color: var(--muted); text-decoration: none; }
.workspace-bar__edit:hover { color: var(--accent); }

.top-edit-notes {
  position: fixed;
  top: 28px;
  right: 96px;
  z-index: 20;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-raised);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.top-edit-notes:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-hover); }

.note-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: -8px 0 18px; }
.note-category, .note-status, .note-tag {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid rgba(99, 217, 189, .34);
  border-radius: 999px;
  color: #8ee8d3 !important;
  background: rgba(99, 217, 189, .1);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.note-status { border-color: rgba(255, 255, 255, .18); color: #d5e0ea !important; background: rgba(255, 255, 255, .07); }
.note-status--tested { border-color: rgba(99, 217, 189, .4); color: #8ee8d3 !important; background: rgba(99, 217, 189, .1); }
.note-status--in-use { border-color: rgba(111, 205, 255, .4); color: #9edfff !important; background: rgba(111, 205, 255, .1); }
.note-status--archived { color: #93a1af !important; background: rgba(147, 161, 175, .1); }
.note-tag { border-color: var(--line); color: var(--muted) !important; background: var(--surface-raised); font-weight: 650; letter-spacing: .02em; text-transform: none; }
.note-category--reference { border-color: rgba(159, 180, 255, .35); color: #b5c4ff !important; background: rgba(159, 180, 255, .1); }
.note-category--my-tools { border-color: rgba(99, 217, 189, .4); color: #a0ead8 !important; background: rgba(99, 217, 189, .11); }
.note-category--digital-forensics { border-color: rgba(191, 152, 255, .38); color: #ceb2ff !important; background: rgba(191, 152, 255, .1); }
.note-category--threat-hunting { border-color: rgba(255, 188, 112, .4); color: #ffd09a !important; background: rgba(255, 188, 112, .1); }
.note-category--detection-engineering { border-color: rgba(111, 205, 255, .4); color: #9edfff !important; background: rgba(111, 205, 255, .1); }
.note-category--malware-analysis { border-color: rgba(255, 132, 156, .4); color: #ffacc0 !important; background: rgba(255, 132, 156, .1); }
.note-category--cloud-security { border-color: rgba(104, 220, 190, .4); color: #91ead7 !important; background: rgba(104, 220, 190, .1); }
.note-category--osint { border-color: rgba(234, 212, 111, .4); color: #f3e58e !important; background: rgba(234, 212, 111, .1); }
.note-category--cheat-sheets { border-color: rgba(255, 188, 112, .4); color: #ffd09a !important; background: rgba(255, 188, 112, .1); }

.recent-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 20px 0 36px; }
.recent-note {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-raised);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.recent-note:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.recent-note__category { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.recent-note strong { color: #f4f8fc; font-size: 15px; line-height: 1.35; }
.recent-note[href="#/notes/rambreaker"] { border-color: rgba(255, 120, 133, .55); }
.recent-note[href="#/notes/rambreaker"]:hover { border-color: #ff7885; }
.recent-note[href="#/notes/rambreaker"] strong { color: #ff7885; }
.recent-note small { margin-top: auto; color: var(--muted); font-size: 12px; }

.sidebar-toggle { border-color: var(--line); }

.profile-logo {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 20;
  display: block;
  width: 54px;
  height: 54px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-raised);
  cursor: zoom-in;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  transition: width .24s ease, height .24s ease, top .24s ease, right .24s ease, transform .24s ease, border-color .15s ease;
}
.profile-logo:hover { border-color: var(--accent); transform: translateY(-2px); }
.profile-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-card {
  position: fixed;
  top: 50%;
  right: 50%;
  z-index: 40;
  width: min(78vw, 500px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .52);
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, -50%) scale(.94);
  transition: opacity .2s ease, transform .2s ease;
}
.profile-card--open { opacity: 1; pointer-events: auto; transform: translate(50%, -50%) scale(1); }
.profile-card img { display: block; width: 100%; border-radius: 10px; }
.profile-card__about { display: block; padding: 12px 2px 0; color: var(--text); font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; }
.profile-card__about:hover { color: var(--accent); }
.profile-card__links { display: flex; gap: 10px; padding-top: 12px; }
.profile-card__link {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #f4f8fc;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.profile-card__link:hover { border-color: var(--accent); transform: translateY(-1px); }
.profile-card__link--linkedin { background: #0a66c2; border-color: #0a66c2; }
.profile-card__link--github { background: #24292f; }

@media screen and (max-width: 768px) {
  .sidebar { width: 288px; padding-top: 16px; }
  .content { left: 0; }
  .markdown-section { padding: 48px 24px 88px; }
  .workspace-bar { margin-top: -18px; }
  .markdown-section h1 { font-size: 2.3rem; }
  .markdown-section h2 { margin-top: 42px; }
  .markdown-section table { display: block; overflow-x: auto; white-space: nowrap; }
  .pdf-note__frame { height: 70vh; min-height: 460px; }
  .profile-logo { display: none; }
  .profile-card { display: none; }
  .top-edit-notes { display: none; }
}

@media (hover: none) {
  .search-result__inline { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
