/* ============================================================
   fazliddin.com — Design Tokens & Styles
   ============================================================ */

:root {
  --neutral-0:   #ffffff;
  --neutral-50:  #fafaf9;
  --neutral-100: #f4f4f3;
  --neutral-200: #e7e7e5;
  --neutral-300: #d4d4d2;
  --neutral-400: #a3a3a0;
  --neutral-500: #737370;
  --neutral-600: #525250;
  --neutral-700: #3f3f3d;
  --neutral-800: #262625;
  --neutral-900: #18181a;
  --neutral-950: #0a0a0b;

  --accent-50:  #eff6ff;
  --accent-100: #dbeafe;
  --accent-200: #bfdbfe;
  --accent-300: #93c5fd;
  --accent-400: #60a5fa;
  --accent-500: #2563eb;
  --accent-600: #1d4ed8;
  --accent-700: #1e40af;
  --accent-800: #1e3a8a;
  --accent-900: #172554;

  --success-500: #16a34a;
  --success-50:  #f0fdf4;
  --warning-500: #d97706;
  --warning-50:  #fffbeb;
  --danger-500:  #dc2626;
  --danger-50:   #fef2f2;
  --info-500:    #0284c7;
  --info-50:     #f0f9ff;

  --bg:             var(--neutral-0);
  --bg-soft:        var(--neutral-50);
  --bg-muted:       var(--neutral-100);
  --surface:        var(--neutral-0);
  --border:         var(--neutral-200);
  --border-strong:  var(--neutral-300);
  --fg:             var(--neutral-950);
  --fg-strong:      var(--neutral-900);
  --fg-muted:       var(--neutral-600);
  --fg-soft:        var(--neutral-400);
  --fg-on-accent:   var(--neutral-0);
  --text-on-dark:   var(--neutral-0);
  --text-on-light:  var(--neutral-950);
  --accent:         var(--accent-500);

  --syn-comment:    #8a8a83;
  --syn-keyword:    #b91c4a;
  --syn-string:     #557837;
  --syn-number:     #b45309;
  --syn-literal:    #b45309;
  --syn-type:       #6d28d9;
  --syn-function:   #1d4ed8;
  --syn-property:   #0e7490;
  --syn-punct:      var(--fg-muted);
  --accent-hover:   var(--accent-600);
  --accent-soft:    var(--accent-50);
  --link:           var(--fg);
  --link-hover:     var(--accent-500);
  --code-bg:        var(--neutral-100);
  --code-fg:        var(--neutral-900);
  --ring:           rgba(37, 99, 235, 0.22);

  --font-sans: 'Geist', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(10, 10, 11, 0.04);
  --shadow-sm: 0 1px 3px rgba(10, 10, 11, 0.06), 0 1px 2px rgba(10, 10, 11, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 10, 11, 0.06), 0 2px 4px rgba(10, 10, 11, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 10, 11, 0.08), 0 4px 8px rgba(10, 10, 11, 0.04);
  --shadow-ring: 0 0 0 3px var(--ring);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 120ms;
  --duration:      200ms;
  --duration-slow: 320ms;
}

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

html {
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--weight-regular) var(--text-base)/1.7 var(--font-sans);
}

::selection { background: var(--accent-200); color: var(--neutral-950); }

h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-sans); color: var(--fg); }
h1 { font-size: var(--text-5xl); line-height: 1.05; font-weight: var(--weight-semibold); letter-spacing: -0.025em; }
h2 { font-size: var(--text-3xl); line-height: 1.3; font-weight: var(--weight-semibold); letter-spacing: -0.015em; }
h3 { font-size: var(--text-xl); line-height: 1.3; font-weight: var(--weight-semibold); letter-spacing: -0.015em; }
p { margin: 0; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

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

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--shadow-ring);
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--neutral-200); border-radius: 99px; }

/* ============================================================
   Layout
   ============================================================ */
.page-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 24px 0;
}
.page-wrapper--narrow {
  max-width: 720px;
}

