/* =================================================================
   HARSH KUMAR — Premium Tech Blog
   Dark-by-default, glowing-orange design system
   ================================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Orange brand ramp */
  --orange-300: #ffb066;
  --orange-400: #ff9838;
  --orange-500: #ff7a1a;   /* primary */
  --orange-600: #f45f00;
  --orange-700: #d24e00;
  --orange-grad: linear-gradient(135deg, #ff9838 0%, #ff6a00 55%, #ff4d00 100%);

  /* Dark surfaces */
  --bg: #0a0a0c;
  --bg-2: #0f0f13;
  --surface: #141419;
  --surface-2: #1a1a21;
  --surface-3: #22222b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #f4f4f6;
  --text-soft: #b6b6c2;
  --text-mute: #7d7d8c;

  /* Glow */
  --glow: rgba(255, 122, 26, 0.45);
  --glow-soft: rgba(255, 122, 26, 0.18);
  --glow-ring: rgba(255, 122, 26, 0.28);

  /* Typography */
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 20px 60px -18px var(--glow);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.5s;

  --maxw: 1200px;
  --nav-h: 74px;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f7f4ef;
  --bg-2: #fffdf9;
  --surface: #ffffff;
  --surface-2: #fbf8f2;
  --surface-3: #f2ede4;
  --border: rgba(20, 12, 0, 0.10);
  --border-strong: rgba(20, 12, 0, 0.18);

  --text: #1c1712;
  --text-soft: #524a40;
  --text-mute: #857b6e;

  --orange-500: #ec5c00;
  --glow: rgba(236, 92, 0, 0.30);
  --glow-soft: rgba(236, 92, 0, 0.12);
  --glow-ring: rgba(236, 92, 0, 0.22);

  --shadow-sm: 0 6px 22px rgba(120, 70, 0, 0.10);
  --shadow-md: 0 20px 50px rgba(120, 70, 0, 0.14);
  --shadow-glow: 0 24px 60px -20px var(--glow);
}

/* ---------- 2. Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 78% -5%, var(--glow-soft), transparent 60%),
    radial-gradient(50% 40% at 12% 8%, rgba(255, 122, 26, 0.10), transparent 60%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }

::selection { background: var(--orange-500); color: #fff; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--orange-600); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.2rem, 4vw, 2.5rem);
}

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.font-heading { font-family: var(--font-heading); }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--orange-400);
}

.grad-text {
  background: var(--orange-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.85rem 1.6rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--orange-grad);
  color: #fff;
  box-shadow: 0 10px 30px -8px var(--glow);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px -10px var(--glow);
}
.btn-primary:active { transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover {
  border-color: var(--orange-500);
  color: var(--orange-400);
  transform: translateY(-3px);
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--orange-400);
  font-weight: 600;
  font-size: 0.95rem;
}
.arrow-link svg { transition: transform 0.35s var(--ease); }
.arrow-link:hover svg { transform: translateX(6px); }

/* ---------- 5. Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--orange-grad);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.35rem;
  box-shadow: 0 8px 22px -6px var(--glow);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.brand:hover .logo-mark::after { transform: translateX(120%); }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-6);
}
.nav-links a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.3s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--orange-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
  border-radius: 2px;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: var(--s-3); }

/* Theme toggle */
.theme-toggle {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  transition: transform 0.4s var(--ease), color 0.3s, border-color 0.3s;
}
.theme-toggle:hover {
  color: var(--orange-400);
  border-color: var(--orange-500);
  transform: rotate(18deg) scale(1.06);
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile menu button */
.menu-btn {
  display: none;
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  place-items: center;
}
.menu-btn span {
  position: relative;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s var(--ease);
}
.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute; left: 0;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s var(--ease);
}
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
body.menu-open .menu-btn span { background: transparent; }
body.menu-open .menu-btn span::before { top: 0; transform: rotate(45deg); }
body.menu-open .menu-btn span::after { top: 0; transform: rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + var(--s-9));
  padding-bottom: var(--s-8);
  overflow: hidden;
}
.hero-orb {
  position: absolute;
  top: -12%; right: -6%;
  width: 620px; height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--orange-500), transparent 60%);
  filter: blur(70px);
  opacity: 0.55;
  z-index: -1;
  animation: float 12s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.08); }
}
.hero-inner { max-width: 860px; }
.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  line-height: 1.02;
  margin: var(--s-4) 0 var(--s-5);
  font-weight: 600;
}
.hero p {
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  color: var(--text-soft);
  max-width: 620px;
  margin-bottom: var(--s-6);
}
.hero-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: var(--s-7);
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.hero-stats .stat strong {
  font-family: var(--font-heading);
  font-size: 2rem;
  display: block;
  line-height: 1;
}
.hero-stats .stat span {
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}

