/*
 * Confluxis / Synfluxcon — style.css
 * The anti-brand. Signal into static.
 *
 * Inverts the Confluxys palette: warm becomes dominant,
 * cool recedes. Structure drifts. Edges blur.
 */

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

/* ── Tokens (Confluxys palette, inverted roles) ───────── */
:root {
  --cx-night-0: #2E3440;
  --cx-night-1: #3B4252;
  --cx-night-2: #434C5E;
  --cx-night-3: #4C566A;
  --cx-snow-0: #D8DEE9;
  --cx-snow-1: #E5E9F0;
  --cx-snow-2: #ECEFF4;
  --cx-frost-0: #8FBCBB;
  --cx-frost-1: #88C0D0;
  --cx-frost-2: #81A1C1;
  --cx-frost-3: #5E81AC;
  --cx-aurora-red:    #BF616A;
  --cx-aurora-orange: #D08770;
  --cx-aurora-yellow: #EBCB8B;
  --cx-aurora-green:  #A3BE8C;
  --cx-aurora-purple: #B48EAD;
  --cx-font-body: 'Inter', -apple-system, sans-serif;
  --cx-font-mono: 'JetBrains Mono', monospace;

  /* entropy variables */
  --drift-1: 0.3deg;
  --drift-2: -0.2deg;
  --drift-3: 0.15deg;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--cx-font-body);
  background: var(--cx-night-0);
  color: var(--cx-snow-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* selection is noise — frost instead of warm */
::selection {
  background: var(--cx-frost-3);
  color: var(--cx-snow-2);
}

a { color: var(--cx-aurora-orange); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--cx-aurora-red); }

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(var(--drift-1)); }
  50%  { transform: rotate(var(--drift-2)); }
  75%  { transform: rotate(var(--drift-3)); }
  100% { transform: rotate(0deg); }
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20%  { transform: translate(-1px, 1px); }
  40%  { transform: translate(1px, -1px); }
  60%  { transform: translate(-1px, 0); }
  80%  { transform: translate(1px, 1px); }
}

@keyframes noiseIn {
  0%   { opacity: 0; filter: blur(8px); letter-spacing: 0.5em; }
  60%  { opacity: 0.7; filter: blur(2px); letter-spacing: 0.15em; }
  100% { opacity: 1; filter: blur(0); letter-spacing: 0.08em; }
}

@keyframes drawPathSlow {
  to { stroke-dashoffset: 0; }
}

@keyframes pathDecay {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0.35; }
}

@keyframes staticFlicker {
  0%, 100% { opacity: 0.03; }
  50%      { opacity: 0.06; }
}

/* ── Layout ───────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Static noise background ──────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  animation: staticFlicker 4s ease-in-out infinite;
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  padding: 2rem 0 0;
  border-bottom: 1px solid var(--cx-night-2);
  position: relative;
  z-index: 1;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* The anti-logo: just the confluence point, no paths */
.header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cx-night-3);
  flex-shrink: 0;
  transition: background 0.3s;
}

.header-dot:hover {
  background: var(--cx-frost-3);
}

.header-title {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--cx-night-3);
}

.header-title .is { color: var(--cx-frost-3); }

.header-tagline {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--cx-night-3);
  margin-left: auto;
}

.site-nav {
  padding: 0.75rem 0;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--cx-night-3);
  border-radius: 4px;
  transition: background 0.2s, color 0.3s;
}

.site-nav a:hover {
  background: var(--cx-night-1);
  color: var(--cx-snow-0);
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 0 4.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--cx-night-2);
  position: relative;
  z-index: 1;
}

/* The anti-logo in the hero: a dot that pulses once then goes still */
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cx-night-3);
  margin: 0 auto 2rem;
  opacity: 0;
  animation: dotAppear 3s ease 0.3s forwards;
}

@keyframes dotAppear {
  0%   { opacity: 0; transform: scale(0); }
  15%  { opacity: 0.6; transform: scale(3); background: var(--cx-frost-3); }
  30%  { opacity: 0.3; transform: scale(1.5); }
  50%  { opacity: 0.8; transform: scale(1); background: var(--cx-night-3); }
  100% { opacity: 0.4; transform: scale(1); background: var(--cx-night-3); }
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: noiseIn 2s ease 1.5s forwards;
}

