:root {
  --bg: #282a36;
  --surface: #1f2130;
  --text: #f8f8f2;
  --comment: #6272a4;
  --cyan: #8be9fd;
  --green: #50fa7b;
  --orange: #ffb86c;
  --pink: #ff79c6;
  --purple: #bd93f9;
  --red: #ff5555;
  --yellow: #f1fa8c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  background: radial-gradient(circle at top right, #44475a 0%, var(--bg) 50%);
  color: var(--text);
  overflow-x: clip;
}

html {
  scrollbar-color: #6272a4 #1f2130;
  scrollbar-width: thin;
}

html::-webkit-scrollbar {
  width: 10px;
  height: 0;
}

html::-webkit-scrollbar-track {
  background: #1f2130;
}

html::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6272a4, #44475a);
  border-radius: 999px;
  border: 2px solid #1f2130;
}

html::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8be9fd, #6272a4);
}

.terminal {
  width: 100%;
  min-height: 100vh;
  background: var(--surface);
  border: 1px solid #44475a;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #191a21;
  border-bottom: 1px solid #44475a;
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: #1d1f2b;
  border-bottom: 1px solid #44475a;
}

.tab-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--comment);
  text-decoration: none;
  text-transform: lowercase;
  padding: 10px 14px;
  border-top: 2px solid transparent;
  border-left: 1px solid #44475a;
  border-right: 1px solid #44475a;
}

.tab-item:first-child {
  border-left: none;
}

.tab-item:last-child {
  border-right: none;
}

.tab-item:hover {
  color: var(--cyan);
  text-decoration: none;
}

.tab-item.is-active {
  color: var(--text);
  border-top-color: var(--purple);
  background: rgba(40, 42, 54, 0.65);
}

.terminal-header p {
  margin: 0;
  color: var(--comment);
  font-size: 0.92rem;
}

.dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.red {
  background: var(--red);
}

.yellow {
  background: var(--yellow);
}

.green {
  background: var(--green);
}

.terminal-body {
  padding: 20px;
  line-height: 1.8;
  flex: 1;
}

.title {
  margin: 0 0 10px;
  color: var(--purple);
  font-size: 1.5rem;
}

.prompt {
  color: var(--green);
  margin: 0 0 12px;
}

.link-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.link-item {
  display: grid;
  grid-template-columns: 44px minmax(120px, 200px) 1fr;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px dashed rgba(98, 114, 164, 0.4);
  padding-bottom: 6px;
}

.line-no {
  color: var(--comment);
}

a {
  color: var(--cyan);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.desc {
  color: var(--orange);
  font-size: 0.95rem;
}

.link-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.link-icon {
  width: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pink);
}

.profile-section {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(98, 114, 164, 0.55);
  border-radius: 8px;
  background: rgba(40, 42, 54, 0.6);
  margin-bottom: 14px;
}

.profile-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #44475a;
}

.profile-heading {
  margin: 0 0 6px;
  color: var(--pink);
  font-weight: 700;
}

.profile-text p {
  margin: 0 0 8px;
  color: var(--text);
}

strong {
  color: var(--yellow);
}

.empty-message {
  margin: 0 0 14px;
  color: var(--comment);
}

.contributions-section {
  padding: 4px 0;
  display: grid;
  gap: 10px;
}

.contribution-heading {
  margin: 0;
  color: var(--purple);
  font-weight: 700;
}

.contributions-link {
  display: block;
  width: 100%;
}

.contributions-chart {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  filter: saturate(1.05) contrast(1.03);
}

.contribution-note {
  margin: 0;
  color: var(--comment);
  font-size: 0.9rem;
}

.markdown-article {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(98, 114, 164, 0.45);
  border-radius: 8px;
  background: rgba(40, 42, 54, 0.55);
}

.articles-content .markdown-article {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.markdown-article h1,
.markdown-article h2,
.markdown-article h3,
.markdown-article h4,
.markdown-article h5,
.markdown-article h6 {
  margin: 0 0 10px;
  color: var(--purple);
  line-height: 1.4;
}

.markdown-article p,
.markdown-article blockquote,
.markdown-article ul,
.markdown-article pre {
  margin: 0 0 12px;
}

.markdown-article blockquote {
  margin-left: 0;
  padding-left: 12px;
  border-left: 3px solid var(--comment);
  color: #c8d1ff;
}

.markdown-article hr {
  border: 0;
  border-top: 1px dashed rgba(98, 114, 164, 0.6);
  margin: 12px 0;
}

.article-list-markdown {
  padding-left: 22px;
  color: var(--text);
}

.articles-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  gap: 16px;
  min-height: 64vh;
}

