/* ══ SeedCrypt Design System ══════════════════════════════════════════════ */

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

:root {
  --bg:        #030308;
  --surface:   #09091280; /* page-level token — used by inline styles */
  --card:      #0D0D1A;
  --border:    rgba(255,255,255,0.07);
  --purple:    #8B5CF6;
  --purple-br: #A78BFA;
  --purple-gw: rgba(139,92,246,0.35); /* page-level token — used by inline styles */
  --green:     #0DFFA3;
  --red:       #FF4757;
  --text:      #E8E8F5;
  --text-dim:  #6B6B8A;
  --text-muted:rgba(232,232,245,0.35);
  --mono:      'JetBrains Mono', monospace;
  --sans:      'DM Sans', sans-serif;
  --display:   'Chakra Petch', sans-serif;
  --r:         20px; /* page-level token — border-radius for cards */
}

html { scroll-behavior: smooth; }

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

/* Grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ══════════════════════════════════════════════════════
   TYPOGRAPHY UTILS
══════════════════════════════════════════════════════ */
.mono { font-family: var(--mono); }

.gradient-text {
  background: linear-gradient(135deg, #C4B5FD 0%, #8B5CF6 40%, var(--green) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  background-size: 200% 200%;
  animation: grad-shift 6s ease infinite;
}

@keyframes grad-shift {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ══════════════════════════════════════════════════════
   NAV
══════════════════════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 66px;
  background: rgba(3,3,8,0.75);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s;
}

#nav.solid {
  border-color: rgba(139,92,246,0.18);
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

.nav-inner {
  width: 100%; height: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 2.5rem;
}

.nav-right {
  display: flex; align-items: center; gap: 10px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
}

.nav-links {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: 0; height: 66px;
  display: flex; align-items: center; gap: 2rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  color: var(--text-dim);
  z-index: 101;
}

.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.nav-dl {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 10px;
  background: linear-gradient(135deg, #9B6BFF, #7C3AED);
  color: #fff; font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  box-shadow: 0 0 24px rgba(139,92,246,0.35);
  transition: filter 0.2s, transform 0.2s;
}
.nav-dl:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════
   HAMBURGER & MOBILE MENU
══════════════════════════════════════════════════════ */
.ham-btn {
  display: none;
  position: absolute; top: 50%; right: 1.25rem; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text-dim); cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  transition: all 0.2s; flex-shrink: 0; padding: 0;
}
.ham-btn span {
  display: block; width: 16px; height: 2px;
  background: currentColor; border-radius: 2px;
}
.ham-btn:hover {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.4);
  color: var(--purple-br);
}
.mobile-menu {
  display: none;
  position: fixed; top: 66px; left: 0; right: 0; z-index: 99;
  background: rgba(3,3,8,0.96);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: block; }
