/* ============================================
   The Nexus Journey — Dark Ledger Theme
   Financial editorial journal aesthetic
   ============================================ */

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

:root {
  --bg: #0D0D0F;
  --bg-surface: #16161A;
  --bg-elevated: #1C1C21;
  --text: #EDEDEC;
  --text-muted: #8B8B8D;
  --text-dim: #5A5A5C;
  --accent: #D4A843;
  --accent-hover: #E8C468;
  --accent-subtle: rgba(212, 168, 67, 0.12);
  --accent-border: rgba(212, 168, 67, 0.25);
  --border: #2A2A2E;
  --border-subtle: #1F1F23;
  --radius: 2px;
  --max-width: 1140px;
  --content-width: 720px;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

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

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

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

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

/* ---------- Sticky Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-decoration: none;
}
.nav-logo:hover { color: var(--accent-hover); }

.nav-links { display: flex; gap: 32px; align-items: center; }

.nav-links a {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ---------- Challenge Ticker ---------- */
.ticker {
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
  overflow: hidden;
}

.ticker-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.ticker-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.ticker-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ticker-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.ticker-value.gold {
  color: var(--accent);
}

.ticker-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---------- Hero (Index) ---------- */
.hero {
  padding: 96px 0 72px;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  display: block;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 24px;
  max-width: 700px;
}

.hero .description {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-rule {
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin-top: 48px;
  border: none;
}

/* ---------- Section Labels ---------- */
.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

/* ---------- Featured Card ---------- */
.featured-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 48px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.featured-entry:hover {
  border-color: var(--accent-border);
}

.featured-day-col {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.featured-day-num {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  opacity: 0.08;
  position: absolute;
}

.featured-day-label {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.featured-content {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-content .card-date {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.featured-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.featured-content .card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.featured-content .read-link {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition), color var(--transition);
}
.featured-entry:hover .read-link { gap: 10px; color: var(--accent-hover); }

/* ---------- Day Card Grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 64px;
}

.day-card {
  background: var(--bg-surface);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background var(--transition);
}

.day-card:hover {
  background: var(--bg-elevated);
}

.day-card .day-num {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  opacity: 0.06;
  position: absolute;
  top: 16px;
  right: 20px;
  pointer-events: none;
}

.day-card .card-date {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.day-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.day-card .card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 20px;
  line-height: 1.6;
}

.day-card .read-link {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition), color var(--transition);
}
.day-card:hover .read-link { gap: 8px; color: var(--accent-hover); }

/* ---------- About Section (Index) ---------- */
.about-section {
  border-top: 1px solid var(--border);
  padding: 80px 0;
  margin-bottom: 0;
}

.about-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}

.about-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: 6px;
}

.about-body p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.cta-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 28px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}
.cta-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Day Post Page ---------- */
.post-breadcrumb {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
  font-size: 0.8rem;
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
}

.breadcrumb-inner a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.breadcrumb-inner a:hover { color: var(--text); }

/* Post Header */
.post-header {
  max-width: var(--content-width);
  margin: 64px auto 48px;
  padding: 0 24px;
}

.post-header .post-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.post-meta span { display: inline-flex; align-items: center; gap: 5px; }

.post-divider {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.post-divider hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin-bottom: 40px;
}

/* Post Content */
.post-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 56px;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.post-content h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 10px;
}

.post-content p {
  margin-bottom: 20px;
  color: var(--text);
  line-height: 1.85;
  font-size: 1.02rem;
}

.post-content ul, .post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 10px;
  line-height: 1.75;
  color: var(--text-muted);
}

.post-content li strong { color: var(--text); }

.post-content strong { color: var(--text); }

.post-content em { color: #A0A0A2; }

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 16px 24px;
  margin: 32px 0;
  color: var(--text-muted);
  background: var(--accent-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.86em;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius);
  color: var(--accent);
  border: 1px solid var(--border-subtle);
}

.post-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  margin: 28px 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Metrics grid */
.post-content .metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0;
}

.post-content .metric-card {
  background: var(--bg-surface);
  padding: 24px 16px;
  text-align: center;
}

.post-content .metric-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.post-content .metric-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Highlight / insight boxes */
.post-content .highlight-box,
.post-content .insight-card {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 28px 0;
}

