/* ==========================================================================
   1. Root Theme Variables & Resets
   ========================================================================== */
:root {
  --bg-color: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2742;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-glow: rgba(168, 85, 247, 0.25);
  --border-color: rgba(255, 255, 255, 0.08);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --container-max: 1100px;
}

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

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-purple);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-purple);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.8rem;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-main);
  transition: 0.3s;
}

/* ==========================================================================
   3. Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */
.hero-section {
  padding: 10rem 0 6rem 0;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
}

.hero-description {
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ==========================================================================
   5. Features Grid ("What I Write")
   ========================================================================== */
.features-section {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  color: var(--accent-purple);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(168, 85, 247, 0.4);
  background: var(--bg-card-hover);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   6. Works Section & Dynamic Story Cards
   ========================================================================== */
.works-section {
  padding: 6rem 0;
}

.filter-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px var(--accent-glow);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-media {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.card-placeholder-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, rgba(19, 27, 46, 0.9), rgba(28, 39, 66, 0.9));
}

.purple-glow { background: radial-gradient(circle at center, rgba(168, 85, 247, 0.2) 0%, transparent 70%); }
.pink-glow { background: radial-gradient(circle at center, rgba(236, 72, 153, 0.2) 0%, transparent 70%); }
.blue-glow { background: radial-gradient(circle at center, rgba(59, 130, 246, 0.2) 0%, transparent 70%); }

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--accent-purple);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-serif);
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* ==========================================================================
   7. CSS Filters (Spotlight Image) & Stats Table
   ========================================================================== */
.stats-section {
  padding: 6rem 0;
}

.spotlight-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 4rem;
}

.spotlight-image-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Applying CSS Filters to Image */
.filtered-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  /* Mood style: Grayscale + contrast + brightness adjustment */
  filter: grayscale(40%) contrast(115%) brightness(85%);
  transition: filter 0.5s ease, transform 0.5s ease;
}

/* Dynamic Filter Shift on Hover */
.spotlight-image-container:hover .filtered-image {
  filter: grayscale(0%) contrast(105%) brightness(100%) saturate(120%);
  transform: scale(1.03);
}

.image-overlay-badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* HTML Data Table */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  overflow-x: auto;
}

.table-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Badges & Status Indicators */
.table-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.table-badge.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.table-badge.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.table-badge.pink { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.table-badge.gray { background: rgba(156, 163, 175, 0.15); color: #d1d5db; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.active { background: #eab308; box-shadow: 0 0 6px #eab308; }
.status-dot.ongoing { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.complete { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }

/* ==========================================================================
   8. Embed Modal System
   ========================================================================== */
.embed-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.embed-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  z-index: 1001;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1rem;
}

.iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   9. About, CTA, and Footer Sections
   ========================================================================== */
.about-section {
  padding: 6rem 0;
  text-align: center;
}

.about-container {
  max-width: 750px;
  background: rgba(19, 27, 46, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 3.5rem 2.5rem;
}

.about-text {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.8;
  margin-top: 1rem;
}

.cta-section {
  padding: 6rem 0;
}

.cta-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 24px;
  padding: 4rem 2rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.cta-card h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta-card p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.cta-form {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.cta-form input[type="email"] {
  flex: 1;
  padding: 0.8rem 1.2rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.8);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.cta-form input[type="email"]:focus {
  border-color: var(--accent-purple);
}

.footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.footer-socials {
  display: flex;
  gap: 1.5rem;
}

.footer-socials a:hover {
  color: var(--accent-purple);
}

.copyright {
  font-size: 0.9rem;
}

/* ==========================================================================
   10. Media Queries / Responsive Rules
   ========================================================================== */
@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: none;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  .spotlight-card {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .filtered-image {
    height: 220px;
  }

  .cta-form {
    flex-direction: column;
  }

  .footer-container {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}