/* ── Self-hosted Inter Font ─────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}

:root {
  --bg: #09090b;
  --bg-rgb: 9, 9, 11;
  --bg-alt: #0c0c0e;
  --surface: #111113;
  --surface-2: #18181b;
  --border: #27272a;
  --border-2: #3f3f46;
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --primary: #2563EB;
  --primary-fg: #ffffff;
  --primary-rgb: 37, 99, 235;
  --accent: #16A34A;
  --accent-2: #86EFAC;
  --accent-rgb: 22, 163, 74;
  --accent-2-rgb: 134, 239, 172;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, .15);
  --shadow-btn: 0 4px 16px rgba(var(--primary-rgb), .3);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 1120px;
  --header-h: 64px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t: .2s var(--ease);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --bg-alt: #fafafa;
  --surface: #f4f4f5;
  --surface-2: #e4e4e7;
  --border: #e4e4e7;
  --border-2: #d4d4d8;
  --text: #09090b;
  --text-2: #52525b;
  --text-3: #71717a;
  --primary: #2563EB;
  --primary-fg: #ffffff;
  --accent: #16A34A;
  --accent-2: #4ADE80;
  --accent-2-rgb: 74, 222, 128;
}

[data-theme="light"] .text-gradient {
  background: linear-gradient(90deg, #16A34A 0%, #4ADE80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .blog-glow {
  background: radial-gradient(ellipse 50% 40% at 50% 30%, rgba(var(--accent-rgb), .06), transparent 70%);
}

[data-theme="light"] .grain {
  opacity: .02;
}

[data-theme="light"] .post-card::before {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .08), rgba(var(--accent-2-rgb), .04));
}

html.theme-transition,
html.theme-transition * {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-2);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  line-height: 1.2;
  font-weight: 600;
}

img,
svg {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 720px;
}

.section {
  padding: clamp(56px, 8vw, 100px) 0;
  position: relative;
}

.text-gradient {
  background: linear-gradient(90deg, #86EFAC 0%, #16A34A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.anim {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim.visible {
  opacity: 1;
  transform: translateY(0);
}

.post-list .anim:nth-child(2) {
  transition-delay: 0.1s;
}

.post-list .anim:nth-child(3) {
  transition-delay: 0.2s;
}

.post-list .anim:nth-child(4) {
  transition-delay: 0.3s;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  transition: all var(--t);
  white-space: nowrap;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.btn-primary:hover {
  opacity: .92;
  box-shadow: var(--shadow-btn);
  transform: scale(1.03);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(var(--bg-rgb), .8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t);
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
}

.logo-smile {
  color: var(--primary);
  margin-top: -2px;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.logo-i {
  position: relative;
  font-style: normal;
}

.logo-i::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  position: relative;
  font-size: 14px;
  color: var(--text-3);
  transition: color var(--t);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--t);
  overflow: hidden;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-2);
}

.theme-toggle svg {
  position: absolute;
  transition: transform .4s var(--ease), opacity .3s ease;
}

.icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

[data-theme="light"] .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="light"] .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 20px;
  padding: 4px 0;
}

.menu-btn span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s ease;
}

.menu-btn.active span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.menu-btn.active span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.reading-progress-container {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  z-index: 101;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}

/* Blog Overview */
.blog-listing {
  padding-top: calc(var(--header-h) + clamp(60px, 8vw, 100px));
  overflow: hidden;
}

.blog-glow {
  position: absolute;
  width: 800px;
  height: 600px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), .15), rgba(var(--accent-2-rgb), .05), transparent 70%);
  pointer-events: none;
  filter: blur(50px);
  z-index: -1;
}

.blog-listing-title {
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  text-align: center;
}

.blog-listing-sub {
  font-size: 18px;
  color: var(--text-2);
  margin: 0 auto 64px;
  max-width: 600px;
  text-align: center;
  line-height: 1.7;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t), transform .25s var(--ease), box-shadow .25s var(--ease);
  overflow: hidden;
  height: 100%;
}

.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .25), rgba(var(--accent-2-rgb), .08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

.post-card:hover::before {
  opacity: 1;
}

.post-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.post-card-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.35;
  color: var(--text);
  transition: color var(--t);
}

.post-card:hover .post-card-title {
  color: var(--text);
}

.post-card-desc {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
  flex-grow: 1;
}

.post-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.runtime-state {
  width: 100%;
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-2);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.runtime-state-error {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.post-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.pagination-label {
  min-width: 72px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}

/* Single Post */
.post {
  padding-top: calc(var(--header-h) + clamp(40px, 6vw, 80px));
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 40px;
  transition: color var(--t);
  font-weight: 500;
}

.post-back:hover {
  color: var(--text);
}

.post-header {
  margin-bottom: 56px;
  text-align: center;
}

.post-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--text-3);
}

.post-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-2);
}

.post-content h2 {
  font-size: 26px;
  margin-top: 56px;
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 22px;
  margin-top: 40px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text);
}

.post-content p {
  margin-bottom: 24px;
}

.post-content ul,
.post-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.post-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color var(--t), text-decoration-color var(--t);
  text-decoration-color: var(--border-2);
  font-weight: 500;
}

.post-content a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.post-content strong {
  color: var(--text);
  font-weight: 600;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 24px 32px;
  margin: 40px 0;
  background: linear-gradient(90deg, var(--surface), transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05em;
  font-style: italic;
}

.post-content blockquote p {
  margin-bottom: 0;
  color: var(--text);
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
}

.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin: 32px 0;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  font-style: normal;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 40px 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 98;
}

.nav-overlay.active {
  display: block;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 48px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .logo {
  margin-bottom: 16px;
  align-items: flex-start;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
}

.footer-cols {
  display: flex;
  gap: 80px;
}

.footer-cols h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.footer-cols a {
  display: block;
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 12px;
  transition: color var(--t);
}

.footer-cols a:hover {
  color: var(--text);
}
.compliance-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.compliance-badge-img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}

.footer-bottom-links {
  display: flex;
  gap: 24px;
}

.footer-bottom-links a {
  color: var(--text-3);
  transition: color var(--t);
}

.footer-bottom-links a:hover {
  color: var(--text);
}

@media (max-width: 1024px) {
  .footer-cols {
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 32px 32px;
    gap: 0;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 99;
  }

  .nav.open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 16px;
    padding: 14px 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
  }

  .nav-link::after {
    display: none;
  }

  .header-right .btn-primary {
    display: none;
  }

  .menu-btn {
    display: flex;
    z-index: 101;
  }

  .footer-inner {
    flex-direction: column;
    gap: 40px;
    align-items: flex-start;
  }

  .footer-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .post-list {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .blog-listing-title {
    font-size: 32px;
  }

  .post-title {
    font-size: 28px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}