/* ---------- 7. Section headers ---------- */
.section { padding-block: var(--s-8); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-top: var(--s-2);
}
.section-head p { color: var(--text-soft); max-width: 46ch; }

/* ---------- 8. Featured post ---------- */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--s-6);
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s;
}
.featured:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--glow-ring);
}
.featured-cover {
  position: relative;
  min-height: 340px;
}
.featured-body {
  padding: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-body h3 {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  margin: var(--s-3) 0 var(--s-4);
}
.featured-body p { color: var(--text-soft); margin-bottom: var(--s-5); }

/* ---------- 9. Post cards / grid ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}
.search svg {
  position: absolute; left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-mute);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search input::placeholder { color: var(--text-mute); }
.search input:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 4px var(--glow-soft);
}

.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chip {
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--orange-500); color: var(--text); transform: translateY(-2px); }
.chip.active {
  background: var(--orange-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px -8px var(--glow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-5);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s;
  will-change: transform;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
  border-color: var(--glow-ring);
}
.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.card-cover .cover-tag {
  position: absolute;
  top: var(--s-3); left: var(--s-3);
  z-index: 2;
}
.card-body {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
}
.card-body h3 {
  font-size: 1.35rem;
  line-height: 1.2;
  transition: color 0.3s;
}
.card:hover .card-body h3 { color: var(--orange-400); }
.card-body p {
  color: var(--text-soft);
  font-size: 0.94rem;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 0.8rem;
  color: var(--text-mute);
  margin-top: auto;
  padding-top: var(--s-2);
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-block;
  padding: 0.32rem 0.8rem;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--orange-500) 16%, transparent);
  color: var(--orange-300);
  border: 1px solid var(--glow-ring);
  backdrop-filter: blur(4px);
}

.no-results {
  text-align: center;
  padding: var(--s-8) var(--s-4);
  color: var(--text-mute);
  display: none;
}
.no-results.show { display: block; }
.no-results svg { width: 46px; height: 46px; margin-bottom: var(--s-3); color: var(--orange-500); opacity: 0.6; }

/* ---------- 10. Cover gradients ---------- */
.cover {
  position: absolute;
  inset: 0;
  background-size: cover;
}
.cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: overlay;
}
.cover-ember  { background: linear-gradient(135deg, #2a1200 0%, #7a2e00 45%, #ff7a1a 120%); }
.cover-amber  { background: linear-gradient(135deg, #1a1400 0%, #6b4a00 40%, #ffab2e 120%); }
.cover-sunset { background: linear-gradient(135deg, #2b0a1a 0%, #7a1a2e 40%, #ff6a3d 120%); }
.cover-copper { background: linear-gradient(135deg, #14100a 0%, #5c3410 42%, #ff8a3d 120%); }

/* decorative mark inside covers */
.cover-mark {
  position: absolute;
  right: -10%; bottom: -30%;
  font-family: var(--font-heading);
  font-size: 16rem;
  font-weight: 600;
  color: rgba(255,255,255,0.10);
  line-height: 1;
  user-select: none;
  z-index: 1;
}

/* ---------- 11. Footer ---------- */
.footer {
  margin-top: var(--s-9);
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding-block: var(--s-8) var(--s-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: var(--s-7);
  align-items: start;
}
.footer-brand p {
  color: var(--text-soft);
  max-width: 40ch;
  margin-top: var(--s-4);
}
.socials { display: flex; gap: var(--s-3); margin-top: var(--s-5); }
.social {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  transition: transform 0.4s var(--ease), color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.social:hover {
  color: var(--orange-400);
  border-color: var(--orange-500);
  transform: translateY(-4px);
  box-shadow: 0 12px 26px -12px var(--glow);
}
.social svg { width: 20px; height: 20px; }
.footer-nav h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  margin-bottom: var(--s-4);
}
.footer-nav a {
  display: block;
  color: var(--text-soft);
  padding: 0.35rem 0;
  transition: color 0.3s, transform 0.3s;
}
.footer-nav a:hover { color: var(--orange-400); transform: translateX(4px); }
.footer-contact h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  margin-bottom: var(--s-4);
}
.footer-contact ul { list-style: none; margin: 0; padding: 0; }
.footer-contact li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.35rem 0;
  color: var(--text-soft);
}
.footer-contact li svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--orange-400);
}
.footer-contact a {
  color: var(--text-soft);
  transition: color 0.3s;
  word-break: break-word;
}
.footer-contact a:hover { color: var(--orange-400); }
.footer-bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  color: var(--text-mute);
  font-size: 0.85rem;
}

/* ---------- 12. Scroll progress + reveal ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--orange-grad);
  z-index: 200;
  box-shadow: 0 0 12px var(--glow);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

/* ---------- 13. Post page ---------- */
.post-hero {
  position: relative;
  padding-top: calc(var(--nav-h) + var(--s-7));
  padding-bottom: var(--s-6);
}
.post-hero .breadcrumb {
  display: flex; gap: 0.5rem; align-items: center;
  color: var(--text-mute); font-size: 0.85rem;
  margin-bottom: var(--s-5);
}
.post-hero .breadcrumb a:hover { color: var(--orange-400); }
.post-title {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.04;
  max-width: 20ch;
  margin: var(--s-4) 0;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  color: var(--text-mute);
  font-size: 0.9rem;
  margin-top: var(--s-4);
}
.post-author {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--orange-grad);
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-heading);
  font-weight: 600;
  box-shadow: 0 6px 16px -6px var(--glow);
}
.post-cover {
  position: relative;
  height: clamp(240px, 42vw, 460px);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin: var(--s-6) 0 var(--s-7);
  border: 1px solid var(--border);
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--s-8);
  align-items: start;
}

/* Article typography */
.article {
  max-width: 72ch;
  font-size: 1.12rem;
}
.article > * + * { margin-top: 1.4em; }
.article .lead {
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text);
}
.article h2 {
  font-size: 1.9rem;
  margin-top: 2.2em;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.article h3 {
  font-size: 1.4rem;
  margin-top: 1.8em;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.article p, .article li { color: var(--text-soft); }
.article strong { color: var(--text); }
.article a {
  color: var(--orange-400);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--glow-ring);
}
.article a:hover { text-decoration-color: var(--orange-500); }
.article ul { padding-left: 1.3em; list-style: none; }
.article ul li { position: relative; padding-left: 1.2em; }
.article ul li::before {
  content: "";
  position: absolute; left: 0; top: 0.65em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--orange-grad);
}
.article blockquote {
  border-left: 3px solid var(--orange-500);
  padding: 0.4em 0 0.4em 1.4em;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  line-height: 1.45;
  font-style: italic;
  color: var(--text);
}
.article pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.3em 1.5em;
  overflow-x: auto;
  font-size: 0.92rem;
}
.article code {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92em;
}
.article p code, .article li code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  color: var(--orange-300);
}
.article pre code { color: var(--text-soft); }

