@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/jetbrainsmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/jetbrainsmono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --primary: #5a67d8;
  /* Accent for TEXT (links, badges, focus rings). Lighter in dark mode for
     AA contrast; backgrounds keep using --primary. */
  --primary-text: #4c51bf; /* â‰¥4.5:1 on white and on the pale badge tints */
  --secondary: #764ba2;
  --accent: #f093fb;
  --success: #48bb78;
  --navbar-bg: rgba(255, 255, 255, 0.8);
  --hero-gradient: linear-gradient(
    135deg,
    rgba(90, 103, 216, 0.08) 0%,
    rgba(118, 75, 162, 0.05) 50%,
    rgba(240, 147, 251, 0.03) 100%
  );
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8fc;
  --bg-tertiary: #edf2f7;
  --bg-card: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  /* Alias kept for markup that used the old inline critical CSS name. */
  --font-sans: var(--font-primary);
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --container-width: 1200px;
  --section-padding: 80px;
  --nav-height: 72px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --primary-text: #8b9cf7;
  --navbar-bg: rgba(15, 17, 23, 0.85);
  --hero-gradient: linear-gradient(
    135deg,
    rgba(90, 103, 216, 0.15) 0%,
    rgba(118, 75, 162, 0.1) 50%,
    rgba(240, 147, 251, 0.05) 100%
  );
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d2e;
  --bg-tertiary: #252a3a;
  --bg-card: #1e2235;
  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted: #94a3b8;
  --border-color: #2d3748;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}
/* No-JS fallback: follow the OS preference unless light is forced.
   Must mirror the full [data-theme="dark"] set above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary-text: #8b9cf7;
    --navbar-bg: rgba(15, 17, 23, 0.85);
    --hero-gradient: linear-gradient(
      135deg,
      rgba(90, 103, 216, 0.15) 0%,
      rgba(118, 75, 162, 0.1) 50%,
      rgba(240, 147, 251, 0.05) 100%
    );
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d2e;
    --bg-tertiary: #252a3a;
    --bg-card: #1e2235;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #94a3b8;
    --border-color: #2d3748;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
  :root:not([data-theme="light"]) .theme-toggle .sun-icon {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .moon-icon {
    display: block;
  }
}
@view-transition {
  navigation: auto;
}
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
  overflow-x: hidden;
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal);
}
a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
ul,
ol {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: none;
}
button:not(:focus-visible) {
  outline: none;
}
input:not(:focus-visible),
textarea:not(:focus-visible) {
  outline: none;
}
input,
textarea {
  font-family: inherit;
}
pre,
code {
  -moz-tab-size: 4;
  tab-size: 4;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
/* Kept ahead of the base .hero rule on purpose: only padding-bottom takes
   effect here (the later base rule re-sets min-height). */
@media (max-width: 768px) {
  .hero-particles .particle:nth-child(n + 8) {
    display: none !important;
  }
  .code-window {
    display: none !important;
  }
  .hero {
    min-height: auto;
    padding-bottom: 40px;
  }
}
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover::after {
  opacity: 1;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(90, 103, 216, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(90, 103, 216, 0.5);
}
.btn-outline {
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-text);
  transform: translateY(-2px);
}
.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}
.btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}
/* The blur lives on ::before: backdrop-filter on .navbar itself would make it
   the containing block for position:fixed descendants (the mobile menu). */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  /* Explicit resets so no other stylesheet can put the blur back here. */
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all var(--transition-normal);
}
.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--navbar-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: background-color var(--transition-normal);
}
.navbar.scrolled {
  box-shadow: var(--shadow-md);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  position: relative;
  z-index: 1011;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  position: relative;
}
.nav-link:hover,
.nav-link.active {
  color: var(--primary-text);
  background: rgba(90, 103, 216, 0.08);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1011;
}
.search-toggle,
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.search-toggle:hover,
.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.theme-toggle .moon-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1011;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-normal);
  margin: 0 auto;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(120px, 15vh);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.search-modal.active {
  opacity: 1;
  visibility: visible;
}
.search-modal-content {
  width: 90%;
  max-width: 640px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: transform var(--transition-normal);
}
.search-modal.active .search-modal-content {
  transform: translateY(0) scale(1);
}
.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}
.search-input-wrapper svg {
  flex-shrink: 0;
  color: var(--text-muted);
}
.search-input-wrapper input {
  flex: 1;
  border: none;
  background: none;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}
