/* Saber Gohardehi — v0.03 simplified */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --border: rgba(148, 163, 184, 0.15);
  --nav-bg: rgba(10, 14, 26, 0.85);
  --hero-gradient: radial-gradient(ellipse at 50% 30%, #1a1040 0%, #0a0e1a 60%, #050810 100%);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.25);
  --border: rgba(15, 23, 42, 0.1);
  --nav-bg: rgba(248, 250, 252, 0.9);
  --hero-gradient: radial-gradient(ellipse at 50% 30%, #e0e7ff 0%, #f8fafc 60%, #f1f5f9 100%);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.font-fa {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
}

.site-name { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.accent-text { color: var(--accent); }
.section-alt { background: var(--bg-secondary); }

/* Navigation */
.nav-glass {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.toggle-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Hero */
.hero-section {
  background: var(--hero-gradient);
  min-height: 70vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  display: none;
}

.hero-section.has-bg-image .hero-bg-layer { display: block; }

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: none;
}

.hero-section.has-bg-image .hero-overlay {
  display: block;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 26, var(--hero-overlay, 0.55)) 0%,
    rgba(10, 14, 26, calc(var(--hero-overlay, 0.55) + 0.15)) 100%
  );
}

[data-theme="light"] .hero-section.has-bg-image .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, var(--hero-overlay, 0.55)) 0%,
    rgba(248, 250, 252, calc(var(--hero-overlay, 0.55) + 0.1)) 100%
  );
}

.hero-title {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--bg-card);
  border: 3px solid var(--accent);
  overflow: hidden;
}

/* Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover,
.glass-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #1a0a00;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Section heading */
.section-heading {
  position: relative;
  display: inline-block;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 50%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

[dir="rtl"] .section-heading::after {
  left: auto;
  right: 0;
  background: linear-gradient(-90deg, var(--accent), transparent);
}

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.open { max-height: 240px; }

/* Footer */
.footer-glass {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* Contact form */
.contact-form { text-align: start; }

.contact-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text-secondary);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact-field textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.contact-status {
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  display: none;
}

.contact-status.visible { display: block; }

.contact-status--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.contact-status--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* Blog */
.blog-card { text-decoration: none; color: inherit; }
.blog-card-img { height: 140px; overflow: hidden; background: var(--bg-secondary); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }

.blog-grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }

.post-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
}

.post-body p { margin-bottom: 1rem; }
.post-body p:last-child { margin-bottom: 0; }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .glass-card, .btn-primary, .btn-outline { transition: none; }
}