@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300,400,500&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700;800&family=Sora:ital,wght@0,400;0,700;1,400&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&display=swap");

:root {
  --green: #24d05a;
  --pink: #eb4888;
  --blue: #10a2f5;
  --yellow: #e9bc3f;
  --orange: #ff6b2b;
  --violet: #9b5de5;
  --red: #f72585;
  --indigo: #5c67f2;

  --bg: #0e0e0e;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-aside: #111111;
  --border: #222222;
  --border-subtle: #1a1a1a;
  --text: #f5f5f5;
  --text-muted: #888888;
  --text-dim: #555555;
  --link: #10a2f5;
  --link-hover: #48b8ff;

  --font-body: "Source Sans 3", sans-serif;
  --font-mainTitle: "Syne", sans-serif;
  --font-display: "Inconsolata", sans-serif;
  --font-mono: "Sora", monospace;

  --page-pad: 1.25rem;
  --page-max: 720px;
}

::search-text {
  background-color: purple;
  color: white;
}

@media (min-width: 600px) {
  :root {
    --page-pad: 2.5rem;
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --bg: #f8f8f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0ed;
    --bg-aside: #f3f3f0;
    --border: #e2e2de;
    --border-subtle: #ececea;
    --text: #111111;
    --text-muted: #555555;
    --text-dim: #888888;
    --link: #0d8fe0;
    --link-hover: #0a72b5;
    --violet: #7c3fd4;
    --indigo: #4451e0;
  }
}

html[data-theme="light"] {
  --bg: #f8f8f6;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0ed;
  --bg-aside: #f3f3f0;
  --border: #e2e2de;
  --border-subtle: #ececea;
  --text: #111111;
  --text-muted: #555555;
  --text-dim: #888888;
  --link: #0d8fe0;
  --link-hover: #0a72b5;
  --violet: #7c3fd4;
  --indigo: #4451e0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

img {
  max-width: 100%;
}

.c-green { color: var(--green); }
.c-pink { color: var(--pink); }
.c-blue { color: var(--blue); }
.c-yellow { color: var(--yellow); }
.c-orange { color: var(--orange); }
.c-violet { color: var(--violet); }
.c-red { color: var(--red); }
.c-indigo { color: var(--indigo); }

.color-bar {
  display: flex;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  gap: 1px;
  margin: 0 var(--page-pad) 2rem;
}

.color-bar span { flex: 1; }
.color-bar span:nth-child(1) { background: var(--green); }
.color-bar span:nth-child(2) { background: var(--pink); }
.color-bar span:nth-child(3) { background: var(--blue); }
.color-bar span:nth-child(4) { background: var(--yellow); }
.color-bar span:nth-child(5) { background: var(--orange); }
.color-bar span:nth-child(6) { background: var(--violet); }
.color-bar span:nth-child(7) { background: var(--red); }
.color-bar span:nth-child(8) { background: var(--indigo); }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  font-family: var(--font-mono);
  margin-right: 4px;
  transition: opacity 0.15s;
}

.tag a {
  color: inherit;
  text-decoration: none;
}

.tag:hover { opacity: 0.8; }
.tag:nth-child(8n + 1) { background: rgba(36, 208, 90, 0.12); color: var(--green); }
.tag:nth-child(8n + 2) { background: rgba(235, 72, 136, 0.12); color: var(--pink); }
.tag:nth-child(8n + 3) { background: rgba(16, 162, 245, 0.12); color: var(--blue); }
.tag:nth-child(8n + 4) { background: rgba(233, 188, 63, 0.12); color: var(--yellow); }
.tag:nth-child(8n + 5) { background: rgba(255, 107, 43, 0.12); color: var(--orange); }
.tag:nth-child(8n + 6) { background: rgba(155, 93, 229, 0.15); color: var(--violet); }
.tag:nth-child(8n + 7) { background: rgba(247, 37, 133, 0.12); color: var(--red); }
.tag:nth-child(8n + 8) { background: rgba(92, 103, 242, 0.15); color: var(--indigo); }

