/* ============================================================
   ROGUE FACULTY — Rustic Tech Aesthetic
   Palette: Charcoal, Saddle Brown, Aged Parchment, Rust, Sage
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&family=JetBrains+Mono:wght@400;600&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* ── TOKENS ── */
:root {
  --bg-deep:      #1a1710;
  --bg-mid:       #221f17;
  --bg-card:      #2b2720;
  --bg-card-hover:#332e26;
  --border:       #3d3729;
  --border-light: #4d4538;

  --rust:         #b05c2a;
  --rust-light:   #c97040;
  --amber:        #c49a3c;
  --amber-dim:    #9a7a30;
  --sage:         #6b7c5e;
  --sage-light:   #849670;
  --parchment:    #d4c8a8;
  --parchment-dim:#a8997a;

  --text-primary:   #e8dfc8;
  --text-secondary: #b8a98a;
  --text-muted:     #7a6e58;
  --text-accent:    var(--rust-light);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Crimson Pro', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-card: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(176,92,42,0.15);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: var(--rust-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--amber); }

/* ── TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { position: relative; z-index: 1; }

/* ── HEADER / NAV ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 23, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--parchment);
  letter-spacing: 0.02em;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--rust);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.logo:hover .logo-text { color: var(--amber); }
.logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--rust-light);
  transition: width 0.25s;
}

.nav-links a:hover { color: var(--parchment); text-decoration: none; }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
}

/* ── HERO ── */
.hero {
  position: relative;
  padding: 6rem 1.5rem 5rem;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(176,92,42,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(107,124,94,0.08) 0%, transparent 60%);
}

.hero-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto 2rem;
}

.hero-rule::before,
.hero-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rust), transparent);
}

.hero-rule span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--rust);
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.05;
  color: var(--parchment);
  margin-bottom: 1.25rem;
  position: relative;
}

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

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.tag-tech    { border-color: var(--amber-dim); color: var(--amber); }
.tag-ai      { border-color: var(--rust);      color: var(--rust-light); }
.tag-cyber   { border-color: var(--sage);      color: var(--sage-light); }
.tag-nature  { border-color: #5a7a4a;          color: #7a9a62; }

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--rust);
  color: var(--parchment);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rust-light);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
  background: var(--rust-light);
  color: var(--bg-deep);
  box-shadow: 0 0 24px rgba(176,92,42,0.4);
  text-decoration: none;
}

/* ── SECTION HEADERS ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--parchment);
  white-space: nowrap;
}

.section-header .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-light), transparent);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.4rem;
  display: block;
}

/* ── POST CARDS ── */
section.posts { padding: 3rem 0 4rem; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: var(--rust);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(-3px);
}

.post-card-img {
  height: 180px;
  background: var(--bg-mid);
  position: relative;
  overflow: hidden;
}

.post-card-img .placeholder-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.35;
  background: linear-gradient(135deg, var(--bg-mid) 0%, var(--bg-card) 100%);
}

.post-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.post-card-meta time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--parchment);
  margin-bottom: 0.6rem;
}

.post-card h3 a { color: inherit; }
.post-card h3 a:hover { color: var(--rust-light); text-decoration: none; }

.post-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rust-light);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
}

.read-more:hover { color: var(--amber); text-decoration: none; }
.read-more::after { content: '→'; transition: transform 0.2s; }
.read-more:hover::after { transform: translateX(4px); }

/* ── FEATURED (BIG CARD) ── */
.post-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}

.post-card.featured .post-card-img {
  width: 380px;
  min-width: 380px;
  height: auto;
}

.post-card.featured h3 { font-size: 1.8rem; }

/* ── CATEGORIES ── */
.categories { padding: 2rem 0 4rem; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  cursor: pointer;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

.cat-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cat-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--parchment);
  margin-bottom: 0.2rem;
}

.cat-card p {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.cat-tech    { border-color: var(--amber-dim); }
.cat-tech:hover    { border-color: var(--amber); box-shadow: 0 4px 20px rgba(196,154,60,0.15); }
.cat-tech    .cat-icon { background: rgba(196,154,60,0.1); }

.cat-ai      { border-color: var(--rust); }
.cat-ai:hover      { border-color: var(--rust-light); box-shadow: 0 4px 20px rgba(176,92,42,0.2); }
.cat-ai      .cat-icon { background: rgba(176,92,42,0.1); }

.cat-cyber   { border-color: var(--sage); }
.cat-cyber:hover   { border-color: var(--sage-light); box-shadow: 0 4px 20px rgba(107,124,94,0.15); }
.cat-cyber   .cat-icon { background: rgba(107,124,94,0.1); }

.cat-nature  { border-color: #4a6a3a; }
.cat-nature:hover  { border-color: #6a9a52; box-shadow: 0 4px 20px rgba(90,130,60,0.15); }
.cat-nature  .cat-icon { background: rgba(90,130,60,0.1); }

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── NEWSLETTER BAND ── */
.newsletter {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(176,92,42,0.07) 0%, transparent 70%);
}

.newsletter h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--parchment);
  margin-bottom: 0.5rem;
  position: relative;
}

.newsletter p {
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  position: relative;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.newsletter-form input[type="email"] {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  width: 300px;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input[type="email"]:focus { border-color: var(--rust); }
.newsletter-form input[type="email"]::placeholder { color: var(--text-muted); }

.newsletter-form button {
  background: var(--rust);
  color: var(--parchment);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--rust-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.newsletter-form button:hover {
  background: var(--rust-light);
  box-shadow: 0 0 20px rgba(176,92,42,0.35);
}

/* ── FOOTER ── */
.site-footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand .logo-text { font-size: 1.3rem; }

.footer-brand p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 1rem;
}

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

.footer-col ul a {
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── BLOG PAGE ── */
.page-hero {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--parchment);
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.filter-bar {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 57px;
  z-index: 90;
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--rust);
  color: var(--rust-light);
  background: rgba(176,92,42,0.08);
}

.blog-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.blog-item:hover {
  border-color: var(--rust);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(-2px);
}

.blog-item-img {
  width: 220px;
  min-width: 220px;
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.5;
}

.blog-item-body {
  padding: 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.blog-item-meta time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.blog-item h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--parchment);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.blog-item h2 a { color: inherit; }
.blog-item h2 a:hover { color: var(--rust-light); text-decoration: none; }

.blog-item p {
  font-size: 1rem;
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.6;
}

/* ── UTILITIES ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .post-card.featured { flex-direction: column; }
  .post-card.featured .post-card-img { width: 100%; height: 220px; min-width: unset; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; gap: 1rem; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-mid);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
  }
  .nav-toggle { display: block; }
  .blog-item { flex-direction: column; }
  .blog-item-img { width: 100%; min-width: unset; height: 140px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