@media (max-width: 640px) {
  .page-wrapper { padding: 32px 16px 0; }
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease);
  /* Measured by JS so the fixed mobile panel starts below the real bar height. */
  --header-height: 56px;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 820px) {
  .header-inner { padding: 12px 16px; }
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  color: var(--fg);
}
.wordmark:hover { color: var(--fg); text-decoration: none; }
.wordmark__dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent-500);
  margin: 0 1px;
  transform: translateY(-1px);
}
.wordmark__tld {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--fg-muted);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.desktop-nav a {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--fg-muted);
}
.desktop-nav a:hover { text-decoration: none; }
.desktop-nav a.active { color: var(--fg); }
/* CTA pill — higher specificity so link styles don't mute the label on blue. */
.desktop-nav a.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent-500);
  color: var(--text-on-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.desktop-nav a.nav-cta:hover,
.desktop-nav a.nav-cta:focus-visible {
  background: var(--accent-600);
  color: var(--text-on-dark);
  text-decoration: none;
}

.header-utilities {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-menu-btn {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn__icon { display: block; }
.mobile-menu-btn__icon--close { display: none; }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-btn__icon--open { display: none; }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-btn__icon--close { display: block; }

.mobile-nav-overlay {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 1;
  background: rgba(10, 10, 11, 0.42);
  -webkit-tap-highlight-color: transparent;
}
[data-theme="dark"] .mobile-nav-overlay {
  background: rgba(0, 0, 0, 0.58);
}

.mobile-nav {
  border-top: 1px solid var(--border);
  padding: 8px 16px 16px;
  display: grid;
  gap: 2px;
  background: var(--bg);
}
.mobile-nav a {
  padding: 12px 8px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
}
.mobile-nav a:hover { text-decoration: none; }
.mobile-nav a.active {
  color: var(--fg);
  background: var(--bg-soft);
}
.mobile-nav a.mobile-nav__cta {
  margin-top: 8px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-500);
  color: var(--text-on-dark);
  font-weight: 600;
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
}
.mobile-nav a.mobile-nav__cta:hover,
.mobile-nav a.mobile-nav__cta:focus-visible {
  background: var(--accent-600);
  color: var(--text-on-dark);
}
.mobile-nav a.mobile-nav__cta.active {
  background: var(--accent-500);
  color: var(--text-on-dark);
}

@media (min-width: 821px) {
  .mobile-menu-btn,
  .mobile-nav,
  .mobile-nav-overlay { display: none !important; }
}
@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .header-utilities {
    gap: 6px;
    margin-left: auto;
  }
  .mobile-menu-btn { display: inline-flex; }
  .header-utilities .theme-toggle {
    width: 40px;
    height: 40px;
  }
  .header-utilities .lang-toggle button {
    min-height: 40px;
    padding: 6px 8px;
  }
}

/* ============================================================
   Language Toggle
   ============================================================ */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.lang-toggle button {
  padding: 4px 9px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--fg-muted);
  text-transform: uppercase;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}
.lang-toggle button.active {
  background: var(--neutral-950);
  color: var(--text-on-dark);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px 32px;
  align-items: start;
}
.footer-tagline {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 320px;
}

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    padding: 32px 16px 48px;
    gap: 28px;
  }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn--lg { height: 44px; padding: 0 18px; font-size: 15px; }

.btn--primary { background: var(--neutral-950); color: var(--text-on-dark); }
.btn--primary:hover { background: var(--neutral-800); color: var(--text-on-dark); }
.btn--accent { background: var(--accent-500); color: var(--text-on-dark); }
.btn--accent:hover { background: var(--accent-600); color: var(--text-on-dark); }
.btn--secondary { background: var(--bg); color: var(--fg); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--border-strong); background: var(--bg); color: var(--fg); }
.btn--ghost { background: transparent; color: var(--fg); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--fg); }

/* ============================================================
   Eyebrow / Pill / Tag
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--fg);
}
.tag__hash { color: var(--fg-soft); margin-right: 1px; }

/* ============================================================
   Page Header
   ============================================================ */
.page-header { margin-bottom: 56px; }
.page-header__title {
  font-size: var(--text-5xl);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 760px;
}
.page-header__lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-top: 18px;
  max-width: 600px;
}

/* ============================================================
   Hero (Homepage)
   ============================================================ */
.hero {
  padding: 40px 0 80px;
  border-bottom: 1px solid var(--border);
}
.hero__title {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 880px;
}
.hero__lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 580px;
  margin-top: 22px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* Commercial homepage & sales pages */
