
/* =====================================================
   DANCING DRUMS HUB — Raw / Collage Aesthetic
   Primary: #fafaf8 | Secondary: #4a4a4a | Ink: #1a1a1a
   ===================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fafaf8;
  --ink: #1a1a1a;
  --mid: #4a4a4a;
  --accent: #8b2e00;
  --accent-light: #c4511a;
  --paper: #f0ece4;
  --rule: #c8c0b4;
  --radius-card: 28px;
  --col-max: 780px;
  --header-h: 64px;
  --font-serif: 'Cormorant Garamond', 'Libre Baskerville', Georgia, serif;
  --font-body: 'Libre Baskerville', Georgia, serif;
}

html {
  font-size: 17px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* =====================================================
   SITE WRAPPER
   ===================================================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 2px solid var(--ink);
  height: var(--header-h);
}

/* Sketch-mark border bottom effect */
.site-header::after {
  content: '';
  display: block;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0px,
    var(--ink) 6px,
    transparent 6px,
    transparent 10px
  );
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  opacity: 0.25;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
}

/* Brand mark */
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-glyph {
  font-size: 26px;
  line-height: 1;
  transform: rotate(-4deg);
  display: inline-block;
  color: var(--accent);
}

/* Nav details/summary */
.nav-details {
  position: relative;
  flex: 1;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 12px 14px;
  background: none;
  border: none;
  list-style: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--mid);
  border-radius: 4px;
}

.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle::marker { display: none; }

.toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* Desktop: show nav inline */
@media (min-width: 769px) {
  .nav-details {
    display: flex;
    align-items: center;
  }

  .nav-toggle {
    display: none;
  }

  .nav-details[open] .nav-menu,
  .nav-details .nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    list-style: none;
  }

  .nav-menu li a {
    padding: 6px 12px;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

/* Mobile: collapse behind toggle */
@media (max-width: 768px) {
  .nav-details .nav-menu {
    display: none;
  }

  .nav-details[open] .nav-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 8px 0;
    list-style: none;
    z-index: 300;
    box-shadow: 4px 4px 0 var(--ink);
  }
}

.nav-menu {
  list-style: none;
}

.nav-menu li a {
  display: block;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  min-height: 44px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.nav-menu li a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* Header CTA buttons */
.header-ctas {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: none;
}

.cta-signup {
  background: var(--ink);
  color: var(--bg);
  border: 2px solid var(--ink);
}

.cta-signup:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.cta-login {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.cta-login:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  position: relative;
  height: 70vh;
  min-height: 380px;
  max-height: 700px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%) contrast(1.05);
}

.hero-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px 32px;
  background: rgba(250, 250, 248, 0.88);
  border: 2px solid var(--ink);
  border-radius: 4px;
  max-width: 680px;
  transform: rotate(-0.5deg);
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.hero-tagline {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--mid);
  font-style: italic;
}

/* Slanted bottom edge */
.hero-slant {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: polygon(0 60%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 3;
}

/* =====================================================
   PAGE BODY LAYOUT
   ===================================================== */
.page-body {
  display: flex;
  gap: 40px;
  max-width: 1280px;
  margin: 48px auto;
  padding: 0 20px;
  width: 100%;
  align-items: flex-start;
}

.page-body--inner {
  margin-top: 40px;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar--left {
  flex: 0 0 220px;
  width: 220px;
  order: -1;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.sidebar-inner {
  background: var(--paper);
  border: 1.5px solid var(--mid);
  border-radius: 4px;
  padding: 20px 16px;
  transform: rotate(-0.3deg);
}

.sidebar-heading {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.sidebar-heading span {
  display: inline;
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li a {
  display: block;
  padding: 7px 0;
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
  min-height: 44px;
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.sidebar-links li a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

/* Rank list in sidebar */
.rank-sidebar-list {
  margin-bottom: 20px;
}

.rank-ol {
  list-style: none;
  counter-reset: rank-counter;
}

.rank-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.85rem;
}

.rank-pos {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 20px;
}

.rank-name {
  color: var(--ink);
  line-height: 1.3;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
  flex: 1 1 0;
  min-width: 0;
}

.prose-section {
  max-width: var(--col-max);
}

.prose-section--inner h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--ink);
}

/* =====================================================
   PROSE STYLES (page.content lands inside .prose-section)
   ===================================================== */
.prose-section h1,
.prose-section h2,
.prose-section h3,
.prose-section h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.25;
}

.prose-section h2 {
  font-size: 1.6rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}

.prose-section h2 > span {
  display: inline;
}

.prose-section h3 {
  font-size: 1.2rem;
}

.prose-section h3 > span {
  display: inline;
}

.prose-section p {
  margin-bottom: 1.1em;
  font-size: 1rem;
  line-height: 1.7;
}

.prose-section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose-section a:hover {
  color: var(--accent-light);
}

.prose-section ul,
.prose-section ol {
  margin: 0 0 1.1em 1.5em;
}

.prose-section li {
  margin-bottom: 0.4em;
  line-height: 1.6;
}

.prose-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92rem;
}

.prose-section th,
.prose-section td {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  text-align: left;
}

.prose-section th {
  background: var(--paper);
  font-family: var(--font-serif);
  font-weight: 700;
}

.prose-section blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.5em 0;
  padding: 10px 20px;
  font-style: italic;
  color: var(--mid);
  background: var(--paper);
}