/* Table of contents */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
}
.toc h4 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  margin-bottom: var(--s-4);
}
.toc ul { border-left: 1px solid var(--border); }
.toc li a {
  display: block;
  padding: 0.4rem 0 0.4rem 1rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-mute);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 0.3s, border-color 0.3s;
}
.toc li.sub a { padding-left: 1.8rem; font-size: 0.83rem; }
.toc li a:hover { color: var(--text-soft); }
.toc li a.active {
  color: var(--orange-400);
  border-left-color: var(--orange-500);
  font-weight: 600;
}

/* Article footer: tags + share */
.article-foot {
  max-width: 72ch;
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
  align-items: center;
}
.tag-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.share { display: flex; gap: var(--s-2); align-items: center; }
.share span { color: var(--text-mute); font-size: 0.85rem; margin-right: 0.3rem; }
.share button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: grid; place-items: center;
  transition: transform 0.35s var(--ease), color 0.3s, border-color 0.3s;
}
.share button:hover { color: var(--orange-400); border-color: var(--orange-500); transform: translateY(-3px); }
.share button svg { width: 17px; height: 17px; }

/* ---------- 14. Comments ---------- */
.comments {
  max-width: 72ch;
  margin-top: var(--s-8);
}
.comments h3 {
  font-size: 1.7rem;
  margin-bottom: var(--s-5);
  display: flex; align-items: center; gap: 0.6rem;
}
.comments h3 .count {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--orange-300);
  background: var(--glow-soft);
  border: 1px solid var(--glow-ring);
  padding: 0.15rem 0.7rem;
  border-radius: var(--r-pill);
}
.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-6);
}
.comment-form .row { display: flex; gap: var(--s-3); margin-bottom: var(--s-3); }
.comment-form input,
.comment-form textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.8rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.comment-form textarea { resize: vertical; min-height: 110px; }
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 4px var(--glow-soft);
}
.comment-form .form-foot {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  margin-top: var(--s-3);
}
.comment-form .hint { font-size: 0.8rem; color: var(--text-mute); }