.hero--commercial {
  padding-bottom: 64px;
  border-bottom: none;
}
.hero__eyebrow { margin-bottom: 16px; }
.hero__cred {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.page-header--commercial { margin-bottom: 48px; }
.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.section__lead {
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.6;
  margin: -8px 0 20px;
  max-width: 560px;
}

/* Offer cards (homepage) */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.offer-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.offer-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.offer-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-50);
  color: var(--accent-500);
}
[data-theme="dark"] .offer-card__icon {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-300);
}
.offer-card__title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.offer-card__desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
  flex: 1;
}
.offer-card__meta {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--fg-soft);
}
.offer-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-500);
  margin-top: 4px;
}
[data-theme="dark"] .offer-card__link { color: var(--accent-300); }

/* Proof / testimonials */
.proof-section .section__title { margin-bottom: 20px; }
.testimonials-grid--home {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Compact product cards on homepage */
.products-grid--home {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.product-card--compact .product-card__blurb {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Commercial product & service cards */
.product-card--commercial,
.service-card--commercial {
  border-color: var(--border);
  transition: border-color var(--duration) var(--ease);
}
.product-card--commercial:hover { border-color: var(--border-strong); }
.product-card__price--prominent {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-500);
}
[data-theme="dark"] .product-card__price--prominent { color: var(--accent-300); }
.product-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.service-card__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-500);
  margin: 0 0 8px;
  font-family: var(--font-mono);
}
[data-theme="dark"] .service-card__price { color: var(--accent-300); }

/* Products trust strip */
.products-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}
.products-trust__item {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--fg-muted);
}
.products-trust__item strong {
  color: var(--fg);
  font-size: 15px;
}

/* Commercial contact & newsletter boxes */
.contact-box--commercial,
.newsletter-box--commercial {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.contact-box__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

/* Footer columns */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 32px;
}
.footer-nav__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.footer-nav__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-nav__col a {
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
}
.footer-nav__col a:hover { color: var(--fg); }

@media (max-width: 900px) {
  .offer-grid { grid-template-columns: 1fr; }
  .products-trust { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hero--commercial { padding-bottom: 48px; }
  .footer-nav { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 720px) {
  .hero { padding: 24px 0 56px; }
  .hero__lead { font-size: 17px; }
}

/* ============================================================
   Featured Cards
   ============================================================ */
.featured-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.featured-grid__side { display: grid; gap: 16px; }

@media (max-width: 720px) {
  .featured-grid { grid-template-columns: 1fr; }
}

.featured-card {
  display: block;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  height: 100%;
}
.featured-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--fg);
}
.featured-card--large { padding: 28px; }
.featured-card__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.featured-card__meta .dot {
  width: 3px; height: 3px; border-radius: 999px; background: var(--fg-soft);
}
.featured-card__title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.featured-card--large .featured-card__title { font-size: 28px; }
.featured-card__dek {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
}
.featured-card--large .featured-card__dek { font-size: 16px; }
.featured-card__footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}
.featured-card__read {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   Post Row
   ============================================================ */
.post-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 22px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
  color: var(--fg);
  transition: background var(--duration) var(--ease);
}
.post-row:hover {
  background: var(--bg-soft);
  text-decoration: none;
  color: var(--fg);
}
.post-row__date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-soft);
}
.post-row__title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.post-row__dek {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
}
.post-row__read {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .post-row {
    display: block;
    padding: 16px 0;
  }
  .post-row__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 6px;
  }
  .post-row__title { font-size: 16px; margin-bottom: 4px; }
  .post-row__dek { font-size: 14px; }
}

/* ============================================================
   Project Card
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  display: block;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--fg);
}
.project-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.project-card__name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}
.project-card__tagline {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.project-card__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 16px;
}
.project-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}
.project-card__lang {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.project-card__stars {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* ============================================================
   Newsletter Capture
   ============================================================ */
