:root {
  --fg: #111;
  --bg: #fff;
  --muted: #666;
  --border: #e6e6e6;
  --brand: #6d28d9;        /* violet — matches the logo */
  --brand-soft: #a78bfa;   /* lighter violet for hovers / glows */
  --accent: #fbbf24;       /* warm amber — matches the feather */
  --accent-2: #ec4899;     /* pink — gradient endpoint */
  --card: #fafafa;
  --card-hover-shadow: 0 8px 24px -8px rgba(109, 40, 217, 0.25);
  --max: 960px;
  --header-pad-y: 1.25rem;
  /* bigger header vertical padding */
  --header-gap: 2rem;
  /* spacing between logo and menu */
  --logo-h: 56px;
  /* bigger logo */
  --menu-size: 1.2rem;
  /* bigger menu text */
  --menu-weight: 600;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

html[data-theme="dark"] {
  --fg: #e9e9e9;
  --bg: #0f1115;
  --muted: #9aa0a6;
  --border: #2a2d33;
  --brand: #a78bfa;        /* lifted violet for dark bg contrast */
  --brand-soft: #c4b5fd;
  --accent: #fcd34d;       /* slightly brighter amber on dark */
  --accent-2: #f472b6;
  --card: #161922;
  --card-hover-shadow: 0 8px 24px -8px rgba(167, 139, 250, 0.35);
}

::selection {
  background: var(--accent);
  color: #111;
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65
}

/* Default subtle divider — now uses brand→accent gradient for life */
hr{
  border:0;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--brand-soft), var(--accent), transparent);
  margin:2rem 0;
  opacity:.7;
}

/* Strong accent divider */
.hr-accent{
  border:0;
  height:2px;
  background:linear-gradient(90deg, transparent, var(--brand), var(--accent-2), var(--accent), transparent);
  margin:2rem 0;
}

/* Decorative divider with centered symbol (uses the page bg) */
.hr-deco{
  position:relative;
  border:0;
  height:1px;
  background:var(--border);
  margin:2.25rem 0;
}
.hr-deco::after{
  content:attr(data-icon);                 /* set via data-icon */
  position:absolute;
  left:50%;
  top:-0.8em;
  transform:translateX(-50%);
  padding:0 .5em;
  background:var(--bg);                    /* matches theme bg */
  color:var(--accent);
  font-size:1.1em;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem
}

/* Header — BIG */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--header-pad-y) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--header-gap)
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
  color: inherit
}

.logo {
  height: var(--logo-h)
}

.menu {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0
}

.menu a {
  text-decoration: none;
  color: inherit;
  font-size: var(--menu-size);
  font-weight: var(--menu-weight);
  line-height: 1
}

.btn-ghost {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  padding: .7rem 1rem;
  border-radius: .6rem;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.btn-ghost:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.btn-ghost:active {
  transform: scale(.97);
}

.menu a {
  position: relative;
  transition: color .15s ease;
}

.menu a:hover {
  color: var(--brand);
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.35rem;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent-2));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}

.menu a:hover::after {
  transform: scaleX(1);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem
}

/* Sections */
.hero {
  padding: 0.5rem 0 0.1rem
}

.hero h1 {
  margin: 0 0 .75rem;
  background: linear-gradient(90deg, var(--brand), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.hero .lede {
  font-size: 1.2rem;
  line-height: 1.55;
  margin: 0.5rem 0 1rem;
}

.hero .audience {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Muted text – upgraded */
.muted {
  color: var(--muted);
  font-size: 0.95em;
  line-height: 1.6;
}

.hero .muted {
  background: color-mix(in srgb, var(--muted) 8%, var(--bg));
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
}

/* Cards / grids */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent-2), var(--accent));
  opacity: 0;
  transition: opacity .18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
}

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

.card a {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 1rem
}

.card h3 {
  margin: .1rem 0 .25rem;
  transition: color .18s ease;
}

.card:hover h3 {
  color: var(--brand);
}

.card p {
  margin: .25rem 0
}

/* Optional cover image in cards */
.card-cover {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  margin: -1rem -1rem 1rem
}

