/**
 * Dedicated Case Study & Project Page Styles
 * Raman Tondro (RMNO21) Systems Architecture
 */

:root {
  --bg-page: #090a0d;
  --bg-card: #101216;
  --bg-elevated: #161920;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-active: #38bdf8;
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-mono: #38bdf8;
  
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-indigo: #818cf8;
  --accent-amber: #f59e0b;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  --font-fa: 'Vazirmatn', Tahoma, sans-serif;
  
  --container-max: 1040px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video {
  max-width: 100%;
}

/* Subtle Technical Grid */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.layout-wrapper {
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

.icon-svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Header & Top Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 10, 13, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
}

.avatar-micro {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  display: block;
}

.identity-text {
  display: flex;
  flex-direction: column;
}

.name-primary {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.name-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.btn-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-pill.primary {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Breadcrumb Navigation */
.breadcrumb-bar {
  padding: 1.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb-bar a {
  color: var(--text-muted);
}

.breadcrumb-bar a:hover {
  color: var(--accent-cyan);
}

.breadcrumb-separator {
  color: var(--border-hover);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hero Article Header */
.project-hero {
  padding: 1.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.project-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.project-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
  color: #ffffff;
}

.project-lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 820px;
  margin-bottom: 1.75rem;
}

.project-actions-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Metadata Bar / Tech Specs Grid */
.specs-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.spec-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.spec-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

/* Media & Screenshot Display */
.media-container,
.project-media-showcase {
  max-width: var(--container-max);
  margin: 2rem auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.media-image,
.project-media-showcase img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  background: var(--bg-card);
}

.media-caption {
  padding: 0.75rem 1.25rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  line-height: 1.5;
}

/* Content Body */
.project-content-body {
  padding: 2.5rem 0 4rem;
}

.content-block {
  margin-bottom: 3rem;
}

.content-block h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.content-block h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  color: var(--accent-cyan);
}

.content-block p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.15s ease;
}

.feature-card:hover {
  border-color: var(--border-hover);
}

.feature-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0;
}

/* Code Snippet Box */
.code-window {
  background: #050608;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-body {
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Dual-Language / Farsi Sections */
.lang-content-fa {
  font-family: var(--font-fa);
  direction: rtl;
  text-align: right;
  display: none;
}

.lang-content-en {
  direction: ltr;
  text-align: left;
}

body.lang-fa .lang-content-fa {
  display: block;
}

body.lang-fa .lang-content-en {
  display: none;
}

body.lang-fa {
  direction: rtl;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.15rem;
  }
  .header-container {
    padding: 0.75rem 1.15rem;
  }
  .media-container,
  .project-media-showcase {
    padding: 0 1.15rem;
    margin: 1.25rem auto;
  }
  .project-title {
    font-size: 1.85rem;
    line-height: 1.2;
  }
  .project-lead {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  .project-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .specs-matrix {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 0.75rem;
  }
  .features-list {
    grid-template-columns: 1fr;
  }
  .code-body {
    padding: 0.85rem;
    font-size: 0.78rem;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.85rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.85rem;
  }
  .media-container,
  .project-media-showcase {
    padding: 0 0.85rem;
  }
  .identity-text .name-sub {
    display: none;
  }
  .project-title {
    font-size: 1.5rem;
  }
  .project-actions-row {
    grid-template-columns: 1fr;
  }
  .btn-pill {
    justify-content: center;
    width: 100%;
  }
}