.newsletter-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  background: var(--bg-soft);
  display: grid;
  gap: 14px;
}
.newsletter-box__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.newsletter-box__desc {
  font-size: 15px;
  color: var(--fg-muted);
  margin: 0;
  max-width: 540px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin-top: 6px;
}
.newsletter-form--compact {
  max-width: 420px;
  margin-top: 0;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
}
.newsletter-form input[type="email"]:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .newsletter-box {
    padding: 20px;
  }
  .newsletter-box__title {
    font-size: 20px;
  }
  .newsletter-box__desc {
    font-size: 14px;
  }
  .newsletter-form,
  .newsletter-form--compact {
    flex-direction: column;
    max-width: 100%;
  }
  .newsletter-form input[type="email"] {
    width: 100%;
  }
}

/* ============================================================
   Blog Filters
   ============================================================ */
.tag-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tag-filter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.tag-filter:hover { text-decoration: none; border-color: var(--border-strong); }
.tag-filter.active {
  border-color: var(--neutral-950);
  background: var(--neutral-950);
  color: var(--text-on-dark);
}

.year-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

/* ============================================================
   Post Detail
   ============================================================ */
.post-back {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 28px;
}
.post-back:hover { text-decoration: none; color: var(--accent); }
.post-back .arrow-back { transform: rotate(180deg); display: inline-block; }

.post-article__title {
  font-size: clamp(32px, 4.5vw, 44px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}
.post-article__dek {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 20px 0 36px;
}
.post-article__body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-strong);
}
.post-article__body p { margin-bottom: 16px; }
.post-article__body h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 40px 0 14px;
}
.post-tags {
  display: flex;
  gap: 10px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.post-author {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.post-author p {
  font-size: 15px;
  color: var(--fg);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   Code Block
   ============================================================ */
.code-block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 24px 0;
}
.code-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.code-block__file {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}
.code-block__copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-soft);
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  padding: 0;
}
.code-block__copy:hover { color: var(--accent-500); }
.code-block__copy.copied { color: var(--accent-500); }
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
  overflow-x: auto;
}

/* Syntax highlighting */
.syn-comment  { color: var(--syn-comment); font-style: italic; }
.syn-keyword  { color: var(--syn-keyword); font-weight: 500; }
.syn-string   { color: var(--syn-string); }
.syn-number   { color: var(--syn-number); }
.syn-type     { color: var(--syn-type); }
.syn-function { color: var(--syn-function); }
.syn-punct    { color: var(--syn-punct); }
.syn-literal  { color: var(--syn-literal); }

/* ============================================================
   Uses Page
   ============================================================ */
.uses-section { margin-bottom: 40px; }
.uses-section__title {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin: 0 0 14px;
}
.uses-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.uses-item:first-child { border-top: 1px solid var(--border); }
.uses-item__name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.uses-item__note { font-size: 15px; color: var(--fg-muted); line-height: 1.55; margin: 0; }

@media (max-width: 640px) {
  .uses-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ============================================================
   Products
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.product-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  background: var(--bg);
}
.product-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.product-card__price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}
.product-card__title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.product-card__blurb {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0;
}
.product-card__bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.product-card__bullet {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--fg);
  align-items: flex-start;
}
.product-card__bullet svg { color: var(--accent-500); flex-shrink: 0; margin-top: 4px; }

/* ============================================================
   Newsletter Issues
   ============================================================ */
.issue-row {
  display: grid;
  grid-template-columns: 110px 130px 1fr auto;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  color: var(--fg);
  align-items: baseline;
  transition: background var(--duration) var(--ease);
}
.issue-row:hover { background: var(--bg-soft); text-decoration: none; color: var(--fg); }
.issue-row__number { font-family: var(--font-mono); font-size: 13px; color: var(--fg-muted); }
.issue-row__date { font-size: 13px; color: var(--fg-soft); }
.issue-row__title { font-size: 15px; }

@media (max-width: 640px) {
  .issue-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .issue-row__meta {
    display: flex;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg-muted);
  }
  .issue-row__title { grid-column: 1 / -1; }
}

/* ============================================================
   Hire Me
   ============================================================ */
.service-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
}
.service-card__header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.service-card__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.service-card__desc {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 640px) {
  .service-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

.contact-box {
  padding: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.contact-form {
  display: grid;
  gap: 12px;
}
.contact-form input,
.contact-form textarea {
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

/* ============================================================
   About / Timeline
   ============================================================ */
.about-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-strong);
  display: grid;
  gap: 16px;
}
.about-body h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 24px 0 4px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.timeline-item__period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
}
.timeline-item__desc { font-size: 16px; }