/* Tags */
.tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: 0 1rem 1rem
}

.tag {
  font-size: .8rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  padding: .1rem .55rem;
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 55%, var(--fg));
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.card:hover .tag {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
  color: color-mix(in srgb, var(--accent) 70%, var(--fg));
}

/* Post content */
.post h1 {
  margin-top: 0
}

/* Default size for inline images */
.content img {
  max-width: 440px;
  height: auto;
  display: block;
  margin: 1rem auto;
  /* centered when no float class */
  border-radius: .5rem;
}

/* When the class lands on the <img> OR on the wrapping <p> */
.content img.float-left,
.content p.float-left {
  float: left;
  margin: 0 1rem 1rem 0;
}

.content img.float-right,
.content p.float-right {
  float: right;
  margin: 0 0 1rem 1rem;
}

/* Remove inner margins when class is on the <p> */
.content p.float-left img,
.content p.float-right img {
  margin: 0;
}

.content figure.float-left {
  float: left;
  margin: 0 1rem 1rem 0;
}

.content figure.float-right {
  float: right;
  margin: 0 0 1rem 1rem;
}

.content figure img {
  max-width: 440px;
  height: auto;
  display: block;
  border-radius: .5rem;
}

.content::after {
  content: "";
  display: block;
  clear: both;
}

.content pre {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .75rem
}

/* Special quoted block */
.content .quoting {
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--muted);
  border-radius: 0 .5rem .5rem 0;
}

.content .quoting p {
  margin: 0;
}

/* Links */
a {
  color: var(--brand);
  text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent);
  text-underline-offset: 2px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

/* Feature list styling */
.features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem; /* vertical spacing between items */
}

.features li {
  position: relative;
  padding-left: 1.75rem;
  line-height: 1.6;
}

.features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.15rem;
  color: var(--accent);
  font-weight: bold;
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox.active {
  display: flex;
  cursor: zoom-out;
}

/* Clickable image hint (supports class on wrapper or data-attr on img) */
.content img[data-lightbox],
.content p.data-lightbox > img,
.content figure.data-lightbox > img {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content img[data-lightbox]:hover,
.content p.data-lightbox > img:hover,
.content figure.data-lightbox > img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-download {
  display: inline-block;
  background: linear-gradient(135deg, var(--brand), var(--accent-2));
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: .6rem;
  text-decoration: none;
  font-weight: 700;
  margin-right: 0.8rem;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--brand) 60%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-download:hover {
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.05);
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--brand) 65%, transparent);
  color: #fff;
}
.btn-download:active {
  transform: translateY(0);
}

.download-note {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  vertical-align: middle;
}

/* Goldmark attribute {.cta} on a paragraph turns its link into a button */
.content p.cta {
  margin: 1.5rem 0;
}
.content p.cta a {
  display: inline-block;
  background: linear-gradient(135deg, var(--brand), var(--accent-2));
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: .6rem;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--brand) 60%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.content p.cta a:hover {
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.05);
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--brand) 65%, transparent);
  color: #fff;
}

/* Content h2 — subtle accent rule for vibrancy */
.content h2 {
  padding-bottom: .35rem;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  margin-top: 2.25rem;
}

.content h3 {
  color: color-mix(in srgb, var(--brand) 70%, var(--fg));
}

/* Inline code pops a little */
.content :not(pre) > code {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  padding: .05rem .35rem;
  border-radius: .3rem;
  font-size: .92em;
}

/* Table styling — used heavily on /download/ */
.content table {
  border-collapse: collapse;
  margin: 1.25rem 0;
  width: 100%;
}
.content table th {
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  text-align: left;
  padding: .55rem .75rem;
}
.content table td {
  border-bottom: 1px solid var(--border);
  padding: .55rem .75rem;
  vertical-align: top;
}
.content table tr:last-child td {
  border-bottom: 0;
}

/* Responsive tweak: shrink header a bit on small screens */
@media (max-width:640px) {
  :root {
    --logo-h: 44px;
    --menu-size: 1.05rem;
    --header-pad-y: .9rem;
    --header-gap: 1rem;
  }

  .menu {
    gap: .75rem
  }
}