.search-input-wrapper kbd {
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.search-results {
  padding: 20px 24px;
  max-height: 400px;
  overflow-y: auto;
}
.search-hint p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Works for both <span> and <button type="button"> markup. */
.search-tag {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 6px 14px;
  border: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 0.85rem;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.search-tag:hover {
  background: var(--primary);
  color: white;
}
.search-tag:focus-visible {
  outline: 2px solid var(--primary-text);
  outline-offset: 2px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.search-result-item:hover {
  background: var(--bg-tertiary);
}
.search-result-item .result-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-result-item .result-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.search-result-item .result-category {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.hero {
  position: relative;
  min-height: min(90vh, 720px);
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: var(--hero-gradient);
}
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.15;
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}
.hero .container {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 60px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(90, 103, 216, 0.1);
  border: 1px solid rgba(90, 103, 216, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 24px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  word-wrap: break-word;
  /* LCP element: never animate or hide it. */
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.typed-wrapper {
  display: inline-flex;
  align-items: baseline;
}
@media (max-width: 768px) {
  .hero-title {
    min-height: 3.5em;
  }
}
.typed-cursor {
  color: var(--primary-text);
  animation: blink 1s infinite;
  font-weight: 100;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
  line-height: 1.8;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
}
.stat {
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-plus {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-text);
}
.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}
.hero-visual {
  perspective: 1000px;
}
.code-window {
  background: #1e1e2e;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: rotateY(-5deg) rotateX(2deg);
  transition: transform var(--transition-slow);
  animation: float-window 6s ease-in-out infinite;
}
.code-window:hover {
  transform: rotateY(0deg) rotateX(0deg);
}
@keyframes float-window {
  0%,
  100% {
    transform: rotateY(-5deg) rotateX(2deg) translateY(0);
  }
  50% {
    transform: rotateY(-5deg) rotateX(2deg) translateY(-10px);
  }
}
.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #181825;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.code-dots {
  display: flex;
  gap: 8px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red {
  background: #ff5f57;
}
.dot.yellow {
  background: #febc2e;
}
.dot.green {
  background: #28c840;
}
.code-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a6adc8;
}
.code-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
  color: #cdd6f4;
  overflow-x: auto;
}
.code-body code {
  font-family: inherit;
}
.code-keyword {
  color: #cba6f7;
}
.code-string {
  color: #a6e3a1;
}
.code-function {
  color: #89b4fa;
}
.code-comment {
  /* #9399b2 on #1e1e2e is ~5.9:1 (AA); the old #6c7086 was ~3.4:1. */
  color: #9399b2;
  font-style: italic;
}
/* Code surfaces (#1e1e2e) are dark in both themes, so these apply to light
   and dark alike (Catppuccin Mocha, like the tokens above). */
.code-type {
  color: #f9e2af;
}
.code-number {
  color: #fab387;
}
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  z-index: 2;
}
.hero-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}
.section {
  padding: var(--section-padding) 0;
  position: relative;
  z-index: 1;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(90, 103, 216, 0.1);
  color: var(--primary-text);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.section-badge:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90, 103, 216, 0.3);
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.section-cta {
  text-align: center;
  margin-top: 48px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.featured-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: row;
}
.featured-card .card-image {
  flex-shrink: 0;
  width: 180px;
}
.featured-card .card-image-placeholder {
  aspect-ratio: auto;
  height: 100%;
  min-height: 180px;
}
.featured-card .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px;
  min-height: 0;
  min-width: 0;
}
.featured-card .card-meta {
  margin-bottom: 8px;
  font-size: 0.8rem;
}
.featured-card .card-title {
  font-size: 1.05rem;
  margin-bottom: 6px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.featured-card .card-excerpt {
  font-size: 0.85rem;
  margin-bottom: 10px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.5;
}
.featured-card .card-tags {
  margin-top: auto;
}
.featured-card .tag {
  font-size: 0.75rem;
  padding: 3px 10px;
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(90, 103, 216, 0.3);
}
.card-image {
  position: relative;
  overflow: hidden;
}
.card-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-slow);
  overflow: hidden;
}
.featured-card:hover .card-image-placeholder {
  transform: scale(1.05);
}
.card-category {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}
.card-content {
  padding: 24px;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  overflow: hidden;
}
.author-name {
  font-weight: 600;
  color: var(--text-secondary);
}
.meta-dot {
  color: var(--text-muted);
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a {
  color: var(--text-primary);
  transition: color var(--transition-fast);
}
.card-title a:hover {
  color: var(--primary-text);
}
.card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  max-height: 64px;
}
.tag {
  padding: 4px 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.tag:hover {
  background: var(--primary);
  color: white;
}
.card-category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(90, 103, 216, 0.1);
  color: var(--primary-text);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent, var(--primary));
}
.category-card:hover::before {
  transform: scaleX(1);
}
.category-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 103, 216, 0.08);
  border-radius: var(--radius-md);
  color: var(--accent, var(--primary));
  transition:
    background var(--transition-normal),
    color var(--transition-normal),
    transform var(--transition-normal);
}
.category-card:hover .category-icon {
  background: var(--accent, var(--primary));
  color: white;
  transform: scale(1.1);
}
.category-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.category-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.category-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-text);
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-card .card-image {
  flex-shrink: 0;
}
.post-card .card-image-placeholder {
  aspect-ratio: 16/10;
}
.post-card .card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card .card-title {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.post-card .card-meta {
  margin-top: auto;
  margin-bottom: 0;
}
.ai-section {
  background: var(--bg-secondary);
}
.ai-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
}
.ai-text .section-title {
  text-align: left;
  font-size: 2.2rem;
}
.ai-text p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.8;
}
.feature-list {
  margin-bottom: 32px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-weight: 500;
  color: var(--text-secondary);
}
.feature-list li svg {
  flex-shrink: 0;
}
.ai-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.ai-card-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 340px;
}
.ai-card {
  width: 100%;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}
