:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --accent: #06b6d4;
  --success: #10b981;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --font: "Vazirmatn", system-ui, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  direction: rtl;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

.page-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(79,70,229,.12), transparent 55%),
    radial-gradient(700px 380px at 0% 15%, rgba(6,182,212,.10), transparent 50%),
    radial-gradient(600px 300px at 50% 100%, rgba(124,58,237,.06), transparent 45%),
    var(--bg);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226,232,240,.9);
}
.nav {
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--text); font-weight: 800; font-size: 1.05rem;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px rgba(79,70,229,.25);
}
.nav-menu { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-menu > a:not(.btn) {
  color: var(--muted); font-weight: 600; font-size: .95rem;
}
.nav-menu > a:not(.btn):hover,
.nav-menu > a.active { color: var(--text); }
.nav-toggle {
  display: none; border: 1px solid var(--border); background: #fff;
  border-radius: 10px; padding: .4rem .65rem; cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 12px; padding: .7rem 1.15rem; font-weight: 700;
  border: 0; cursor: pointer; font-family: inherit; transition: .2s ease;
}
.btn-main {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(79,70,229,.28);
}
.btn-main:hover { filter: brightness(1.05); transform: translateY(-1px); color: #fff !important; }
.btn-soft {
  background: #fff; color: var(--text) !important;
  border: 1px solid var(--border);
}
.btn-soft:hover { background: #f8fafc; color: var(--text) !important; }

/* Hero */
.hero { padding: 4.5rem 0 3rem; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(79,70,229,.08); color: var(--primary);
  border: 1px solid rgba(79,70,229,.15);
  padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 1.2; margin: 1rem 0;
  letter-spacing: -0.02em;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); font-size: 1.08rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; margin-top: 2rem;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem; box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.3rem; }
.stat span { color: var(--muted); font-size: .85rem; }

.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.preview-card::after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.18), transparent 70%);
  top: -40px; left: -30px;
}
.code-win {
  position: relative; z-index: 1;
  background: #0b1220; color: #e2e8f0; border-radius: 16px; overflow: hidden;
  direction: ltr; text-align: left;
}
.code-top {
  display: flex; gap: 6px; padding: .7rem .9rem; background: #111827; border-bottom: 1px solid #1f2937;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.r { background: #f87171; } .dot.y { background: #fbbf24; } .dot.g { background: #34d399; }
.code-body {
  margin: 0; padding: 1rem 1.1rem; font-family: ui-monospace, Consolas, monospace;
  font-size: .82rem; line-height: 1.55; min-height: 210px;
}
.kw { color: #c4b5fd; } .fn { color: #93c5fd; } .str { color: #6ee7b7; } .cm { color: #64748b; }

/* Sections */
section { padding: 3.5rem 0; }
.section-head { text-align: center; margin-bottom: 2rem; }
.section-head h2 { margin: 0 0 .5rem; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow);
  transition: .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: #cbd5e1; }
.icon-box {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(79,70,229,.1), rgba(6,182,212,.1));
  color: var(--primary); font-size: 1.2rem; margin-bottom: .85rem;
}
.card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

.bullets { list-style: none; padding: 0; margin: 1rem 0 0; }
.bullets li {
  display: flex; gap: .5rem; color: var(--muted); padding: .35rem 0;
}
.bullets li i { color: var(--success); margin-top: .2rem; }

.cta-box {
  text-align: center;
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(6,182,212,.08));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem 1.5rem;
}

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.blog-card { padding: 0; overflow: hidden; }
.blog-cover {
  height: 150px;
  background: linear-gradient(135deg, #e0e7ff, #cffafe);
  display: grid; place-items: center; font-size: 2.2rem;
}
.blog-body { padding: 1.1rem 1.2rem 1.3rem; }
.meta { color: var(--muted); font-size: .8rem; margin-bottom: .4rem; }
.tag {
  display: inline-block; background: #eef2ff; color: #4338ca;
  border-radius: 999px; padding: .12rem .55rem; font-size: .75rem; font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1.5rem; }
.chip {
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); font-weight: 600; font-size: .9rem;
}
.chip:hover, .chip.active { color: var(--primary); border-color: #c7d2fe; background: #eef2ff; }

/* Forms */
label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
input, textarea, select {
  width: 100%; background: #fff; border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: .8rem .95rem;
  font-family: inherit; margin-bottom: 1rem;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.page-hero { padding: 3rem 0 1.25rem; text-align: center; }
.page-hero h1 { margin: .4rem 0; letter-spacing: -0.02em; }

/* Footer */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--border);
  background: #fff; padding: 2.5rem 0 1.25rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
.site-footer h4 { margin: 0 0 .7rem; font-size: .95rem; }
.site-footer a { display: block; color: var(--muted); margin-bottom: .35rem; font-size: .92rem; }
.site-footer a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1rem;
  text-align: center; color: var(--muted); font-size: .85rem;
}

