/* ══════════════════════════════════════════════════════════════════════════
   HULULX v5.2 — DESIGN UPGRADE LAYER "Public Editorial Polish"
   Evolves the v2 "Nebula" language (does NOT replace it). Loaded after
   hululx-v2/v4 (+v3/v43/v44 on article & taxonomy pages).

   1. Typography & rhythm     — fluid clamp() scale, refined measure,
                                drop caps / lead paragraphs, Arabic stack
   2. Color & depth           — refined tokens, layered borders/shadows,
                                full dark-mode pass on every component
   3. Cards & grids           — image zoom, arrow slide, shadow lift,
                                aspect-ratio-stable covers
   4. Header / nav            — stronger glass, animated active indicator,
                                polished language switcher + drawer
   5. Footer                  — newsletter CTA panel, richer bottom bar
   6. Articles index          — animated filter chips, refined pagination
   7. Article page            — magazine reading: TOC, share rail (RTL),
                                pull-quotes, tables, figures, author box
   8. Motion                  — consistent hx-reveal, reduced-motion safe
   9. A11y                    — focus rings, skip-link, contrast fixes
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. TOKEN REFINEMENT ─────────────────────────────────────────────
   Deeper, slightly warmer dark surface; a touch more contrast for faint
   text (was 8b87ab → 7d78a3, both modes verified ≥4.5:1 on their bg);
   layered shadow ramp for real depth; new focus ring color. */
:root {
  --hx-ink-faint:   #6f6a96; /* ≥4.5:1 on white AND surface-2 (a11y bump from 8b87ab) */
  --hx-surface-2:   #f3f3fb;
  --hx-ring:        rgba(99, 102, 241, .42);

  /* layered elevation (border + ambient + key light) */
  --hx-shadow-xs: 0 1px 2px rgba(30, 27, 75, .05);
  --hx-shadow-sm: 0 1px 2px rgba(30, 27, 75, .05), 0 3px 10px rgba(30, 27, 75, .06);
  --hx-shadow-md: 0 1px 2px rgba(30, 27, 75, .06), 0 10px 28px -6px rgba(30, 27, 75, .14);
  --hx-shadow-lg: 0 1px 2px rgba(30, 27, 75, .06), 0 24px 60px -12px rgba(30, 27, 75, .20);

  /* hairline gradient used on section seams + footer top */
  --hx-hairline: linear-gradient(90deg, transparent, rgba(99,102,241,.45), rgba(167,139,250,.45), transparent);

  /* type ramp (fluid) */
  --hx-fs-xs:  .75rem;
  --hx-fs-sm:  clamp(.8rem,  .2vw + .76rem, .875rem);
  --hx-fs-base: clamp(.95rem, .25vw + .9rem, 1.05rem);
  --hx-fs-lead: clamp(1.05rem, .5vw + .95rem, 1.25rem);
}
.dark {
  --hx-ink-faint:  #948ec4; /* ≥4.5:1 on dark surface + surface-2 */
  --hx-bg:         #0b0918;
  --hx-surface:    #14112e;
  --hx-surface-2:  #1b1740;
  --hx-shadow-sm: 0 1px 2px rgba(0,0,20,.4), 0 3px 10px rgba(0,0,20,.35);
  --hx-shadow-md: 0 1px 2px rgba(0,0,20,.4), 0 10px 28px -6px rgba(0,0,20,.55);
  --hx-shadow-lg: 0 1px 2px rgba(0,0,20,.4), 0 24px 60px -12px rgba(0,0,20,.65);
}

/* ── 2. TYPOGRAPHY & RHYTHM ────────────────────────────────────────── */
html { scroll-padding-top: 6.5rem; }

body {
  font-size: var(--hx-fs-base);
  text-wrap: pretty;
}

/* Fluid display/headings — slightly tighter, more editorial */
.hx-display { font-size: clamp(2.2rem, 1.2rem + 4.4vw, 4.1rem); letter-spacing: -.015em; }
.hx-title-1 { font-size: clamp(1.7rem, 1rem + 2.6vw, 2.6rem); }
.hx-title-2 { font-size: clamp(1.3rem, 1rem + 1.4vw, 1.7rem); }
.hx-eyebrow { letter-spacing: .18em; font-size: .72rem; }