@media (max-width: 640px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.about-actions {
  margin-top: 40px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   Section spacing
   ============================================================ */
.section { padding: 64px 0 24px; }
.section--sm { padding: 40px 0 24px; }
.section--border { border-bottom: 1px solid var(--border); }

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}
.section__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.section__link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.divider { border-top: 1px solid var(--border); }

/* ============================================================
   Toast notification
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--neutral-950);
  color: var(--text-on-dark);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--duration-slow) var(--ease);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================================
   Utilities
   ============================================================ */
.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-muted); }
.mt-0 { margin-top: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-14 { margin-bottom: 14px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.gap-10 { gap: 10px; }
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }

/* ============================================================
   SVG icons inline
   ============================================================ */
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }
.icon--sm { width: 14px; height: 14px; }
.icon--xs { width: 12px; height: 12px; }

/* ============================================================
   Dark mode
   ============================================================ */
[data-theme="dark"] {
  --bg: var(--neutral-950);
  --bg-soft: var(--neutral-900);
  --bg-muted: var(--neutral-800);
  --surface: var(--neutral-900);
  --border: var(--neutral-800);
  --border-strong: var(--neutral-700);
  --fg: var(--neutral-50);
  --fg-strong: var(--neutral-0);
  --fg-muted: var(--neutral-400);
  --fg-soft: var(--neutral-500);
  --code-bg: var(--neutral-800);
  --code-fg: var(--neutral-100);
  --link: var(--neutral-50);
}

.theme-toggle, .nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  text-decoration: none;
}
.theme-toggle:hover, .nav-icon-link:hover { color: var(--fg); border-color: var(--border-strong); }

.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 10000;
  transition: width 0.1s linear;
}

/* Search */
.search-form { display: flex; gap: 10px; margin-bottom: 32px; }
.search-form__input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: var(--surface);
  color: var(--fg);
}
.search-results-meta { color: var(--fg-muted); margin-bottom: 20px; font-size: 14px; }

/* Post TOC & nav */
.post-toc {
  margin: 24px 0 32px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.post-toc__title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-muted); margin-bottom: 12px; }
.post-toc ul { list-style: none; margin: 0; padding: 0; }
.post-toc__item { margin: 6px 0; }
.post-toc__item--h3 { padding-left: 16px; }
.post-toc a { color: var(--fg-muted); text-decoration: none; font-size: 14px; }
.post-toc a:hover { color: var(--accent); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 48px 0 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-nav__link { text-decoration: none; color: inherit; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.post-nav__link:hover { border-color: var(--border-strong); background: var(--bg-soft); }
.post-nav__link--next { text-align: right; }
.post-nav__label { display: block; font-size: 12px; color: var(--fg-muted); margin-bottom: 6px; }
.post-nav__title { font-size: 15px; font-weight: 500; }

.related-posts { display: grid; gap: 12px; }
.related-post {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
}
.related-post:hover { background: var(--bg-soft); }
.related-post__title { font-weight: 500; margin-bottom: 4px; }
.related-post__meta { font-size: 13px; color: var(--fg-muted); }

.series-banner { margin-bottom: 20px; }
.series-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.series-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-decoration: none;
  color: var(--fg-muted);
}
.series-link.active, .series-link:hover { border-color: var(--accent); color: var(--accent); }

.comments-section { margin-top: 0; padding-bottom: 64px; }

/* Testimonials */
.testimonials-grid { display: grid; gap: 16px; }
.testimonial-card {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}
.testimonial-card__quote { font-size: 16px; line-height: 1.6; margin: 0 0 16px; }
.testimonial-card__author { font-size: 14px; color: var(--fg-muted); }
.testimonial-card__author strong { display: block; color: var(--fg); margin-bottom: 2px; }

.tag { text-decoration: none; }
.tag:hover { color: var(--accent); }

@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__link--next { text-align: left; }
}

/* ============================================================
   Polish: dark mode, accessibility, motion, UI tweaks
   ============================================================ */

