#nav-toggle { display: none; }
/* ============================================
   TERMINAL — Hacker/Terminal Theme
   Green on black, monospace, CLI aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2129;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --green: #3fb950;
  --green-dim: #238636;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --orange: #d29922;
  --red: #f85149;
  --cyan: #39d2c0;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
}

html { font-size: 15px; }

body {
  margin: 0;
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }
a { color: var(--green); }
img { max-width: 100%; height: auto; display: block; }

::selection {
  background: var(--green);
  color: var(--bg);
}

/* Scanline effect */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ---- HEADER ---- */
body > header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

body > header > div {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--green);
}

.logo img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  opacity: 0.8;
}

.logo span {
  display: inline;
  font-weight: 600;
  font-size: 0.9rem;
}

.logo::before {
  content: "~$";
  color: var(--text-muted);
  font-weight: 400;
}

.hamburger { display: none; }

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--sp-3);
}

nav ul li a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

nav ul li a::before {
  content: "./";
  color: var(--text-muted);
  opacity: 0.5;
}

nav ul li a:hover {
  color: var(--green);
  background: rgba(63, 185, 80, 0.1);
}

/* ---- MAIN ---- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ---- ARTICLES SECTION ---- */
.articles-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.articles-section h2::before {
  content: "$ ls -la ";
  color: var(--text-muted);
  font-weight: 400;
}

.articles-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* All cards as terminal rows */
.articles-grid article a {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--sp-4);
  text-decoration: none;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, background 0.2s;
}

.articles-grid article a:hover {
  border-color: var(--green-dim);
  background: var(--surface-hover);
}

.articles-grid article img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.articles-grid article .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.articles-grid article h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.3;
  margin-bottom: var(--sp-2);
}

.articles-grid article p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--sp-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.articles-grid article time {
  font-size: 0.75rem;
  color: var(--orange);
  font-weight: 500;
}

.articles-grid article time::before {
  content: "modified: ";
  color: var(--text-muted);
  font-weight: 400;
}

/* First card highlighted */
.articles-grid article:first-child a {
  border-color: var(--green-dim);
  grid-template-columns: 280px 1fr;
}

.articles-grid article:first-child img {
  width: 280px;
  height: 180px;
}

.articles-grid article:first-child h3 {
  font-size: 1.1rem;
  color: var(--green);
}

.articles-grid article:first-child p {
  white-space: normal;
}

/* ---- ABOUT SECTION ---- */
.about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-6);
  margin-top: var(--sp-10);
  position: relative;
}

.about-section::before {
  content: "# README.md";
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.about-section h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: var(--sp-4);
}

.about-section h1::before {
  content: "# ";
  color: var(--text-muted);
}

.about-section h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.about-section h2::before {
  content: "## ";
  color: var(--text-muted);
}

.about-section p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.about-section ul {
  list-style: none;
  padding: 0;
  margin: var(--sp-3) 0;
}

.about-section li {
  padding: var(--sp-2) 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

.about-section li::before {
  content: "- ";
  color: var(--text-muted);
}

.about-section li strong {
  color: var(--cyan);
}

/* ---- COMMENTS SECTION ---- */
.comments-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.comments-section h2::before {
  content: "$ git log --oneline ";
  color: var(--text-muted);
  font-weight: 400;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.comments-list article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-6);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.comment-header a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--cyan);
}

.comment-header a img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.comment-header time {
  font-size: 0.75rem;
  color: var(--orange);
}

.comments-list article p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---- COMMENTS CTA ---- */
.comments-cta {
  background: var(--surface);
  border: 1px dashed var(--green-dim);
  border-radius: 6px;
  padding: var(--sp-6);
  margin-top: var(--sp-6);
  text-align: center;
}

.comments-cta h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-3);
}

.comments-cta p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.comments-cta a {
  display: inline-block;
  padding: var(--sp-3) var(--sp-6);
  background: var(--green-dim);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.comments-cta a:hover {
  background: var(--green);
  color: var(--bg);
}

/* ---- ARTICLE PAGE ---- */
.breadcrumb {
  list-style: none;
  display: flex;
  gap: var(--sp-2);
  padding: 0;
  margin: 0 0 var(--sp-6) 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--sp-2);
  color: var(--text-muted);
}

.breadcrumb a {
  text-decoration: none;
  color: var(--blue);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.article-hero {
  margin-bottom: var(--sp-6);
}

.article-hero img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.article-meta {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-3);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-meta time {
  color: var(--orange);
}

.article-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: var(--sp-6);
}

