/* ==========================================================================
   Phototranslatorai — base
   Design tokens, reset, layout primitives and every component shared by more
   than one template. Loaded on every request.
   ========================================================================== */

/* --------------------------------------------------------------- Tokens -- */
:root {
  --bg: #F7F6FD;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1EFFC;
  --text: #14112B;
  --muted: #5E5A7A;
  --line: #E6E3F5;

  --p1: #6D5BFF;
  --p2: #9B4DFF;
  --p3: #FF6B8B;
  --ok: #12B886;
  --warn: #F59F00;

  --grad: linear-gradient(135deg, var(--p1) 0%, var(--p2) 55%, var(--p3) 100%);
  --shadow: 0 20px 60px -20px rgba(64, 40, 180, .25), 0 4px 16px -6px rgba(64, 40, 180, .12);
  --radius: 22px;
  --radius-sm: 14px;

  --head: 72px; /* Sticky header height — scroll offsets depend on it. */

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0D0B1A;
  --bg-2: #120F24;
  --surface: #17142C;
  --surface-2: #1F1B3A;
  --text: #F2F0FF;
  --muted: #A39FC4;
  --line: #2A2550;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6), 0 4px 16px -6px rgba(0, 0, 0, .4);

  color-scheme: dark;
}

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

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

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

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

button,
input,
select,
textarea { font: inherit; color: inherit; }

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

ul, ol { list-style: none; }

/* The theme toggles panels with the `hidden` attribute; `!important` keeps it
   winning over the component's own display rule. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--p1);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------------------- Utilities - */
.container {
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
}

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

/* Keep gradient text readable if the clip is unsupported. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text { color: var(--p2); background: none; }
}

.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 16px; top: 16px;
  z-index: 999;
  background: var(--p1);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}

/* ---------------------------------------------------------- Typography --- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.5px;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -1.8px;
}

h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); letter-spacing: -1.1px; }
h3 { font-size: 1.15rem; letter-spacing: -.3px; }
h4 { font-size: 1rem; }

.lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 58ch;
}

/* -------------------------------------------------------------- Buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(109, 91, 255, .6);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(109, 91, 255, .75);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--p1); transform: translateY(-2px); }

.btn:disabled,
.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.icon-btn {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--p1); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }

.link-btn {
  color: var(--p3);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* --------------------------------------------------------------- Header -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

/* Older browsers get a solid bar rather than a transparent one. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header { background: var(--bg); }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--head);
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.brand svg { width: 38px; height: 38px; flex-shrink: 0; }
.brand img { width: auto; max-height: 42px; }
.brand-text { white-space: nowrap; }

.custom-logo-link { display: block; }

.primary-nav { margin-inline: auto; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links > li { position: relative; }

.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .94rem;
  color: var(--muted);
  transition: color .2s, background .2s;
}

.nav-links a:hover,
.nav-links > li.current-menu-item > a,
.nav-links > li.current_page_item > a,
.nav-links > li.current-menu-ancestor > a,
.nav-links > li.current-page-ancestor > a {
  color: var(--text);
  background: var(--surface-2);
}

/* Desktop dropdowns */
.nav-links .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav-links > li:hover > .sub-menu,
.nav-links > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-ic { display: grid; place-items: center; }
.theme-ic svg { width: 19px; height: 19px; }

.menu-btn { display: none; }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--head) 0 auto 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 20px;
  transform: translateY(-120%);
  transition: transform .35s ease;
  z-index: 49;
  max-height: calc(100vh - var(--head));
  overflow-y: auto;
}
.mobile-menu.open { transform: none; }
.mobile-menu a {
  display: block;
  padding: 14px 12px;
  border-radius: 12px;
  font-weight: 600;
}
.mobile-menu a:hover { background: var(--surface-2); }
.mobile-menu .sub-menu { padding-left: 14px; }
.mobile-menu .btn { width: 100%; margin-top: 10px; }

/* --------------------------------------------------------------- Footer -- */
.site-footer {
  padding: 60px 0 28px;
  border-top: 1px solid var(--line);
  margin-top: 84px;
  background: var(--bg-2);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}

.foot-tagline { color: var(--muted); font-size: .94rem; margin: 14px 0; }