/* Skip-link (visible only when focused). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--neutral-950);
  color: var(--text-on-dark);
  padding: 8px 12px;
  z-index: 10001;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Honeypot — totally hidden but still rendered. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important;
}

/* Dark-mode tweaks (extend existing rule). */
[data-theme="dark"] body { color: var(--fg); }
[data-theme="dark"] .site-header { background: rgba(10, 10, 11, 0.78); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--neutral-700); }
[data-theme="dark"] ::selection { background: var(--accent-700); color: var(--neutral-50); }
[data-theme="dark"] :not(pre) > code {
  background: var(--neutral-800);
  color: var(--neutral-100);
  border-color: var(--neutral-700);
}
[data-theme="dark"] .login-error {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
}

/* Dark mode: invert dark-surface controls so text stays readable. */
[data-theme="dark"] .btn--primary {
  background: var(--neutral-0);
  color: var(--text-on-light);
}
[data-theme="dark"] .btn--primary:hover {
  background: var(--neutral-100);
  color: var(--text-on-light);
}
[data-theme="dark"] .lang-toggle button.active {
  background: var(--neutral-0);
  color: var(--text-on-light);
}
[data-theme="dark"] .tag-filter.active {
  background: var(--neutral-0);
  border-color: var(--neutral-0);
  color: var(--text-on-light);
}
[data-theme="dark"] .toast {
  background: var(--neutral-100);
  color: var(--text-on-light);
}
[data-theme="dark"] .skip-link {
  background: var(--neutral-0);
  color: var(--text-on-light);
}
[data-theme="dark"] .toast--error {
  background: var(--danger-500);
  color: var(--text-on-dark);
}

/* Theme icon: show only the active one. */
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }

/* Featured-grid single-column variant. */
.featured-grid--single { display: block; }
.featured-grid--single .featured-card--large { width: 100%; }
.meta-dot {
  display: inline-block; width: 3px; height: 3px;
  border-radius: 999px; background: var(--fg-soft);
}

/* Section sub-title used on home Recent. */
.section-subtitle {
  font-size: 18px; font-weight: 600;
  color: var(--fg-muted); margin-bottom: 8px;
}

/* Pagination. */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 24px 0 8px; flex-wrap: wrap;
}
.pagination__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  color: var(--fg-muted); text-decoration: none;
}
.pagination__link:hover {
  color: var(--fg); border-color: var(--border-strong);
  text-decoration: none;
}
.pagination__info {
  font-size: 13px; color: var(--fg-muted); font-variant-numeric: tabular-nums;
}

/* Empty/info states. */
.empty-state {
  padding: 32px; border: 1px dashed var(--border);
  border-radius: var(--radius-md); color: var(--fg-muted);
  text-align: center;
}
.search-suggestions { margin-top: 24px; color: var(--fg-muted); }

