/* =========================================================
   Tasavvuf & Mevlana — Dekoratif Tema Katmanı
   ========================================================= */

:root {
  --green-dark:   #0f2e24;
  --green-mid:    #1e4d3a;
  --green-light:  #2d6a52;
  --teal-deep:    #134e4a;
  --gold:         #c9a227;
  --gold-light:   #e8d48b;
  --gold-muted:   rgba(201, 162, 39, 0.35);
  --cream:        #f8f4eb;
  --cream-dark:   #efe6d4;
  --burgundy:     #5c2e2e;
  --lapis:        #1a365d;
  --font-arabesque: 'Amiri', 'Scheherazade New', 'Noto Sans Arabic', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans Arabic', system-ui, sans-serif;
  --section-pad: 5.5rem;
  --shadow-card: 0 4px 24px rgba(15, 46, 36, 0.08);
}

body {
  background: var(--cream);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201, 162, 39, 0.08), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='0.4' opacity='0.35'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40Z'/%3E%3Cpath d='M40 8 L72 40 L40 72 L8 40Z'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3Cpath d='M40 20 L60 40 L40 60 L20 40Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, 80px 80px;
}

/* ── Geometric utilities ─────────────────────────────── */
.islamic-star-icon {
  width: 28px;
  height: 28px;
  fill: var(--gold);
  flex-shrink: 0;
}

.section-ornament-top {
  text-align: center;
  margin-bottom: 2rem;
}

.section-ornament-top svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0.85;
}

/* ── Navbar ──────────────────────────────────────────── */
#navbar:not(.scrolled) {
  background: linear-gradient(to bottom, rgba(15, 46, 36, 0.92), transparent);
}

.nav-brand-icon {
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: 50%;
  position: relative;
}

.nav-brand-icon::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed var(--gold-muted);
  border-radius: 50%;
}

.nav-brand-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
}

.nav-brand-title {
  font-family: var(--font-arabesque);
  font-style: italic;
  letter-spacing: 0.08em;
}

/* ── Hero ────────────────────────────────────────────── */
#hero {
  background:
    radial-gradient(ellipse 120% 80% at 70% 20%, rgba(201, 162, 39, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 10% 80%, rgba(19, 78, 74, 0.4), transparent),
    linear-gradient(145deg, #0a1f18 0%, var(--green-dark) 35%, var(--green-mid) 70%, #163d30 100%);
}

#hero .pattern-bg {
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cg fill='none' stroke='%23e8d48b' stroke-width='0.6'%3E%3Cpath d='M50 0 L100 50 L50 100 L0 50Z'/%3E%3Cpath d='M50 15 L85 50 L50 85 L15 50Z'/%3E%3Cpath d='M50 30 L70 50 L50 70 L30 50Z'/%3E%3Ccircle cx='50' cy='50' r='12'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100px 100px;
}

.hero-sema {
  position: absolute;
  width: 520px;
  height: 520px;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.14;
  z-index: 0;
}

#hero .hero-inner {
  z-index: 2;
}

.hero-sema-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  animation: semaSpin 48s linear infinite;
}

.hero-sema-ring:nth-child(2) {
  inset: 12%;
  animation-duration: 36s;
  animation-direction: reverse;
  border-style: dashed;
  opacity: 0.7;
}

.hero-sema-ring:nth-child(3) {
  inset: 24%;
  animation-duration: 28s;
  opacity: 0.5;
}

.hero-sema-center {
  position: absolute;
  inset: 38%;
  background: radial-gradient(circle, var(--gold-muted), transparent 70%);
  border-radius: 50%;
}

@keyframes semaSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero-ornament-1,
.hero-ornament-2 {
  border: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50,5 95,50 50,95 5,50' fill='none' stroke='%23c9a227' stroke-width='0.5' opacity='0.5'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.12;
}

.hero-badge {
  font-family: var(--font-arabesque);
  border-radius: 4px;
  letter-spacing: 0.06em;
  position: relative;
  padding-left: 1.25rem;
}