.article-title::before {
  content: "# ";
  color: var(--text-muted);
}

.article-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 900px;
}

.article-content p {
  margin-bottom: var(--sp-4);
}

.article-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.article-content h2::before {
  content: "## ";
  color: var(--text-muted);
}

.article-content blockquote {
  border-left: 3px solid var(--green-dim);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-4) 0;
  color: var(--text-muted);
  background: rgba(63, 185, 80, 0.05);
  border-radius: 0 6px 6px 0;
}

.article-content blockquote::before {
  content: "> ";
  color: var(--green-dim);
}

.article-content code {
  font-family: var(--font-mono);
  background: rgba(110, 118, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--cyan);
}

.article-content pre {
  background: var(--surface);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

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

/* ---- AUTH PAGE ---- */
.auth-section {
  max-width: 440px;
  margin: var(--sp-16) auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-8);
}

.auth-card::before {
  content: "$ ssh login@blog";
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.auth-card h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green);
  text-align: center;
  margin-bottom: var(--sp-6);
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.auth-card label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.auth-card label::after {
  content: ":";
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  padding: var(--sp-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.auth-card input:focus {
  border-color: var(--green);
}

.auth-card button {
  padding: var(--sp-4);
  background: var(--green-dim);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-card button:hover {
  background: var(--green);
  color: var(--bg);
}

.auth-links {
  margin-top: var(--sp-4);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-links a {
  color: var(--blue);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-6) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.auth-social {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  transition: border-color 0.2s, background 0.2s;
}

.auth-social:hover {
  border-color: var(--green-dim);
  background: var(--surface-hover);
}

.auth-social img {
  width: 20px;
  height: 20px;
}

/* ---- SEARCH PAGE ---- */
.search-section {
  max-width: 640px;
  margin: var(--sp-12) auto;
}

.search-section h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-6);
}

.search-section h1::before {
  content: "$ grep -r ";
  color: var(--text-muted);
  font-weight: 400;
}

.search-form {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.search-form input {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: none;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-form button {
  padding: var(--sp-3) var(--sp-4);
  background: var(--green-dim);
  color: #fff;
  border: none;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.search-form button:hover {
  background: var(--green);
  color: var(--bg);
}

/* ---- CONTACTS PAGE ---- */
.contacts-section {
  max-width: 640px;
  margin: var(--sp-12) auto;
}

.contacts-section h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-6);
}

.contacts-section h1::before {
  content: "$ cat ";
  color: var(--text-muted);
  font-weight: 400;
}

.contacts-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

/* ---- 404 PAGE ---- */
.not-found {
  text-align: center;
  padding: var(--sp-20) var(--sp-6);
}

.not-found h1 {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--sp-4);
  color: var(--red);
}

.not-found h1::before {
  content: "Error ";
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-bottom: var(--sp-2);
}

.not-found p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}

.not-found p::before {
  content: "bash: page: ";
  color: var(--red);
}

.not-found a {
  display: inline-block;
  padding: var(--sp-2) var(--sp-6);
  background: var(--green-dim);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.not-found a:hover {
  background: var(--green);
  color: var(--bg);
}

/* ---- ABOUT PAGE ---- */
.about-page {
  max-width: 780px;
  margin: var(--sp-12) auto;
}

.about-page h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-6);
}

.about-page h1::before {
  content: "$ cat ";
  color: var(--text-muted);
  font-weight: 400;
}

/* ---- FOOTER ---- */
footer {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-10);
}

footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  #nav-toggle {
    display: block;
    appearance: none;
    width: 44px;
    height: 44px;
    min-height: 44px;
    min-width: 44px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    color: var(--green);
    font-size: 1.2rem;
  }

  #nav-toggle:focus {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }

  #nav-toggle::before {
    content: "☰";
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-2);
    z-index: 50;
  }

  #nav-toggle:checked ~ .nav-menu {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: var(--sp-1);
  }

  nav ul li a {
    padding: var(--sp-3) var(--sp-4);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .articles-grid article:first-child a {
    grid-template-columns: 120px 1fr;
  }

  .articles-grid article:first-child img {
    width: 120px;
    height: 120px;
  }

  .articles-grid article:first-child h3 {
    font-size: 1.2rem;
  }

  .articles-grid article h3 {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  .articles-grid article p {
    font-size: 0.9rem;
  }

  .article-title {
    font-size: clamp(1.3rem, 4vw, 1.6rem);
  }

  .not-found h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  /* Larger touch targets */
  input, button, textarea, select {
    font-size: 16px;
  }

  .container {
    padding: var(--sp-4) var(--sp-3);
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-dim);
}

/* =========================
   Comment replies
========================= */
.comment-replies {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comment--reply {
  margin-left: var(--space-lg);
  border-left: 2px solid var(--accent-color, var(--border-color));
  background: transparent;
}

/* ===========================
   Scroll Animations — Terminal
   "Rendering" effect with blur
=========================== */

:root {
  --t-fast: 0.1s;
  --t-base: 0.2s;
  --t-slow: 0.3s;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes terminalBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(2px);
}

.animate-on-scroll.is-visible {
  animation: fadeSlideUp 0.3s ease-out forwards;
}

.articles-grid .animate-on-scroll.is-visible:nth-child(2) { animation-delay: 0.08s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(3) { animation-delay: 0.12s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(4) { animation-delay: 0.16s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(5) { animation-delay: 0.2s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(6) { animation-delay: 0.24s; }

/* Lazy-loaded images */
@keyframes imgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

img[loading="lazy"] {
  opacity: 0;
  animation: none;
}

img[loading="lazy"].is-loaded {
  animation: imgFadeIn 0.3s ease-out forwards;
}

/* Card hover — terminal glow */
.articles-grid article a {
  transition: border-color var(--t-base), background var(--t-base);
}

.articles-grid article a:hover {
  border-color: var(--green);
}

.articles-grid article a:hover h3 {
  text-shadow: 0 0 5px var(--green);
}

/* ===========================
   Cookie Banner — Terminal
=========================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg);
  border-top: 1px solid var(--green);
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--t-slow), opacity var(--t-slow);
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.cookie-banner__inner p {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 4px;
}

.cookie-banner__btn--accept {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}

.cookie-banner__btn--accept:hover {
  background: var(--green);
  color: var(--bg);
}

.cookie-banner__btn--more {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cookie-banner__btn--more:hover {
  color: var(--green);
  border-color: var(--green);
}

@media (max-width: 600px) {
  .cookie-banner__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================
   Scroll to Top — Terminal
=========================== */

.scroll-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--green);
  border: 1px solid var(--green);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base), background var(--t-fast);
}

.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--green);
  color: var(--bg);
}

.scroll-to-top svg {
  color: currentColor;
}

/* ===========================
   Share Buttons — Terminal
=========================== */

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) 0;
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.share-buttons__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 4px;
  text-decoration: none;
  transition: text-shadow var(--t-base), background var(--t-base);
}

.share-btn:hover {
  text-shadow: 0 0 8px var(--green);
  color: var(--green);
}

.share-btn svg {
  flex-shrink: 0;
  fill: var(--green);
}

@media (max-width: 600px) {
  .share-buttons {
    justify-content: center;
  }
  .share-buttons__label {
    width: 100%;
    text-align: center;
  }
}

/* ===========================
   Related Articles — Terminal
=========================== */

.related-articles {
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.related-articles__heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-6);
  font-family: var(--font-mono);
}

.related-articles__heading::before {
  content: "> ";
  color: var(--text-muted);
}

.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color var(--t-base);
}

.related-card:hover {
  border-color: var(--green-dim);
}

.related-card a {
  display: block;
  text-decoration: none;
}

.related-card .card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.related-card .card-body {
  padding: var(--sp-3);
}

.related-card h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--sp-2);
  color: var(--blue);
}

.related-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .related-articles__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }
}

/* ===========================
   Subscribe Form — Terminal
=========================== */

.footer-subscribe {
  padding: var(--sp-8) var(--sp-6);
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.subscribe-block__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  margin: 0 0 var(--sp-2);
  font-family: var(--font-mono);
}

.subscribe-block__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 var(--sp-6);
  font-family: var(--font-mono);
}

.subscribe-form__group {
  display: flex;
  gap: 0;
  border: 1px solid var(--green);
  border-radius: 6px;
  overflow: hidden;
}

.subscribe-form__input {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--green);
  outline: none;
  min-width: 0;
}

.subscribe-form__input::placeholder {
  color: var(--text-muted);
}

.subscribe-form__input:focus {
  background: var(--surface);
}

.subscribe-form__btn {
  padding: var(--sp-3) var(--sp-6);
  background: var(--green-dim);
  color: #fff;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast);
}

.subscribe-form__btn::before {
  content: "$ ";
  color: rgba(255,255,255,0.5);
}

.subscribe-form__btn:hover {
  background: var(--green);
  color: var(--bg);
}

.subscribe-form__success {
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
}