/* Arabic: bump line-height for stacked diacritics + proper Arabic stack.
   Cairo stays first (self-hosted); system fallbacks cover the other
   Arabic-capable platforms. */
html[lang="ar"] body { line-height: 1.9; letter-spacing: 0; }
html[lang="ar"] .hx-display { letter-spacing: 0; }
html[lang="ar"] .reading-content { line-height: calc(var(--rx-lh, 1.75) + .15); }

/* ── 3. SECTION RHYTHM & SEAMS ─────────────────────────────────────── */
/* soft gradient seam between home sections instead of nothing */
.hx-v4-section { position: relative; }
.hx-v4-section::before {
  content: '';
  position: absolute; top: clamp(-3rem, -1rem - 2.5vw, -1.5rem);
  inset-inline: clamp(0px, 4vw, 3rem);
  height: 1px;
  background: var(--hx-hairline);
  opacity: .5;
  pointer-events: none;
}
.hx-v4-section:first-child::before { display: none; }

/* ── 4. HEADER: stronger glass + animated active indicator ─────────── */
.hx-glass {
  background: color-mix(in srgb, var(--hx-surface) 80%, transparent);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
}
header.is-scrolled .hx-glass {
  background: color-mix(in srgb, var(--hx-surface) 92%, transparent);
  box-shadow: var(--hx-shadow-md);
}
.dark .hx-glass { background: color-mix(in srgb, #14112e 70%, transparent); }
.dark header.is-scrolled .hx-glass { background: color-mix(in srgb, #14112e 88%, transparent); }

/* nav pills: animated gradient underline that grows on hover/active */
.hx-nav-link {
  position: relative;
  transition: color .2s var(--hx-ease), background-color .2s var(--hx-ease);
}
.hx-nav-link::after {
  content: '';
  position: absolute;
  bottom: .1rem; inset-inline: 20%;
  height: 2px; border-radius: 2px;
  background: var(--hx-gradient);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s var(--hx-ease);
}
.hx-nav-link:hover::after { transform: scaleX(.55); }
.hx-nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* language switcher rows: flag-style code badge + name */
.hx-lang-code {
  display: inline-grid; place-items: center;
  min-width: 2.1rem; height: 1.5rem;
  padding-inline: .3rem;
  border-radius: .5rem;
  font-size: .66rem; font-weight: 800;
  letter-spacing: .05em;
  background: var(--hx-surface-2);
  color: var(--hx-ink-muted);
  border: 1px solid var(--hx-border);
}
.hx-lang-row { gap: .65rem; }
.hx-lang-row:hover .hx-lang-code { border-color: var(--hx-indigo-500); color: var(--hx-indigo-600); }
.hx-lang-row[aria-current="true"] .hx-lang-code {
  background: var(--hx-gradient); color: #fff; border-color: transparent;
}

/* mobile drawer: slide-in panel look */
.hx-drawer-panel {
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
}
.hx-drawer-link { position: relative; }
.hx-drawer-link[aria-current="page"]::before {
  content: '';
  position: absolute; inset-inline-start: .55rem; top: 22%; bottom: 22%;
  width: 3px; border-radius: 3px;
  background: var(--hx-gradient);
}

/* ── 5. CARDS: hover micro-interactions ────────────────────────────── */
/* image zoom (already 1.05 → 1.08 + faster ease) + arrow slide + lift */
.hx-card-hover:hover, .hx-card-hover:focus-within {
  transform: translateY(-5px);
  box-shadow: var(--hx-shadow-lg);
}
.hx-card .hx-cover > img { transition: transform .6s var(--hx-ease); }
.hx-card:hover .hx-cover > img,
.hx-card:focus-within .hx-cover > img { transform: scale(1.07); }

/* "read" arrow that slides in on hover (RTL flips automatically) */
.hx-card-arrow {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .74rem; font-weight: 800;
  color: var(--hx-indigo-600);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .25s var(--hx-ease), transform .25s var(--hx-ease);
}
[dir="rtl"] .hx-card-arrow { transform: translateX(6px); }
.hx-card:hover .hx-card-arrow,
.hx-card:focus-within .hx-card-arrow { opacity: 1; transform: translateX(0); }
.dark .hx-card-arrow { color: #a5b4fc; }

/* skeleton cover placeholder keeps the aspect ratio stable (no CLS) */
.hx-cover { contain: layout paint style; }

/* ── 6. FILTER CHIPS & PAGINATION (articles index) ─────────────────── */
.hx-chip { -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
  .hx-chip { transition: transform .2s var(--hx-ease), background-color .2s var(--hx-ease),
             border-color .2s var(--hx-ease), color .2s var(--hx-ease), box-shadow .2s var(--hx-ease); }
  .hx-chip:hover { transform: translateY(-1px); }
}
.hx-chip.is-active, .hx-chip[aria-pressed="true"] {
  box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .55);
}
.hx-tag.is-active .hx-tag-n { color: rgba(255,255,255,.75); }

/* pagination: current page glow + prev/next buttons with labels */
.hx-pg a, .hx-pg .hx-pg-cur { -webkit-tap-highlight-color: transparent; }
.hx-pg .hx-pg-cur { box-shadow: 0 6px 18px -6px rgba(99, 102, 241, .65); }
.hx-pg-step { min-width: 2.75rem; height: 2.75rem; gap: .35rem; }

/* ── 7. ARTICLE PAGE — magazine reading ────────────────────────────── */

/* 7a. Refined lead paragraph + drop cap (LTR + RTL safe) */
.hx-prose > p:first-of-type.hx-lead,
.reading-content > p:first-of-type.hx-lead {
  font-size: var(--hx-fs-lead);
  color: var(--hx-ink-muted);
  line-height: 1.7;
  margin-bottom: 1.6rem;
}
.reading-content.hx-has-dropcap > p:first-of-type:first-letter {
  float: inline-start;
  font-size: 3.4em;
  line-height: .82;
  font-weight: 800;
  margin-inline-end: .12em;
  margin-top: .06em;
  background: var(--hx-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
html[lang="ar"] .reading-content.hx-has-dropcap > p:first-of-type:first-letter {
  font-size: 2.6em; /* Arabic caps look oversized at 3.4em */
}
@media (max-width: 640px) {
  .reading-content.hx-has-dropcap > p:first-of-type:first-letter { font-size: 2.8em; }
}

/* 7b. Body type: measure + rhythm (~68ch) */
.hx-prose { font-size: 1.08rem; }
.hx-prose p { line-height: 1.8; margin-bottom: 1.25rem; }
.hx-prose h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.65rem); margin: 2.6rem 0 1rem; letter-spacing: -.015em; }
.hx-prose h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.3rem); margin: 2.1rem 0 .8rem; }
.hx-prose ul, .hx-prose ol { margin-bottom: 1.25rem; }
.hx-prose li { margin-bottom: .5rem; }
.hx-prose li::marker { color: var(--hx-indigo-500); font-weight: 800; }
.reading-content { max-width: min(var(--rx-width, 720px), 100%); }

/* 7c. Pull-quote / blockquote — editorial treatment */
.hx-prose blockquote {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--hx-indigo-500) 22%, var(--hx-border));
  border-inline-start: 4px solid var(--hx-violet-500);
  background:
    linear-gradient(135deg, rgba(99,102,241,.06), rgba(167,139,250,.08)),
    var(--hx-surface);
  padding: 1.35rem 1.6rem;
  font-size: 1.02em;
  line-height: 1.75;
  margin: 2rem 0;
  box-shadow: var(--hx-shadow-xs);
}
.hx-prose blockquote > p { margin-bottom: 0; }
.hx-prose blockquote p:first-child::before {
  content: '"';
  display: block;
  font-size: 2.6rem; line-height: .6;
  font-weight: 800;
  margin-bottom: .5rem;
  background: var(--hx-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.dark .hx-prose blockquote {
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(124,58,237,.12)), var(--hx-surface);
}

/* 7d. Tables — striped, sticky-free, horizontal scroll wrapper */
.hx-table-wrap { overflow-x: auto; margin: 1.8rem 0; border-radius: var(--hx-r-md); border: 1px solid var(--hx-border); -webkit-overflow-scrolling: touch; }
.hx-prose table { width: 100%; border-collapse: collapse; font-size: .92em; min-width: 480px; }
.hx-prose thead th {
  background: var(--hx-surface-2);
  font-weight: 800; text-align: start;
  padding: .7rem .9rem;
  border-bottom: 2px solid color-mix(in srgb, var(--hx-indigo-500) 30%, var(--hx-border));
  white-space: nowrap;
}
.hx-prose tbody td { padding: .65rem .9rem; border-bottom: 1px solid color-mix(in srgb, var(--hx-border) 70%, transparent); }
.hx-prose tbody tr:nth-child(even) { background: color-mix(in srgb, var(--hx-surface-2) 45%, transparent); }
.hx-prose tbody tr:last-child td { border-bottom: 0; }

/* 7e. Code blocks — header bar + language label */
#article-body pre {
  position: relative;
  border-radius: var(--hx-r-md);
  border: 1px solid rgba(148, 163, 184, .18);
  box-shadow: var(--hx-shadow-sm);
  margin: 1.8rem 0;
  padding-top: 2.2rem;
  background: #14122e;
}
.dark #article-body pre { background: #0d0b22; }
#article-body pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute; top: 0; inset-inline: 0;
  height: 2.2rem;
  display: flex; align-items: center;
  padding-inline: 1rem;
  font-size: .68rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