.alert-ok {
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
  border-radius: 12px; padding: .85rem 1rem; margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .hero-grid, .grid-3, .grid-2, .blog-grid, .footer-grid, .stats { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none; position: absolute; top: 72px; right: 0; left: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 1rem; flex-direction: column; align-items: stretch;
  }
  .nav-menu.open { display: flex; }
}

/* ===== Landing animations & extra sections ===== */
.anim-fade-up {
  opacity: 0;
  transform: translateY(22px);
  animation: fadeUp .7s ease forwards;
}
.anim-fade-left {
  opacity: 0;
  transform: translateX(-28px);
  animation: fadeLeft .8s ease forwards;
}
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .35s; }
.delay-4 { animation-delay: .5s; }
.delay-5 { animation-delay: .65s; }

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}
@keyframes fadeLeft {
  to { opacity: 1; transform: none; }
}

.anim-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.anim-on-scroll.in-view {
  opacity: 1;
  transform: none;
}
.anim-on-scroll.delay-1.in-view { transition-delay: .1s; }
.anim-on-scroll.delay-2.in-view { transition-delay: .2s; }
.anim-on-scroll.delay-3.in-view { transition-delay: .3s; }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: pulse 1.6s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); }
  70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.float-card {
  animation: floatY 4.5s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.pill.soft {
  background: rgba(79,70,229,.06);
  color: var(--primary);
  border-color: rgba(79,70,229,.12);
}

.trust-row {
  display: flex; flex-wrap: wrap; gap: .85rem 1.25rem;
  margin-top: 1.5rem; color: var(--muted); font-size: .9rem; font-weight: 600;
}
.trust-row i { color: var(--primary); margin-left: .35rem; }

.code-title {
  margin-right: auto; margin-left: .5rem;
  color: #94a3b8; font-size: .75rem; font-family: var(--font);
}

.ai-chip {
  margin-top: .75rem;
  display: inline-flex; align-items: center; gap: .45rem;
  background: #eef2ff; color: #4338ca;
  border-radius: 999px; padding: .4rem .85rem;
  font-size: .82rem; font-weight: 600;
}
.anim-pulse { animation: softPulse 2s ease-in-out infinite; }
@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

.strip {
  padding: 1.25rem 0 2rem;
}
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 1.25rem 1rem; box-shadow: var(--shadow);
}
.stat-item { text-align: center; }
.stat-item strong {
  display: block; font-size: 1.6rem;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-item span { color: var(--muted); font-size: .85rem; }

.section { padding: 4rem 0; }
.section.alt-bg {
  background: linear-gradient(180deg, rgba(79,70,229,.03), transparent 40%, rgba(6,182,212,.03));
}
.text-grad {
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.feature-card { height: 100%; }
.feature-card .icon-box { transition: transform .25s ease; }
.feature-card:hover .icon-box { transform: scale(1.08) rotate(-3deg); }

.feature-row {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem;
  align-items: center; margin: 2.5rem 0;
}
.feature-row.reverse { direction: ltr; }
.feature-row.reverse > * { direction: rtl; }

.mock-panel { padding: 0; overflow: hidden; }
.mock-bar {
  display: flex; gap: 6px; padding: .7rem .9rem;
  background: #f1f5f9; border-bottom: 1px solid var(--border);
}
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.mock-bar span:first-child { background: #f87171; }
.mock-bar span:nth-child(2) { background: #fbbf24; }
.mock-bar span:nth-child(3) { background: #34d399; }
.mock-body { display: grid; grid-template-columns: 70px 1fr; min-height: 140px; }
.mock-side { background: #f8fafc; border-left: 1px solid var(--border); }
.mock-main { padding: 1rem; }
.mock-line {
  height: 10px; border-radius: 6px; background: linear-gradient(90deg, #e2e8f0, #f1f5f9, #e2e8f0);
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
  margin-bottom: .55rem;
}
.mock-line.w80 { width: 80%; } .mock-line.w60 { width: 60%; }
.mock-line.w90 { width: 90%; } .mock-line.w40 { width: 40%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.mock-chat { padding: 1.2rem; min-height: 160px; display: flex; flex-direction: column; gap: .75rem; }
.chat-bubble {
  max-width: 90%; padding: .75rem 1rem; border-radius: 14px;
  font-size: .9rem; line-height: 1.5;
}
.chat-bubble.user {
  align-self: flex-start;
  background: #eef2ff; color: #312e81;
  border-bottom-right-radius: 4px;
}
.chat-bubble.bot {
  align-self: flex-end;
  background: #f1f5f9; color: #0f172a;
  border-bottom-left-radius: 4px;
}
.typing { display: inline-flex; gap: 3px; margin-left: .35rem; vertical-align: middle; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: #64748b;
  animation: bounce 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem;
}
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.step-num {
  width: 42px; height: 42px; border-radius: 12px; margin: 0 auto .9rem;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(79,70,229,.25);
}
.step-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--muted); font-size: .92rem; }

.use-card h3 { margin-top: 0; }
.use-card:hover { border-color: #c7d2fe; }

@media (max-width: 900px) {
  .stats-strip, .steps, .feature-row { grid-template-columns: 1fr; }
  .feature-row.reverse { direction: rtl; }
}

/* ========== Enhancements: Blog / About / Contact / Motion ========== */

.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: box-shadow .25s ease, background .25s ease;
}
.site-header.scrolled {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(15,23,42,.06);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* Page hero shared */
.page-hero {
  padding: 3.5rem 0 2rem;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  margin: .75rem 0 .5rem;
  letter-spacing: -0.02em;
}
.page-hero .lead { margin-inline: auto; }
.text-center { text-align: center; }

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  justify-content: center; font-size: .85rem; color: var(--muted); margin-bottom: .75rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* Blog layout */
.blog-section { padding: 0 0 4rem; }
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.blog-card {
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15,23,42,.1);
}
.blog-cover-link { display: block; text-decoration: none; }
.blog-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(6,182,212,.1));
  display: grid; place-items: center;
  overflow: hidden;
}
.blog-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.blog-card:hover .blog-cover img { transform: scale(1.04); }
.cover-emoji { font-size: 2.5rem; }
.blog-body { padding: 1.15rem 1.2rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.blog-body .meta { font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.blog-body h3 { font-size: 1.05rem; margin: 0 0 .45rem; line-height: 1.4; }
.blog-body h3 a { color: var(--text); text-decoration: none; }
.blog-body h3 a:hover { color: var(--primary); }
.blog-body p { color: var(--muted); font-size: .9rem; flex: 1; margin: 0 0 .75rem; }
.read-more {
  font-size: .88rem; font-weight: 700; color: var(--primary);
  text-decoration: none; display: inline-flex; align-items: center; gap: .3rem;
}
.read-more:hover { gap: .5rem; }

.blog-search {
  display: flex; align-items: center; gap: .5rem;
  max-width: 480px; margin: 1.25rem auto 0;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: .35rem .35rem .35rem .9rem;
  box-shadow: var(--shadow);
}
.blog-search i { color: var(--muted); }
.blog-search input {
  flex: 1; border: 0; outline: none; font-family: inherit; font-size: .95rem;
  background: transparent; padding: .45rem 0;
}
.meta-count { font-size: .85rem; color: var(--muted); margin-top: .75rem; }

.filter-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem; font-size: .9rem;
}

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  color: var(--text); font-size: .85rem; font-weight: 600;
  text-decoration: none; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary); color: #fff !important; border-color: var(--primary);
}

.pagination {
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
  margin-top: 2rem;
}

.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow); margin-bottom: 1rem;
}
.sidebar-card h4 {
  font-size: .95rem; margin: 0 0 .85rem;
  display: flex; align-items: center; gap: .4rem;
}
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem 0; color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--border); font-size: .9rem; font-weight: 500;
}
.cat-list li:last-child a { border-bottom: 0; }
.cat-list li a:hover, .cat-list a.active-cat { color: var(--primary); }
.cta-card {
  background: linear-gradient(145deg, rgba(79,70,229,.08), rgba(6,182,212,.06));
}