.hero h1 .is   { color: var(--cx-frost-3); }
.hero h1 .base { color: var(--cx-night-3); }

.hero-sub {
  font-size: 1rem;
  color: var(--cx-snow-0);
  font-style: italic;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeIn 1.5s ease 2.8s forwards;
}

.hero-rule {
  width: 60px;
  height: 2px;
  margin: 0 auto 2rem;
  /* inverted gradient: orange → blue (warm dissolves into cool) */
  background: linear-gradient(90deg, var(--cx-aurora-orange), var(--cx-frost-3));
  border: none;
  opacity: 0;
  animation: fadeIn 1s ease 3.3s forwards;
}

.hero-blurb {
  max-width: 560px;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--cx-snow-0);
  line-height: 1.8;
  opacity: 0;
  animation: slideUp 1s ease 3.8s forwards;
}

.hero-blurb strong {
  color: var(--cx-snow-0);
  font-weight: 500;
}

/* ── Sections ─────────────────────────────────────────── */
.content-section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--cx-night-2);
  position: relative;
  z-index: 1;
}

.content-section:last-child { border-bottom: none; }

.section-heading {
  font-size: 0.7rem;
  font-family: var(--cx-font-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cx-night-3);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cx-night-2);
}

/* ── Inversion table ──────────────────────────────────── */
.inversion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.inversion-col {
  background: var(--cx-night-1);
  padding: 2.5rem;
  transition: background 0.3s;
}

.inversion-col:hover { background: var(--cx-night-2); }

.inversion-col.signal { border-right: 1px solid var(--cx-night-0); }

.inversion-col h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.inversion-col.signal h3 { color: var(--cx-aurora-orange); }
.inversion-col.static h3 { color: var(--cx-frost-3); }

.inversion-col .subtitle {
  font-family: var(--cx-font-mono);
  font-size: 0.75rem;
  color: var(--cx-night-3);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.inversion-col p {
  font-size: 0.9rem;
  color: var(--cx-snow-1);
  line-height: 1.65;
}

/* ── Argument blocks ──────────────────────────────────── */
.argument {
  margin-bottom: 2.5rem;
}

.argument:last-child { margin-bottom: 0; }

.argument h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cx-snow-0);
  margin-bottom: 0.75rem;
}

.argument p {
  font-size: 0.95rem;
  color: var(--cx-snow-0);
  line-height: 1.75;
  max-width: 620px;
  margin-bottom: 1rem;
}

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

.argument strong { color: var(--cx-snow-0); font-weight: 500; }

.argument em { color: var(--cx-aurora-purple); font-style: italic; }

/* ── Blockquotes (cold, not warm) ─────────────────────── */
blockquote {
  border-left: 3px solid var(--cx-frost-3);
  padding: 0.75rem 0 0.75rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: var(--cx-snow-0);
  font-weight: 400;
  max-width: 580px;
}

/* ── Code (exposed, raw) ──────────────────────────────── */
code {
  font-family: var(--cx-font-mono);
  font-size: 0.85em;
  background: var(--cx-night-1);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--cx-aurora-red);
}

/* ── Comparison table ─────────────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.85rem;
}

.compare-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--cx-night-3);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.compare-table th:first-child { color: var(--cx-night-3); }
.compare-table th.col-signal { color: var(--cx-aurora-orange); }
.compare-table th.col-static { color: var(--cx-frost-3); }

.compare-table td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--cx-night-2);
  color: var(--cx-snow-0);
}

.compare-table td:first-child {
  font-family: var(--cx-font-mono);
  font-size: 0.7rem;
  color: var(--cx-night-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compare-table tr:hover td { background: var(--cx-night-1); }

/* ── Counter link ─────────────────────────────────────── */
.counter-link {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cx-aurora-orange);
  border: 1px solid var(--cx-night-3);
  border-radius: 4px;
  transition: all 0.3s;
}