.foot-col h4 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.foot-links { display: grid; gap: 10px; }
.foot-links a { color: var(--muted); font-size: .94rem; transition: color .2s; }
.foot-links a:hover { color: var(--p1); }

.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.socials a:hover { background: var(--grad); color: #fff; border-color: transparent; }
.socials svg { width: 17px; height: 17px; }

.foot-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}

/* ------------------------------------------------------------- Sections -- */
.section { padding: 84px 0; }
.section-tight { padding-top: 0; }

.sec-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.sec-head-left { text-align: left; margin: 0 0 24px; }
.sec-head p { color: var(--muted); font-size: 1.05rem; margin-top: 12px; }

.sec-tag {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--p1);
  background: color-mix(in srgb, var(--p1) 10%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.section-more { text-align: center; margin-top: 36px; }

/* ----------------------------------------------------------------- Hero -- */
.hero { position: relative; padding: 64px 0 40px; overflow: hidden; }
.hero h1 { margin-bottom: 16px; }

.blog-hero,
.page-hero { text-align: center; }
.blog-hero .lead,
.page-hero .lead { margin: 0 auto 28px; }

.page-hero { position: relative; padding: 56px 0 32px; overflow: hidden; }
.page-hero-tight { padding-bottom: 16px; }

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}
.b1 { width: 460px; height: 460px; background: #7C6BFF; top: -170px; left: -110px; opacity: .42; }
.b2 { width: 400px; height: 400px; background: #FF7FA0; top: -40px; right: -130px; opacity: .3; }
.b3 { width: 360px; height: 360px; background: #B26BFF; bottom: -160px; left: 40%; opacity: .22; }

/* ------------------------------------------------------- Post meta bits -- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p1) 12%, transparent);
  color: var(--p1);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .86rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.meta b { color: var(--text); font-weight: 700; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar.has-img { background: var(--surface-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  flex-shrink: 0;
}

.crumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  font-size: .86rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.crumbs a:hover { color: var(--p1); }

/* ----------------------------------------------- Thumbnails & gradients -- */
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
}
.thumb .emo {
  font-size: 3.2rem;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18));
  transition: transform .4s;
  position: relative;
  z-index: 1;
}
.thumb:not(.has-img)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .35), transparent 50%);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.t1 { background: linear-gradient(135deg, #6D5BFF, #9B4DFF); }
.t2 { background: linear-gradient(135deg, #FF8A65, #FF6B8B); }
.t3 { background: linear-gradient(135deg, #12B886, #38D9A9); }
.t4 { background: linear-gradient(135deg, #2F80ED, #56CCF2); }
.t5 { background: linear-gradient(135deg, #F59F00, #FFD43B); }
.t6 { background: linear-gradient(135deg, #9B4DFF, #FF6B8B); }
.t7 { background: linear-gradient(135deg, #343A40, #6D5BFF); }

.cover {
  max-width: 1000px;
  margin: 0 auto 48px;
  min-height: 300px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cover:not(.has-img)::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .35), transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(255, 255, 255, .18), transparent 40%);
}
.cover > span {
  font-size: clamp(3.5rem, 10vw, 7rem);
  position: relative;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .25));
}
.cover.has-img { min-height: 0; display: block; }
.cover.has-img img { width: 100%; }
.cover figcaption {
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

/* -------------------------------------------------------- Feature cards -- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

.ic {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.ic svg { width: 26px; height: 26px; }

.ic.v { background: #EDEAFF; color: #6D5BFF; }
.ic.p { background: #FFE8EE; color: #F0476E; }
.ic.g { background: #DDF8EE; color: #0EA372; }
.ic.o { background: #FFF1DE; color: #E8860C; }
.ic.b { background: #E1F0FF; color: #2F80ED; }
.ic.m { background: #F5E6FF; color: #9B4DFF; }

:root[data-theme="dark"] .ic { background: var(--surface-2); }

/* ---------------------------------------------------------- Post cards --- */
.posts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.posts-3 { grid-template-columns: repeat(3, 1fr); }

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.post-card:hover .emo { transform: scale(1.12) rotate(-5deg); }

.post-card .card-link { display: block; }
.post-card .thumb { height: 180px; }

.p-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  align-items: flex-start;
}

.p-title { font-size: 1.12rem; line-height: 1.3; font-weight: 700; }
.p-title a:hover { color: var(--p1); }

.p-excerpt {
  color: var(--muted);
  font-size: .93rem;
  flex: 1;
}

/* ------------------------------------------------------------- Widgets --- */
.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.widget h4,
.widget .widget-title {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget p { color: var(--muted); font-size: .93rem; }
.widget a:hover { color: var(--p1); }

.widget ul { display: grid; gap: 10px; }
.widget ul a { font-size: .93rem; font-weight: 600; }

.widget.try {
  background: var(--grad);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}
.widget.try::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  right: -60px; bottom: -70px;
}
.widget.try p { color: #fff; opacity: .9; margin-bottom: 16px; }
.widget.try .btn {
  background: #fff;
  color: #14112B;
  width: 100%;
  position: relative;
  z-index: 1;
}
.widget.try a:hover { color: inherit; }

.pop { display: grid; gap: 14px; counter-reset: n; }
.pop a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.4;
}
.pop a::before {
  counter-increment: n;
  content: "0" counter(n);
  font-weight: 800;
  font-size: 1.1rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
  min-width: 26px;
}
.pop-plain a::before { content: none; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: .84rem;
  font-weight: 600;
  transition: background .2s, color .2s;
}
.tags a:hover { background: var(--grad); color: #fff; }

.news-hint { font-size: .88rem; }
.news-hint a { color: var(--p1); text-decoration: underline; }

/* ------------------------------------------------------------ Ad slots --- */
.ad-slot {
  border: 1px dashed var(--line);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--surface);
  min-height: 100px;
  margin: 20px 0;
  padding: 12px;
  text-align: center;
}
.ad-slot.ad-tall { min-height: 250px; }
.ad-slot.is-live { border: none; background: none; min-height: 0; padding: 0; }

/* ----------------------------------------------------------------- CTA --- */
.cta {
  position: relative;
  border-radius: 32px;
  padding: 60px 40px;
  text-align: center;
  color: #fff;
  background: var(--grad);
  overflow: hidden;
  margin-bottom: 20px;
}
.cta::before,
.cta::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.cta::before { width: 300px; height: 300px; top: -120px; left: -80px; }
.cta::after { width: 240px; height: 240px; bottom: -110px; right: -60px; }
.cta h2 { color: #fff; position: relative; margin-bottom: 14px; }
.cta p { opacity: .92; max-width: 52ch; margin: 0 auto 26px; position: relative; }
.cta .btn {
  background: #fff;
  color: #14112B;
  position: relative;
  min-height: 52px;
  padding: 0 28px;
}

.help-card {
  background: var(--grad);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
}
.help-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.help-card p { opacity: .9; font-size: .94rem; margin-bottom: 16px; }
.help-card .btn { background: #fff; color: #14112B; min-height: 44px; }

.help-card-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.help-card-wide p { margin-bottom: 0; }

/* ----------------------------------------------------------------- FAQ --- */
.faq { display: grid; gap: 12px; }
.faq-full .faq { max-width: 820px; margin-inline: auto; }

.qa {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.qa.open { border-color: var(--p1); box-shadow: var(--shadow); }

.qa-q { font-size: 1rem; font-weight: 700; }
.qa button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
}

.qa .pm {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  transition: transform .3s, background .3s, color .3s;
}
.qa .pm svg { width: 14px; height: 14px; stroke-width: 3; }
.qa.open .pm { background: var(--grad); color: #fff; transform: rotate(45deg); }

/* Collapsed only when JS can expand it again — without scripting every
   answer stays visible rather than being unreachable. */
.ptai-js .qa .ans {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.qa .ans p { padding: 0 22px 20px; color: var(--muted); }

/* --------------------------------------------------------------- Prose --- */
.prose { font-size: 1.06rem; line-height: 1.85; }
.prose > * + * { margin-top: 1.2em; }

.prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.25; letter-spacing: -.7px; margin-top: 2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose h4 { font-size: 1.08rem; margin-top: 1.4em; }

.prose p { color: color-mix(in srgb, var(--text) 84%, var(--muted)); }

.prose a {
  color: var(--p1);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--p2); }

.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--p1); font-weight: 700; }

.prose blockquote {
  border-left: 4px solid var(--p1);
  padding: 6px 0 6px 22px;
  font-size: 1.18rem;
  font-weight: 600;
  font-style: italic;
}

.prose img,
.prose figure { border-radius: 18px; overflow: hidden; }
.prose figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; text-align: center; }

.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: .9em;
}
.prose pre {
  background: var(--surface-2);
  padding: 18px;
  border-radius: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
}
.prose pre code { background: none; padding: 0; }

.prose hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }

/* Numbered step list inside prose */
.prose .steps-list {
  display: grid;
  gap: 14px;
  list-style: none;
  padding-left: 0;
  counter-reset: s;
}
.prose .steps-list li {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 0;
}
.prose .steps-list li::before {
  counter-increment: s;
  content: counter(s);
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.callout {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--p1) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--p1) 22%, transparent);
  font-size: 1rem;
  line-height: 1.6;
}
.callout .ic {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: auto; height: auto;
  background: none;
  margin: 0;
}
.callout.warn {
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 440px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  background: var(--surface-2);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .6px;
}
tr:last-child td { border-bottom: none; }

.inline-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border-radius: 22px;
  background: var(--grad);
  color: #fff;
  flex-wrap: wrap;
}
.inline-cta h4 { font-size: 1.2rem; }
.inline-cta p { color: #fff; opacity: .9; font-size: .95rem; margin: 4px 0 0; }
.inline-cta .btn { background: #fff; color: #14112B; }

.page-body { max-width: 760px; margin-inline: auto; }
.page-links { display: flex; gap: 8px; margin-top: 2em; font-weight: 700; }

/* ------------------------------------------- Table of contents / aside -- */
.a-aside { display: grid; gap: 20px; align-content: start; }

.toc {
  position: sticky;
  top: calc(var(--head) + 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.toc h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc-links { display: grid; }
.toc a {
  display: block;
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s, border-color .2s, background .2s;
}
.toc a:hover { color: var(--text); }
.toc a.active {
  color: var(--p1);
  border-color: var(--p1);
  background: color-mix(in srgb, var(--p1) 7%, transparent);
}

/* ---------------------------------------------------- Split page layout -- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}
.split-aside { display: grid; gap: 20px; position: sticky; top: calc(var(--head) + 24px); }

/* --------------------------------------------------------- Empty states -- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-state .e { font-size: 2.8rem; display: block; margin-bottom: 12px; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 46ch; margin: 0 auto 20px; }
.empty-state a { color: var(--p1); text-decoration: underline; }

.empty { text-align: center; color: var(--muted); padding: 26px 0; font-size: .95rem; }

/* ----------------------------------------------------------- Pagination -- */
.pagination { margin-top: 36px; }
.nav-links--pagination,
.pagination .nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: .92rem;
}
.pagination .page-numbers:hover { border-color: var(--p1); }
.pagination .page-numbers.current {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

/* ---------------------------------------------------------------- Toast -- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 140px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: .92rem;
  z-index: 100;
  transition: transform .35s;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

.to-top {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 40;
  box-shadow: 0 10px 24px -8px rgba(109, 91, 255, .6);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }
.to-top svg { width: 20px; height: 20px; stroke-width: 2.5; }

/* --------------------------------------------------------------- Reveal -- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 1024px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .posts-3 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .split-aside { position: static; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .primary-nav,
  .nav-actions .nav-cta { display: none; }

  .menu-btn { display: grid; }
  .mobile-menu { display: block; }

  .cover { margin-bottom: 32px; }
}

@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .hero { padding: 36px 0 20px; }
  .page-hero { padding: 36px 0 24px; }

  h1 { letter-spacing: -1.2px; }

  .features,
  .posts,
  .posts-3 { grid-template-columns: 1fr; }

  .split-aside { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }

  .cta { padding: 44px 22px; border-radius: 24px; }
  .cover { border-radius: 20px; min-height: 200px; }
  .prose { font-size: 1.01rem; }

  .ad-slot { min-height: 90px; }
  .ad-slot.ad-tall { min-height: 160px; }

  .help-card-wide { flex-direction: column; align-items: stretch; }
  .help-card-wide .btn { width: 100%; }
}

/* -------------------------------------------------------- Accessibility -- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header,
  .site-footer,
  .to-top,
  .toast,
  .share,
  .toc,
  .ad-slot,
  .blob { display: none !important; }

  body { background: #fff; color: #000; }
  .prose a { text-decoration: underline; }
}