.ai-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(90, 103, 216, 0.3);
}
.ai-card-1 {
  animation: float-card 4s ease-in-out infinite;
}
.ai-card-2 {
  animation: float-card 4s ease-in-out infinite 1s;
}
.ai-card-3 {
  animation: float-card 4s ease-in-out infinite 2s;
}
@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.ai-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  color: white;
  margin-bottom: 16px;
}
.ai-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.ai-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.newsletter-card {
  display: flex;
  align-items: center;
  gap: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-xl);
  padding: 60px;
  color: white;
  position: relative;
  overflow: hidden;
}
.newsletter-card::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  top: -200px;
  right: -100px;
}
.newsletter-content {
  flex: 1;
  position: relative;
  z-index: 1;
}
.newsletter-content h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.newsletter-content p {
  opacity: 0.9;
  margin-bottom: 24px;
  line-height: 1.7;
}
.newsletter-form .input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 14px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}
.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
.newsletter-form input:focus {
  border-color: white;
  background: rgba(255, 255, 255, 0.15);
}
.newsletter-form .btn {
  background: white;
  color: var(--primary);
  font-weight: 700;
  box-shadow: none;
}
.newsletter-form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
/* Full opacity: white on the lightest gradient stop (#5a67d8) is ~4.8:1;
   0.9 would drop to ~4.2:1. */