#article-body pre code { font-size: .86em; line-height: 1.7; }

/* 7f. Figures + captions */
.hx-prose figure { margin: 2rem 0; }
.hx-prose figure > img { border-radius: var(--hx-r-lg); box-shadow: var(--hx-shadow-md); }
.hx-prose figcaption {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .7rem; justify-content: center;
  font-size: .8rem; color: var(--hx-ink-faint); font-weight: 600;
  text-align: center;
}
.hx-prose figcaption::before { content: ''; width: 1.4rem; height: 1px; background: var(--hx-border); flex-shrink: 0; }

/* 7g. TOC — refined card with numbered entries + active rail */
.hx-toc-list { counter-reset: hx-toc; }
.hx-toc-list > li { counter-increment: hx-toc; }
.hx-toc-link {
  position: relative;
  padding-inline-start: 1.9rem;
  border-radius: .55rem;
  min-height: 2rem;
  display: flex; align-items: center;
}
.hx-toc-link::before {
  content: counter(hx-toc, decimal-leading-zero);
  position: absolute; inset-inline-start: .3rem;
  font-size: .62rem; font-weight: 800;
  color: var(--hx-ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  transition: color .2s;
}
.hx-toc-link:hover::before { color: var(--hx-indigo-500); }
.hx-toc-link.is-active {
  background: linear-gradient(90deg, rgba(99,102,241,.10), transparent);
  border-inline-start-color: transparent;
  box-shadow: inset 2px 0 0 var(--hx-indigo-500);
}
[dir="rtl"] .hx-toc-link.is-active { box-shadow: inset -2px 0 0 var(--hx-indigo-500); }
.dark .hx-toc-link.is-active { box-shadow: inset 2px 0 0 #a78bfa; }
[dir="rtl"] .dark .hx-toc-link.is-active { box-shadow: inset -2px 0 0 #a78bfa; }
.hx-toc-link.is-active::before { color: var(--hx-indigo-600); }
.dark .hx-toc-link.is-active::before { color: #a5b4fc; }
html.hx-focus .hx-toc-link.is-active { box-shadow: none; }

/* TOC collapse (mobile details): smooth rotation of the chevron */
[data-hx-toc-mobile] summary::-webkit-details-marker { display: none; }
[data-hx-toc-mobile][open] summary svg { transform: rotate(180deg); }
[data-hx-toc-mobile] summary svg { transition: transform .25s var(--hx-ease); }

/* 7h. Sticky share rail (desktop): vertical pill between tools and body.
       RTL mirrors automatically via inset-inline. */
.hx-share-rail {
  position: fixed;
  z-index: 45;
  inset-inline-start: max(.75rem, calc((100vw - 1440px) / 2 - 4.6rem));
  top: 50%; transform: translateY(-50%) translateX(-8px);
  display: flex; flex-direction: column; gap: .3rem;
  padding: .55rem .45rem;
  background: color-mix(in srgb, var(--hx-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hx-border);
  border-radius: 1.1rem;
  box-shadow: var(--hx-shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
[dir="rtl"] .hx-share-rail { transform: translateY(-50%) translateX(8px); }
.hx-share-rail.is-visible { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
.hx-share-rail-label {
  font-size: .58rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--hx-ink-faint);
  text-align: center; padding-bottom: .2rem; margin-bottom: .15rem;
  border-bottom: 1px solid var(--hx-border);
}
.hx-share-rail .hx-share-btn { width: 2.4rem; height: 2.4rem; border-radius: .75rem; }
.hx-share-rail .hx-share-btn svg { width: 15px; height: 15px; }
@media (max-width: 1279px) { .hx-share-rail { display: none; } } /* hidden under XL */

/* 7i. Reading progress bar (top hairline) — thicker + glow */
.hx-progressbar { height: 3px; }
.hx-progressbar > div { box-shadow: 0 0 12px rgba(124, 58, 237, .8); }

/* 7j. Author box (E-E-A-T): verified check, divider layout */
.hx-author-card {
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(99,102,241,.07), transparent 55%),
    var(--hx-surface);
}
.hx-author-verified {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .68rem; font-weight: 800;
  color: #0d9463;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .25);
  padding: .18rem .55rem;
  border-radius: var(--hx-r-full);
}
.dark .hx-author-verified { color: #34d399; }

/* 7k. Prev/next nav: hover arrow nudge */
[data-hx-prevnext] a .hx-pn-arrow { transition: transform .25s var(--hx-ease); }
[data-hx-prevnext] a:hover .hx-pn-arrow.prev { transform: translateX(-4px); }
[data-hx-prevnext] a:hover .hx-pn-arrow.next { transform: translateX(4px); }
[dir="rtl"] [data-hx-prevnext] a:hover .hx-pn-arrow.prev { transform: translateX(4px); }
[dir="rtl"] [data-hx-prevnext] a:hover .hx-pn-arrow.next { transform: translateX(-4px); }

/* 7l. Related rail: image zoom + card press */
[data-hx-mobile-related] a img { transition: transform .5s var(--hx-ease); }
[data-hx-mobile-related] a:hover img { transform: scale(1.06); }

/* ── 8. EMPTY STATES — illustrated, friendly ───────────────────────── */
.hx-empty-ill {
  width: 88px; height: 88px;
  margin-inline: auto;
  border-radius: 1.6rem;
  display: grid; place-items: center;
  background: var(--hx-gradient-soft);
  border: 1px solid color-mix(in srgb, var(--hx-indigo-500) 18%, var(--hx-border));
  box-shadow: var(--hx-shadow-sm);
  position: relative;
  margin-bottom: 1.15rem;
}
.hx-empty-ill::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1.5px dashed color-mix(in srgb, var(--hx-indigo-500) 30%, transparent);
  animation: hx-empty-float 4s ease-in-out infinite;
  pointer-events: none;
}
.hx-empty-ill svg { width: 36px; height: 36px; color: var(--hx-indigo-500); }
.dark .hx-empty-ill svg { color: #a78bfa; }
@keyframes hx-empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.hx-empty {
  border: 1.5px dashed color-mix(in srgb, var(--hx-indigo-500) 22%, var(--hx-border));
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(99,102,241,.04), transparent),
    var(--hx-surface);
}

/* ── 9. FOOTER — professional multi-column + CTA ───────────────────── */
.hx-footer-cta {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--hx-indigo-500) 25%, var(--hx-border));
  border-radius: var(--hx-r-xl);
  overflow: hidden;
  background:
    radial-gradient(120% 160% at 85% -10%, rgba(167,139,250,.18), transparent 55%),
    radial-gradient(90% 130% at 10% 110%, rgba(99,102,241,.20), transparent 55%),
    var(--hx-surface);
  box-shadow: var(--hx-shadow-md);
}
.dark .hx-footer-cta {
  background:
    radial-gradient(120% 160% at 85% -10%, rgba(167,139,250,.14), transparent 55%),
    radial-gradient(90% 130% at 10% 110%, rgba(99,102,241,.16), transparent 55%),
    var(--hx-surface);
}
.hx-footer-heading { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--hx-ink); }
.hx-footer-link { position: relative; transition: color .2s, transform .2s var(--hx-ease); }
.hx-footer-link:hover { transform: translateX(2px); }
[dir="rtl"] .hx-footer-link:hover { transform: translateX(-2px); }
.hx-footer-bottom {
  border-top: 1px solid var(--hx-border);
  background: color-mix(in srgb, var(--hx-surface-2) 55%, transparent);
}

/* ── 10. HOME — stats band + hero polish ────────────────────────────── */
.hx-stats-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--hx-border);
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-r-lg);
  overflow: hidden;
}
@media (min-width: 640px) { .hx-stats-band { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hx-stats-band > div {
  background: var(--hx-surface);
  padding: 1.1rem 1rem;
  text-align: center;
  position: relative;
}
.hx-stats-band > div:not(:nth-child(2))::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%;
  width: 1px; background: var(--hx-border);
}
@media (max-width: 639px) {
  .hx-stats-band > div:nth-child(3)::before { display: none; }
}
.dark .hx-stats-band > div { background: var(--hx-surface); }

/* hero: layered glow behind the spotlight card */
.hx-hero-spot {
  box-shadow:
    0 1px 2px rgba(30,27,75,.05),
    0 30px 70px -18px rgba(99, 102, 241, .28);
}
.dark .hx-hero-spot {
  box-shadow:
    0 1px 2px rgba(0,0,20,.4),
    0 30px 70px -18px rgba(124, 58, 237, .35);
}

/* section header: title + arrow link aligned */
.hx-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }

/* ── 11. A11Y: focus rings, skip link, touch targets ───────────────── */
:focus-visible {
  outline: 3px solid var(--hx-ring);
  outline-offset: 2px;
  border-radius: 6px;
}
.hx-btn:focus-visible, .hx-chip:focus-visible, .hx-share-btn:focus-visible,
.hx-ftool-btn:focus-visible, .hx-seg button:focus-visible {
  outline: 3px solid var(--hx-ring);
  outline-offset: 2px;
}
/* 44px touch targets on icon-only buttons (pads the hit area, not the icon) */
.hx-touch { position: relative; }
.hx-touch::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%);
  border-radius: inherit;
}
[dir="rtl"] .hx-touch::after { transform: translate(-50%, -50%); }

/* FIX (pre-existing): Tailwind's .hidden is single-class and loads before
   hululx-v2's .hx-btn/.hx-chip (display:inline-flex), so `hidden sm:inline-flex
   hx-btn` stayed visible on phones and overflowed the header row. Same for
   utility variants. Escaped-class selectors keep one-class specificity but
   our sheet is last in the cascade. */
.hidden:not([x-show]) { display: none !important; }
@media (min-width: 640px)  { .sm\:inline-flex.hidden, .hidden.sm\:inline-flex { display: inline-flex !important; } }
@media (min-width: 640px)  { .sm\:inline.hidden,     .hidden.sm\:inline     { display: inline !important; } }
@media (min-width: 640px)  { .sm\:block.hidden,      .hidden.sm\:block      { display: block !important; } }
@media (min-width: 768px)  { .md\:flex.hidden,       .hidden.md\:flex       { display: flex !important; } }
@media (min-width: 1024px) { .lg\:flex.hidden,       .hidden.lg\:flex       { display: flex !important; } }
@media (min-width: 1280px) { .xl\:inline.hidden,     .hidden.xl\:inline     { display: inline !important; } }

