/*
Theme Name: AuthorityMax
Theme URI: https://authoritymax.ai
Author: BigDeal Ventures
Description: Local-first reverse-proxied WordPress blog theme for AuthorityMax.
Version: 0.1.7
Requires at least: 6.5
Tested up to: 6.6
Requires PHP: 8.1
*/

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.87 0 0);
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --font-sans: "DM Sans", "DM Sans Fallback", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Host Grotesk", "Host Grotesk Fallback", var(--font-sans);
}

html[data-theme="dark"],
html.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-kerning: normal;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: normal;
  font-variation-settings: normal;
  letter-spacing: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

img {
  max-width: 100%;
  height: auto;
}

.am-shell {
  width: 90vw;
  margin: 0 auto;
}

.am-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.am-header.am-is-scrolled {
  border-bottom-color: color-mix(in srgb, var(--border) 40%, transparent);
}

.am-header__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.am-logo img {
  display: block;
  height: 28px;
  width: auto;
}

.am-logo .am-logo--light {
  display: none;
}

html[data-theme="dark"] .am-logo .am-logo--dark,
html.dark .am-logo .am-logo--dark {
  display: none;
}

html[data-theme="dark"] .am-logo .am-logo--light,
html.dark .am-logo .am-logo--light {
  display: block;
}

html[data-theme="light"] .am-logo .am-logo--dark,
html.light .am-logo .am-logo--dark {
  display: block;
}

html[data-theme="light"] .am-logo .am-logo--light,
html.light .am-logo .am-logo--light {
  display: none;
}

.am-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.am-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.am-nav a:hover,
.am-nav button:hover {
  color: var(--foreground);
}

.am-nav button,
.am-icon-button,
.am-mobile-toggle,
.am-theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.am-mega {
  position: relative;
}

.am-mega__trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 160ms ease;
}

.am-mega__trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms ease;
}

.am-mega:hover .am-mega__trigger svg,
.am-mega:focus-within .am-mega__trigger svg {
  transform: rotate(180deg);
}

.am-mega__panel {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(90vw, 1180px);
  transform: translateX(-50%);
  padding-top: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.am-mega:hover .am-mega__panel,
.am-mega:focus-within .am-mega__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.am-mega__surface {
  display: grid;
  grid-template-columns: 2fr 1px 1fr 1px 240px;
  gap: 30px;
  align-items: start;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--radius-2xl);
  background: var(--background);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
}

.am-mega__divider {
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}

.am-eyebrow {
  margin: 0 0 18px;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.am-mega__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.am-mega__category {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  color: color-mix(in srgb, var(--foreground) 62%, transparent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.am-link-list {
  display: grid;
  gap: 5px;
}

.am-link-list a {
  padding: 7px 8px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: 14px;
}

.am-link-list a:hover {
  color: var(--foreground);
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

.am-mega__compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.am-mega__feature {
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.am-mega__feature h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.am-mega__feature p {
  margin: 0 0 16px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.6;
}

.am-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.am-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--foreground);
  border-radius: var(--radius-md);
  background: var(--foreground);
  color: var(--background);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.am-button--outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.am-search-trigger,
.am-mobile-toggle {
  min-width: 40px;
  width: auto;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--muted-foreground);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.am-search-trigger:hover {
  color: var(--foreground);
  border-color: color-mix(in srgb, var(--border) 60%, transparent);
}

.am-search-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.am-search-trigger kbd {
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.2;
}

.am-theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.am-theme-toggle:hover {
  border-color: color-mix(in srgb, var(--foreground) 18%, var(--border));
  background: var(--accent);
}

.am-theme-toggle svg {
  position: absolute;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease, opacity 180ms ease;
}

.am-theme-toggle__sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.am-theme-toggle__moon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

html[data-theme="dark"] .am-theme-toggle__sun,
html.dark .am-theme-toggle__sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

html[data-theme="dark"] .am-theme-toggle__moon,
html.dark .am-theme-toggle__moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.am-mobile-toggle {
  display: none;
}

.am-mobile-toggle svg,
.am-mobile-panel__close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.am-mobile-panel {
  display: none;
}

.am-main {
  min-height: 60vh;
}

.am-blog {
  padding: 48px 0;
}

.am-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 64px;
  padding: 48px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  transition: border-color 180ms ease, background 180ms ease;
}

.am-featured:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--muted) 50%, transparent);
}

.am-featured__image,
.am-post-card__image,
.am-single__image {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--muted);
}

.am-featured__image {
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}

.am-featured__image img,
.am-post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.am-featured:hover img,
.am-post-card:hover img {
  transform: scale(1.04);
}

