/* ===== Whitepaper Page ===== */

/* Layout */
.wp-page { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.wp-header {
  padding: clamp(16px, 3vw, 24px) var(--page-px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.wp-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.wp-header-nav { display: flex; align-items: center; gap: 16px; }
.wp-header-nav a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.1); transition: border-color 0.2s;
}
.wp-header-nav a:hover { border-color: var(--brand); }
.wp-header-breadcrumb { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 4px; text-transform: uppercase; }
.wp-header-bottom { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.wp-header h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900; font-style: italic;
  letter-spacing: -0.03em; text-transform: uppercase;
}
.wp-header h1 span { color: var(--brand); }
.wp-lang-label { font-family: var(--font-mono); font-size: 10px; color: var(--brand); }

/* Search */
.wp-search-wrap { position: relative; width: min(100%, 384px); }
.wp-search-input {
  width: 100%; padding: 12px 40px 12px 16px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6); font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.wp-search-input:focus { border-color: rgba(var(--brand-rgb), 0.5); }
.wp-search-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.2); }

/* Body: sidebar + main */
.wp-body { display: flex; flex: 1; min-height: 0; }

/* Sidebar */
.wp-aside {
  width: 340px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}
.wp-aside-label {
  flex-shrink: 0; padding: 24px 32px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wp-aside-label p {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.3em;
}
.wp-toc-scroll {
  flex: 1; overflow-y: auto; padding: 16px 32px 80px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.wp-toc-scroll::-webkit-scrollbar { display: none; }
.wp-toc { display: flex; flex-direction: column; gap: 12px; }

.toc-item {
  padding: 16px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(10,10,10,0.6); backdrop-filter: blur(40px);
  transition: all 0.3s ease;
}
.toc-item:hover { border-color: rgba(var(--brand-rgb), 0.4); transform: translateY(-2px); }
.toc-item.is-active {
  border-color: rgba(var(--brand-rgb), 0.4);
  box-shadow: 0 0 20px rgba(var(--brand-rgb), 0.1), inset 0 0 10px rgba(var(--brand-rgb), 0.05);
}
.toc-item-inner { display: flex; align-items: flex-start; gap: 12px; }
.toc-num { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.2); transition: color 0.3s; }
.toc-title { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.6); line-height: 1.4; margin-bottom: 8px; transition: color 0.3s; }
.toc-item.is-active .toc-num { color: var(--brand); }
.toc-item.is-active .toc-title { color: #fff; }
.toc-chips { display: flex; gap: 6px; }
.toc-chip { padding: 2px 6px; background: rgba(255,255,255,0.05); font-family: var(--font-mono); font-size: 8px; color: rgba(255,255,255,0.25); }

.wp-aside-footer {
  flex-shrink: 0; background: #000;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 16px 32px;
}

/* Mobile TOC toggle */
.wp-toc-toggle {
  display: none; /* shown on mobile */
  width: 100%; padding: 12px var(--page-px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--brand); letter-spacing: 2px; text-transform: uppercase;
  text-align: left;
}
.wp-toc-toggle i { vertical-align: middle; margin-right: 8px; }

/* Main content */
.wp-main {
  flex: 1; overflow-y: auto; min-width: 0;
  padding: 0 clamp(24px, 4vw, 80px);
  background: linear-gradient(to bottom, transparent, rgba(var(--brand-rgb), 0.03));
}
.wp-main::-webkit-scrollbar { width: 4px; }
.wp-main::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 2px; }
.wp-content { padding-top: 40px; padding-bottom: 80px; }