/* ── 12. MOTION SAFETY (consolidated; v2/v4 rules still apply) ─────── */
@media (prefers-reduced-motion: reduce) {
  .hx-reveal, .hx-card, .hx-card .hx-cover > img, .hx-card-arrow,
  .hx-chip, .hx-nav-link::after, .hx-toc-link, .hx-empty-ill::after,
  .hx-share-rail, [data-hx-prevnext] a .hx-pn-arrow { transition: none !important; animation: none !important; }
  .hx-empty-ill::after { animation: none; }
  .hx-share-rail.is-visible { transform: translateY(-50%); }
}


/* ═══ 15. AUTH PAGES (login/register use the main layout — the hxa-* auth system lives here too, mirrored from hululx-admin-v52.css §7) ═══ */
/* ── 7. AUTH SPLIT CARD ────────────────────────────────────────────── */
.hxa-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  background: var(--hx-bg);
}
@media (min-width: 1024px) { .hxa-auth { grid-template-columns: 1.05fr 1fr; } }

.hxa-auth-hero {
  display: none;
  position: relative;
  overflow: hidden;
  padding: 3rem;
  color: #fff;
  background:
    radial-gradient(120% 160% at 85% -10%, rgba(167,139,250,.35), transparent 55%),
    radial-gradient(90% 130% at 10% 110%, rgba(99,102,241,.45), transparent 55%),
    linear-gradient(160deg, #4338ca 0%, #5b21b6 45%, #312e81 100%);
}
@media (min-width: 1024px) { .hxa-auth-hero { display: flex; flex-direction: column; } }
.hxa-auth-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 60% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(80% 70% at 60% 40%, #000 30%, transparent 100%);
}
.hxa-auth-hero > * { position: relative; }
.hxa-auth-logo {
  width: 3.4rem; height: 3.4rem;
  border-radius: 1.05rem;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
}
.hxa-auth-hero h2 { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; margin-top: auto; }
.hxa-auth-hero p { color: rgba(255,255,255,.82); max-width: 34rem; font-size: 1.02rem; line-height: 1.7; }
.hxa-auth-hero-ft { display: flex; gap: 1.5rem; margin-top: 2rem; }
.hxa-auth-hero-ft div strong { display: block; font-size: 1.3rem; font-weight: 800; }
.hxa-auth-hero-ft div span { font-size: .78rem; color: rgba(255,255,255,.72); font-weight: 600; }

.hxa-auth-main {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 1.25rem;
  gap: 1.25rem;
}
@media (min-width: 640px) { .hxa-auth-main { padding: 3.5rem 2rem; } }
.hxa-auth-card {
  width: 100%; max-width: 26.5rem;
  background: var(--hx-surface);
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-r-xl);
  box-shadow: var(--hx-shadow-md);
  padding: 1.9rem;
  position: relative;
}
@media (min-width: 640px) { .hxa-auth-card { padding: 2.2rem; } }
.hxa-auth-brand-sm { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }
.hxa-auth-brand-sm .hxa-auth-logo { width: 2.35rem; height: 2.35rem; border-radius: .75rem; }
.hxa-auth-brand-sm span { font-weight: 800; font-size: 1.05rem; }
@media (min-width: 1024px) { .hxa-auth-brand-sm { display: none; } }
.hxa-auth-card h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.hxa-auth-sub { color: var(--hx-ink-muted); font-size: .88rem; margin-top: .35rem; line-height: 1.55; }