.form-note {
  font-size: 0.82rem;
  opacity: 1;
}
/* Default ring (var(--primary)) disappears on the brand gradient. */
.newsletter-card :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.form-note a {
  text-decoration: underline;
}
.newsletter-visual {
  position: relative;
  z-index: 1;
  opacity: 0.6;
}
.cookie-settings-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.cookie-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
}
.cookie-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.cookie-option span {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 80px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(
      0,
      1fr
    );
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p {
  color: var(--text-secondary);
  margin: 16px 0 24px;
  line-height: 1.7;
  max-width: 320px;
}
.social-links {
  display: flex;
  gap: 12px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}
.footer-links h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color var(--transition-fast);
}
.footer-links a:hover {
  color: var(--primary-text);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 3000;
  padding: 20px 0;
  /* Hidden = off-screen AND out of the tab order. visibility flips only after
     the slide-out finishes: "visibility 0s var(--transition-normal)" reads as
     duration 0s + delay 0.3s (the var supplies delay and easing, so don't add
     another easing keyword or the whole declaration becomes invalid). */
  transform: translateY(100%);
  visibility: hidden;
  transition:
    transform var(--transition-normal),
    visibility 0s var(--transition-normal);
}
.cookie-banner.show {
  transform: translateY(0);
  visibility: visible;
  transition:
    transform var(--transition-normal),
    visibility 0s 0s;
}
.cookie-content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cookie-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.cookie-content a {
  color: var(--primary-text);
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
/* Entrance animations only hide content once the <head> script has added
   .js to <html>; without JS everything is visible. :where() keeps the
   original single-class specificity so the cascade is unchanged. */
:where(.js) .animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
:where(.js) .animate-fade-in {
  opacity: 0;
  animation: fade-in 0.8s ease forwards;
}
:where(.js) .animate-fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-in-up 0.8s ease forwards;
}
:where(.js) .animate-fade-in-left {
  opacity: 0;
  transform: translateX(40px);
  animation: fade-in-left 0.8s ease forwards;
}
.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
}
@keyframes fade-in {
  to {
    opacity: 1;
  }
}
@keyframes fade-in-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fade-in-left {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.post-hero {
  padding: calc(var(--nav-height) + 60px) 0 40px;
  background: var(--bg-secondary);
}
.post-hero .container {
  max-width: 800px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
  overflow: hidden;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--primary-text);
}
.breadcrumb-sep {
  font-size: 0.7rem;
}
.post-hero .card-category-badge {
  margin-bottom: 16px;
}
.post-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.post-hero .card-excerpt {
  font-size: 1.1rem;
  margin-bottom: 24px;
}
.post-author-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
}
.post-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.post-author-details h4 {
  font-weight: 600;
  font-size: 0.95rem;
}
.post-author-details span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.post-content-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}
.post-content {
  max-width: 100%;
  overflow: hidden;
  min-width: 0;
}
.post-content h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}
.post-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 32px 0 12px;
}
.post-content p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.85;
  font-size: 1.05rem;
}
.post-content ul,
.post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.post-content ul {
  list-style: disc;
}
.post-content ol {
  list-style: decimal;
}
.post-content li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.7;
}
.post-content a {
  color: var(--primary-text);
  text-decoration: underline;
}
.post-content img {
  border-radius: var(--radius-md);
  margin: 24px 0;
}
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.code-block {
  position: relative;
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #181825;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a6adc8;
}
.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #a6adc8;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.code-block pre {
  padding: 20px;
  background: #1e1e2e;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: #cdd6f4;
  max-width: 100%;
}
.code-block pre code {
  white-space: pre;
  display: block;
}
.post-toc {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
}
.post-toc h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.toc-list li {
  margin-bottom: 8px;
}
.toc-list a {
  display: block;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition-fast);
}
.toc-list a:hover,
.toc-list a.active {
  color: var(--primary-text);
  border-left-color: var(--primary);
  background: rgba(90, 103, 216, 0.05);
}
.share-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 40px 0;
}
.share-section span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.share-btn.twitter {
  background: #1da1f2;
  color: white;
}
.share-btn.facebook {
  background: #1877f2;
  color: white;
}
.share-btn.linkedin {
  background: #0a66c2;
  color: white;
}
.share-btn.copy-link {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.author-box {
  display: flex;
  gap: 24px;
  padding: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin: 40px 0;
}
.author-box img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
}
.author-box h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.author-box .author-title {
  font-size: 0.85rem;
  color: var(--primary-text);
  margin-bottom: 10px;
}
.author-box p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.comments-section {
  margin: 40px 0;
}
.comments-section h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.comment-form {
  margin-bottom: 40px;
}
.comment-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color var(--transition-fast);
  margin-bottom: 12px;
}
.comment-form textarea:focus {
  border-color: var(--primary);
}
.comment-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}
.comment-form input:focus {
  border-color: var(--primary);
}
.comment {
  display: flex;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}