.hero-badge::before {
  content: '✦';
  position: absolute;
  left: 0.65rem;
  color: var(--gold);
  font-size: 0.65rem;
}

.hero-verse {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--gold);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  max-width: 520px;
}

.hero-verse-text {
  font-family: var(--font-arabesque);
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.75;
}

.hero-verse-source {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.hero-avatar-ring-outer {
  border: 2px solid var(--gold-muted);
  box-shadow: 0 0 40px rgba(201, 162, 39, 0.15);
}

.hero-avatar-ring-inner::after {
  content: '☪';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--gold);
  opacity: 0.9;
  background: var(--green-dark);
  padding: 0 6px;
  border-radius: 4px;
}

.hero-avatar {
  border: 4px solid var(--gold);
  box-shadow:
    0 0 0 8px rgba(201, 162, 39, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-stat {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--gold-muted);
  border-radius: var(--radius-sm);
}

/* ── Wisdom band (Mevlana) ───────────────────────────── */
#wisdom {
  padding: 0;
  background: linear-gradient(90deg, var(--burgundy) 0%, #3d2520 40%, var(--green-dark) 100%);
  position: relative;
  overflow: hidden;
}

#wisdom .pattern-bg {
  opacity: 0.06;
}

.wisdom-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.wisdom-ornament {
  width: 64px;
  height: 64px;
  opacity: 0.5;
}

.wisdom-ornament svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 1;
}

.wisdom-quote {
  text-align: center;
}

.wisdom-quote p {
  font-family: var(--font-arabesque);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-style: italic;
  color: var(--cream);
  line-height: 1.85;
  margin: 0;
}

.wisdom-quote cite {
  display: block;
  margin-top: 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-style: normal;
  color: var(--gold-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Sections ────────────────────────────────────────── */
.section-label {
  font-family: var(--font-arabesque);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.section-title {
  position: relative;
}

#about {
  background: var(--white);
  position: relative;
}

#about::before,
#career::after,
#expertise::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}

#about::before { top: 0; }
#career::after { bottom: 0; }
#expertise::before { top: 0; }

#career {
  background: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30Z' fill='none' stroke='%23c9a227' stroke-width='0.3' opacity='0.2'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

.highlight-item,
.info-card,
.expertise-card,
.timeline-card {
  border-radius: 4px;
  position: relative;
}

.highlight-item::after,
.info-card::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 L22 12 L12 22 L2 12Z' fill='none' stroke='%23c9a227' stroke-width='1' opacity='0.35'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}

.highlight-icon,
.info-card-icon,
.expertise-icon {
  border-radius: 50%;
  border: 1px solid var(--gold-muted);
}

.timeline::before {
  background: linear-gradient(to bottom, transparent, var(--gold) 10%, var(--green-light) 50%, var(--gold) 90%, transparent);
}

.timeline-dot {
  border-radius: 4px;
  transform: rotate(45deg);
  width: 22px;
  height: 22px;
}

.timeline-dot-inner {
  border-radius: 2px;
  transform: rotate(0deg);
}

.expertise-card::before {
  background: linear-gradient(180deg, var(--gold), var(--burgundy));
}

#publications {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

#courses {
  background:
    radial-gradient(ellipse at center, rgba(201, 162, 39, 0.08), transparent 70%),
    linear-gradient(160deg, #0a1f18, var(--green-dark) 50%, var(--teal-deep));
  position: relative;
}

#courses .pattern-bg {
  opacity: 0.05;
}

.quote-block {
  background: linear-gradient(135deg, var(--green-dark), var(--teal-deep));
  border: 1px solid var(--gold-muted);
  box-shadow: var(--shadow-lg);
}

.quote-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 0 L40 20 L20 40 L0 20Z' fill='none' stroke='%23c9a227' stroke-width='0.4' opacity='0.15'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  pointer-events: none;
}

.quote-text {
  font-family: var(--font-arabesque);
  font-size: 1.35rem;
}

