@import url('https://fonts.googleapis.com/css2?family=Bitcount+Grid+Double:wght@100..900&family=VT323&display=swap');

:root {
  --moss: #5b7a5e;
  --moss-dark: #3e5a45;
  --moss-light: #b9cdb2;
  --lichen: #cddba3;
  --dusk: #9584b8;
  --dusk-light: #dcd4ee;

  --parchment: #f6f1e6;
  --parchment-deep: #efe7d5;
  --ink: #2c2a24;
  --muted: #766f61;
  --border: #ddd0ae;

  --glow: 0 0 12px rgba(149, 132, 184, 0.35);
  --sidebar-width: 230px;
}

/* =========================
   Reset
   ========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--dusk);
  color: var(--parchment);
}

body {
  min-height: 100vh;

  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  line-height: 1.65;

  color: var(--ink);
  background-color: var(--parchment);

  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(44, 42, 36, 0.025) 0px,
      rgba(44, 42, 36, 0.025) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(circle at 15% 20%, rgba(185, 205, 178, 0.35), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(149, 132, 184, 0.18), transparent 45%);
  background-attachment: fixed;
}

/* scrollbar custom */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--parchment-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--moss-light);
  border: 2px solid var(--parchment-deep);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--dusk);
}

/* =========================
   Header / Navbar
   ========================= */

header {
  position: fixed;
  top: 0;
  left: 0;

  width: var(--sidebar-width);
  height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;

  padding: 34px 26px;

  background: linear-gradient(180deg, var(--parchment-deep), var(--parchment));
  border-right: 1px dashed var(--border);
}

header::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--dusk-light), transparent);
  opacity: 0.7;
}

header::before {
  content: "· ⁘ ·";
  display: block;
  text-align: center;
  color: var(--moss);
  letter-spacing: 4px;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Navbar */

nav ul {
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 6px;
}

nav a {
  position: relative;
  display: block;

  padding: 8px 10px 8px 18px;

  color: var(--moss-dark);
  text-decoration: none;
  letter-spacing: 0.3px;

  border-radius: 3px;

  transition: color 0.2s ease, padding-left 0.2s ease, background-color 0.2s ease;
}

nav a::before {
  content: "»";
  position: absolute;
  left: 2px;
  opacity: 0;
  color: var(--dusk);
  transition: opacity 0.2s ease, left 0.2s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--dusk);
  padding-left: 22px;
  background: rgba(149, 132, 184, 0.08);
}

nav a:hover::before,
nav a:focus-visible::before {
  opacity: 1;
  left: 6px;
}

/* =========================
   Search
   ========================= */

#searchInput {
  width: 100%;
  padding: 9px 12px;

  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  letter-spacing: 0.5px;

  color: var(--ink);
  background: var(--parchment);
  caret-color: var(--dusk);

  border: 1px dashed var(--border);
  border-radius: 3px;
  outline: none;

  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#searchInput::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

#searchInput:focus {
  border-color: var(--dusk);
  border-style: solid;
  box-shadow: var(--glow);
}

/* =========================
   Main
   ========================= */

main {
  max-width: 880px;

  margin-left: var(--sidebar-width);
  margin-right: auto;
  padding: 75px 60px;
}

/* =========================
   Typography
   ========================= */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bitcount Grid Double', monospace;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 25px;
  font-size: clamp(2.2rem, 5vw, 4rem);

  color: var(--moss-dark);
  text-shadow: 0 0 18px rgba(149, 132, 184, 0.28);
}

h1::after {
  content: "_";
  color: var(--dusk);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

h2, h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--moss);
  text-shadow: none;
}

p {
  margin-bottom: 1rem;
  color: var(--ink);
}

/* =========================
   Links
   ========================= */

main a {
  color: var(--dusk);
  font-weight: 600;

  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;

  transition: color 0.2s ease, text-shadow 0.2s ease;
}

main a:hover {
  color: var(--moss-dark);
  text-shadow: 0 0 8px rgba(149, 132, 184, 0.4);
}

/* =========================
   Articles
   ========================= */

#articles {
  margin-top: 35px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#articles > * {
  position: relative;
  padding: 22px 24px;

  background: var(--parchment);
  border: 1px dashed var(--border);
  border-left: 3px solid var(--moss);
  border-radius: 4px;

  transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
}

#articles > *::before {
  content: "✦";
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--lichen);
  font-size: 0.9rem;
  opacity: 0.8;
}

#articles > *:hover {
  transform: translateX(3px);
  border-left-color: var(--dusk);
  box-shadow: var(--glow);
}

/* =========================
   Footer
   ========================= */

footer {
  margin-left: var(--sidebar-width);
  padding: 20px 60px 50px;

  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

footer::before {
  content: "· · · · · · ·";
  display: block;
  margin-bottom: 12px;
  color: var(--moss-light);
  letter-spacing: 6px;
}

@media (prefers-reduced-motion: reduce) {
  h1::after {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 700px) {

  header {
    position: static;

    width: 100%;
    height: auto;

    padding: 20px;

    border-right: 0;
    border-bottom: 1px dashed var(--border);

    gap: 20px;
  }

  header::after {
    display: none;
  }

  nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
  }

  nav a {
    padding: 7px 10px 7px 18px;
  }

  #searchInput {
    max-width: 300px;
  }

  main {
    margin-left: 0;
    padding: 45px 25px;
  }

  footer {
    margin-left: 0;
    padding: 20px 25px 40px;
  }

  h1 {
    font-size: 2.5rem;
  }
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 400px) {

  header {
    padding: 15px;
  }

  main {
    padding: 35px 18px;
  }

  nav ul {
    flex-direction: column;
  }

  #searchInput {
    max-width: none;
  }
}