/* =========================================================
   N.S. Nandvanshi — Unified Dark Purple Production Theme
   Design system: Deep Midnight Purple, Soft Amethyst, Highlight Lavender
   ========================================================= */

:root {
  --color-bg: #171123;
  --color-bg-soft: #1e162e;
  --color-surface: #251c3a;
  --color-ink: #f3effa;
  --color-ink-soft: #cbb3ff;
  --color-accent: #a380ff;
  --color-accent-soft: #bfa3ff;
  --color-gray: #a99cb8;
  --color-line: #4a3b68;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1080px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-bg) !important;
  color: var(--color-ink) !important;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Unified Stable Inputs - Prevents page elements from jumping when typing */
input, textarea {
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--color-line);
  background: var(--color-bg-soft);
  color: #fff;
  border-radius: 8px;
  box-sizing: border-box;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink) !important;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

p { margin: 0 0 1em 0; color: var(--color-gray); }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* ---------- Header / Mobile-First Navigation ---------- */
.site-header {
  padding: 1.2rem 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap; 
}

/* Restricts the massive logo graphic layout dynamically */
header.site-header a.brand img, 
.brand img, 
.site-header img {
  max-height: 55px !important; 
  width: auto !important;
  object-fit: contain !important;
  display: inline-block !important;
  vertical-align: middle;
}

.nav-horizontal-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* High Visibility Pill Formats */
.pill-btn {
  background: linear-gradient(135deg, #bfa3ff, #ddccff) !important;
  color: #120c1f !important;
  border: none !important;
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pill-btn:hover {
  transform: translateY(-1px);
}

/* ---------- Hero Section ---------- */
.hero { padding: var(--space-xl) 0 var(--space-lg); }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: var(--space-md);
  align-items: center;
}
.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
  display: block;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-style: italic; }
.hero h1 em { font-style: normal; color: var(--color-accent); }
.hero-sub { margin-top: 1rem; font-size: 1rem; color: var(--color-gray); }

/* ---------- COMPLETE BACKGROUND SPIN FIX ---------- */
.hero-portrait {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.portrait-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 260px;
  border-radius: 18px;
}
.portrait-frame::before,
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-line), var(--color-accent-soft));
  animation: none !important; 
  transform: none !important;
  z-index: 0;
}
.portrait-frame::before {
  filter: blur(12px);
  opacity: 0.65;
}
.portrait-frame::after {
  opacity: 0.8;
  padding: 3px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.portrait-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 18px;
  border: 4px solid var(--color-bg);
}
.pen-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  margin-bottom: 0.5rem;
  color: var(--color-ink);
}

/* ---------- Sections Layouts ---------- */
.about, .books, .blog-section, .newsletter {
  padding: var(--space-lg) 0;
}
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  display: block;
}
.section-heading { font-size: 2rem; margin-bottom: var(--space-md); }
.about-body { max-width: 65ch; font-size: 1rem; color: var(--color-gray); }
.about-body p:first-of-type { font-size: 1.2rem; font-style: italic; color: var(--color-ink); }

/* ---------- Books Display ---------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}
.book-card {
  background: var(--color-surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
}
.book-cover { aspect-ratio: 2/3; background: var(--color-bg-soft); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.book-card-body h3 { font-size: 1.15rem; font-style: italic; }

/* ---------- Blog Row Display ---------- */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-line);
}
.post-date { font-size: 0.8rem; color: var(--color-gray); }

/* ---------- Glass Overlay System ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 11, 23, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.glass-modal {
  background: var(--color-bg-soft);
  border: 2px solid var(--color-line);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

/* ---------- Responsive Mobile Adaptation Rules ---------- */
@media (max-width: 768px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-portrait { order: -1; max-width: 200px; margin: 0 auto; }
  .post-row { grid-template-columns: 1fr; }
  .site-header .wrap { justify-content: center; text-align: center; }
}

/* ==================== MAIN NAVIGATION PILL BUTTONS ==================== */
.main-nav {
  display: flex;
  gap: 12px; 
  align-items: center;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 500;
  color: #ffffff !important;
  text-decoration: none;
  background: rgba(191, 163, 255, 0.15) !important; 
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(221, 204, 255, 0.3) !important; 
  border-radius: 50px !important;
  box-shadow: 0 4px 15px rgba(163, 128, 255, 0.2);
  transition: all 0.3s ease;
}

.main-nav a:hover {
  background: rgba(191, 163, 255, 0.25) !important;
  border-color: rgba(221, 204, 255, 0.5) !important;
  box-shadow: 0 4px 20px rgba(163, 128, 255, 0.35);
  transform: translateY(-1px);
  color: #ffffff !important;
}