.comment:last-child {
  border-bottom: none;
}
.comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
}
.comment-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.comment-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.comment-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.comment-action {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.comment-action:hover {
  color: var(--primary-text);
}
.related-section {
  padding: 60px 0;
  background: var(--bg-secondary);
}
.related-section .section-title {
  font-size: 1.6rem;
  margin-bottom: 32px;
  text-align: left;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.page-hero {
  padding: calc(var(--nav-height) + 60px) 0 60px;
  background: var(--bg-secondary);
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.page-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.page-content {
  padding: 60px 0;
}
.page-content .container {
  max-width: 800px;
}
.page-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
}
.page-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 32px 0 12px;
}
.page-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}
.page-content ul,
.page-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.page-content ul {
  list-style: disc;
}
.page-content ol {
  list-style: decimal;
}
.page-content li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.7;
}
.page-content a {
  color: var(--primary-text);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: start;
}
.contact-info-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  align-items: center;
}
.contact-info-card .icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 103, 216, 0.1);
  border-radius: var(--radius-sm);
  color: var(--primary-text);
  flex-shrink: 0;
}
.contact-info-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.contact-info-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  margin-bottom: 16px;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
}
.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  margin: 48px 0;
}
.about-grid.reverse {
  direction: rtl;
}
.about-grid.reverse > * {
  direction: ltr;
}
.about-image {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-xl);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
  max-width: 100%;
}
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.feature-card {
  padding: 36px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(90, 103, 216, 0.3);
}
.feature-card .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  color: white;
}
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.faq-list {
  max-width: 700px;
  margin: 48px auto 0;
}
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.faq-item:hover {
  border-color: rgba(90, 103, 216, 0.3);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.faq-question:hover {
  background: var(--bg-secondary);
}
.faq-question svg {
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  color: var(--text-muted);
}
.faq-item.active .faq-question svg {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height var(--transition-normal),
    padding var(--transition-normal);
}
.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 24px 20px;
}
.faq-answer p {
  color: var(--text-secondary);
  line-height: 1.7;
}
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .hero-visual {
    display: none;
  }
  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .featured-card {
    flex-direction: column;
  }
  .featured-card .card-image {
    width: 100%;
  }
  .featured-card .card-image-placeholder {
    aspect-ratio: 16/9;
    min-height: auto;
  }
  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ai-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .ai-text {
    text-align: center;
  }
  .ai-text .section-title {
    text-align: center;
  }
  .ai-visual {
    display: flex;
  }
  .ai-card-stack {
    max-width: 400px;
    margin: 0 auto;
  }
  .newsletter-card {
    gap: 32px;
    padding: 48px 40px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .post-content-wrapper {
    grid-template-columns: 1fr;
  }
  .post-toc {
    position: static;
    margin-bottom: 24px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-grid.reverse {
    direction: ltr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .landing-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
  }
  .hamburger {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-primary);
    flex-direction: column;
    padding: calc(var(--nav-height) + 20px) 24px 24px;
    box-shadow: var(--shadow-xl);
    z-index: 1010;
    gap: 4px;
    align-items: stretch;
    overflow-y: auto;
    /* Closed = off-canvas AND not focusable; visibility flips after the
       slide-out finishes (same delay technique as .cookie-banner). */
    visibility: hidden;
    transition:
      right var(--transition-normal),
      visibility 0s var(--transition-normal);
  }
  .nav-links.active {
    right: 0;
    visibility: visible;
    transition:
      right var(--transition-normal),
      visibility 0s 0s;
  }
  /* Backdrop covers the viewport left of the panel (the menu is no longer
     clipped to the navbar). It is a negative-z child, so it must not overlap
     the panel or it would paint over the panel's own background. Clicks on it
     target #nav-links, which main.js treats as "close". */
  .nav-links.active::before {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: min(80%, 320px);
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
  .nav-link {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-md);
  }
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .category-card {
    padding: 20px 16px;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .newsletter-card {
    flex-direction: column;
    padding: 40px 28px;
    text-align: center;
  }
  .newsletter-visual {
    display: none;
  }
  .newsletter-form .input-group {
    flex-direction: column;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .cookie-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .cookie-actions {
    width: 100%;
    justify-content: center;
  }
  .post-content-wrapper {
    padding: 32px 16px;
  }
  .author-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .share-section {
    flex-wrap: wrap;
  }
  .landing-features {
    grid-template-columns: 1fr;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    gap: 8px;
  }
}
@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-stats {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stat-number {
    font-size: 1.5rem;
  }
  .stat-divider {
    display: none;
  }
  .stat {
    min-width: 80px;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .category-card {
    padding: 20px 14px;
  }
  .search-modal-content {
    width: 95%;
  }
  .newsletter-card {
    padding: 28px 20px;
  }
  .newsletter-content h2 {
    font-size: 1.5rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .footer-grid {
    gap: 24px;
  }
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
.categories-grid-page {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats-grid-about {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1024px) {
  .stats-grid-about {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .categories-grid-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid-about {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .categories-grid-page {
    grid-template-columns: 1fr;
  }
  .stats-grid-about {
    grid-template-columns: 1fr;
  }
}
@media print {
  .navbar,
  .cookie-banner,
  .search-modal,
  .footer,
  .share-section,
  .comments-section,
  .related-section,
  .newsletter-section,
  .hero-particles,
  .hero-bg,
  .post-toc {
    display: none !important;
  }
  body {
    background: white;
    color: black;
    padding-top: 0;
    font-size: 12pt;
  }
  .post-content-wrapper {
    grid-template-columns: 1fr;
  }
  a {
    color: black;
    text-decoration: underline;
  }
  .post-content a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  .code-block {
    page-break-inside: avoid;
    border: 1px solid #ccc;
  }
  pre {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  img {
    max-width: 100% !important;
  }
  h2,
  h3 {
    page-break-after: avoid;
  }
  * {
    color: black !important;
    background: white !important;
    box-shadow: none !important;
  }
}
.post-content,
.related-section,
.comments-section,
.newsletter-section,
footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    /* Also beats the inline transition-delay main.js sets on
       .animate-on-scroll. */
    transition-delay: 0s !important;
  }
  html {
    scroll-behavior: auto;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
:focus-visible {
  outline: 2px solid var(--primary-text);
  outline-offset: 2px;
}
/* Fully self-styled (the inline style attribute is gone from the markup). */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 12px 24px;
  background: #5a67d8;
  color: #fff;
  z-index: 10000;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
}

/* === MOBILE PHONE OPTIMIZATIONS === */

/* Touch-friendly defaults */
a,
button,
.tag,
.search-tag,
.nav-link,
.btn {
  -webkit-tap-highlight-color: transparent;
}
button,
.btn,
.tag,
.search-tag,
.nav-link,
.share-btn,
.social-link,
.copy-btn,
.comment-action,
.faq-question {
  min-height: 48px;
  min-width: 48px;
}
.tag,
.search-tag,
.card-category-badge {
  min-height: auto;
  min-width: auto;
}

/* iOS momentum scrolling for scroll containers */
.search-results,
.nav-links,
.post-toc,
.code-block pre {
  -webkit-overflow-scrolling: touch;
}

/* Phone-specific refinements (768px) */
@media (max-width: 768px) {
  /* Reduce nav height on mobile for more content space */
  :root {
    --nav-height: 60px;
  }

  /* Reduce post hero double-padding issue on mobile */
  .post-hero {
    padding: calc(var(--nav-height) + 32px) 0 28px;
  }
  .page-hero {
    padding: calc(var(--nav-height) + 32px) 0 32px;
  }

  /* Smaller code blocks on mobile */
  .code-block pre {
    font-size: 0.8rem;
    padding: 14px;
    line-height: 1.6;
  }
  .code-block-header {
    padding: 10px 14px;
    font-size: 0.75rem;
  }
  .copy-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-height: 32px;
    min-width: auto;
  }

  /* Post content adjustments */
  .post-content p {
    font-size: 0.95rem;
    line-height: 1.75;
  }
  .post-content h2 {
    font-size: 1.4rem;
    margin: 32px 0 12px;
  }
  .post-content h3 {
    font-size: 1.15rem;
    margin: 24px 0 10px;
  }
  .post-hero .card-excerpt {
    font-size: 0.95rem;
  }

  /* Breadcrumb - allow horizontal scroll on mobile */
  .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .breadcrumb::-webkit-scrollbar {
    display: none;
  }
  .breadcrumb a,
  .breadcrumb span {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Search modal - full width on mobile */
  .search-modal {
    padding-top: 0;
    align-items: flex-start;
  }
  .search-modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    min-height: 100vh;
  }
  .search-results {
    max-height: calc(100vh - 80px);
  }
  .search-input-wrapper {
    padding: 16px;
  }
  .search-input-wrapper kbd {
    display: none;
  }
  .search-input-wrapper input {
    font-size: 1rem;
  }

  /* All inputs 16px to prevent iOS Safari zoom */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
  .contact-form input,
  .contact-form textarea {
    padding: 14px 16px;
  }
  .comment-form textarea,
  .comment-form input {
    padding: 12px 14px;
  }

  /* Full-width buttons in cookie settings */
  .cookie-settings-panel .cookie-actions {
    flex-direction: column;
  }
  .cookie-settings-panel .cookie-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Newsletter form improvements */
  .newsletter-form input {
    font-size: 16px;
    min-width: 0;
  }
}

/* Small phone specific (480px and below) */
@media (max-width: 480px) {
  /* Even smaller code blocks */
  .code-block pre {
    font-size: 0.75rem;
    padding: 12px 10px;
  }

  /* Tighter container padding */
  .container {
    padding: 0 16px;
  }
  .post-content-wrapper {
    padding: 24px 12px;
  }

  /* Reduce section spacing */
  :root {
    --section-padding: 48px;
  }

  /* Comment section mobile */
  .comment {
    gap: 10px;
  }
  .comment-avatar {
    width: 36px;
    height: 36px;
  }

  /* Author box tighter */
  .author-box {
    padding: 24px 16px;
  }
  .author-box img {
    width: 64px;
    height: 64px;
  }

  /* Smaller featured card padding */
  .featured-card .card-content {
    padding: 14px;
  }
  .card-content {
    padding: 16px;
  }

  /* Reduce post hero spacing */
  .post-hero {
    padding: calc(var(--nav-height) + 20px) 0 20px;
  }
  .page-hero {
    padding: calc(var(--nav-height) + 20px) 0 24px;
  }
  .page-hero p {
    font-size: 0.95rem;
  }

  /* FAQ mobile */
  .faq-question {
    padding: 14px 16px;
    font-size: 0.9rem;
  }
  .faq-item.active .faq-answer {
    padding: 0 16px 16px;
  }

  /* Table of contents mobile */
  .post-toc {
    padding: 16px;
  }
  .toc-list a {
    padding: 4px 10px;
    font-size: 0.82rem;
  }

  /* Share section compact */
  .share-section {
    gap: 8px;
    padding: 16px 0;
  }
  .share-btn {
    width: 44px;
    height: 44px;
    min-height: 44px;
    min-width: 44px;
  }

  /* Related posts */
  .related-section {
    padding: 40px 0;
  }
  .related-section .section-title {
    font-size: 1.3rem;
  }
}

/* Card transitions: kept after .animate-on-scroll on purpose so cards that
   also animate on scroll keep these (it wins by source order). */
.featured-card,
.category-card,
.post-card,
.ai-card,
.feature-card {
  transition:
    transform var(--transition-normal),
    box-shadow var(--transition-normal),
    border-color var(--transition-normal);
}
@media (max-width: 768px) {
  .footer-links a {
    padding: 10px 4px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
@media (forced-colors: active) {
  .navbar,
  .cookie-banner,
  .btn,
  .card {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .btn-primary {
    forced-color-adjust: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .navbar::before,
  .cookie-banner,
  .search-modal-content {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: var(--bg-primary) !important;
  }
}
@media print {
  .navbar,
  .footer,
  .cookie-banner,
  .search-modal,
  .share-buttons,
  .comment-form,
  ins.adsbygoogle {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
  .post-content {
    max-width: 100%;
  }
  .code-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
.post-hero-image {
  grid-column: 1 / -1;
}

/* === Comments widget (rendered by js/comments.js) === */
#comments {
  position: relative;
  margin: 56px 0;
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
#comments::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
#comments .comments-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
#comments .comments-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
#comments .comments-title::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/></svg>")
    center/20px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/></svg>")
    center/20px no-repeat;
}
#comments .comments-count {
  margin-left: auto;
  padding: 5px 14px;
  background: rgba(90, 103, 216, 0.1);
  color: var(--primary-text);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}
#comments .comments-count:empty {
  display: none;
}
#comments .comments-form {
  --cmt-gap: 14px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  /* dense: lets a bare email label back-fill row 1 next to the name label.
     No effect on the current label-less layout. */
  grid-auto-flow: row dense;
  gap: var(--cmt-gap);
  margin-bottom: 36px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
#comments .comments-form textarea {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 130px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  resize: vertical;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}
#comments .comments-form textarea:focus {
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(90, 103, 216, 0.12);
  outline: none;
}
#comments .comments-form input[type="text"],
#comments .comments-form input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}
#comments .comments-form input[type="text"]:focus,
#comments .comments-form input[type="email"]:focus {
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(90, 103, 216, 0.12);
  outline: none;
}
#comments .comments-form input::placeholder,
#comments .comments-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}
/* Visible field labels. Works whether each label/control pair is wrapped in
   its own element or the labels sit directly in the form grid. */
#comments .comments-form .comments-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-secondary);
}
/* Wrapped pairs: the comment field spans both columns. */
#comments .comments-form > :has(> textarea) {
  grid-column: 1 / -1;
}
/* Bare labels as grid items (siblings of their control): stack each label
   over its control, name | email side by side, comment full width. The
   negative margin pulls the control up so the label sits 4px above it. */
#comments .comments-form > .comments-label:not(:has(input, textarea)) {
  align-self: end;
  margin-bottom: calc(4px - var(--cmt-gap));
}
#comments .comments-form > .comments-label[for="cmt-name"],
#comments .comments-form > #cmt-name {
  grid-column: 1;
}
#comments .comments-form > .comments-label[for="cmt-email"],
#comments .comments-form > #cmt-email {
  grid-column: 2;
}
#comments .comments-form > .comments-label[for="cmt-body"] {
  grid-column: 1 / -1;
}
#comments .cmt-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
#comments .comments-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
#comments .comments-actions .btn {
  padding: 12px 28px;
  font-size: 0.95rem;
}
#comments .comments-actions .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
#comments .comments-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  min-width: 180px;
}
#comments .comments-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}
#comments .comments-status:not(:empty) {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* AA: ~5.9:1 (success) / ~6.4:1 (error) on the tinted form background. */
#comments .comments-status.success {
  background: rgba(72, 187, 120, 0.1);
  color: #276749;
  border: 1px solid rgba(72, 187, 120, 0.3);
}
#comments .comments-status.error {
  background: rgba(252, 129, 129, 0.12);
  color: #9b2c2c;
  border: 1px solid rgba(252, 129, 129, 0.35);
}
#comments .comments-status.success::before {
  content: "\2713";
  font-weight: 700;
  font-size: 1rem;
}
#comments .comments-status.error::before {
  content: "\26A0";
  font-weight: 700;
  font-size: 1rem;
}
[data-theme="dark"] #comments .comments-status.success {
  background: rgba(72, 187, 120, 0.15);
  color: #9ae6b4;
}
[data-theme="dark"] #comments .comments-status.error {
  background: rgba(252, 129, 129, 0.15);
  color: #feb2b2;
}
#comments .comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#comments .comments-empty,
#comments .comments-loading,
#comments .comments-error {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}
#comments .comments-loading {
  color: var(--primary-text);
  font-weight: 500;
}
#comments .comments-error {
  color: #c53030;
  border-color: rgba(252, 129, 129, 0.35);
  background: rgba(252, 129, 129, 0.06);
}
[data-theme="dark"] #comments .comments-error {
  color: #feb2b2;
}
#comments .comment {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 18px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}
#comments .comment:hover {
  border-color: rgba(90, 103, 216, 0.3);
  box-shadow: var(--shadow-sm);
}
#comments .comment-head {
  display: contents;
}
#comments .comment-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  grid-row: span 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 2px solid var(--bg-card);
}
#comments .comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 0;
  align-self: center;
}
#comments .comment-name {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
#comments .comment-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-feature-settings: "tnum";
}
#comments .comment-time::before {
  content: "\B7";
  margin-right: 8px;
  color: var(--border-color);
}
#comments .comment-body {
  grid-column: 2;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