.prose-section img {
  max-width: 100%;
  height: auto;
  border: 1.5px solid var(--mid);
  border-radius: 4px;
  display: block;
  margin: 1.5em 0;
}

/* =====================================================
   BYLINE
   ===================================================== */
.byline {
  font-size: 0.85rem;
  color: var(--mid);
  margin-bottom: 1.5em;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.byline-author {
  font-weight: 700;
  font-style: normal;
  color: var(--ink);
}

/* =====================================================
   PAGE EYEBROW
   ===================================================== */
.page-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 8px;
  font-family: var(--font-serif);
  font-weight: 600;
}

/* =====================================================
   STAGE LABEL
   ===================================================== */
.stage-label {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid var(--mid);
  border-radius: 20px;
  margin-bottom: 10px;
  color: var(--mid);
  font-family: var(--font-serif);
}

.stage-label--decision {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   CHILD LINK ROW (structure lottery: sibling <a><strong>)
   ===================================================== */
.child-link-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1.5px solid var(--mid);
  border-radius: var(--radius-card);
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
  transform: rotate(-0.2deg);
}

.child-card:nth-child(even) {
  transform: rotate(0.3deg);
}

.child-card:hover {
  border-color: var(--accent);
  background: var(--paper);
}

.child-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.child-desc {
  font-size: 0.82rem;
  color: var(--mid);
  line-height: 1.4;
}

/* Child section heading */
.child-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px dashed var(--rule);
}

.child-section h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.child-section h2 > span {
  display: inline;
}

/* =====================================================
   AUTHOR SECTION (about page)
   ===================================================== */
.author-section {
  background: var(--paper);
  border: 1.5px solid var(--mid);
  border-radius: 6px;
  padding: 24px 28px;
  margin: 28px 0;
  transform: rotate(-0.2deg);
}

.author-name-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.author-name-heading span {
  display: inline;
}

.author-credentials {
  font-size: 0.85rem;
  color: var(--mid);
  font-style: italic;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.author-bio {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--ink);
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 40px 0;
  position: relative;
}

/* Footer structure lottery: direct child div/nav */
.site-footer::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--bg) 0px,
    var(--bg) 6px,
    transparent 6px,
    transparent 14px
  );
  opacity: 0.3;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col--brand .footer-logo {
  width: 36px;
  height: 36px;
  filter: invert(1);
  opacity: 0.85;
}

.footer-brand-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-desc {
  font-size: 0.82rem;
  color: rgba(250,250,248,0.6);
  line-height: 1.5;
}

.footer-heading {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250,250,248,0.5);
  margin-bottom: 4px;
}

.footer-heading span {
  display: inline;
}

.footer-col--nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-col--nav ul li a {
  display: block;
  color: rgba(250,250,248,0.8);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 5px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-col--nav ul li a:hover {
  color: var(--bg);
  text-decoration: underline;
}

.trust-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trust-links a {
  color: rgba(250,250,248,0.75);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 5px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.trust-links a:hover {
  color: var(--bg);
}

.rg-notice {
  font-size: 0.72rem;
  color: rgba(250,250,248,0.45);
  line-height: 1.5;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 10px;
}

/* Footer bottom bar */
.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 16px 0 20px;
  font-size: 0.75rem;
  color: rgba(250,250,248,0.35);
  text-align: center;
}

/* =====================================================
   COMPARE TABLE ENHANCEMENTS
   ===================================================== */
.prose-section--compare table th {
  background: rgba(26,26,26,0.07);
}

/* =====================================================
   SCROLL REVEAL (vanilla, no CDN)
   ===================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  .reveal.revealed {
    transition: none;
  }
}

/* =====================================================
   PARALLAX HERO (JS-driven, degrades gracefully)
   ===================================================== */
.hero-media {
  will-change: transform;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  .sidebar--left {
    flex: 0 0 180px;
    width: 180px;
  }
}

@media (max-width: 768px) {
  .page-body {
    flex-direction: column;
    margin-top: 28px;
    gap: 24px;
  }

  .sidebar--left {
    position: static;
    width: 100%;
    flex: none;
    order: 0;
  }

  .sidebar-inner {
    transform: none;
  }

  .header-inner {
    padding: 0 14px;
  }

  .hero {
    height: 55vw;
    min-height: 260px;
  }

  .hero-copy {
    padding: 16px 18px;
    transform: none;
  }

  .hero-h1 {
    font-size: 1.35rem;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 36px 20px 0;
  }

  .footer-bottom {
    text-align: center;
  }

  .child-link-row {
    grid-template-columns: 1fr;
  }

  .nav-menu li a {
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .cta {
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .prose-section h2 {
    font-size: 1.3rem;
  }

  .hero {
    height: 60vw;
    min-height: 220px;
  }
}

/* =====================================================
   NO HORIZONTAL SCROLL GUARD
   ===================================================== */
img, video, iframe, table {
  max-width: 100%;
}

/* =====================================================
   UTILITY
   ===================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* 2026-09-26 移动端：.page-body 列方向 + align-items:flex-start 让 main 取内容宽（表格页 641px）撑出横向滚动 */
@media (max-width: 768px) {
  .page-body { align-items: stretch; }
  .main-content { width: 100%; }
}

a[data-cta],button[aria-controls]{min-height:44px;min-width:44px;box-sizing:border-box}main p a{text-decoration:underline}