/* ============================================================
   ETC Tracker — Design System
   Dark fintech aesthetic for Ethereum Classic tracking
   ============================================================ */

/* --- Tokens --- */
:root {
  /* Palette */
  --bg:          #0a0e14;
  --bg-elevated: #111820;
  --surface:     #161d27;
  --surface-alt: #1c2533;
  --border:      #242d3a;
  --border-light:#2e3a4a;

  --text:        #e8edf4;
  --text-mid:    #a0aab8;
  --text-muted:  #6b7a8d;

  --accent:      #3ecf8e;       /* ETC green — primary brand */
  --accent-dim:  rgba(62,207,142,.12);
  --accent-glow: rgba(62,207,142,.25);
  --blue:        #4ea8de;
  --red:         #ef6461;
  --red-dim:     rgba(239,100,97,.12);
  --amber:       #f0b752;

  /* Typography */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Fira Code", monospace;

  /* Scale (modular 1.25) */
  --fs-xs:  .75rem;
  --fs-sm:  .8125rem;
  --fs-base: 1rem;
  --fs-md:  1.125rem;
  --fs-lg:  1.25rem;
  --fs-xl:  1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.75rem;
  --fs-4xl: 3.5rem;

  /* Spacing */
  --sp-xs: .25rem;
  --sp-sm: .5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2.5rem;
  --sp-2xl: 4rem;
  --sp-3xl: 6rem;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* Transition */
  --ease: cubic-bezier(.4,0,.2,1);
}

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

/* --- Base --- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: .5rem 1rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  z-index: 999;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

/* --- Container --- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}
.container--wide {
  max-width: 1080px;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,20,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s var(--ease);
}
.site-header.scrolled {
  box-shadow: var(--shadow-md);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
}
.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--bg);
  flex-shrink: 0;
}
.logo-accent {
  color: var(--accent);
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}
.main-nav a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: .01em;
  transition: color .2s var(--ease);
}
.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
}
.main-nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width .25s var(--ease);
}
.main-nav a:hover::after {
  width: 100%;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: var(--sp-xl) 0 var(--sp-lg);
  text-align: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: .25;
}

.hero-overline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: var(--sp-md);
}
.hero-overline .pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { opacity: .7; box-shadow: 0 0 0 6px transparent; }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: var(--sp-sm);
  position: relative;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============================================================
   Stats bar
   ============================================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--sp-3xl);
}
.stat-item {
  background: var(--surface);
  padding: var(--sp-lg) var(--sp-md);
  text-align: center;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.stat-value.up { color: var(--accent); }
.stat-value.down { color: var(--red); }
.stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: var(--sp-xs);
}

/* ============================================================
   Section headings
   ============================================================ */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.section-header .view-all {
  font-size: var(--fs-sm);
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity .2s;
}
.section-header .view-all:hover { opacity: .75; }

/* ============================================================
   Post cards
   ============================================================ */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding-bottom: var(--sp-xl);
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .25s var(--ease),
              box-shadow .25s var(--ease),
              transform .25s var(--ease);
}
.post-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.post-card a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  text-decoration: none;
  color: inherit;
}
.post-card-body {
  min-width: 0;
}
.post-card h3 {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-card time {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.post-card p {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  margin-top: var(--sp-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .arrow {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  transition: color .2s, transform .2s;
  flex-shrink: 0;
}
.post-card:hover .arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ============================================================
   Single post
   ============================================================ */
.post {
  padding: var(--sp-2xl) 0 var(--sp-3xl);
}
.post-header {
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--border);
}
.post-header h1 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: var(--sp-sm);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
}
.post-meta time {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.post-meta .tag {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Post content */
.post-content {
  font-size: var(--fs-base);
  line-height: 1.8;
}
.post-content h2 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text);
  margin: var(--sp-xl) 0 var(--sp-md);
  letter-spacing: -.01em;
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  margin: var(--sp-lg) 0 var(--sp-sm);
}
.post-content p {
  margin: var(--sp-md) 0;
  color: var(--text-mid);
}
.post-content strong {
  color: var(--text);
  font-weight: 600;
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .2s;
}
.post-content a:hover {
  text-decoration-color: transparent;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-xl) 0;
}
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin: var(--sp-md) 0;
}
.post-content li {
  margin: var(--sp-sm) 0;
  color: var(--text-mid);
}
.post-content li::marker {
  color: var(--accent);
}
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--sp-sm) var(--sp-lg);
  margin: var(--sp-lg) 0;
  background: var(--accent-dim);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-mid);
  font-style: italic;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}
.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  overflow-x: auto;
  margin: var(--sp-lg) 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: var(--fs-sm);
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-lg) 0;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.post-content th {
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: var(--sp-sm) var(--sp-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.post-content td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.post-content tr:last-child td {
  border-bottom: none;
}
.post-content tr:hover td {
  background: var(--bg-elevated);
}

/* ============================================================
   Post navigation
   ============================================================ */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--border);
}
.post-nav a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.post-nav a:hover {
  color: var(--accent);
}

/* ============================================================
   List / Archive page
   ============================================================ */
.list-header {
  padding: var(--sp-2xl) 0 var(--sp-lg);
}
.list-header h1 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-xl) 0 var(--sp-2xl);
}
.pagination a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.pagination span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-xl) 0;
  margin-top: var(--sp-2xl);
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: -.01em;
}
.site-footer p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity .2s;
}
.site-footer a:hover { opacity: .75; }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--sp-3xl) 0;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-md);
  opacity: .5;
}
.empty-state p {
  font-size: var(--fs-sm);
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================================
   Scroll reveal
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Focus visible
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --fs-4xl: 1.75rem;
    --fs-3xl: 1.5rem;
    --fs-2xl: 1.3rem;
  }
  .site-header .container {
    height: 52px;
  }
  .hero {
    padding: var(--sp-lg) 0 var(--sp-md);
  }
  .stats-bar {
    grid-template-columns: 1fr;
  }
  .post-card a {
    padding: var(--sp-md);
  }
  .post-nav {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-4xl: 1.5rem;
    --fs-2xl: 1.15rem;
    --fs-xl: 1.1rem;
  }
  .container {
    padding: 0 var(--sp-md);
  }
  .main-nav {
    gap: var(--sp-md);
  }
  .post-card h3 {
    white-space: normal;
  }
}
