:root {
  --ink: #0a0a0a;
  --paper: #f5f0e8;
  --acid: #e8ff00;
  --rust: #c84b2f;
  --dust: #8a8070;
  --rule: #0a0a0a;
  --col: calc(100% / 12);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Libre Baskerville', Georgia, serif;
  overflow-x: hidden;
  cursor: auto;
}

/* NOISE OVERLAY */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* MASTHEAD */
header {
  border-bottom: 3px solid var(--ink);
  padding: 0;
  animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dateline {
  background: var(--ink);
  color: var(--paper);
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 0.4rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}

.dateline span { opacity: 0.7; }

.masthead-inner {
  padding: 1.5rem 2rem 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
}

.masthead-left, .masthead-right {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.8;
  color: var(--dust);
}

.masthead-right { text-align: right; }

.site-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(4rem, 10vw, 9rem);
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
  position: relative;
  cursor: default;
}

.site-title::after {
  content: 'The Veridan';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
  transform: translate(3px, 3px);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.site-title:hover::after { opacity: 0.15; transform: translate(6px, 6px); }

.tagline-bar {
  border-top: 1px solid var(--ink);
  margin-top: 1rem;
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: center;
  gap: 3rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dust);
}

.tagline-bar span { position: relative; }
.tagline-bar span.active {
  color: var(--ink);
  font-weight: 500;
}
.tagline-bar span.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--rust);
}

.tagline-bar a {
  text-decoration: none;
  color: inherit;
}

/* NAV */
nav {
  border-bottom: 1px solid var(--ink);
  padding: 0 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  animation: slideDown 0.6s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

nav a {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-right: 1px solid var(--ink);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

nav a:first-child { border-left: 1px solid var(--ink); }
nav a:hover { background: var(--ink); color: var(--acid); }
nav a.featured { background: var(--rust); color: var(--paper); }
nav a.nav-admin { background: var(--acid); color: var(--ink); margin-left: auto; }

/* MAIN GRID */
.container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

/* HERO ARTICLE */
.hero-section {
  border-bottom: 2px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: fadeUp 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.hero-text {
  padding: 3rem 2rem 3rem 0;
  border-right: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.issue-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.issue-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--rust);
}

.hero-headline {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-headline em {
  font-style: italic;
  color: var(--rust);
}

.hero-deck {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3a3530;
  margin-bottom: 2rem;
  max-width: 42ch;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.author-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.read-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--dust);
}

.read-btn {
  margin-left: auto;
  background: var(--ink);
  color: var(--acid);
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.7rem 1.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-block;
}

.read-btn:hover { background: var(--rust); transform: translateY(-2px); }

.hero-image {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  min-height: 480px;
}

.hero-image-inner {
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(232,255,0,0.04) 40px,
      rgba(232,255,0,0.04) 42px
    ),
    linear-gradient(135deg, #1a1610 0%, #0a0a0a 50%, #1f1a10 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-number {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 18rem;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232,255,0,0.2);
  line-height: 1;
  user-select: none;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.hero-category-stamp {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: var(--acid);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  font-weight: 500;
}

/* THREE COLUMN ARTICLES */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--ink);
  animation: fadeUp 0.8s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.article-card {
  padding: 2rem;
  border-right: 1px solid var(--ink);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}

.article-card:last-child { border-right: none; }
.article-card:hover { background: rgba(10,10,10,0.03); }

.article-card .card-num {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(10,10,10,0.12);
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  user-select: none;
}

.card-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.8rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.8rem;
}

.card-title em { font-style: italic; }

.card-excerpt {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #3a3530;
  margin-bottom: 1.2rem;
}

.card-byline {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(10,10,10,0.15);
  padding-top: 0.8rem;
}

/* DIVIDER QUOTE */
.pull-quote-bar {
  background: var(--ink);
  color: var(--acid);
  padding: 3rem 2rem;
  text-align: center;
  animation: fadeUp 0.8s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pull-quote-bar blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.3;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.pull-quote-bar blockquote::before {
  content: '\201C';
  font-size: 6rem;
  line-height: 0;
  position: absolute;
  top: 1.5rem;
  left: -2rem;
  opacity: 0.3;
}

.pull-quote-bar cite {
  display: block;
  font-family: 'DM Mono', monospace;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232,255,0,0.5);
  margin-top: 1.5rem;
}

/* MIXED LAYOUT SECTION */
.mixed-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border-bottom: 2px solid var(--ink);
  animation: fadeUp 0.8s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.featured-long {
  padding: 2.5rem 2rem;
  border-right: 2px solid var(--ink);
}

.featured-long .big-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--rust);
  color: var(--paper);
  padding: 0.3rem 0.6rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.featured-long h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.featured-long h2 em {
  font-style: italic;
  color: var(--rust);
}

