:root {
  /* Base palette */
  --lavender: #E3E3ED;
  --atomic-tangerine: #EC793F;
  --sandy-brown: #F2A066;
  --sunlit-clay: #EAB467;
  --soft-periwinkle: #A690F9;
  --bright-lavender: #BA80E2;
  --deep-lilac: #6F45BC;

  /* Neutrals */
  --bg-main: #F4F4FB;
  --bg-elevated: #F8F7FF;
  --outline-soft: rgba(222, 220, 245, 0.9);

  --text-main: #1E1A30;
  --text-muted: #7A7695;
  --text-subtle: #9A97B6;

  /* Shadows */
  --shadow-soft: 0 18px 35px rgba(23, 17, 52, 0.25);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --radius-lg: 1.2rem;
  --radius-md: 0.9rem;
  --radius-pill: 999px;

  --transition-fast: 0.15s ease;
  --transition-med: 0.3s ease;
}

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #ffffff, var(--bg-main));
  color: var(--text-main);
}

/* Layout Shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.page-main {
  flex: 1 0 auto;
  padding: 1.25rem 1.25rem 3.5rem;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(244, 244, 251, 0.95),
    rgba(244, 244, 251, 0.85)
  );
  border-bottom: 1px solid var(--outline-soft);
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.brand-text {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 1rem;
  text-transform: uppercase;
}

/* Nav links */
.navbar-links {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.nav-link {
  position: relative;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text-muted);
  background: linear-gradient(145deg, #ffffff, #e4e2f6);
  border: 1px solid rgba(222, 220, 245, 0.9);
  box-shadow:
    -4px -4px 8px rgba(255, 255, 255, 0.85),
    4px 4px 10px rgba(34, 22, 73, 0.12);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.9),
    3px 3px 9px rgba(34, 22, 73, 0.16);
  transform: translateY(-1px);
}