.subscribe-form__success.is-visible {
  display: block !important;
}

@media (max-width: 600px) {
  .auth-socials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .subscribe-form__group {
    flex-direction: column;
  }
}

/* ===========================
   Prefers Reduced Motion
=========================== */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .animate-on-scroll.is-visible {
    animation: none;
  }
  img[loading="lazy"] {
    opacity: 1;
  }
  img[loading="lazy"].is-loaded {
    animation: none;
  }
  .cookie-banner {
    transition: none;
  }
  .scroll-to-top {
    transition: none;
  }
}

/* ===========================
   Accessibility: Skip Link
=========================== */
.skip-link {
  position: fixed;
  top: -100%;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===========================
   Reading Progress Bar
=========================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.05);
  z-index: 1000;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.1s linear;
}

/* ===========================
   Reading Time
=========================== */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reading-time::before {
  content: "⏱";
  font-size: 0.9em;
}

/* Article Content Typography */
.article-body {
  line-height: 1.75;
}
.article-body h1,
.article-body h2,
.article-body h3 {
  margin-block: 1.5rem 1rem;
}
.article-body p {
  margin-block: 1rem;
}
.article-body ul,
.article-body ol {
  margin-block: 1rem;
  padding-left: 1.5rem;
}
.article-body li {
  margin-block: 0.35rem;
}
.article-body blockquote {
  border-left: 3px solid currentColor;
  padding-left: 1rem;
  margin: 1.5rem 0;
  opacity: 0.85;
  font-style: italic;
}

/* Article Content Images */
.article-body img {
  display: block;
  max-width: min(50%, 620px);
  height: auto;
  margin: 1.5rem auto;
  border-radius: 8px;
}

/* Article Tables */
.article-body table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 8px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.article-body table thead,
.article-body table tbody,
.article-body table tfoot {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.article-body table thead {
  background: rgba(128, 128, 128, 0.35);
  font-weight: 700;
}
.article-body table th,
.article-body table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid rgba(128, 128, 128, 0.4);
  white-space: normal;
  word-break: break-word;
}
.article-body table th {
  font-weight: 700;
  text-align: center;
}
.article-body table tbody tr:nth-child(even) {
  background: rgba(128, 128, 128, 0.1);
}
.article-body table tbody tr:hover {
  background: rgba(128, 128, 128, 0.15);
}
@media (max-width: 768px) {
  .article-body table {
    font-size: 0.85rem;
  }
  .article-body table th,
  .article-body table td {
    padding: 0.5rem;
  }
  .article-body img {
    max-width: 100%;
  }
}

/* Fix: auto-reveal hidden elements that never enter viewport */
.animate-on-scroll:not(.is-visible) {
  animation: aos-fallback-reveal 0.5s ease forwards;
  animation-delay: 1.5s;
}
@keyframes aos-fallback-reveal {
  to { opacity: 1; transform: translateY(0); }
}

.share-btn--fb:hover {
  background: #1877F2;
  border-color: #1877F2;
}

.share-btn--wa:hover {
  background: #25D366;
  border-color: #25D366;
}

.share-btn--ok:hover {
  background: #EE8208;
  border-color: #EE8208;
}

.share-btn--li:hover {
  background: #0A66C2;
  border-color: #0A66C2;
}

.share-btn--pin:hover {
  background: #E60023;
  border-color: #E60023;
}

.share-btn--rd:hover {
  background: #FF4500;
  border-color: #FF4500;
}
/* === Contacts === */
.contacts-hero { margin-bottom: 2rem; }
.contacts-hero h1 { font-family: var(--font-heading); margin-bottom: 0.5rem; }
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.contacts-form-section h2 { font-family: var(--font-heading); margin-bottom: 1rem; }
.contacts-form .form-group { margin-bottom: 1rem; }
.contacts-form .form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.contacts-form .form-group input,
.contacts-form .form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #333);
}
.contacts-form .form-group textarea { min-height: 120px; resize: vertical; }
.contacts-form .btn-submit {
  padding: 0.8rem 2rem;
  background: var(--accent-color, #333);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.contacts-form .btn-submit:hover { opacity: 0.9; }
.contacts-info h3 { font-family: var(--font-heading); margin-bottom: 0.5rem; }
.contacts-info p { margin-bottom: 0.5rem; }
.contacts-info a { color: var(--accent-color, #333); }
.social-links { list-style: none; padding: 0; }
.social-links li { margin-bottom: 0.3rem; }
@media (max-width: 768px) {
  .contacts-grid { grid-template-columns: 1fr; }
}