.featured-long .body-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #3a3530;
  columns: unset;
}

.sidebar-articles { display: flex; flex-direction: column; }

.sidebar-article {
  padding: 1.5rem;
  border-bottom: 1px solid var(--ink);
  transition: background 0.2s;
}

.sidebar-article:last-child { border-bottom: none; }
.sidebar-article:hover { background: var(--ink); color: var(--paper); }
.sidebar-article:hover .card-tag { color: var(--acid); }
.sidebar-article:hover .card-excerpt-sm { color: rgba(245,240,232,0.7); }

.card-excerpt-sm {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #3a3530;
  margin-top: 0.5rem;
  transition: color 0.2s;
}

/* TOPICS ROW */
.topics-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 2px solid var(--ink);
  animation: fadeUp 0.8s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.topic-cell {
  padding: 1.5rem;
  border-right: 1px solid var(--ink);
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
}

.topic-cell:last-child { border-right: none; }

.topic-cell::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  background: var(--acid);
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.topic-cell:hover::before { height: 100%; }
.topic-cell:hover .topic-name { color: var(--ink); }

.topic-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
  position: relative;
  z-index: 1;
}

.topic-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.topic-count {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--dust);
  display: block;
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}

/* LATEST SECTION */
.latest-section {
  display: grid;
  grid-template-columns: 1fr 340px;
  border-bottom: 2px solid var(--ink);
  animation: fadeUp 0.8s 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.latest-feed { border-right: 2px solid var(--ink); }

.section-header {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.section-more {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
  transition: letter-spacing 0.2s;
}

.section-more:hover { letter-spacing: 0.25em; }

.feed-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(10,10,10,0.12);
  align-items: start;
  transition: background 0.2s;
  cursor: pointer;
}

.feed-item:hover { background: rgba(10,10,10,0.03); }

.feed-num {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(10,10,10,0.2);
}

.feed-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.feed-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
}

/* NEWSLETTER POPUP */
.newsletter-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.newsletter-popup.active {
  opacity: 1;
  visibility: visible;
}

.popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(4px);
}

.popup-content {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: 3rem;
  max-width: 480px;
  width: 90%;
  border: 2px solid var(--paper);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.newsletter-popup.active .popup-content {
  transform: translateY(0);
}

.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.popup-close:hover {
  opacity: 1;
}

.popup-header {
  margin-bottom: 1.5rem;
}

.popup-label {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.2rem;
  border-bottom: 3px solid var(--acid);
  padding-bottom: 0.5rem;
}

.popup-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.popup-body {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.popup-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.popup-form input {
  background: rgba(245, 240, 232, 0.05);
  border: 1px solid rgba(245, 240, 232, 0.2);
  padding: 1rem;
  color: var(--paper);
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.3s;
}

.popup-form input:focus {
  border-color: var(--acid);
}

.popup-subscribe-btn {
  background: var(--acid);
  color: var(--ink);
  border: none;
  padding: 1.1rem;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.popup-subscribe-btn:hover {
  background: #f0ff40;
  transform: translateY(-2px);
}

.popup-response {
  margin-top: 0.8rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--acid);
}

.popup-dismiss {
  margin-top: 1.5rem;
  background: none;
  border: none;
  color: var(--paper);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.popup-dismiss:hover {
  opacity: 1;
}

.popup-count {
  margin-top: 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.4;
}


/* FOOTER */
footer {
  background: var(--ink);
  color: var(--paper);
  padding: 3rem 2rem 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .footer-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 3rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--acid);
  line-height: 1;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(245,240,232,0.6);
  max-width: 30ch;
}

.footer-col h4 {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--acid);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: rgba(245,240,232,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: 'Libre Baskerville', serif;
  transition: color 0.15s;
}

.footer-col ul li a:hover { color: var(--acid); }

.footer-bottom {
  border-top: 1px solid rgba(245,240,232,0.15);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.3);
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink); }

/* SELECTION */
::selection { background: var(--ink); color: var(--paper); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-image { min-height: 250px; display: none; }
  .article-grid { grid-template-columns: 1fr; }
  .mixed-grid { grid-template-columns: 1fr; }
  .topics-row { grid-template-columns: repeat(3, 1fr); }
  .latest-section { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .masthead-inner { grid-template-columns: 1fr; }
  .masthead-left, .masthead-right { display: none; }
  .hero-text { border-right: none; padding: 2rem 0; }
  .featured-long .body-text { columns: 1; }
}

.image-preview {
  margin-top: 10px;
  max-width: 300px;
}

.image-preview img {
  width: 100%;
  border-radius: 4px;
}