[data-theme="dark"] #comments .comments-count {
  background: rgba(90, 103, 216, 0.18);
}
@media (max-width: 600px) {
  #comments {
    padding: 24px 18px;
    margin: 36px 0;
    border-radius: var(--radius-lg);
  }
  #comments .comments-title {
    font-size: 1.25rem;
  }
  #comments .comments-title::before {
    width: 28px;
    height: 28px;
  }
  #comments .comments-form {
    --cmt-gap: 12px;
    padding: 18px;
    grid-template-columns: 1fr;
  }
  #comments .comments-form > .comments-label[for],
  #comments .comments-form > #cmt-name,
  #comments .comments-form > #cmt-email {
    grid-column: 1 / -1;
  }
  #comments .comments-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #comments .comments-actions .btn {
    width: 100%;
    justify-content: center;
  }
  #comments .comments-note {
    order: 2;
    text-align: center;
  }
  #comments .comment {
    grid-template-columns: auto 1fr;
    gap: 10px 14px;
    padding: 16px;
  }
  #comments .comment-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.84rem;
  }
  #comments .comment-body {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Callout notices ï¿½ legal-use warnings and honest status notes
   ========================================================================== */
.notice {
  margin: 28px 0;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-text);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}
.notice p {
  margin: 0;
}
.notice p + p {
  margin-top: 10px;
}
.notice strong {
  color: var(--text-primary);
}
.notice-warning {
  border-left-color: #b45309;
  background: rgba(180, 83, 9, 0.06);
}
[data-theme="dark"] .notice-warning {
  border-left-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}
.notice-info {
  border-left-color: var(--primary-text);
}
/* Inline links inside cards and notices must be distinguishable from body text
   (not by colour alone) — WCAG 1.4.1. */
.feature-card p a,
.notice a {
  color: var(--primary-text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.feature-card p a:hover,
.notice a:hover {
  text-decoration-thickness: 2px;
}