.mobile-menu-inner {
  padding: 1rem 5vw 1.4rem;
  display: flex; flex-direction: column;
}
.mobile-menu-inner a {
  font-family: var(--mono); font-size: 0.83rem; font-weight: 500;
  color: var(--text-dim); padding: 0.78rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-menu-inner a:last-of-type { border-bottom: none; }
.mobile-menu-inner a:hover { color: var(--text); padding-left: 6px; }
.mobile-menu-dl {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 1rem; padding: 11px 18px; border-radius: 10px;
  background: linear-gradient(135deg, #9B6BFF, #7C3AED);
  color: #fff !important; font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  box-shadow: 0 0 24px rgba(139,92,246,0.35);
  border-bottom: none !important; padding-left: 18px !important;
  transition: filter 0.2s !important;
}
.mobile-menu-dl:hover { filter: brightness(1.12); }

/* ══════════════════════════════════════════════════════
   LANG & THEME BUTTONS
══════════════════════════════════════════════════════ */
.lang-btn {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid rgba(139,92,246,0.2); color: var(--text-dim);
  background: transparent; cursor: pointer; transition: all 0.15s;
}
.lang-btn:hover { background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.5); color: var(--purple-br); }
.lang-btn.active { border-color: rgba(139,92,246,0.55); color: var(--purple-br); background: rgba(139,92,246,0.08); }

.theme-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.theme-btn:hover {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.4);
  color: var(--purple-br);
}

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.btn-p {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 28px; border-radius: 16px;
  background: linear-gradient(135deg, #9B6BFF, #7C3AED);
  color: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer;
  box-shadow: 0 0 32px rgba(139,92,246,0.4), 0 6px 24px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.btn-p::after {
  content: ''; position: absolute;
  top: -50%; left: -100%; width: 60%; height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
}
.btn-p:hover { transform: translateY(-3px); box-shadow: 0 0 50px rgba(139,92,246,0.55), 0 10px 36px rgba(0,0,0,0.6); }
.btn-p:hover::after { animation: shine 0.55s ease forwards; }

.btn-s {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 28px; border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03);
  color: var(--text-dim); font-weight: 600; font-size: 0.95rem; cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.btn-s:hover {
  border-color: rgba(139,92,246,0.5); color: var(--purple-br);
  background: rgba(139,92,246,0.07); transform: translateY(-3px);
}

.btn-sub { font-size: 0.7rem; font-weight: 400; opacity: 0.6; font-family: var(--mono); }
.btn-row { display: flex; align-items: center; gap: 8px; }

@keyframes shine { to { left: 150%; } }

.pbtn {
  display: block; text-align: center; padding: 10px; border-radius: 12px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  transition: all 0.2s; cursor: pointer;
}
.pbtn-out { border: 1px solid rgba(139,92,246,0.35); color: var(--purple-br); background: transparent; }
.pbtn-out:hover { background: rgba(139,92,246,0.09); border-color: rgba(139,92,246,0.6); }
.pbtn-hot { background: linear-gradient(135deg, #8B5CF6, #6D28D9); color: #fff; border: none; box-shadow: 0 0 22px rgba(139,92,246,0.35); }
.pbtn-hot:hover { filter: brightness(1.12); box-shadow: 0 0 34px rgba(139,92,246,0.55); }

/* ══════════════════════════════════════════════════════
   PILLS
══════════════════════════════════════════════════════ */
.hero-trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem;
  margin-bottom: 4rem;
  opacity: 0; animation: fadein-up 0.8s cubic-bezier(0.16,1,0.3,1) 1.05s forwards;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 100px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  font-family: var(--mono); font-size: 0.67rem; color: var(--text-dim);
  transition: all 0.2s;
}
.pill:hover { border-color: rgba(139,92,246,0.4); color: var(--purple-br); background: rgba(139,92,246,0.06); }
.pill-g { border-color: rgba(13,255,163,0.22); color: var(--green); background: rgba(13,255,163,0.04); }

/* ══════════════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════════════ */
.sec { padding: 100px 5vw; }
.sec-inner { max-width: 1100px; margin: 0 auto; }
.sec-narrow { max-width: 680px; margin: 0 auto; }

.sec-head { text-align: center; margin-bottom: 64px; }

.sec-label {
  display: inline-block;
  font-family: var(--mono); font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--purple-br);
  margin-bottom: 1rem;
}

.sec-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.1;
}

.sec-sub {
  margin-top: 1rem; font-size: 1rem; color: var(--text-dim);
  max-width: 520px; margin-left: auto; margin-right: auto;
  line-height: 1.75; font-weight: 300;
}

/* ══════════════════════════════════════════════════════
   REVEAL ANIMATION
══════════════════════════════════════════════════════ */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1), transform 0.85s cubic-bezier(0.16,1,0.3,1);
}
.reveal.vis { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; }
.d5 { transition-delay: 0.5s; }