.post-info svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-dim);
  flex-shrink: 0;
  vertical-align: middle;
}

.content {
  width: 760px;
  margin: 0 auto;
  align-items: unset;
  max-width: 100%;
}

.lang {
  margin-left: 18px;
  border-left: 1px solid #a9a9b3;
  padding-left: 18px;
  margin-right: 18px;
}

.logo__cursor {
  background: #f77825;
}

@keyframes logo-text-spectrum {
  0% { color: var(--green); }
  12.5% { color: var(--pink); }
  25% { color: var(--blue); }
  37.5% { color: var(--yellow); }
  50% { color: var(--orange); }
  62.5% { color: var(--violet); }
  75% { color: var(--red); }
  87.5% { color: var(--indigo); }
  100% { color: var(--green); }
}

.logo__text {
  color: var(--text);
}

.logo__text:hover {
  animation: logo-text-spectrum 1s linear infinite;
}

section.header {
  border-top: 2px solid #eee;
  height: 50px;
  display: flex;
  justify-content: space-around;
}

.header__inner p:first-child {
  font-weight: bolder;
}

.tags {
  list-style: none;
  display: inline-flex;
  overflow-x: scroll;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tags li {
  margin-left: 12px;
}

.tags::-webkit-scrollbar {
  display: none;
}

/* Menu links: black by default with colored hover */
.menu__inner li a,
.submenu .dropbtn,
.submenu .dropdown-content a {
  color: #111111;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.menu__inner li a:hover,
.submenu .dropbtn:hover,
.submenu .dropdown-content a:hover {
  color: var(--blue);
  background-color: rgba(16, 162, 245, 0.08);
}

/* Home category tags row: black links + colorful hover */
.tags li a {
  color: #111111;
  border-bottom: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 4px;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.tags li:nth-child(8n + 1) a:hover { color: var(--green); border-bottom-color: var(--green); background-color: rgba(36, 208, 90, 0.1); }
.tags li:nth-child(8n + 2) a:hover { color: var(--pink); border-bottom-color: var(--pink); background-color: rgba(235, 72, 136, 0.1); }
.tags li:nth-child(8n + 3) a:hover { color: var(--blue); border-bottom-color: var(--blue); background-color: rgba(16, 162, 245, 0.1); }
.tags li:nth-child(8n + 4) a:hover { color: var(--yellow); border-bottom-color: var(--yellow); background-color: rgba(233, 188, 63, 0.12); }
.tags li:nth-child(8n + 5) a:hover { color: var(--orange); border-bottom-color: var(--orange); background-color: rgba(255, 107, 43, 0.1); }
.tags li:nth-child(8n + 6) a:hover { color: var(--violet); border-bottom-color: var(--violet); background-color: rgba(155, 93, 229, 0.12); }
.tags li:nth-child(8n + 7) a:hover { color: var(--red); border-bottom-color: var(--red); background-color: rgba(247, 37, 133, 0.1); }
.tags li:nth-child(8n + 8) a:hover { color: var(--indigo); border-bottom-color: var(--indigo); background-color: rgba(92, 103, 242, 0.12); }

/* Dark mode readability for menu and home tags */
html[data-theme="dark"] .menu__inner li a,
html[data-theme="dark"] .submenu .dropbtn,
html[data-theme="dark"] .submenu .dropdown-content a,
html[data-theme="dark"] .tags li a {
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .menu__inner li a,
  html:not([data-theme="light"]) .submenu .dropbtn,
  html:not([data-theme="light"]) .submenu .dropdown-content a,
  html:not([data-theme="light"]) .tags li a {
    color: var(--text);
  }
}

@media screen and (min-width: 321px) {
  .lang {
    margin-right: 0;
  }

  .header__inner p:first-child {
    width: unset;
  }
}
