@import url('https://fonts.googleapis.com/css2?family=Anton&family=Epilogue:wght@400;500;600;700&display=swap');

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --clr-primary: #56228b;
  --clr-primary-dark: #3d1866;
  --clr-primary-light: #7a3dbf;
  --clr-secondary: #8b4513;
  --clr-secondary-light: #b5601c;
  --clr-ink: #1f1726;
  --clr-ink-soft: #3a2d45;
  --clr-surface: #faf8f5;
  --clr-surface-2: #f0ebe3;
  --clr-surface-3: #e4dbd0;
  --clr-border: #d6ccbe;
  --clr-muted: #7a6e66;
  --clr-white: #ffffff;
  --clr-hero-overlay: rgba(31,23,38,0.72);

  --ff-heading: 'Anton', 'Impact', sans-serif;
  --ff-body: 'Epilogue', 'Segoe UI', system-ui, sans-serif;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  --shadow-sm: 0 2px 8px rgba(31,23,38,0.08);
  --shadow-md: 0 4px 20px rgba(31,23,38,0.12);
  --shadow-lg: 0 8px 40px rgba(31,23,38,0.18);

  --bar-h: 64px;
  --sidebar-w: 240px;
  --content-max: 760px;
  --shell-max: 1160px;
  --gap: 24px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--clr-ink);
  background: var(--clr-surface);
  padding-bottom: calc(var(--bar-h) + 16px);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--clr-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--clr-primary-dark); }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.3em; }

h1, h2, h3, h4 {
  font-family: var(--ff-heading);
  line-height: 1.15;
  color: var(--clr-ink);
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.3rem, 3.5vw, 2rem); margin-top: 1.8em; margin-bottom: 0.4em; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); margin-top: 1.4em; margin-bottom: 0.3em; }
h4 { font-size: 1rem; font-family: var(--ff-body); font-weight: 700; }

p { margin-bottom: 1em; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th { background: var(--clr-primary); color: var(--clr-white); padding: 10px 12px; text-align: left; }
td { padding: 9px 12px; border-bottom: 1px solid var(--clr-border); }
tr:nth-child(even) td { background: var(--clr-surface-2); }
blockquote { border-left: 4px solid var(--clr-primary); padding: 0.8em 1.2em; background: var(--clr-surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; margin: 1.4em 0; }

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link-wrap { position: relative; }
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--clr-primary);
  color: var(--clr-white);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   HERO (home only)
   ============================================================ */
.hero-wrap {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media--placeholder {
  background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-secondary) 60%, var(--clr-ink) 100%);
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--clr-hero-overlay);
  z-index: 1;
}
.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 40px var(--gap) calc(var(--bar-h) + 48px);
}
.hero-inner {
  max-width: 680px;
  margin: 0;
}
.eyebrow {
  display: inline-block;
  background: var(--clr-secondary);
  color: var(--clr-white);
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
}
.hero-copy h1 {
  color: var(--clr-white);
  font-size: clamp(2rem, 6vw, 3.6rem);
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-bottom: 0.6em;
}
.hero-desc {
  color: rgba(255,255,255,0.88);
  font-size: 1.1rem;
  max-width: 560px;
  margin-bottom: 1.6em;
}
.btn-hero {
  display: inline-block;
  background: var(--clr-secondary);
  color: var(--clr-white);
  font-family: var(--ff-heading);
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 14px 32px;
  border-radius: var(--radius-xl);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: background 0.2s, transform 0.15s;
  min-height: 48px;
}
.btn-hero:hover { background: var(--clr-secondary-light); transform: translateY(-2px); color: var(--clr-white); }

/* ============================================================
   PAGE SHELL (sidebar + main)
   ============================================================ */
.page-shell {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 40px var(--gap) 40px;
  gap: var(--gap);
}