.am-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.am-featured h1,
.am-post-title,
.am-single h1,
.am-author h1 {
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: 0;
  line-height: 1.08;
}

.am-featured h1 {
  margin-top: 18px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
}

.am-excerpt {
  color: var(--muted-foreground);
  line-height: 1.7;
}

.am-featured .am-excerpt {
  font-size: 18px;
}

.am-author-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
}

.am-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.am-avatar--large {
  width: 192px;
  height: 192px;
  border: 4px solid var(--background);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}

.am-filters {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 44px;
}

.am-category-list {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.am-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 16px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  transition: background 160ms ease, color 160ms ease;
}

.am-pill--active,
.am-category-list .am-pill:first-child {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.am-pill--ghost:hover {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  color: var(--accent-foreground);
}

.am-search {
  position: relative;
  min-width: 260px;
}

.am-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted-foreground);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.am-search input {
  width: 100%;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  color: var(--foreground);
  padding: 0 14px 0 36px;
  font: inherit;
  font-size: 14px;
}

.am-post-list {
  display: grid;
  gap: 0;
}

.am-post-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 16px;
  margin: 0 -16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  border-radius: var(--radius-lg);
  transition: background 160ms ease;
}

.am-post-row:hover {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}

.am-post-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.am-post-row:hover h2,
.am-featured:hover h1 {
  color: color-mix(in srgb, var(--foreground) 78%, #6b7280);
}

.am-post-row__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted-foreground);
  font-size: 14px;
  white-space: nowrap;
}

.am-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
  transition: color 160ms ease;
}

.am-back:hover {
  color: var(--primary);
}

.am-back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.am-single {
  padding: 48px 0;
}

.am-single__header {
  margin-bottom: 48px;
}

.am-single__meta {
  gap: 24px;
}

.am-single__meta .am-author-inline {
  gap: 8px;
  margin-top: 0;
  color: var(--foreground);
  font-weight: 500;
}

.am-single__meta .am-author-inline:hover {
  color: var(--primary);
}

.am-single__meta .am-avatar {
  width: 24px;
  height: 24px;
}

.am-meta__date {
  display: flex;
  align-items: center;
  gap: 8px;
}

.am-single h1 {
  margin: 0 0 24px;
  max-width: none;
  font-size: 48px;
  line-height: 1.25;
  letter-spacing: 0;
}

.am-single__image {
  margin-bottom: 64px;
  border-radius: var(--radius-2xl);
}

.am-single__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 48px;
}

.am-single__grid > div:first-child {
  grid-column: span 8 / span 8;
}

.am-single__grid > .am-sidebar {
  grid-column: span 4 / span 4;
}

.am-prose {
  font-size: 18px;
  line-height: 1.625;
  letter-spacing: 0;
}

.am-prose h1,
.am-prose h2,
.am-prose h3,
.am-prose h4 {
  margin: 24px 0 16px;
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
}

.am-prose h1 {
  font-size: 36px;
}

.am-prose h2 {
  font-size: 30px;
}

.am-prose h3 {
  font-size: 24px;
}

.am-prose p,
.am-prose ul,
.am-prose ol,
.am-prose blockquote,
.am-prose table {
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.625;
}

.am-prose ul,
.am-prose ol {
  margin-left: 16px;
  padding-left: 0;
  list-style-position: inside;
}

.am-prose ul {
  list-style-type: disc;
}

.am-prose ol {
  list-style-type: decimal;
}

.am-prose li > p {
  display: inline;
}

.am-prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.am-prose a:hover {
  opacity: .8;
}

.am-prose blockquote {
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: color-mix(in srgb, var(--muted) 32%, transparent);
  padding: 8px 16px;
  font-style: italic;
}

.am-prose img {
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border-radius: var(--radius-lg);
}

.am-prose table {
  width: 100%;
  border-collapse: collapse;
}

.am-prose th,
.am-prose td {
  border: 1px solid var(--border);
  padding: 12px;
}

.am-summary-cta {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--secondary) 30%, transparent);
}

.am-summary-cta h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 18px;
}

.am-summary-cta p {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.6;
}

.am-summary-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.am-summary-cta__actions > span,
.am-floating-summary__inner > span {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
}

.am-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.am-ai-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--foreground) 12%, transparent);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.am-ai-button:hover {
  border-color: color-mix(in srgb, var(--foreground) 22%, transparent);
  background: color-mix(in srgb, var(--secondary) 54%, transparent);
}

.am-ai-button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

html[data-theme="dark"] .am-ai-button img,
html.dark .am-ai-button img {
  filter: invert(1);
}