.hxa-field { margin-top: 1.05rem; }
.hxa-field label { display: block; font-size: .82rem; font-weight: 800; color: var(--hx-ink); margin-bottom: .4rem; }
.hxa-field .hxa-input {
  width: 100%;
  padding: .78rem .9rem;
  background: var(--hx-surface);
  border: 1.5px solid var(--hx-border);
  border-radius: .75rem;
  color: var(--hx-ink);
  font-size: .92rem;
  font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.hxa-field .hxa-input::placeholder { color: var(--hx-ink-faint); }
.hxa-field .hxa-input:focus { outline: none; border-color: var(--hx-indigo-500); box-shadow: 0 0 0 4px var(--hx-ring); }
.hxa-field .hxa-input[aria-invalid="true"] { border-color: var(--hxa-danger); box-shadow: 0 0 0 4px var(--hxa-danger-bg); }

.hxa-alert {
  display: flex; align-items: flex-start; gap: .55rem;
  border-radius: .75rem;
  padding: .75rem .9rem;
  font-size: .84rem; font-weight: 600;
  line-height: 1.5;
}
.hxa-alert i { margin-top: .1rem; }
.hxa-alert.is-error   { background: var(--hxa-danger-bg); color: var(--hxa-danger); border: 1px solid var(--hxa-danger-bd); }
.hxa-alert.is-success { background: var(--hxa-ok-bg);    color: var(--hxa-ok);     border: 1px solid var(--hxa-ok-bd); }
.hxa-alert.is-info    { background: var(--hxa-info-bg);  color: var(--hxa-info);   border: 1px solid var(--hxa-info-bd); }

