/* CTX-Crypto — Base Reset + Typography + Layout */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; display: block; }

h1 { font-size: 2rem; font-weight: 800; margin-bottom: var(--gap); }
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: var(--gap); }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gap); }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; align-items: center; gap: var(--gap); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Header / Nav */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
}
.nav { height: 64px; }
.logo {
  font-size: 1.4rem; font-weight: 800;
  color: var(--primary); letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo span { color: var(--text); }
.nav-links {
  display: flex; align-items: center; gap: 32px;
}
.nav-links a {
  color: var(--text-secondary); font-weight: 600;
  font-size: 0.9rem; transition: color 0.2s;
  position: relative; padding: 6px 4px;
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px; background: var(--primary);
  transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 4px;
}
.dropdown-arrow {
  font-size: 0.65em; transition: transform 0.2s; display: inline-block;
}
.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 220px; padding: 8px 0; z-index: 200;
}
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-secondary); font-size: 0.85rem;
  font-weight: 500; transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-card-hover); color: var(--primary);
}
.nav-dropdown-menu a .dd-icon {
  font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0;
}

.nav-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; white-space: nowrap; flex-wrap: nowrap;
}
/* Language Switcher */
.lang-switcher {
  flex-shrink: 0;
}
.lang-switcher select {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; outline: none;
  min-width: 52px;
  -webkit-appearance: none; appearance: none;
}
/* Hamburger Button */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 32px; height: 32px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--gap-lg) 0;
  margin-top: 48px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--primary); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: var(--primary); color: #fff; }
