/* ==========================================================================
   THE DEFI CUSTODY REVIEW — OFFICIAL STYLESHEET
   Independent Security, DEX Protocol & Self-Custody Publication
   100% Unique Design System & Modern Web3 Editorial Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #080b12;
  --bg-card: #0f1422;
  --bg-card-hover: #141c30;
  --bg-elevated: #182239;
  --bg-glass: rgba(15, 20, 34, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(255, 0, 122, 0.4);
  --border-cyan: rgba(6, 182, 212, 0.4);

  --accent-pink: #ff007a;
  --accent-pink-glow: rgba(255, 0, 122, 0.25);
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;

  --gradient-brand: linear-gradient(135deg, #ff007a 0%, #7928ca 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-dark: linear-gradient(180deg, #0d1220 0%, #080b12 100%);

  --text-white: #ffffff;
  --text-body: #94a3b8;
  --text-light: #e2e8f0;
  --text-muted: #64748b;

  --status-danger: #f43f5e;
  --status-danger-bg: rgba(244, 63, 94, 0.08);
  --status-danger-border: rgba(244, 63, 94, 0.3);

  --status-warn: #f59e0b;
  --status-warn-bg: rgba(245, 158, 11, 0.08);
  --status-warn-border: rgba(245, 158, 11, 0.3);

  --status-safe: #10b981;
  --status-safe-bg: rgba(16, 185, 129, 0.08);
  --status-safe-border: rgba(16, 185, 129, 0.3);

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --container-max: 960px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(255, 0, 122, 0.15);

  color-scheme: dark;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-body);
  font-family: var(--font-sans);
  line-height: 1.7;
  font-weight: 400;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(255, 0, 122, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 12%, rgba(139, 92, 246, 0.09) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 60%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Links */
a {
  color: var(--accent-pink);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #ff409f;
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Notice Bar / Header Disclaimer */
.top-notice-bar {
  background: #060910;
  border-bottom: 1px solid var(--border-subtle);
  padding: 9px 16px;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--text-muted);
}

.top-notice-bar strong {
  color: var(--text-light);
  font-weight: 600;
}

.top-notice-bar a {
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-wrapper:hover {
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-pink-glow);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.csj-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.csj-brand-title span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-navigation {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-body);
  transition: color 0.2s ease;
  position: relative;
  padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-white);
  text-decoration: none;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
}

.btn-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-brand);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px var(--accent-pink-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 0, 122, 0.4);
  text-decoration: none;
}

/* Hero Section */
.hero-section {
  padding: 48px 0 28px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 0, 122, 0.1);
  border: 1px solid rgba(255, 0, 122, 0.3);
  color: var(--accent-pink);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.badge-pill.cyan {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
}

.badge-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

h1.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-white);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 28px;
}

/* Editorial Metadata Bar */
.editorial-meta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 36px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

.meta-item strong {
  color: var(--text-light);
}

/* Table of Contents */
.toc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 32px 0 44px;
}

.toc-header {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.toc-list li a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: color 0.15s ease, transform 0.15s ease;
}

.toc-list li a:hover {
  color: var(--accent-pink);
  transform: translateX(4px);
  text-decoration: none;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-purple);
  font-weight: 600;
}

/* Article Styling */
article.main-content {
  margin-bottom: 60px;
}

article h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.3;
  margin: 50px 0 18px;
  letter-spacing: -0.015em;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.4;
  margin: 32px 0 12px;
}

article p {
  margin-bottom: 18px;
  font-size: 1.03rem;
  line-height: 1.75;
}

article ul, article ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

article li {
  margin-bottom: 10px;
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Callouts */
.callout-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 28px 0;
  position: relative;
}

.callout-box.security {
  border-left: 4px solid var(--status-danger);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.05) 0%, var(--bg-card) 100%);
}

.callout-box.security-core {
  border: 2px solid var(--status-danger);
  background: rgba(244, 63, 94, 0.09);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.15);
}

.callout-box.warning {
  border-left: 4px solid var(--status-warn);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-card) 100%);
}

.callout-box.official {
  border-left: 4px solid var(--accent-pink);
  background: linear-gradient(180deg, rgba(255, 0, 122, 0.06) 0%, var(--bg-card) 100%);
}

.callout-box.tip {
  border-left: 4px solid var(--accent-cyan);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.05) 0%, var(--bg-card) 100%);
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 10px;
}

.callout-box.security .callout-header { color: #fda4af; }
.callout-box.warning .callout-header { color: #fde68a; }
.callout-box.official .callout-header { color: #f472b6; }
.callout-box.tip .callout-header { color: #67e8f9; }

.callout-box p:last-child {
  margin-bottom: 0;
}

/* High-Impact Domain Cards */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.2s ease;
  position: relative;
}

.domain-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.domain-purpose {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.domain-address {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-cyan);
  word-break: break-all;
}

.domain-card .badge-verified {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Feature Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 28px 0 34px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

table.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

table.custom-table th {
  background: #0b0f1a;
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-card);
}

table.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
  vertical-align: top;
}

table.custom-table tr:last-child td {
  border-bottom: none;
}

table.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

table.custom-table td strong {
  color: var(--text-white);
}

/* Step-by-Step Guide */
.steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 28px 0 36px;
}

.step-card {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
}

.step-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(4px);
}

.step-number {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 800;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 14px var(--accent-pink-glow);
}

.step-body h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 6px;
}

.step-body p {
  margin-bottom: 0;
  font-size: 0.98rem;
  color: var(--text-body);
}

/* Red Flags Checklist */
.red-flags-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 24px 0 32px;
}

.red-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.red-flag-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--status-danger);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.red-flag-text {
  color: #fecdd3;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Official Action Box (CTA Box) */
.official-cta-card {
  background: linear-gradient(135deg, rgba(255, 0, 122, 0.12) 0%, rgba(121, 40, 202, 0.12) 100%);
  border: 1px solid rgba(255, 0, 122, 0.35);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  text-align: center;
  margin: 36px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.official-cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-pink-glow) 0%, transparent 70%);
  pointer-events: none;
}

.official-cta-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 10px;
}

.official-cta-card p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 22px;
  font-size: 1.02rem;
}

.btn-primary-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-brand);
  color: #ffffff !important;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(255, 0, 122, 0.45);
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 0, 122, 0.6);
  text-decoration: none;
}

.official-cta-card .card-note {
  display: block;
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* FAQ Section */
.faq-container {
  margin: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all 0.2s ease;
  overflow: hidden;
}

.faq-item[open] {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.faq-question {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-white);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
  fill: var(--accent-pink);
  flex-shrink: 0;
}

.faq-item[open] .faq-icon-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 22px 20px;
  color: var(--text-body);
  font-size: 0.98rem;
  line-height: 1.7;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-card);
  background: #060910;
  padding: 60px 0 30px;
  margin-top: 80px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about p {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 14px;
}

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

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent-pink);
  text-decoration: none;
}

.footer-disclaimer-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 28px;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.footer-disclaimer-box strong {
  color: var(--text-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8125rem;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  h1.hero-title {
    font-size: 1.95rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .main-navigation {
    order: 3;
    width: 100%;
    justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
  }

  .btn-header-cta {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .toc-list {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .step-card {
    flex-direction: column;
    gap: 12px;
  }
}