.quote-source-name {
  font-family: var(--font-arabesque);
  font-style: italic;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  background: linear-gradient(180deg, #081612 0%, #0d1f16 100%);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--burgundy), var(--gold), transparent);
}

.footer-brand-name {
  font-family: var(--font-arabesque);
}

.footer-motto {
  font-family: var(--font-arabesque);
  font-style: italic;
  color: var(--gold-light);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

#back-to-top {
  border-radius: 4px;
  transform: rotate(45deg);
}

#back-to-top svg {
  transform: rotate(-45deg);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-sema { width: 320px; height: 320px; right: -25%; opacity: 0.08; }
  .hero-verse { margin-left: auto; margin-right: auto; text-align: left; }
  .wisdom-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .wisdom-ornament { display: none; }
}

/* ═══════════════════════════════════════════════════════
   Language switcher
   ═══════════════════════════════════════════════════════ */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--gold-muted);
  border-radius: 50px;
  margin-right: 0.5rem;
}

.lang-btn {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.lang-btn:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
  background: var(--gold);
  color: var(--green-dark);
}

#navbar.scrolled .lang-switcher {
  background: rgba(255, 255, 255, 0.08);
}

.nav-inner {
  gap: 1rem;
}

/* ═══════════════════════════════════════════════════════
   Unified section styling
   ═══════════════════════════════════════════════════════ */
section:not(#hero):not(#wisdom) {
  position: relative;
}

section:not(#hero):not(#wisdom) .container {
  position: relative;
  z-index: 1;
}

#about,
#expertise,
#contact {
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(201, 162, 39, 0.15);
}

#publications,
#projects {
  background: linear-gradient(180deg, var(--cream) 0%, var(--white) 100%);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-head .section-label {
  display: block;
}

.section-head .section-desc {
  margin-left: auto;
  margin-right: auto;
}

.expertise-card,
.info-card,
.timeline-card,
.project-card,
.course-card,
.pub-item {
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.highlight-item {
  border-left-width: 4px;
  border-image: linear-gradient(180deg, var(--gold), var(--green-mid)) 1;
}

/* Hero layout polish */
.hero-inner {
  gap: 3rem;
}

.hero-content {
  max-width: 560px;
}

.hero-verse {
  backdrop-filter: blur(6px);
}

/* ═══════════════════════════════════════════════════════
   RTL (Arabic)
   ═══════════════════════════════════════════════════════ */
html[dir="rtl"] body {
  font-family: var(--font-arabesque);
}

html[dir="rtl"] .nav-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

html[dir="rtl"] .lang-switcher {
  margin-right: 0;
  margin-left: 0.5rem;
}

html[dir="rtl"] .hero-verse {
  border-left: none;
  border-right: 3px solid var(--gold);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  text-align: right;
}

html[dir="rtl"] .highlight-item {
  border-left: none;
  border-right: 4px solid var(--gold);
}

html[dir="rtl"] .highlight-item:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 3rem;
}

html[dir="rtl"] .timeline::before {
  left: auto;
  right: 12px;
}

html[dir="rtl"] .timeline-dot {
  left: auto;
  right: -3rem;
}

html[dir="rtl"] .timeline-item {
  transform: translateX(20px);
}

html[dir="rtl"] .timeline-item.visible {
  transform: translateX(0);
}

html[dir="rtl"] .contact-link-btn:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .section-title,
html[dir="rtl"] .hero-name,
html[dir="rtl"] .wisdom-quote p {
  font-family: var(--font-arabesque);
  line-height: 1.9;
}

html[dir="rtl"] .footer-top,
html[dir="rtl"] .about-grid,
html[dir="rtl"] .contact-grid {
  direction: rtl;
}

/* Mobile: lang + nav */
@media (max-width: 900px) {
  .lang-switcher {
    position: absolute;
    top: 1rem;
    left: 2rem;
    z-index: 1001;
    margin: 0;
  }

  html[dir="rtl"] .lang-switcher {
    left: auto;
    right: 2rem;
  }

  .nav-links.open .lang-switcher {
    position: static;
    margin-bottom: 1rem;
    align-self: flex-start;
  }
}
