/* ==========================================================
   Cross Entropy — Website Stylesheet
   Vintage science journal meets modern design studio.
   ========================================================== */

:root {
  --ce-navy: #0D1B2A;
  --ce-amber: #D4A843;
  --ce-offwhite: #F5F0EB;
  --ce-slate: #415A77;
  --ce-light-slate: #778DA9;
  --ce-green: #00E5A0;

  --font-headline: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', 'Source Sans Pro', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

/* ---- BODY ---- */
body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ce-navy);
  background: var(--ce-offwhite);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle grain texture — matches carousel film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  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-size: 256px 256px;
  pointer-events: none;
  z-index: 9999;
}

/* ---- LAYOUT ---- */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-column {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding-bottom: 4rem;
}

/* ---- HEADER ---- */
.site-header {
  padding: 2rem 0;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  margin-bottom: 3rem;
}

.site-header .content-column {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.site-logo {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ce-navy);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--ce-amber);
}

.site-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ce-light-slate);
  letter-spacing: 0.05em;
}

/* ---- FOOTER ---- */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(13, 27, 42, 0.08);
  margin-top: 2rem;
}

.site-footer .content-column {
  text-align: center;
}

.footer-brand {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ce-navy);
  margin-bottom: 0.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ce-slate);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.footer-links a:hover {
  color: var(--ce-amber);
}

.footer-byline {
  font-size: 0.85rem;
  color: var(--ce-light-slate);
}

/* ---- TYPOGRAPHY ---- */
h1 {
  font-family: var(--font-headline);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--ce-slate);
  text-decoration-color: var(--ce-amber);
  text-underline-offset: 3px;
  transition: color 0.15s;
}

a:hover {
  color: var(--ce-amber);
}

blockquote {
  border-left: 3px solid var(--ce-amber);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--ce-slate);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(13, 27, 42, 0.05);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: rgba(13, 27, 42, 0.05);
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
}

/* ---- HERO ---- */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--ce-slate);
  line-height: 1.7;
  max-width: 600px;
}

/* ---- FORMAT BADGE ---- */
.format-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ce-navy);
  background: var(--ce-amber);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}

/* ---- TOPIC TAG ---- */
.topic-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ce-slate);
  border: 1px solid var(--ce-light-slate);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.5rem 0;
}

/* ---- DATE ---- */
.date-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ce-light-slate);
  letter-spacing: 0.05em;
}

/* ---- DIVIDER ---- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--ce-amber);
  border-radius: 2px;
  margin: 1.5rem 0;
}

/* ---- FEED CARDS ---- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feed-card {
  display: block;
  padding: 1.5rem;
  border-left: 3px solid var(--ce-amber);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, transform 0.1s;
}

.feed-card:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateX(2px);
}

.feed-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.feed-card-title {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ce-navy);
  margin-bottom: 0.35rem;
}

.feed-card-subtitle {
  font-size: 0.95rem;
  color: var(--ce-slate);
  line-height: 1.5;
}

/* ---- PAGE HEADER ---- */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header .date-label {
  margin-bottom: 0.5rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-family: var(--font-headline);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ce-slate);
  line-height: 1.5;
}

/* ---- STORY SECTION ---- */
.story-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.06);
}

.story-section:last-of-type {
  border-bottom: none;
}

.story-section h2 {
  margin-top: 0;
}

.story-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ce-light-slate);
  margin-bottom: 0.25rem;
}

.story-development,
.story-insight {
  margin-bottom: 1rem;
}

.story-insight {
  padding-left: 1rem;
  border-left: 2px solid var(--ce-amber);
}

/* ---- SOURCES ---- */
.sources {
  margin-top: 0.75rem;
}

.sources-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ce-light-slate);
  margin-bottom: 0.25rem;
}

.source-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ce-light-slate);
  margin-right: 1rem;
}

.source-link::before {
  content: '\2192 ';
  color: var(--ce-amber);
}

/* ---- RADAR SECTION ---- */
.radar-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(13, 27, 42, 0.08);
}

.radar-section h2 {
  margin-top: 0;
}

.radar-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ce-green);
  flex-shrink: 0;
  margin-top: 0.55rem;
}

.radar-content {
  flex: 1;
}

.radar-headline {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.radar-summary {
  font-size: 0.9rem;
  color: var(--ce-slate);
  line-height: 1.5;
}

.radar-source {
  font-size: 0.8rem;
  color: var(--ce-light-slate);
}

/* ---- WEEKLY PAGE ---- */
.weekly-overview {
  font-size: 1.05rem;
  color: var(--ce-slate);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.weekly-section {
  margin-bottom: 2.5rem;
}

.emerging-patterns {
  background: rgba(13, 27, 42, 0.03);
  border: 1px solid rgba(13, 27, 42, 0.06);
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.emerging-patterns h3 {
  margin-top: 0;
  color: var(--ce-amber);
}

/* ---- STORY (deep dive) PAGE ---- */
.story-hook {
  font-family: var(--font-headline);
  font-size: 1.2rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ce-slate);
  line-height: 1.55;
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--ce-amber);
}

.story-body p {
  margin-bottom: 1.25rem;
}

.story-body h2 {
  margin-top: 2.5rem;
}

.story-sources {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(13, 27, 42, 0.08);
}

.story-sources h3 {
  margin-top: 0;
}

.story-sources ul {
  list-style: none;
  padding: 0;
}

.story-sources li {
  font-size: 0.9rem;
  color: var(--ce-light-slate);
  margin-bottom: 0.5rem;
  padding-left: 1rem;
}

.story-sources li::before {
  content: '\2192 ';
  color: var(--ce-amber);
  margin-left: -1rem;
}

/* ---- RELATED CONTENT ---- */
.related-content {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(13, 27, 42, 0.08);
}

.related-content h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.related-list {
  list-style: none;
  padding: 0;
}

.related-list li {
  margin-bottom: 0.75rem;
}

.related-list a {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 500;
}

.related-list .date-label {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .site-header .content-column {
    flex-direction: column;
    gap: 0.25rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .feed-card {
    padding: 1.25rem;
  }

  .feed-card-title {
    font-size: 1.1rem;
  }
}