/* sidebar to the LEFT */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  order: -1;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}
.sidebar-inner {
  background: var(--clr-surface-2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
}
.sidebar-heading {
  font-size: 1rem;
  margin-top: 0;
  color: var(--clr-primary);
  letter-spacing: 0.03em;
}
.sidebar-heading + p.subtitle {
  font-size: 0.82rem;
  color: var(--clr-muted);
  margin-bottom: 1em;
  margin-top: 0.2em;
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
}
.sidebar-list li { margin-bottom: 0.1em; }
.sidebar-list a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--clr-ink-soft);
  transition: background 0.15s, color 0.15s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.sidebar-list a:hover { background: var(--clr-primary); color: var(--clr-white); }

.rank-index {
  padding-left: 1.4em;
  font-size: 0.83rem;
  color: var(--clr-ink-soft);
}
.rank-index li { margin-bottom: 0.25em; }

.sidebar-cta-box {
  background: var(--clr-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 1em;
  color: var(--clr-white);
}
.sidebar-cta-box p { font-size: 0.85rem; margin-bottom: 0.8em; color: rgba(255,255,255,0.9); }
.btn-sidebar {
  display: inline-block;
  background: var(--clr-white);
  color: var(--clr-primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 18px;
  border-radius: var(--radius-xl);
  text-decoration: none;
  min-height: 40px;
  transition: background 0.15s;
}
.btn-sidebar:hover { background: var(--clr-surface-2); }

main {
  flex: 1 1 0;
  min-width: 0;
}

/* ============================================================
   CONTENT SECTION
   ============================================================ */
.content-section {
  position: relative;
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: 36px 36px 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  margin-bottom: var(--gap);
  overflow: hidden;
}
.content-section--narrow { max-width: var(--content-max); }

.content-figure {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 0;
}
.blob-deco { width: 100%; height: 100%; }
.blob-deco--sm { width: 160px; height: 160px; }
.blob-deco--xs { width: 110px; height: 110px; }

.article-hero-fig {
  margin: -36px -36px 28px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}
.article-hero-fig figcaption {
  padding: 10px 20px;
  font-size: 0.8rem;
  color: var(--clr-muted);
  background: var(--clr-surface-2);
}
.article-hero-img { width: 100%; max-height: 420px; object-fit: cover; }

/* ============================================================
   INLINE ASIDE
   ============================================================ */
.inline-aside {
  background: var(--clr-surface-2);
  border-left: 4px solid var(--clr-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 14px 20px;
  margin-bottom: 1.8em;
  position: relative;
  z-index: 1;
}
.inline-aside strong { display: block; font-family: var(--ff-heading); font-size: 0.95rem; color: var(--clr-secondary); margin-bottom: 4px; letter-spacing: 0.03em; }
.inline-aside p { margin: 0; font-size: 0.88rem; color: var(--clr-ink-soft); }

/* ============================================================
   PROSE
   ============================================================ */
.prose { position: relative; z-index: 1; }
.prose h2 { color: var(--clr-primary); }
.prose h2 + .subtitle,
.prose h2 + p.subtitle { font-size: 0.93rem; color: var(--clr-muted); margin-top: -0.2em; margin-bottom: 1em; }
.prose a { color: var(--clr-primary); font-weight: 600; }
.prose table { margin: 1.4em 0; border-radius: var(--radius-sm); overflow: hidden; }
.compare-prose table { font-size: 0.88rem; }

/* ============================================================
   BYLINE & STAGE
   ============================================================ */
.byline {
  font-size: 0.85rem;
  color: var(--clr-muted);
  margin-bottom: 1.4em;
  margin-top: -0.3em;
}
.byline time { font-style: normal; }
.page-stage-label {
  display: inline-block;
  background: var(--clr-surface-3);
  color: var(--clr-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  margin-bottom: 0.6em;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--clr-muted);
  margin-bottom: 1.2em;
  padding: 0 0 0.4em;
}
.breadcrumb a { color: var(--clr-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ============================================================
   CHILD CARDS (home)
   ============================================================ */
.cards-section {
  background: transparent;
  padding: 0;
  margin-bottom: var(--gap);
}
.cards-section > h2 { color: var(--clr-ink); margin-top: 0; }
.cards-section > .subtitle { color: var(--clr-muted); font-size: 0.93rem; margin-bottom: 1.4em; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.child-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.child-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.child-card-body { padding: 22px 22px 16px; flex: 1; }
.child-card-body h3 { font-size: 1rem; margin-top: 0; margin-bottom: 0.4em; }
.child-card-body h3 a { text-decoration: none; color: var(--clr-ink); font-family: var(--ff-heading); }
.child-card-body h3 a:hover { color: var(--clr-primary); }
.child-card-body p { font-size: 0.87rem; color: var(--clr-ink-soft); margin-bottom: 0.5em; }
.card-date { font-size: 0.78rem; color: var(--clr-muted); display: block; margin-top: 0.4em; }
.child-card-accent {
  height: 5px;
  background: var(--card-accent, var(--clr-primary));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   CHILD DL LIST (ranking child pages)
   ============================================================ */
.child-list-section {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--gap);
}
.child-list-section > h2 { margin-top: 0; color: var(--clr-primary); }
.child-list-section > h2 + .subtitle { font-size: 0.93rem; color: var(--clr-muted); margin-top: -0.2em; margin-bottom: 1.2em; }
.child-dl { margin: 0; }
.child-dl dt {
  font-family: var(--ff-heading);
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin-top: 1em;
}
.child-dl dt:first-child { margin-top: 0; }
.child-dl dt a {
  text-decoration: none;
  color: var(--clr-primary);
  padding: 4px 0;
  display: inline-block;
  min-height: 40px;
  line-height: 1.3;
}
.child-dl dt a:hover { text-decoration: underline; }
.child-dl dd {
  font-size: 0.87rem;
  color: var(--clr-ink-soft);
  margin-left: 0;
  padding-left: 1em;
  border-left: 2px solid var(--clr-border);
  margin-top: 4px;
}

/* ============================================================
   AUTHOR SECTION (about page)
   ============================================================ */
.author-section {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--gap);
}
.author-section > h2 { margin-top: 0; color: var(--clr-primary); }
.author-section > h2 + .subtitle { font-size: 0.93rem; color: var(--clr-muted); margin-top: -0.2em; margin-bottom: 1.2em; }
.author-card { display: flex; flex-direction: column; gap: 12px; }
.author-meta { display: flex; flex-direction: column; gap: 4px; }
.author-name { font-family: var(--ff-heading); font-size: 1.2rem; color: var(--clr-ink); letter-spacing: 0.02em; }
.author-credentials {
  display: inline-block;
  background: var(--clr-secondary);
  color: var(--clr-white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-xl);
}
.author-bio { font-size: 0.95rem; color: var(--clr-ink-soft); line-height: 1.7; }

/* ============================================================
   BOTTOM BAR (navigation — fixed, full width)
   ============================================================ */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  background: var(--clr-ink);
  z-index: 1000;
  box-shadow: 0 -2px 16px rgba(31,23,38,0.28);
}
.bottom-bar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 12px;
  gap: 4px;
  overflow: hidden;
}
.bottom-bar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.bottom-bar-left { justify-content: flex-start; }
.bottom-bar-right { justify-content: flex-end; }
.bottom-bar-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}
.bottom-bar-link:hover { background: rgba(255,255,255,0.12); color: var(--clr-white); }
.bottom-bar-brand {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary);
  border-radius: 50%;
  color: var(--clr-white);
  font-family: var(--ff-heading);
  font-size: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.bottom-bar-brand:hover { background: var(--clr-primary-light); }
.bottom-bar-brand img { width: 28px; height: 28px; border-radius: 50%; }

/* CTA buttons in bottom bar */
.cta {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: var(--radius-xl);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.cta-signup {
  background: var(--clr-secondary);
  color: var(--clr-white);
  border: 2px solid var(--clr-secondary);
  margin-left: 6px;
}
.cta-signup:hover { background: var(--clr-secondary-light); border-color: var(--clr-secondary-light); color: var(--clr-white); transform: translateY(-1px); }
.cta-login {
  background: transparent;
  color: var(--clr-white);
  border: 2px solid rgba(255,255,255,0.5);
  margin-left: 4px;
}
.cta-login:hover { background: rgba(255,255,255,0.12); border-color: var(--clr-white); color: var(--clr-white); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--clr-ink);
  color: rgba(255,255,255,0.82);
  padding-bottom: calc(var(--bar-h) + 8px);
}
footer article { padding: 36px var(--gap); }
footer article + article { border-top: 1px solid rgba(255,255,255,0.1); }

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.footer-brand-text {
  font-family: var(--ff-heading);
  font-size: 1.3rem;
  color: var(--clr-white);
  letter-spacing: 0.04em;
}
.footer-logo { max-width: 140px; margin-bottom: 10px; }
.footer-tagline { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 8px; }
.footer-contact h3,
.footer-nav-col h3 {
  font-family: var(--ff-heading);
  font-size: 0.95rem;
  color: var(--clr-white);
  letter-spacing: 0.05em;
  margin-bottom: 0.7em;
  margin-top: 0;
}
.footer-contact p { font-size: 0.87rem; color: rgba(255,255,255,0.65); }
.footer-contact-link {
  display: inline-block;
  margin-top: 10px;
  background: var(--clr-primary);
  color: var(--clr-white);
  padding: 9px 20px;
  border-radius: var(--radius-xl);
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 40px;
  transition: background 0.2s;
}
.footer-contact-link:hover { background: var(--clr-primary-light); color: var(--clr-white); }

/* footer nav uses dl */
.footer-dl { margin: 0; padding: 0; }
.footer-dl dt {
  margin-top: 0.6em;
  margin-bottom: 0;
}
.footer-dl dt:first-child { margin-top: 0; }
.footer-dl dt a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 4px 0;
  transition: color 0.15s;
}
.footer-dl dt a:hover { color: var(--clr-primary-light); }
.footer-dl dd {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin: 0 0 0 0;
  padding-left: 0;
  line-height: 1.4;
}

.footer-rg { padding-top: 20px !important; padding-bottom: 20px !important; }
.rg-notice {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  max-width: 860px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}
.footer-copy { font-size: 0.82rem; color: rgba(255,255,255,0.4); margin: 0; }
.footer-trust { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-trust a {
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.footer-trust a:hover { color: var(--clr-primary-light); }

/* ============================================================
   SUBTITLE RULE (h2 + p.subtitle)
   ============================================================ */
h2 + p.subtitle {
  font-size: 0.93rem;
  color: var(--clr-muted);
  margin-top: -0.25em;
  margin-bottom: 1em;
  font-style: italic;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .child-card { transition: none; }
  .btn-hero, .cta, .bottom-bar-link { transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-nav-col { grid-column: 1 / -1; }
  .page-shell { gap: 16px; }
  .sidebar { flex: 0 0 200px; width: 200px; }
}

@media (max-width: 680px) {
  :root { --sidebar-w: 100%; }

  .page-shell {
    flex-direction: column;
    padding: 16px 12px 32px;
  }
  .sidebar {
    width: 100%;
    position: static;
    order: 0;
  }
  .content-section { padding: 24px 18px 28px; }
  .article-hero-fig { margin: -24px -18px 20px; }

  .hero-copy { padding: 24px 16px calc(var(--bar-h) + 36px); }
  .hero-wrap { min-height: 100vh; }

  .footer-top { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .bottom-bar-inner { padding: 0 6px; gap: 2px; }
  .bottom-bar-link { font-size: 0.65rem; padding: 0 6px; }
  .cta { font-size: 0.7rem; padding: 0 10px; }

  .cards-grid { grid-template-columns: 1fr; }

  .child-list-section { padding: 20px 16px; }
  .author-section { padding: 20px 16px; }
}

@media (max-width: 400px) {
  html { font-size: 16px; }
  h1 { font-size: 1.7rem; }
  .bottom-bar-link { display: none; }
  .bottom-bar-links { flex: 0 0 auto; }
  .cta { min-height: 44px; font-size: 0.72rem; }
}