.counter-link:hover {
  border-color: var(--cx-aurora-orange);
  color: var(--cx-snow-2);
  background: var(--cx-night-1);
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--cx-night-2);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-rule {
  width: 60px;
  height: 2px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(90deg, var(--cx-aurora-orange), var(--cx-frost-3));
  border: none;
}

.site-footer p {
  font-family: var(--cx-font-mono);
  font-size: 0.7rem;
  color: var(--cx-night-3);
  letter-spacing: 0.04em;
}

/* ── Glitch hover on headings ─────────────────────────── */
.glitch-hover:hover {
  animation: glitch 0.3s ease;
}

/* ── Main ─────────────────────────────────────────────── */
main { padding: 2.5rem 0 4rem; }

/* ── Categories (pills — formal taxonomy) ─────────────── */
.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: var(--cx-night-1);
  border: 1px solid var(--cx-night-3);
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.category-pill:hover {
  background: var(--cx-night-2);
  border-color: var(--cx-frost-2);
}

.category-pill a {
  color: var(--cx-snow-0);
  font-weight: 500;
  font-size: 0.85rem;
}

.category-pill:hover a { color: var(--cx-frost-1); }

.category-pill .count {
  font-family: var(--cx-font-mono);
  font-size: 0.6rem;
  color: var(--cx-snow-0);
  background: var(--cx-night-2);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  min-width: 1.4rem;
  text-align: center;
}

/* ── Article cards ────────────────────────────────────── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.article-card {
  background: var(--cx-night-1);
  padding: 1.25rem 1.5rem;
  transition: background 0.2s;
}

.article-card:hover { background: var(--cx-night-2); }

.article-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.article-card h3 a { color: var(--cx-snow-0); }
.article-card h3 a:hover { color: var(--cx-frost-1); }

.article-meta {
  font-family: var(--cx-font-mono);
  font-size: 0.7rem;
  color: var(--cx-night-3);
  letter-spacing: 0.03em;
}

.article-meta a { color: var(--cx-frost-2); }

.article-summary {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--cx-snow-0);
}

/* ── Page title ───────────────────────────────────────── */
h2.page-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--cx-snow-0);
  margin-bottom: 2rem;
}

/* ── Back link ────────────────────────────────────────── */
.back-link {
  display: inline-block;
  font-family: var(--cx-font-mono);
  font-size: 0.75rem;
  color: var(--cx-night-3);
  margin-bottom: 2rem;
  letter-spacing: 0.03em;
}

.back-link:hover { color: var(--cx-frost-1); }

/* ── Article page content ─────────────────────────────── */
.article-content {
  max-width: 680px;
}

.article-content h1 {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--cx-snow-0);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.article-header-meta {
  font-family: var(--cx-font-mono);
  font-size: 0.75rem;
  color: var(--cx-night-3);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cx-night-2);
}

.article-header-meta a { color: var(--cx-frost-2); }

.article-content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--cx-snow-0);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-content h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--cx-snow-0);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-content p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  color: var(--cx-snow-0);
}

.article-content a { color: var(--cx-frost-1); border-bottom: 1px solid transparent; }
.article-content a:hover { border-bottom-color: var(--cx-frost-1); }

.article-content strong { color: var(--cx-snow-0); font-weight: 500; }
.article-content em { color: var(--cx-aurora-purple); }

.article-content ul, .article-content ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--cx-snow-0);
}

.article-content li {
  margin-bottom: 0.35rem;
  line-height: 1.65;
}

.article-content pre {
  background: var(--cx-night-1);
  border: 1px solid var(--cx-night-3);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--cx-snow-0);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.article-content th {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--cx-night-3);
  color: var(--cx-snow-0);
  font-weight: 600;
  font-size: 0.8rem;
}

.article-content td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--cx-night-2);
  color: var(--cx-snow-0);
}

.article-content hr {
  border: none;
  height: 1px;
  background: var(--cx-night-3);
  margin: 2.5rem 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .header-tagline { display: none; }
  .hero h1 { font-size: 2rem; }
  .inversion { grid-template-columns: 1fr; }
  .inversion-col.signal { border-right: none; border-bottom: 1px solid var(--cx-night-0); }
  .categories-grid { gap: 0.35rem; }
}