.empty-state {
  text-align: center; padding: 3rem 1rem;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 16px;
}
.empty-state i { font-size: 2.5rem; color: var(--muted); }
.empty-state h3 { margin: .75rem 0 .35rem; }

/* Post detail */
.post-hero {
  padding: 2.5rem 0 1.5rem;
  background: linear-gradient(180deg, rgba(79,70,229,.06), transparent);
}
.post-hero-inner { max-width: 800px; margin: 0 auto; text-align: center; }
.post-hero h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  margin: .75rem 0;
  line-height: 1.3;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
  font-size: .88rem; color: var(--muted);
}
.post-meta i { margin-left: .25rem; }
.post-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-aside { order: 2; }
}
.post-content { max-width: 720px; }
.post-cover {
  border-radius: 16px; overflow: hidden; margin: 0 0 1.5rem;
  border: 1px solid var(--border);
}
.post-cover img { width: 100%; display: block; max-height: 420px; object-fit: cover; }
.post-summary { font-size: 1.1rem; color: var(--muted); margin-bottom: 1.5rem; }
.prose {
  line-height: 1.9; font-size: 1.02rem;
  white-space: normal;
}
.prose p { margin: 0 0 1rem; }
.prose h2, .prose h3 { margin: 1.5rem 0 .75rem; }
.prose pre, .prose code {
  font-family: ui-monospace, monospace; font-size: .9em;
  background: #f1f5f9; border-radius: 6px;
}
.prose pre { padding: 1rem; overflow-x: auto; }
.prose code { padding: .1rem .35rem; }
.post-share {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
}
.sticky-aside { position: sticky; top: 5rem; }
.related-section { padding: 0 0 4rem; }
.section-h { font-size: 1.35rem; margin-bottom: 1.25rem; }
.related-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* About */
.about-section { padding: 0 0 4rem; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }
.about-card { padding: 1.5rem; text-align: center; }
.icon-badge {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 1rem;
  display: grid; place-items: center; font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(124,58,237,.1));
  color: var(--primary);
}
.about-story {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 2rem; margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.about-story h2 { margin-top: 0; }
.feature-ticks {
  list-style: none; padding: 0; margin: 1.25rem 0 0;
  display: grid; gap: .55rem;
}
.feature-ticks li {
  display: flex; align-items: center; gap: .5rem; font-weight: 500;
}
.feature-ticks i { color: #10b981; }
.about-cta {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(6,182,212,.08));
  border: 1px solid rgba(79,70,229,.12);
}

/* Contact */
.contact-section { padding: 0 0 4rem; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form-card { padding: 1.5rem; }
.contact-form .form-row { margin-bottom: 1rem; }
.contact-form label {
  display: block; font-size: .85rem; font-weight: 600;
  margin-bottom: .35rem; color: var(--text);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem .9rem; font-family: inherit; font-size: .95rem;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 0; color: var(--muted); font-size: .95rem;
}
.contact-list a { color: var(--primary); text-decoration: none; }
.alert-ok {
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
  border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem; font-weight: 600;
}
.alert-err {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
  border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem; font-weight: 600;
}

/* Back to top */
.back-top {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff;
  color: var(--text); box-shadow: var(--shadow);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .2s;
  display: grid; place-items: center;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-2px); color: var(--primary); }

@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    padding: .75rem 0; gap: .35rem;
  }
  .nav-menu.open { display: flex; }
  .nav { flex-wrap: wrap; }
}

/* Smooth focus */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