.am-ai-button span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.am-ai-button small {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

.am-floating-summary {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 45;
  transform: translate(-50%, 90px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

.am-floating-summary.am-is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.am-floating-summary__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

.am-floating-summary__close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.am-floating-summary__close:hover {
  color: var(--foreground);
  background: var(--accent);
}

.am-floating-summary__close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.am-mobile-bottom-bar,
.am-sheet-backdrop,
.am-bottom-sheet {
  display: none;
}

.am-sidebar {
  position: relative;
}

.am-sticky {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 32px;
}

.am-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.am-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.am-card p {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.55;
}

.am-form {
  display: grid;
  gap: 8px;
}

.am-form input {
  height: 36px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.am-toc {
  display: grid;
  gap: 8px;
}

.am-toc a {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.45;
  padding: 4px 0;
  transition: color 160ms ease;
}

.am-toc a:hover {
  color: var(--foreground);
}

.am-toc .am-toc__h3 {
  padding-left: 14px;
  font-size: 13px;
}

.am-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.am-share a,
.am-share button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.am-share a:hover,
.am-share button:hover,
.am-share button.am-is-copied {
  border-color: color-mix(in srgb, var(--foreground) 18%, var(--border));
  background: var(--accent);
  transform: translateY(-1px);
}

.am-share svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.am-post-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.am-post-footer h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.am-archive-header {
  margin-bottom: 42px;
}

.am-archive-header h1 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1.08;
}

.am-pagination {
  margin-top: 36px;
}

.am-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.am-pagination a,
.am-pagination span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 700;
}

.am-pagination .current,
.am-pagination a:hover {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

.am-author {
  padding: 48px 0;
  max-width: 1024px;
}

.am-author__hero {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 64px;
}

.am-author__content {
  display: grid;
  gap: 16px;
}

.am-author h1 {
  font-size: 36px;
  line-height: 1.12;
}

.am-author__role {
  color: var(--foreground);
  font-size: 20px;
  font-weight: 500;
}

.am-author__bio {
  max-width: 672px;
  font-size: 18px;
  line-height: 1.625;
}

.am-author .am-post-title {
  margin-bottom: 48px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
}

.am-cta {
  margin: 48px 0;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: #111 url("/images/cta-bg.jpg") center / cover no-repeat;
  color: #fff;
  text-align: center;
  position: relative;
}

.am-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}

.am-cta__inner {
  position: relative;
  z-index: 1;
  padding: 64px 32px;
}

.am-cta h2 {
  max-width: 700px;
  margin: 0 auto 16px;
  font-family: var(--font-heading);
  font-size: clamp(30px, 4vw, 36px);
  line-height: 1.15;
  letter-spacing: 0;
}

.am-cta p {
  max-width: 620px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, .82);
  font-size: 18px;
  line-height: 1.55;
}

.am-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.am-cta__actions .am-button {
  min-height: 40px;
  padding-inline: 24px;
  background: #fff;
  color: #000;
  border-color: #fff;
}

.am-cta__demo {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 160ms ease;
}

.am-cta__demo:hover {
  border-color: #fff;
}

.am-cta .am-cta__fineprint {
  margin-top: 24px;
  color: rgba(255, 255, 255, .5);
  font-size: 14px;
}

.am-footer {
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  background: var(--background);
}

.am-footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr 1.3fr;
  gap: 48px;
  padding: 48px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}

.am-footer h3 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.am-footer p,
.am-footer a {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.6;
}

.am-footer__links {
  display: grid;
  gap: 12px;
}

.am-footer__links--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.am-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 32px 0;
}