/* Section */
.wp-section { margin-bottom: clamp(80px, 12vw, 256px); position: relative; }
.wp-section-num {
  font-size: clamp(4rem, 10vw, 10rem); line-height: 1; font-weight: 900;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  position: absolute; left: -1rem; top: -1rem; z-index: -1; pointer-events: none;
}
.wp-section-label { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.wp-section-dot { width: 12px; height: 12px; background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.wp-section-tag { font-family: var(--font-mono); font-size: 12px; color: var(--brand); letter-spacing: 0.4em; text-transform: uppercase; }
.wp-section-title {
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  font-weight: 900; font-style: italic;
  letter-spacing: -0.03em; text-transform: uppercase;
  line-height: 1.06; margin-bottom: clamp(24px, 4vw, 48px);
}

/* Section body grid: content + sidebar spec */
.wp-section-body { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }
.wp-section-content { min-width: 0; }
.wp-section-content > * + * { margin-top: 24px; }
.wp-section-spec {
  padding: 32px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); border-radius: var(--card-radius);
  height: fit-content; position: sticky; top: 200px;
}
.wp-section-spec h5 {
  font-size: 10px; font-weight: 900; color: var(--brand);
  text-transform: uppercase; letter-spacing: 4px; margin-bottom: 16px;
}
.wp-spec-row {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wp-spec-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wp-spec-row span:first-child { opacity: 0.5; }

/* Rich text styles */
.wp-rich h3 { font-size: clamp(1.25rem, 2.5vw, 2rem); font-weight: 900; font-style: italic; color: rgba(255,255,255,0.85); margin-top: 48px; margin-bottom: 20px; }
.wp-rich p { color: rgba(255,255,255,0.45); line-height: 1.8; text-align: justify; }
.wp-rich ul { list-style: disc; padding-left: 20px; color: rgba(255,255,255,0.45); }
.wp-rich ul li { margin-bottom: 8px; }
.wp-rich ol { list-style: decimal; padding-left: 20px; color: rgba(255,255,255,0.48); font-size: 1.125rem; }
.wp-rich ol li { margin-bottom: 20px; }
.wp-rich ol li::marker { color: var(--brand); font-weight: 800; }

.wp-emphasis { color: var(--brand); font-weight: 800; text-shadow: 0 0 12px rgba(var(--brand-rgb), 0.18); }
.wp-quote {
  position: relative;
  border-left: 2px solid rgba(var(--brand-rgb), 0.55);
  padding: 12px 16px 12px 22px;
  color: rgba(var(--brand-rgb), 0.88); font-style: italic;
  background: linear-gradient(90deg, rgba(var(--brand-rgb),0.08) 0%, rgba(var(--brand-rgb),0) 55%), rgba(255,255,255,0.02);
  border-radius: 10px; box-shadow: 0 0 18px rgba(var(--brand-rgb), 0.06);
}
.wp-lead {
  border-left: 2px solid rgba(var(--brand-rgb), 0.55); padding-left: 22px;
  color: rgba(255,255,255,0.68);
  background: linear-gradient(90deg, rgba(var(--brand-rgb),0.09) 0%, rgba(var(--brand-rgb),0) 62%);
  border-radius: 10px;
}

/* Chips */
.wp-chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  font-weight: 800; font-size: 12px; line-height: 1.2;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 0 16px rgba(0,0,0,0.18);
}
.wp-chip--a { background: rgba(59,130,246,0.18); color: rgba(96,165,250,0.96); border-color: rgba(59,130,246,0.35); }
.wp-chip--b { background: rgba(239,68,68,0.18); color: rgba(248,113,113,0.98); border-color: rgba(239,68,68,0.34); }
.wp-chip--c { background: rgba(0,255,209,0.14); color: rgba(0,255,209,0.95); border-color: rgba(0,255,209,0.32); }
.wp-chip--d { background: rgba(190,242,100,0.18); color: rgba(190,242,100,0.98); border-color: rgba(190,242,100,0.38); }
.wp-chip--e { background: rgba(168,85,247,0.18); color: rgba(192,132,252,0.98); border-color: rgba(168,85,247,0.34); }
.wp-chip--f { background: rgba(249,115,22,0.18); color: rgba(251,146,60,0.98); border-color: rgba(249,115,22,0.34); }

/* Tables in whitepaper */
.wp-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 12px; position: relative;
  overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.wp-table-wrap::-webkit-scrollbar { height: 8px; }
.wp-table-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; }
.wp-table {
  width: 100%; border-collapse: collapse; min-width: 560px;
}
.wp-table th, .wp-table td { padding: 12px 26px; vertical-align: middle; font-size: 13px; line-height: 1.55; text-align: left; }
.wp-table th { background-color: rgb(14,16,16); color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 14px; white-space: nowrap; }
.wp-table td { color: rgba(255,255,255,0.48); padding-top: 16px; padding-bottom: 18px; overflow-wrap: anywhere; }
.wp-table tbody tr { position: relative; }
.wp-table tbody tr::after {
  content: ''; position: absolute; left: 26px; right: 26px; bottom: 0; height: 1px;
  background: rgba(255,255,255,0.10); box-shadow: 0 0 10px rgba(255,255,255,0.05);
}
.wp-table tbody tr:last-child::after { display: none; }

/* Marks */
.wp-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4em; font-weight: 800; }
.wp-mark--yes { color: rgba(var(--brand-rgb),0.95); text-shadow: 0 0 14px rgba(var(--brand-rgb),0.22); }
.wp-mark--no { color: rgba(248,113,113,0.96); text-shadow: 0 0 14px rgba(248,113,113,0.18); }

/* Reveal animation */
.reveal-node { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-node.visible { opacity: 1; transform: translateY(0); }

/* Footer */
.wp-footer {
  padding: clamp(32px, 5vw, 64px) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 48px; margin-top: 32px;
}
.wp-footer-brand { font-size: 24px; font-weight: 900; margin-bottom: 24px; }
.wp-footer-desc { color: rgba(255,255,255,0.4); font-size: 14px; line-height: 1.6; margin-bottom: 32px; max-width: 400px; }
.wp-footer-icons { display: flex; gap: 24px; }
.wp-footer-icons i { width: 20px; height: 20px; opacity: 0.4; cursor: pointer; transition: opacity 0.2s; }
.wp-footer-icons i:hover { opacity: 1; }
.wp-footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 64px; }
.wp-footer-links h5 { font-size: 11px; font-weight: 900; text-transform: uppercase; color: var(--brand); margin-bottom: 24px; letter-spacing: 4px; }
.wp-footer-links li { font-size: 14px; color: rgba(255,255,255,0.3); margin-bottom: 12px; cursor: pointer; transition: color 0.2s; }
.wp-footer-links li:hover { color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .wp-section-body { grid-template-columns: 1fr; }
  .wp-section-spec { display: none; }
}
@media (max-width: 768px) {
  .wp-aside { display: none; }
  .wp-toc-toggle { display: flex; align-items: center; }

  /* Mobile TOC drawer */
  .wp-aside.mobile-open {
    display: flex;
    position: fixed; inset: 0; z-index: 200;
    width: 100%; background: rgba(0,0,0,0.95);
    backdrop-filter: blur(20px);
  }
  .wp-aside.mobile-open .wp-aside-label { padding: 24px var(--page-px) 16px; }
  .wp-aside.mobile-open .wp-toc-scroll { padding: 16px var(--page-px) 80px; }
  .wp-aside.mobile-open .wp-aside-footer { padding: 16px var(--page-px); }

  .wp-header h1 { font-size: 28px; }
  .wp-header-bottom { flex-direction: column; align-items: flex-start; }
  .wp-search-wrap { width: 100%; }
  .wp-footer { flex-direction: column; }
  .wp-footer-links { gap: 32px; }
}