.comment-list { display: flex; flex-direction: column; gap: var(--s-4); }
.comment {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  animation: fadeUp 0.5s var(--ease) both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.comment .avatar { flex-shrink: 0; }
.comment-main { flex: 1; }
.comment-main .head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.comment-main .head strong { font-size: 0.98rem; }
.comment-main .head time { font-size: 0.78rem; color: var(--text-mute); }
.comment-main p { color: var(--text-soft); font-size: 0.96rem; }
.comment-empty { color: var(--text-mute); font-size: 0.95rem; padding: var(--s-3) 0; }

/* ---------- 15. Related posts ---------- */
.related { margin-top: var(--s-9); }

/* ---------- 16. Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--surface-2);
  border: 1px solid var(--glow-ring);
  color: var(--text);
  padding: 0.9rem 1.4rem;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 300;
  display: flex; align-items: center; gap: 0.6rem;
  transition: transform 0.5s var(--ease), opacity 0.5s;
  opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast svg { width: 18px; height: 18px; color: var(--orange-400); }

/* ---------- 17. Responsive ---------- */
@media (max-width: 940px) {
  .post-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .featured { grid-template-columns: 1fr; }
  .featured-cover { min-height: 240px; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-6); }
}

@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: var(--s-4) clamp(1.2rem, 4vw, 2.5rem) var(--s-5);
    transform: translateY(-140%);
    transition: transform 0.45s var(--ease);
    box-shadow: var(--shadow-md);
  }
  body.menu-open .nav-links { transform: translateY(0); }
  .nav-links a { width: 100%; padding: 0.85rem 0; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
  .nav-links a::after { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
  .hero-stats { gap: var(--s-6); }
  .article-foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- 18. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