.nav-link.is-active {
  background: linear-gradient(145deg, #d9d3ff, #b39bf8);
  color: #20152f;
  box-shadow:
    inset 3px 3px 6px rgba(126, 108, 190, 0.35),
    inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  border: none;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, #ffffff, #e4e2f6);
  box-shadow:
    -4px -4px 8px rgba(255, 255, 255, 0.85),
    4px 4px 10px rgba(34, 22, 73, 0.12);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.18rem;
}

.nav-toggle-line {
  width: 16px;
  height: 2px;
  border-radius: 99px;
  background: var(--text-muted);
}

.nav-toggle.is-open .nav-toggle-line:nth-child(1) {
  transform: translateY(2px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-line:nth-child(2) {
  transform: translateY(-2px) rotate(-45deg);
}

/* Section / headers */
.component-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.component-header {
  max-width: 640px;
}

.component-title {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.component-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* On desktop, centre sections slightly inside the shell */
@media (min-width: 900px) {
  .component-section {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Generic demo container */
.component-demo {
  margin-top: 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow:
    -6px -6px 14px rgba(255, 255, 255, 0.9),
    6px 6px 18px rgba(34, 22, 73, 0.18);
  border: 1px solid var(--outline-soft);
  padding: 0.9rem 1rem;
}

/* Body card grid */
.body-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Card Component */
.card {
  --card-gradient: linear-gradient(
    135deg,
    var(--deep-lilac) 0%,
    var(--soft-periwinkle) 25%,
    var(--bright-lavender) 50%,
    var(--sandy-brown) 75%,
    var(--atomic-tangerine) 100%
  );

  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 220px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--card-gradient);
  overflow: visible;
  box-shadow: var(--shadow-soft);
  z-index: 1;

  display: flex;
  height: 100%;
}

.card::after {
  content: "";
  position: absolute;
  inset: 16px;
  z-index: -1;
  border-radius: inherit;
  filter: blur(28px);
  opacity: 0.8;
  background: var(--card-gradient);
  transition: opacity var(--transition-med), transform var(--transition-med);
}

.card-inner {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 100%;
  border-radius: calc(var(--radius-lg) - 0.3rem);
  padding: 1.2rem 1.35rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.9), transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(186, 128, 226, 0.18), transparent 60%),
    var(--bg-elevated);
  box-shadow: var(--shadow-inner), 0 0 0 1px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--text-main);
  flex: 1 1 auto;
}

.card:hover::after,
.card:focus-within::after {
  opacity: 0.35;
  transform: scale(1.02);
}

.card:hover .card-inner,
.card:focus-within .card-inner {
  box-shadow:
    var(--shadow-inner),
    0 0 0 1px rgba(166, 144, 249, 0.8),
    0 14px 30px rgba(34, 22, 73, 0.35);
  transform: translateY(-1px);
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

/* Hero wrapper */
.hero-layout {
  margin-top: 0.4rem;
  width: 100%;
  max-width: 100%;
}

.hero-card .card-inner {
  padding: 1.4rem 1.7rem 1.2rem;
}

/* Hero layout internals (feature + detail) */
.hero-title {
  font-size: 1.4rem;
  line-height: 1.25;
}

.hero-subtitle {
  font-size: 0.9rem;
  margin-top: 0.3rem;
  display: block;
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}

/* Middle: text + image row (used on index hero) */
.hero-main-row {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-main-left {
  flex: 2;
}

.hero-main-right {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* Hero footer row */
.hero-footer-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hero-footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hero-footer-right {
  display: flex;
  align-items: center;
}

.hero-fields {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Desktop hero layout + bigger title */
@media (min-width: 900px) {
  .hero-main-row {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    gap: 1.4rem;
    align-items: center;
    margin-top: 0.9rem;
  }

  .hero-title {
    font-size: 2.1rem;
    line-height: 1.15;
  }

  .hero-main-left {
    padding-right: 0.25rem;
  }
}

/* Hero image frame (used in index hero) */
.hero-image-frame {
  border-radius: 1.1rem;
  background: radial-gradient(circle at 0% 0%, #ffffff, #e4e2f6);
  padding: 0.75rem;
  box-shadow:
    -8px -8px 16px rgba(255, 255, 255, 0.98),
    8px 8px 20px rgba(23, 17, 52, 0.28);
  border: 1px solid var(--outline-soft);
}

.hero-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.9rem;
}

/* Desktop hero image sizing */
/* Error page hero image – show full illustration, don't crop */
.hero-image-frame--error img {
  width: 100%;
  height: auto;
}

@media (min-width: 900px) {
  .hero-image-frame--error {
    width: 260px;
    max-width: 260px;
  }

  .hero-image-frame--error img {
    aspect-ratio: auto;
    object-fit: contain;
  }
}

/* Card typography */
.card-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--soft-periwinkle);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0;
}

.card-subtitle {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2;
  max-height: 2.8em;
}

.card-body {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1 0 auto;
}

.card-meta {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
  align-items: center;
  flex-wrap: wrap;
}

.card-meta-pill {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(166, 144, 249, 0.4);
  background: rgba(230, 228, 244, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--soft-periwinkle);
}

/* Make body tiles consistent minimum height */
.body-card .card-inner {
  min-height: 260px;
}

/* Per-post body block */
.post-body-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-main);
  max-width: 100%;
}

/* Headings inside posts */
.post-body-block h2,
.post-body-block h3,
.post-body-block h4 {
  margin: 1.2rem 0 0.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.post-body-block h2 {
  font-size: 1.25rem;
}

.post-body-block h3 {
  font-size: 1.05rem;
  color: var(--text-main);
}

.post-body-block h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Paragraphs */
.post-body-block p {
  margin: 0;
}

/* Lists */
.post-body-block ul,
.post-body-block ol {
  margin: 0.3rem 0 0.3rem 1.2rem;
  padding-left: 0;
}

.post-body-block li {
  margin-bottom: 0.3rem;
}

.post-body-block ul li::marker {
  color: var(--soft-periwinkle);
}

.post-body-block ol {
  list-style-position: outside;
}

/* Inline code */
.post-body-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
    "Fira Code", monospace;
  font-size: 0.85rem;
  background: rgba(18, 16, 43, 0.9);
  color: #f7f4ff;
  padding: 0.06rem 0.35rem;
  border-radius: 0.35rem;
  box-shadow:
    0 0 0 1px rgba(159, 139, 250, 0.25),
    0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Make long inline code wrap nicely in paragraphs/lists */
.post-body-block p code,
.post-body-block li code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Code block wrapper with header + copy button */
.code-block {
  margin: 0.6rem 0;
  border-radius: 1rem;
  background: radial-gradient(circle at 0% 0%, #252342, #13122b);
  box-shadow:
    0 18px 30px rgba(5, 4, 22, 0.75),
    0 0 0 1px rgba(159, 139, 250, 0.35);
  overflow: hidden;
  max-width: 100%;
}

/* Header injected by JS */
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.8rem 0.35rem;
  border-bottom: 1px solid rgba(140, 122, 220, 0.65);
}

.code-lang-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #e3ddff;
  opacity: 0.9;
}

.code-copy-btn {
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  background: radial-gradient(circle at 0% 0%, #ffffff, #d2ccff);
  color: #261739;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow:
    -2px -2px 5px rgba(255, 255, 255, 0.7),
    3px 3px 7px rgba(17, 12, 40, 0.6);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.code-copy-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow:
    -1px -1px 3px rgba(255, 255, 255, 0.9),
    2px 2px 5px rgba(17, 12, 40, 0.7);
}

.code-copy-btn.copied {
  background: radial-gradient(
    circle at 0% 0%,
    var(--soft-periwinkle),
    var(--bright-lavender)
  );
  color: #20152f;
  box-shadow:
    inset 2px 2px 4px rgba(126, 108, 190, 0.35),
    inset -2px -2px 4px rgba(255, 255, 255, 0.9);
}

/* Code block content */
.code-block pre {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 0;
  background: transparent;
  color: #f7f4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
    "Fira Code", monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre;
}

/* override inline-code styles when inside pre */
.code-block pre code {
  background: none;
  padding: 0;
  box-shadow: none;
}

/* Images inside posts */
.post-image-frame {
  margin: 0.9rem 0;
  border-radius: 1.1rem;
  background: radial-gradient(circle at 0% 0%, #ffffff, #e4e2f6);
  padding: 0.75rem;
  box-shadow:
    -8px -8px 16px rgba(255, 255, 255, 0.98),
    8px 8px 20px rgba(23, 17, 52, 0.28);
  border: 1px solid var(--outline-soft);
}

.post-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.9rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .post-image-frame img {
    max-width: 720px;
  }
}

.post-image-caption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-align: center;
}

@media (min-width: 900px) {
  .post-image-caption {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Callout / container blocks */
.post-callout {
  margin: 0.5rem 0;
  padding: 0.8rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(166, 144, 249, 0.45);
  background: linear-gradient(
    135deg,
    rgba(166, 144, 249, 0.1),
    rgba(186, 128, 226, 0.06)
  );
  box-shadow:
    -4px -4px 8px rgba(255, 255, 255, 0.85),
    4px 4px 10px rgba(34, 22, 73, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-callout-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft-periwinkle);
}

.post-callout p {
  font-size: 0.9rem;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Download callout variant */
.post-callout-download {
  border-color: rgba(166, 144, 249, 0.7);
  background: linear-gradient(
    135deg,
    rgba(166, 144, 249, 0.12),
    rgba(186, 128, 226, 0.08)
  );
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-callout code,
.post-callout a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Tables */
.post-table-wrapper {
  margin: 0.6rem 0;
  padding: 0.3rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #ffffff, #ebe9ff);
  box-shadow:
    -4px -4px 8px rgba(255, 255, 255, 0.9),
    4px 4px 10px rgba(34, 22, 73, 0.16);
  border: 1px solid var(--outline-soft);
  overflow-x: auto;
}

.post-table-label {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin: 0 0 0.35rem 0.3rem;
}

.post-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

.post-table thead {
  background: rgba(166, 144, 249, 0.12);
}

.post-table th,
.post-table td {
  padding: 0.35rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid rgba(222, 220, 245, 0.8);
  white-space: nowrap;
}

.post-table th {
  font-weight: 600;
  color: var(--text-muted);
}

.post-table tbody tr:last-child td {
  border-bottom: none;
}

.post-table tbody tr:hover {
  background: rgba(244, 244, 251, 0.7);
}

/* Charts / time series block */
.chart-frame {
  margin: 0.8rem 0 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 1rem;
  background: radial-gradient(circle at 0 0, #ffffff, #e6e4ff);
  box-shadow:
    -6px -6px 14px rgba(255, 255, 255, 0.96),
    6px 6px 18px rgba(23, 17, 52, 0.26);
  border: 1px solid var(--outline-soft);
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chart-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(229, 226, 252, 0.9);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--soft-periwinkle);
}

/* Chart body */
.chart-body {
  width: 100%;
  overflow-x: auto;
}

.chart-body svg,
.chart-body img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Download pill for chart */
.chart-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;

  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);

  font-size: 0.78rem;
  font-weight: 500;

  background: radial-gradient(circle at 0 0, #ffffff 0, #f4f4fb 45%, #e5ddff 100%);
  border: 1px solid var(--outline-soft);
  box-shadow: var(--shadow-soft);

  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}

.chart-download-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(23, 17, 52, 0.16);
  background: radial-gradient(circle at 0 0, #ffffff 0, #f8f7ff 45%, #e9e1ff 100%);
}

.chart-download-link:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(23, 17, 52, 0.22);
}

/***********************
 * Card actions & buttons
 ***********************/
.card-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card-actions a {
  text-decoration: none;
}

.card-btn {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(
    135deg,
    var(--atomic-tangerine),
    var(--sunlit-clay)
  );
  color: #2a1720;
  box-shadow: 0 8px 18px rgba(236, 121, 63, 0.35);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
  white-space: nowrap;
}

.card-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.6),
    transparent 55%
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.card-btn:hover,
.card-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(236, 121, 63, 0.45);
  filter: brightness(1.03);
}

.card-btn:hover::after,
.card-btn:focus-visible::after {
  opacity: 1;
}

.card-btn-secondary {
  background: linear-gradient(
    135deg,
    var(--soft-periwinkle),
    var(--bright-lavender)
  );
  color: #20152f;
  box-shadow: 0 8px 18px rgba(166, 144, 249, 0.35);
}

/* Pagination – neumorphic */
.pagination-demo {
  margin-top: 1.5rem;
}

.pagination-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.page-btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: linear-gradient(145deg, #ffffff, #e6e4f7);
  color: var(--text-muted);
  border: 1px solid rgba(222, 220, 245, 0.9);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  white-space: nowrap;
}

.page-btn-raised {
  box-shadow:
    -4px -4px 8px rgba(255, 255, 255, 0.85),
    4px 4px 10px rgba(34, 22, 73, 0.12);
}

.page-btn-raised:hover {
  color: var(--text-main);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.9),
    3px 3px 9px rgba(34, 22, 73, 0.16);
  transform: translateY(-1px);
}

.page-btn-active {
  background: linear-gradient(145deg, #d9d3ff, #b39bf8);
  color: #20152f;
  box-shadow:
    inset 3px 3px 6px rgba(126, 108, 190, 0.35),
    inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}

.page-btn-disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

/* Inline download links */
.inline-download-link {
  font-weight: 600;
  color: var(--soft-periwinkle);
  text-decoration: none;
  border-bottom: 1px dashed rgba(166, 144, 249, 0.6);
}

.inline-download-link:hover {
  color: var(--deep-lilac);
  border-bottom-style: solid;
}

/* Desktop: on the first page "Latest posts" only show 3 cards. */
@media (min-width: 900px) {
  .latest-card--extra {
    display: none;
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .navbar-inner {
    align-items: center;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .navbar-links {
    display: none;
    width: 100%;
    margin-top: 0.6rem;
    flex-direction: column;
    gap: 0.45rem;
  }

  .navbar-links.is-open {
    display: flex;
  }

  .page-main {
    padding-inline: 1rem;
  }

  .page-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .hero-layout {
    max-width: 100%;
  }

  .code-block pre {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .post-table {
    min-width: 100%;
  }

  .post-table th,
  .post-table td {
    white-space: normal;
  }

  .chart-frame {
    max-width: 100%;
  }
}

/* ============================
   Subscribe layout
   ============================ */

.subscribe-section {
  margin-top: 0.5rem;
}

.subscribe-card {
  max-width: 480px;
  margin: 1rem auto 0;
  padding: 1.1rem 1.2rem 1.25rem;
}

/* Form structure */
.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.subscribe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

/* Compact text input – force height */
.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;

  display: block;
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;

  height: 44px !important;
  max-height: 44px !important;
  line-height: 1.2;

  border-radius: 0.9rem;
  border: 1px solid var(--outline-soft);
  padding: 0 0.9rem !important;

  font-size: 0.9rem;

  background: linear-gradient(145deg, #ffffff, #ecebff);
  box-shadow:
    -2px -2px 5px rgba(255, 255, 255, 0.9),
    2px 2px 6px rgba(34, 22, 73, 0.12);
  outline: none;
  color: var(--text-main);
}

.form-input:focus {
  border-color: rgba(166, 144, 249, 0.9);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.95),
    3px 3px 9px rgba(34, 22, 73, 0.2);
}

.form-helper {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mobile: stack input and button full-width */
@media (max-width: 600px) {
  .subscribe-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subscribe-row .card-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================
   Professional Footer
   ============================ */

.page-footer {
  border-top: 1px solid var(--outline-soft);
  background: rgba(244, 244, 251, 0.98);
  backdrop-filter: blur(12px);
  padding: 1.4rem 1.25rem 1.6rem;
}

.page-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.4rem;
}

/* Left: brand + tagline inline */
.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;

  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-main);
  white-space: nowrap;
}

.footer-logo {
  width: 16px;
  height: 16px;
  flex: 0;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* Middle (footer nav) */
.footer-middle {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.9rem;
}

.footer-link {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.footer-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

/* Right (meta) */
.footer-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.footer-path {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .page-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .footer-left {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .footer-brand {
    font-size: 0.95rem;
  }

  .footer-tagline {
    font-size: 0.8rem;
  }

  .footer-middle {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.6rem;
  }

  .footer-link {
    font-size: 0.8rem;
    padding: 0.2rem 0.35rem;
  }

  .footer-right {
    text-align: left;
  }
}

/* PLEX: allow long reference URLs to wrap inside article cards */
.post-body-block a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ============================
   Step lists & checklists
   ============================ */

/* Numbered “step” lists – e.g. lifecycle of a bank loan */
.post-steps {
  margin: 0.5rem 0;
  padding-left: 0;
  list-style: none;
  counter-reset: post-step-counter;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-steps li {
  position: relative;
  counter-increment: post-step-counter;
  padding: 0.55rem 0.8rem 0.55rem 2.4rem;
  border-radius: 0.9rem;
  background: linear-gradient(
    135deg,
    rgba(244, 244, 251, 0.98),
    rgba(230, 228, 244, 0.9)
  );
  border: 1px solid rgba(222, 220, 245, 0.9);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.9),
    3px 3px 10px rgba(34, 22, 73, 0.16);
}

.post-steps li::before {
  content: counter(post-step-counter);
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--soft-periwinkle),
    var(--bright-lavender)
  );
  box-shadow:
    0 4px 10px rgba(23, 17, 52, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.7);
}

.post-step-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.post-step-body {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Compact spacing on mobile */
@media (max-width: 600px) {
  .post-steps li {
    padding: 0.5rem 0.7rem 0.5rem 2.2rem;
  }

  .post-steps li::before {
    left: 0.6rem;
  }
}

/* Checklist bullets with tick icon – for human-readable copyable checklists */
.post-checklist {
  margin: 0.4rem 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-checklist li {
  position: relative;
  padding-left: 1.7rem;
  font-size: 0.9rem;
}

.post-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--soft-periwinkle),
    var(--deep-lilac)
  );
  box-shadow:
    0 3px 6px rgba(23, 17, 52, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.85);
}

/* When checklists live inside callouts, keep layout tight */
.post-callout .post-checklist {
  margin-top: 0.3rem;
  gap: 0.25rem;
}

/* ============================
   Subscribe success state
   ============================ */

.subscribe-section--success {
  min-height: calc(100vh - 140px); /* allow for navbar + footer */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* subtle grey-out / focus effect */
  background: radial-gradient(
    circle at top,
    rgba(30, 26, 48, 0.06),
    rgba(244, 244, 251, 0.98)
  );
}

.subscribe-section--success .component-header {
  display: none;
}

.subscribe-section--success .subscribe-card {
  margin: 0;
  max-width: 420px;
  width: 100%;
}

.subscribe-card--success .post-callout {
  text-align: left;
}

/* Slight tightening on very small screens */
@media (max-width: 600px) {
  .subscribe-section--success {
    padding-inline: 1rem;
  }
}

/* ============================
   Subscribe success state
   ============================ */

.subscribe-section--success {
  min-height: calc(100vh - 140px); /* allow for navbar + footer */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* subtle grey-out / focus effect */
  background: radial-gradient(
    circle at top,
    rgba(30, 26, 48, 0.06),
    rgba(244, 244, 251, 0.98)
  );
}

.subscribe-section--success .component-header {
  display: none;
}

.subscribe-section--success .subscribe-card {
  margin: 0;
  max-width: 420px;
  width: 100%;
}

.subscribe-card--success .post-callout {
  text-align: left;
}

/* Slight tightening on very small screens */
@media (max-width: 600px) {
  .subscribe-section--success {
    padding-inline: 1rem;
  }
}
