/* =========================================================================
   Custom modernization layer for the Terminal theme.
   Loaded LAST via head.html, so it overrides theme defaults.
   Delete this file to fully revert to the stock theme.
   Direction: refined terminal (keep Fira Code mono) + cool blue accent.
   ========================================================================= */

:root {
  /* Cool, deep near-black with a subtle blue undertone */
  --background: #0d0f13;
  --surface: #14181f;
  --surface-2: #1b2129;
  --foreground: #e6e9ee;
  --muted: #98a2b3;
  --accent: #4ea3ff;
  --accent-soft: #7cbcff;
  --accent-dim: rgba(78, 163, 255, 0.14);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --line-height: 1.7em;
}

html {
  scroll-behavior: smooth;
}

/* Subtle depth: a faint radial glow anchored top-center */
body {
  background-color: var(--background);
  background-image:
    radial-gradient(1100px 600px at 50% -10%, rgba(78, 163, 255, 0.08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-dim);
  color: var(--foreground);
}

/* Refined scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* --- Layout container ------------------------------------------------- */
.container {
  border: none !important;
  max-width: 820px;
}

/* --- Typography ------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.01em;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover { color: var(--accent-soft); }

/* Inline prose links get a subtle animated underline */
.post-content a,
.index-content a {
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size 0.25s ease, color 0.18s ease;
  padding-bottom: 1px;
}
.post-content a:hover,
.index-content a:hover {
  background-size: 100% 1.5px;
}

/* --- Header / logo ---------------------------------------------------- */
.header {
  padding-top: 10px;
  margin-bottom: 10px;
}

.logo {
  background: var(--accent);
  color: #06121f;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(78, 163, 255, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.header__logo a:hover .logo {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(78, 163, 255, 0.4);
}

/* Soften the dashed strip after the logo */
.header__logo::after {
  background: repeating-linear-gradient(
    90deg,
    var(--border-strong),
    var(--border-strong) 2px,
    transparent 0,
    transparent 12px
  );
  opacity: 0.7;
  align-self: center;
  height: 1px;
  margin-left: 16px;
}

/* --- Navigation ------------------------------------------------------- */
.navigation-menu {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  margin: 14px 1px 30px;
}

.navigation-menu__inner > li a {
  position: relative;
  color: var(--muted);
  padding: 4px 2px;
  font-size: 0.95em;
  transition: color 0.18s ease;
}
.navigation-menu__inner > li a:hover {
  color: var(--foreground);
}
.navigation-menu__inner > li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.navigation-menu__inner > li a:hover::after {
  transform: scaleX(1);
}

.menu__trigger { color: var(--muted); }
.menu__dropdown {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
}
.menu__dropdown > li a { border-radius: 6px; color: var(--muted); }
.menu__dropdown > li a:hover { background: var(--accent-dim); color: var(--foreground); }

/* --- Post list as cards ---------------------------------------------- */
.posts {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.post.on-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px !important;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.post.on-list:not(:last-of-type) {
  border-bottom: 1px solid var(--border); /* override theme divider */
}
.post.on-list:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* Clean post titles — drop the theme's double dotted underline */
.post-title {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 10px !important;
  color: var(--foreground);
  font-size: calc(var(--font-size) * 1.4);
}
.post-title::after { display: none !important; }
.post-title a { color: var(--foreground); transition: color 0.18s ease; }
.post.on-list:hover .post-title a,
.post-title a:hover { color: var(--accent); }

.post-meta {
  color: var(--muted);
  font-size: 0.85em;
}

/* Tags as pills */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.post-tags a {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.8em;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.post-tags a:hover {
  background: rgba(78, 163, 255, 0.22);
  border-color: var(--accent);
}

.post-content { color: var(--muted); }
.post.on-list .post-content { margin-top: 16px; }

/* --- Read more / buttons --------------------------------------------- */
.button, button, .read-more {
  border: 1px solid var(--border-strong) !important;
  border-radius: 999px !important;
  color: var(--accent) !important;
  font-weight: 500 !important;
  padding: 7px 18px !important;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease !important;
}
.button:hover, button:hover, .read-more:hover {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  transform: translateY(-1px);
}
.read-more.inline { display: inline-block; margin-top: 6px; }

/* --- Single post page ------------------------------------------------- */
.post:not(.on-list) .post-title {
  font-size: calc(var(--font-size) * 1.9);
  margin-bottom: 14px !important;
}

/* --- Images: replace thick gold frame with soft modern treatment ----- */
img {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 0 !important;
  box-shadow: var(--shadow-sm);
}
.post-cover { border-radius: var(--radius) !important; }

figure figcaption {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -4px;
  padding: 6px 12px;
  font-size: 0.85em;
}

iframe[src*="youtube.com"] {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 0 !important;
}

/* Profile picture on the homepage */
.index-content img[src*="profile"] {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 0 6px var(--accent-dim), var(--shadow);
}

/* --- Blockquote: modern left accent bar ------------------------------ */
blockquote {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--accent) !important;
  border-radius: var(--radius-sm);
  padding: 18px 22px 18px 26px !important;
  color: var(--muted);
}
blockquote::before { display: none !important; }

/* --- Code ------------------------------------------------------------- */
code, kbd {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  color: var(--accent-soft) !important;
  padding: 2px 6px !important;
}
pre {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 18px 20px !important;
  box-shadow: var(--shadow-sm);
}
pre code {
  border: none !important;
  background: transparent !important;
  color: inherit !important;
}

/* --- Tables ----------------------------------------------------------- */
table { border-radius: var(--radius-sm); overflow: hidden; }
table, th, td { border: 1px solid var(--border) !important; }
th {
  background: var(--surface-2);
  color: var(--foreground);
}
td { color: var(--muted); }
tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }

/* --- Horizontal rule -------------------------------------------------- */
hr {
  height: 1px !important;
  background: var(--border) !important;
}

/* --- Lists in prose --------------------------------------------------- */
.post ul li:not(:empty)::before { color: var(--accent); }
li::marker { color: var(--accent); }

/* --- Footer ----------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  opacity: 1;
  color: var(--muted);
}
.footer a { color: var(--muted); transition: color 0.18s ease; }
.footer a:hover { color: var(--accent); }

/* --- Section dividers on the about/home page -------------------------- */
.index-content hr {
  margin: 34px 0;
}

/* --- Respect reduced motion ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* --- Mobile tweaks ---------------------------------------------------- */
@media (max-width: 684px) {
  .post.on-list { padding: 20px 18px !important; }
  .container { padding: 20px 16px; }
}