.post-content .highlight-box h3,
.post-content .insight-card h3 {
  font-family: var(--font-display);
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

/* Product cards */
.post-content .product-showcase {
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0;
}

.post-content .product-card {
  background: var(--bg-surface);
  overflow: hidden;
}

.post-content .product-card.featured {
  border-left: 2px solid var(--accent);
}

.post-content .product-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.post-content .product-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.post-content .product-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 4px;
}

.post-content .product-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.post-content .product-content {
  padding: 24px 28px;
}

/* Audit cards */
.post-content .audit-grid {
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0;
}

.post-content .audit-card {
  background: var(--bg-surface);
  padding: 24px 28px;
}

.post-content .audit-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
}

.post-content .finding,
.post-content .recommendation,
.post-content .optimization {
  margin-bottom: 10px;
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Test priority cards */
.post-content .testing-priorities {
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0;
}

.post-content .test-card {
  background: var(--bg-surface);
  padding: 24px 28px;
}

.post-content .test-card h4 { margin-top: 0; }

.post-content .expected-impact {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.post-content .optimization-list {
  margin: 28px 0;
}

.post-content .optimization-list h4 {
  margin-top: 0;
}

/* Day badges */
.post-content .day-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  color: var(--accent);
  margin-bottom: 14px;
  border: 1px solid var(--accent-border);
}

.post-content .day-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.post-content .theme-tag {
  font-size: 0.72rem;
  padding: 3px 12px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ---------- Post Navigation ---------- */
.post-nav {
  max-width: var(--content-width);
  margin: 0 auto 64px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.post-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition);
}
.post-nav a:hover { color: var(--accent); }

.post-nav .disabled {
  color: var(--text-dim);
  pointer-events: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.site-footer p { margin-bottom: 6px; }

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero { animation: fadeUp 0.6s ease-out; }
.ticker { animation: fadeUp 0.5s ease-out 0.1s both; }
.featured-entry { animation: fadeUp 0.6s ease-out 0.2s both; }
.section-label { animation: fadeUp 0.5s ease-out 0.3s both; }
.card-grid { animation: fadeUp 0.6s ease-out 0.35s both; }

.day-card {
  animation: fadeUp 0.5s ease-out both;
}
.day-card:nth-child(1) { animation-delay: 0.4s; }
.day-card:nth-child(2) { animation-delay: 0.45s; }
.day-card:nth-child(3) { animation-delay: 0.5s; }
.day-card:nth-child(4) { animation-delay: 0.55s; }
.day-card:nth-child(5) { animation-delay: 0.6s; }
.day-card:nth-child(6) { animation-delay: 0.65s; }
.day-card:nth-child(7) { animation-delay: 0.7s; }
.day-card:nth-child(8) { animation-delay: 0.72s; }
.day-card:nth-child(9) { animation-delay: 0.74s; }
.day-card:nth-child(10) { animation-delay: 0.76s; }
.day-card:nth-child(11) { animation-delay: 0.78s; }
.day-card:nth-child(12) { animation-delay: 0.8s; }
.day-card:nth-child(13) { animation-delay: 0.82s; }
.day-card:nth-child(14) { animation-delay: 0.84s; }

/* Post page animations */
.post-header { animation: fadeUp 0.6s ease-out 0.1s both; }
.post-content { animation: fadeUp 0.6s ease-out 0.2s both; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(13, 13, 15, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 20px 24px 28px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: block; }

  .ticker-inner {
    gap: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .hero { padding: 56px 0 48px; }

  .hero h1 { font-size: clamp(2.2rem, 8vw, 3rem); }

  .featured-entry {
    grid-template-columns: 1fr;
  }

  .featured-day-col {
    padding: 32px;
    min-height: 120px;
  }

  .featured-content {
    padding: 28px 24px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-header { margin-top: 36px; }

  .post-meta { flex-direction: column; gap: 8px; }

  .post-nav { flex-direction: column; }

  .breadcrumb-inner { font-size: 0.75rem; }

  .post-content .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  body { font-size: 15px; }

  .day-card { padding: 24px 20px 22px; }

  .ticker-stat { gap: 6px; }

  .post-content .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1px;
  }
}