/* Error pages (404 / 500). */
.error-page {
  text-align: center;
  padding: 88px 16px 64px;
  display: grid; gap: 14px; justify-items: center;
}
.error-code {
  font-family: var(--font-mono);
  font-size: 14px; color: var(--accent);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.error-icon { color: var(--accent); }
.error-title {
  font-size: var(--text-3xl);
  letter-spacing: -0.015em;
  max-width: 540px;
}
.error-lead {
  color: var(--fg-muted); max-width: 540px;
  font-size: 16px; line-height: 1.65;
}
.error-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Hero featured image on post detail. */
.post-hero-image {
  margin: 0 0 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-hero-image img { width: 100%; height: auto; display: block; }

/* Newsletter inline CTA on issue detail. */
.newsletter-cta {
  margin-top: 48px; padding: 28px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.newsletter-cta .eyebrow { margin-bottom: 8px; }
.newsletter-cta p { font-size: 15px; color: var(--fg-muted); margin-bottom: 14px; }

/* Product CTA box. */
.product-cta-box {
  margin-top: 48px; padding: 28px; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.product-cta-box h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.product-cta-box p { margin-bottom: 20px; font-size: 15px; }

/* Service grid spacing on hire-me. */
.services { display: grid; gap: 14px; margin-bottom: 48px; }

/* Contact form spacing. */
.contact-box__lead { margin: 0 0 18px; font-size: 15px; color: var(--fg-muted); }

/* Calendly embed. */
.calendly-section { margin: 48px 0; }
.calendly-embed iframe {
  width: 100%; min-height: 630px; border: 0;
  border-radius: var(--radius-md);
}

/* Uses list. */
.uses-list { display: grid; gap: 40px; }

/* AJAX form button states. */
button.is-loading { opacity: .85; cursor: progress; }
button.is-success { background: var(--success-500) !important; color: var(--neutral-0) !important; }

/* Toast: error state. */
.toast--error { background: var(--danger-500); color: var(--text-on-dark); }

/* About page muted-link / link inside paragraphs */
.muted-link { color: var(--fg-muted); }
.muted-link:hover { color: var(--accent); }
.footer-copy { color: var(--fg-soft); margin-left: 6px; }

/* Reduced motion: disable expensive transitions. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus-visible: stronger ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Mobile polish
   ============================================================ */

/* Body scroll lock helper (used by mobile nav and dashboard sidebar).
   We pin the body in place via JS (sets `top: -scrollY`) so iOS Safari
   actually stops scrolling. Touch interaction inside the panel still works. */
.body--no-scroll {
  position: fixed;
  width: 100%;
  overflow-y: scroll; /* prevents layout shift from disappearing scrollbar */
}

/* Honour the HTML `hidden` attribute everywhere (class selectors would otherwise win). */
[hidden] { display: none !important; }

/* Mobile nav: scrollable panel below the sticky header; overlay stays tappable beneath it. */
@media (max-width: 820px) {
  .mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--header-height));
    max-height: calc(100svh - var(--header-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    z-index: 2;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(10, 10, 11, 0.12);
  }
  [data-theme="dark"] .mobile-nav {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
  .mobile-nav a {
    padding: 14px 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 17px;
    border-radius: var(--radius-sm);
    touch-action: manipulation;
  }
  .site-header.scrolled { border-bottom-color: var(--border); }
  .site-header.mobile-nav-open { border-bottom-color: var(--border); }
}

/* Page wrappers: trim padding so cards don't feel cramped on phones. */
@media (max-width: 640px) {
  .page-wrapper { padding: 28px 16px 0; }
  .hero { padding-top: 8px; }
  .hero__title { font-size: var(--text-3xl); line-height: 1.1; }
  .hero__lead { font-size: 17px; }
  .hero__actions { flex-wrap: wrap; gap: 10px; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }

  .featured-grid { grid-template-columns: 1fr; }
  .featured-grid__side { display: contents; }
  .featured-card,
  .featured-card--large { padding: 18px; }
  .featured-card__title { font-size: 20px; }

  .post-row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .post-row__date {
    grid-column: 1 / -1;
    order: -1;
    font-size: 12px;
  }
  .post-row__read { grid-row: 2; align-self: end; white-space: nowrap; }

  .post-article__title { font-size: 28px; line-height: 1.2; }
  .post-article__dek { font-size: 17px; }

  .offer-grid { gap: 12px; }
  .product-card__actions { flex-direction: column; }
  .product-card__actions .btn { width: 100%; justify-content: center; }
  .page-header__actions .btn { flex: 1 1 auto; justify-content: center; }

  .products-grid,
  .project-grid { grid-template-columns: 1fr; }

  .services { gap: 12px; }
  .service-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .service-card .btn { width: 100%; justify-content: center; }

  .newsletter-form,
  .newsletter-form--compact {
    flex-direction: column;
    align-items: stretch;
  }
  .newsletter-form input[type="email"] { width: 100%; }
  .newsletter-form .btn { width: 100%; justify-content: center; }

  .contact-form { gap: 10px; }
  .contact-form input,
  .contact-form textarea {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }

  .post-toc { padding: 16px 18px; }
  .pagination { flex-direction: column; gap: 8px; }
  .pagination__link { width: 100%; justify-content: center; }

  .tag-filters { gap: 6px; }
  .tag-filter { font-size: 12px; padding: 6px 10px; }

  .calendly-embed iframe { min-height: 720px; }
}

/* Inputs at <16px trigger iOS zoom on focus — bump to 16px on phones. */
@media (max-width: 480px) {
  input[type="text"], input[type="email"], input[type="search"],
  input[type="password"], input[type="number"], input[type="url"],
  textarea, select { font-size: 16px; }
}

/* Make sure tap targets aren't tiny on touch devices. */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .nav-icon-link, .theme-toggle, .lang-toggle button { min-height: 36px; min-width: 36px; }
}