.articles-sidebar-backdrop,
.article-menu-toggle {
  display: none;
}

.articles-sidebar,
.articles-content {
  padding: 14px;
  border: 1px solid rgba(98, 114, 164, 0.45);
  border-radius: 8px;
  background: rgba(25, 26, 33, 0.85);
}


.article-filter-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(98, 114, 164, 0.45);
  border-radius: 8px;
  background: rgba(40, 42, 54, 0.55);
}

.article-filter-label {
  margin: 0;
  color: var(--purple);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-search-input {
  width: 100%;
  border: 1px solid #44475a;
  border-radius: 6px;
  background: #1a1c28;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.article-search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(139, 233, 253, 0.2);
}

.article-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-filter-tag {
  border: 1px solid rgba(98, 114, 164, 0.55);
  border-radius: 999px;
  background: rgba(25, 26, 33, 0.95);
  color: var(--comment);
  padding: 4px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.article-filter-tag:hover {
  color: var(--cyan);
  border-color: rgba(139, 233, 253, 0.55);
}

.article-filter-tag.is-active {
  color: var(--bg);
  background: var(--purple);
  border-color: var(--purple);
}

.article-filter-summary {
  margin: 0;
  color: var(--comment);
  font-size: 0.8rem;
}

.article-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.article-nav-item {
  border: 1px solid transparent;
  border-radius: 6px;
}

.article-nav-item.is-selected {
  border-color: rgba(189, 147, 249, 0.75);
  background: rgba(68, 71, 90, 0.55);
}

.article-nav-link {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  padding: 8px;
  text-decoration: none;
}

.article-nav-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.article-nav-title,
.article-nav-date {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-nav-title {
  color: var(--cyan);
  font-weight: 600;
}

.article-nav-date {
  font-size: 0.85rem;
  color: var(--comment);
}

.article-nav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-tag {
  font-size: 0.78rem;
  border: 1px solid rgba(139, 233, 253, 0.35);
  color: var(--yellow);
  border-radius: 999px;
  padding: 1px 8px;
}

.markdown-article pre {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #44475a;
  background: #11131d;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.markdown-article code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  background: rgba(68, 71, 90, 0.55);
  color: var(--orange);
  border-radius: 4px;
  padding: 1px 4px;
}

.markdown-article pre code {
  background: transparent;
  color: var(--text);
  padding: 0;
}

.markdown-article,
.markdown-article p,
.markdown-article li,
.desc,
.link-label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.back-link {
  color: var(--pink);
}

.photo-workspace {
  display: grid;
  gap: 14px;
}

.photo-list {
  display: grid;
  gap: 22px;
  max-height: none;
  overflow: visible;
}

.photo-item {
  margin: 0;
  display: grid;
  gap: 10px;
}

.photo-source {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--comment);
  font-size: 0.9rem;
}

.photo-source code {
  background: rgba(68, 71, 90, 0.45);
  color: var(--cyan);
  border-radius: 4px;
  padding: 1px 6px;
}

.photo-image {
  width: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(98, 114, 164, 0.6);
  background: #11131d;
}

@media (max-width: 900px) {
  .articles-workspace {
    grid-template-columns: 1fr;
  }

  .articles-content {
    min-height: calc(100vh - 220px);
  }

  .articles-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(88vw, 340px);
    max-height: 100vh;
    overflow-y: auto;
    border-radius: 0 10px 10px 0;
    z-index: 30;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: 12px 0 34px rgba(0, 0, 0, 0.32);
  }

  .articles-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

  .articles-workspace.is-sidebar-open .articles-sidebar {
    transform: translateX(0);
  }

  .articles-workspace.is-sidebar-open .articles-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .article-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    border: 1px solid rgba(189, 147, 249, 0.9);
    border-radius: 999px;
    background: rgba(31, 33, 48, 0.95);
    color: var(--cyan);
    padding: 10px 14px;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }

  .article-menu-toggle[aria-expanded="true"] {
    color: var(--yellow);
    border-color: var(--yellow);
  }
}

@media (max-width: 640px) {
  .link-item {
    grid-template-columns: 36px 1fr;
  }

  .desc {
    grid-column: 2;
    margin-top: -8px;
    color: var(--purple);
  }

  .profile-section {
    grid-template-columns: 1fr;
  }

  .profile-image {
    max-width: 180px;
  }
}