@keyframes fadein     { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadein-up  { from { opacity: 0; transform: translateY(26px); filter: blur(4px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
footer {
  padding: 56px 5vw; border-top: 1px solid var(--border);
  text-align: center; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.ft-logo { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: 0.88rem; color: var(--text-dim); }
.ft-links { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 12px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }
.ft-links a { transition: color 0.2s; }
.ft-links a:hover { color: var(--purple-br); }
.ft-sep { opacity: 0.3; }
.ft-copy { font-family: var(--mono); font-size: 0.65rem; color: rgba(107,107,138,0.35); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .nav-inner { display: flex; justify-content: space-between; }
  .nav-links { display: none; }
  .nav-right { display: none; }
  .ham-btn { display: flex; }
}
@media (max-width: 600px) {
  .nav-inner { padding: 0 1.25rem; }
  .sec { padding: 60px 5vw; }
}

/* ══════════════════════════════════════════════════════
   LIGHT THEME — shared components only
══════════════════════════════════════════════════════ */
html.light {
  color-scheme: light;
  --bg:         #F0F0F8;
  --card:       #FFFFFF;
  --border:     rgba(0,0,0,0.09);
  --text:       #0D0D1E;
  --text-dim:   #5A5A80;
  --text-muted: rgba(13,13,30,0.35);
  --purple:     #7C3AED;
  --purple-br:  #6D28D9;
  --green:      #00A86B;
}

html.light body { background: #F0F0F8; color: #0D0D1E; }
html.light body::after { opacity: 0.025; }

/* Scrollbar */
html.light ::-webkit-scrollbar-track { background: #F0F0F8; }
html.light ::-webkit-scrollbar-thumb { background: rgba(109,40,217,0.3); }

/* Nav */
html.light #nav {
  background: rgba(240,240,248,0.88);
  border-color: rgba(0,0,0,0.08);
}
html.light #nav.solid {
  border-color: rgba(109,40,217,0.14);
  box-shadow: 0 4px 32px rgba(0,0,0,0.07);
}
html.light .nav-links a { color: #5A5A80; }
html.light .nav-links a:hover { color: #0D0D1E; }
html.light .ham-btn { border-color: rgba(0,0,0,0.09); color: #5A5A80; background: rgba(0,0,0,0.03); }
html.light .ham-btn:hover { background: rgba(109,40,217,0.07); border-color: rgba(109,40,217,0.2); color: #6D28D9; }
html.light .mobile-menu { background: rgba(240,240,248,0.97); }
html.light .mobile-menu-inner a { color: #5A5A80; border-color: rgba(0,0,0,0.09); }
html.light .mobile-menu-inner a:hover { color: #0D0D1E; }
html.light .lang-btn { border-color: rgba(109,40,217,0.2); color: #5A5A80; }
html.light .lang-btn:hover { background: rgba(109,40,217,0.07); color: #6D28D9; }
html.light .lang-btn.active { color: #6D28D9; background: rgba(109,40,217,0.07); border-color: rgba(109,40,217,0.4); }
html.light .theme-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: #5A5A80; }
html.light .theme-btn:hover { background: rgba(109,40,217,0.08); border-color: rgba(109,40,217,0.3); color: #6D28D9; }

/* Buttons */
html.light .btn-s {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.12);
  color: #5A5A80;
}
html.light .btn-s:hover {
  background: rgba(109,40,217,0.06);
  border-color: rgba(109,40,217,0.4);
  color: #6D28D9;
}
html.light .pbtn-out { border-color: rgba(109,40,217,0.3); color: #6D28D9; }
html.light .pbtn-out:hover { background: rgba(109,40,217,0.07); border-color: rgba(109,40,217,0.55); }

/* Pills */
html.light .pill { border-color: rgba(0,0,0,0.09); background: rgba(255,255,255,0.6); color: #5A5A80; }
html.light .pill:hover { border-color: rgba(109,40,217,0.35); color: #6D28D9; background: rgba(109,40,217,0.05); }
html.light .pill-g { border-color: rgba(0,168,107,0.25); color: #00875A; background: rgba(0,168,107,0.04); }

/* Section labels */
html.light .sec-label { color: #6D28D9; }
html.light .sec-title { color: #0D0D1E; }
html.light .sec-sub { color: #5A5A80; }

/* Gradient text */
html.light .gradient-text {
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 40%, #059669 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Footer */
html.light footer { border-color: rgba(0,0,0,0.08); }
html.light .ft-logo { color: #5A5A80; }
html.light .ft-links { color: #5A5A80; }
html.light .ft-links a:hover { color: #6D28D9; }
html.light .ft-copy { color: rgba(90,90,128,0.4); }

/* ── TOC sidebar (blog articles) ──────────────────────────────────────────── */
#toc { display: none !important; }

@media (min-width: 1100px) {
  #toc.toc-ready {
    display: block !important;
    position: fixed;
    top: 110px;
    left: calc(50% - 370px - 220px);
    width: 180px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    transition: opacity 0.3s;
  }
  #toc .toc-label {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: block;
  }
  #toc a {
    display: block;
    font-size: 0.76rem;
    color: var(--text-dim);
    padding: 5px 12px;
    border-left: 2px solid var(--border);
    transition: color 0.2s, border-color 0.2s;
    line-height: 1.5;
    font-weight: 300;
  }
  #toc a:hover { color: var(--purple-br); border-left-color: rgba(139,92,246,0.4); }
  #toc a.active { color: var(--purple-br); border-left-color: var(--purple-br); font-weight: 500; }
}

html.light #toc a { color: #5A5A80; border-left-color: rgba(0,0,0,0.1); }
html.light #toc a:hover { color: #6D28D9; border-left-color: rgba(109,40,217,0.3); }
html.light #toc a.active { color: #6D28D9; border-left-color: #6D28D9; }
html.light #toc .toc-label { color: #9CA3AF; }

/* ── Article category badge colors ───────────────────────────────────────── */
.art-cat.cat-security   { color: #F59E0B !important; background: rgba(245,158,11,0.08) !important; border-color: rgba(245,158,11,0.25) !important; }
.art-cat.cat-guide      { color: #60A5FA !important; background: rgba(96,165,250,0.08) !important;  border-color: rgba(96,165,250,0.25) !important; }
.art-cat.cat-crypto     { color: #A78BFA !important; background: rgba(167,139,250,0.08) !important; border-color: rgba(167,139,250,0.25) !important; }
.art-cat.cat-comparison { color: #2DD4BF !important; background: rgba(45,212,191,0.08) !important;  border-color: rgba(45,212,191,0.25) !important; }

html.light .art-cat.cat-security   { color: #B45309 !important; background: rgba(245,158,11,0.07) !important;  border-color: rgba(245,158,11,0.3) !important; }
html.light .art-cat.cat-guide      { color: #1D4ED8 !important; background: rgba(37,99,235,0.06) !important;   border-color: rgba(37,99,235,0.22) !important; }
html.light .art-cat.cat-crypto     { color: #6D28D9 !important; background: rgba(109,40,217,0.06) !important;  border-color: rgba(109,40,217,0.22) !important; }
html.light .art-cat.cat-comparison { color: #0D9488 !important; background: rgba(13,148,136,0.06) !important;  border-color: rgba(13,148,136,0.22) !important; }