@media (max-width: 900px) {
  .am-nav,
  .am-actions .am-button {
    display: none;
  }

  .am-actions {
    gap: 8px;
  }

  .am-search-trigger {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-color: transparent;
    border-radius: var(--radius-md);
  }

  .am-search-trigger span,
  .am-search-trigger kbd {
    display: none;
  }

  .am-mobile-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--foreground);
  }

  .am-mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    overflow-y: auto;
    background: var(--background);
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  body.am-mobile-open .am-mobile-panel {
    transform: translateX(0);
  }

  body.am-mobile-open {
    overflow: hidden;
  }

  .am-mobile-panel__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
  }

  .am-mobile-panel__content {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 72px 0;
  }

  .am-mobile-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
    color: var(--muted-foreground);
  }

  .am-mobile-nav > a,
  .am-mobile-solutions__trigger {
    color: var(--muted-foreground);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
    transition: color 160ms ease;
  }

  .am-mobile-nav > a:hover,
  .am-mobile-solutions__trigger:hover {
    color: var(--primary);
  }

  .am-mobile-solutions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .am-mobile-solutions__trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
  }

  .am-mobile-solutions__icon {
    width: 20px;
    height: 20px;
    transition: transform 180ms ease;
  }

  .am-mobile-solutions.am-is-open .am-mobile-solutions__icon {
    transform: rotate(180deg);
  }

  .am-mobile-solutions__panel {
    display: none;
    width: 100%;
    max-width: 448px;
    margin-top: 16px;
    padding: 0 32px;
  }

  .am-mobile-solutions.am-is-open .am-mobile-solutions__panel {
    display: block;
  }

  .am-mobile-solutions__group {
    margin-bottom: 24px;
  }

  .am-mobile-solutions__group h4 {
    margin: 0 0 12px;
    color: var(--foreground);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .am-mobile-solutions__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
  }

  .am-mobile-solutions__grid a {
    color: var(--muted-foreground);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
  }

  .am-mobile-solutions__grid a:hover {
    color: var(--primary);
  }

  .am-mobile-solutions__divider {
    height: 1px;
    margin-bottom: 24px;
    background: color-mix(in srgb, var(--border) 40%, transparent);
  }

  .am-mobile-panel__cta {
    width: 100%;
    max-width: 320px;
    padding: 0 32px;
  }

  .am-mobile-panel__cta .am-button {
    width: 100%;
    min-height: 48px;
    font-size: 18px;
    font-weight: 500;
  }

  .am-featured,
  .am-single__grid,
  .am-footer__grid {
    grid-template-columns: 1fr;
  }

  .am-single__grid > div:first-child,
  .am-single__grid > .am-sidebar {
    grid-column: auto;
  }

  .am-featured {
    padding: 28px;
  }

  .am-filters,
  .am-post-row,
  .am-post-footer,
  .am-author__hero,
  .am-footer__bottom {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .am-filters > *,
  .am-post-row > *,
  .am-post-footer > *,
  .am-author__hero > *,
  .am-footer__bottom > * {
    max-width: 100%;
    min-width: 0;
  }

  .am-search {
    width: 100%;
  }

  .am-post-row__meta {
    white-space: normal;
  }

  .am-sidebar {
    display: none;
  }

  .am-single {
    padding: 32px 0 96px;
  }

  .am-single h1 {
    font-size: 30px;
    line-height: 1.25;
  }

  .am-single__header {
    margin-bottom: 34px;
  }

  .am-single__image {
    margin-bottom: 40px;
    border-radius: var(--radius-2xl);
  }

  .am-prose {
    font-size: 18px;
  }

  .am-prose h2 {
    font-size: 30px;
  }

  .am-prose h3 {
    font-size: 24px;
  }

  .am-summary-cta__actions,
  .am-summary-cta__actions .am-ai-actions,
  .am-summary-cta__actions .am-ai-button {
    width: 100%;
  }

  .am-floating-summary {
    display: none;
  }

  .am-mobile-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    background: var(--background);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .08);
    transform: translateY(100%);
    transition: transform 220ms ease;
  }

  .am-mobile-bottom-bar.am-is-visible {
    transform: translateY(0);
  }

  .am-mobile-bottom-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    color: var(--foreground);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
  }

  .am-mobile-bottom-bar svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .am-mobile-bottom-bar button:last-child {
    border-right: 0;
  }

  .am-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 58;
    display: block;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.am-sheet-open .am-sheet-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .am-bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: block;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid var(--border);
    border-bottom: 0;
    background: var(--background);
    box-shadow: 0 -20px 70px rgba(0, 0, 0, .22);
    transform: translateY(105%);
    transition: transform 220ms ease;
  }

  .am-bottom-sheet.am-is-open {
    transform: translateY(0);
  }

  .am-bottom-sheet__header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
  }

  .am-bottom-sheet__header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 18px;
  }

  .am-bottom-sheet__header button {
    border: 0;
    background: transparent;
    color: var(--muted-foreground);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
  }

  .am-bottom-sheet__body {
    padding: 18px 20px 34px;
  }

  .am-bottom-sheet .am-toc a {
    padding: 12px 8px;
    border-radius: 8px;
    color: var(--foreground);
    font-weight: 700;
  }

  .am-bottom-sheet .am-toc a:hover {
    background: var(--secondary);
  }

  .am-ai-sheet-actions {
    display: grid;
    gap: 12px;
  }

  .am-ai-sheet-actions .am-ai-button {
    width: 100%;
    min-height: 56px;
    justify-content: flex-start;
  }

  .am-cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .am-cta__actions .am-button,
  .am-cta__demo {
    width: 100%;
  }

  .am-author__hero {
    gap: 28px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .am-single h1 {
    font-size: 36px;
    line-height: 1.18;
  }
}
