/* ------------------------------------------------------------------ *
 * دریاچهٔ خاموش — Theme & Styles
 * ------------------------------------------------------------------ */

:root {
  --bg:          #FBF7EF;
  --bg-soft:     #FDFBF6;
  --card:        #FFFFFF;
  --card-hover:  #FFFDF8;
  --text:        #3A342E;
  --text-soft:   #6B6258;
  --muted:       #9A8F80;
  --gold:        #B98A2E;
  --gold-soft:   #E7D5A8;
  --crimson:     #8C3B3B;
  --crimson-soft:#E6CFCF;
  --line:        #EBE2D2;
  --shadow:      0 6px 24px rgba(90, 70, 40, 0.08);
  --shadow-hi:   0 14px 40px rgba(90, 70, 40, 0.16);
}

.dark-theme {
  --bg:          #16151B;
  --bg-soft:     #1C1B22;
  --card:        #22212B;
  --card-hover:  #28273234;
  --card-hover:  #2A2934;
  --text:        #ECE6DA;
  --text-soft:   #B7AF9E;
  --muted:       #837B6C;
  --gold:        #D9B25A;
  --gold-soft:   #4A3F26;
  --crimson:     #C87070;
  --crimson-soft:#4A2E2E;
  --line:        #2E2C38;
  --shadow:      0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-hi:   0 16px 44px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  transition: background .5s ease, color .5s ease;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(185,138,46,.10), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(140,59,59,.06), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

/* ---------- Layout ---------- */
.app-root { display: flex; flex-direction: column; min-height: 100vh; }
.main-wrap { flex: 1; }
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.4rem 1.2rem 4rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1040px; margin: 0 auto;
  padding: .85rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-weight: 900; font-size: 1.35rem; letter-spacing: -.5px;
  display: flex; align-items: center; gap: .65rem;
}

/* ---------- Logo (calligraphy on transparent/black) ---------- */
/* mix-blend-mode 'screen' drops the black backdrop of the PNG so red
   calligraphy floats elegantly on both dark & light themes. */
.brand-logo {
  height: 42px; width: auto; display: block;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(200, 60, 60, .35));
  transition: transform .3s ease, filter .3s ease;
}
.brand:hover .brand-logo {
  transform: scale(1.06);
  filter: drop-shadow(0 0 10px rgba(217, 90, 90, .55));
}
.light-theme .brand-logo {
  /* on light backgrounds, screen won't hide black — mask it with a soft blend */
  mix-blend-mode: multiply;
  filter: drop-shadow(0 0 4px rgba(140, 59, 59, .25));
}
.brand-text {
  background: linear-gradient(120deg, var(--gold), var(--crimson));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-logo {
  display: block; margin: 0 auto 1.4rem;
  max-width: min(320px, 72vw); height: auto;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 24px rgba(200, 60, 60, .35));
  animation: rise .9s ease both;
  position: relative; z-index: 1;
}
.light-theme .hero-logo {
  mix-blend-mode: multiply;
  filter: drop-shadow(0 0 12px rgba(140, 59, 59, .2));
}

.footer-logo {
  display: block; margin: 0 auto .7rem;
  height: 56px; width: auto;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 10px rgba(200, 60, 60, .3));
  opacity: .92;
}
.light-theme .footer-logo {
  mix-blend-mode: multiply;
  filter: drop-shadow(0 0 6px rgba(140, 59, 59, .18));
}

@media (max-width: 720px) {
  .brand-logo { height: 34px; }
  .brand-text { display: none; } /* keep header tidy on mobile — logo speaks for itself */
  .footer-logo { height: 46px; }
}
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold), var(--crimson));
  box-shadow: 0 0 14px var(--gold);
}
.nav-desktop { display: flex; align-items: center; gap: 1.4rem; }
.nav-link {
  position: relative; font-weight: 500; color: var(--text-soft);
  padding: .3rem 0; transition: color .25s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--gold); }
.nav-link.active::after {
  content: ""; position: absolute; bottom: -4px; right: 0; left: 0;
  height: 2px; background: var(--gold); border-radius: 2px;
}
.header-mobile { display: none; align-items: center; gap: .7rem; }
.hamburger {
  background: none; border: none; color: var(--text);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.nav-mobile {
  display: flex; flex-direction: column;
  padding: .4rem 1.2rem 1rem;
  border-bottom: 1px solid var(--line);
  animation: fadeIn .3s ease;
}
.nav-link-m {
  padding: .7rem 0; font-weight: 500; color: var(--text-soft);
  border-bottom: 1px solid var(--line);
}
.nav-link-m.active { color: var(--gold); }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  color: var(--gold); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s, background .3s, box-shadow .3s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); box-shadow: var(--shadow); }

/* ---------- Hero ---------- */
.hero {
  position: relative; text-align: center;
  padding: 4.5rem 1rem 3.5rem;
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(185,138,46,.16), transparent 60%);
}
.hero-title {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  font-weight: 900; letter-spacing: -2px; margin: 0 0 .6rem;
  background: linear-gradient(120deg, var(--text), var(--gold), var(--crimson));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rise .8s ease both;
}
.hero-sub {
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  font-weight: 300; color: var(--text-soft);
  margin: 0 0 2rem; animation: rise .8s .12s ease both;
}
.btn-primary {
  display: inline-block; cursor: pointer; border: none;
  padding: .8rem 2.2rem; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 1rem;
  color: #fff;
  background: linear-gradient(120deg, var(--crimson), var(--gold));
  box-shadow: 0 8px 22px rgba(140,59,59,.28);
  transition: transform .25s, box-shadow .25s, filter .25s;
  animation: rise .8s .24s ease both;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(140,59,59,.35); filter: brightness(1.05); }

/* ---------- Sections ---------- */
.section { margin-top: 3rem; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.section-title {
  font-size: 1.7rem; font-weight: 900; margin: 0;
  position: relative; padding-right: 1rem;
}
.section-title::before {
  content: ""; position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 1.3em; border-radius: 3px;
  background: linear-gradient(var(--gold), var(--crimson));
}
.section-link { color: var(--gold); font-weight: 500; font-size: .95rem; }
.section-link:hover { text-decoration: underline; }

/* ---------- Poem grid & cards ---------- */
.poem-grid {
  display: grid; gap: 1.3rem;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px) { .poem-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .poem-grid { grid-template-columns: 1fr; } }

.poem-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.3rem 1.3rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s, background .35s;
  animation: rise .6s ease both;
}
.poem-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hi);
  border-color: var(--gold-soft);
  background: var(--card-hover);
}
.poem-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.poem-date { color: var(--muted); font-size: .82rem; }
.poem-card-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 .55rem; }
.poem-card-preview {
  color: var(--text-soft); font-weight: 300; font-size: .96rem;
  line-height: 2; margin: 0 0 1rem; white-space: pre-line;
  flex: 1;
}
.poem-card-more { color: var(--gold); font-weight: 600; font-size: .9rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: .78rem; font-weight: 600;
  padding: .22rem .7rem; border-radius: 999px; line-height: 1.6;
}
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-crimson { background: var(--crimson-soft); color: var(--crimson); }

/* ---------- Poems page controls ---------- */
.poems-head, .page-title, .page-sub { }
.page-title { font-size: 2.2rem; font-weight: 900; margin: 0 0 .4rem; }
.page-sub { color: var(--text-soft); font-weight: 300; margin: 0 0 1.8rem; }

.controls {
  display: flex; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 200px;
  padding: .8rem 1.1rem; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-family: inherit; font-size: 1rem;
  box-shadow: var(--shadow); outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search-input::placeholder { color: var(--muted); }
.sort-select {
  padding: .8rem 1rem; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-family: inherit; font-size: .95rem;
  cursor: pointer; box-shadow: var(--shadow);
}

.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 2rem; }
.chip {
  padding: .45rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-soft); font-family: inherit; font-weight: 500;
  cursor: pointer; font-size: .9rem;
  transition: all .25s;
}
.chip:hover { border-color: var(--gold-soft); color: var(--text); }
.chip-active {
  background: linear-gradient(120deg, var(--gold), var(--crimson));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(140,59,59,.25);
}

.empty {
  text-align: center; padding: 4rem 1rem; color: var(--text-soft);
}
.empty-icon { font-size: 3rem; color: var(--muted); letter-spacing: .3em; }

/* ---------- Poem detail ---------- */
.back-crumb { color: var(--gold); font-weight: 500; display: inline-block; margin-bottom: 1.5rem; }
.back-crumb:hover { text-decoration: underline; }

.poem-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2.6rem clamp(1.4rem, 5vw, 3.4rem);
  box-shadow: var(--shadow);
  max-width: 760px; margin: 0 auto;
}
.detail-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.detail-title { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 900; margin: 0 0 1rem; text-align: center; }
.detail-rule {
  height: 2px; width: 70px; margin: 0 auto 2rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.detail-body {
  text-align: center;
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  line-height: 2.5;
  font-weight: 300;
  color: var(--text);
}
.verse { margin: 0; }
.stanza-gap { height: 1.6rem; }

.detail-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 2.4rem 0 1.6rem; }
.detail-actions {
  display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap;
  padding-top: 1.4rem; border-top: 1px solid var(--line);
}
.btn-secondary {
  cursor: pointer; font-family: inherit; font-weight: 600; font-size: .95rem;
  padding: .7rem 1.6rem; border-radius: 999px;
  border: 1px solid var(--gold-soft); background: transparent; color: var(--gold);
  transition: all .25s;
}
.btn-secondary:hover { background: var(--gold-soft); transform: translateY(-2px); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 240px 1fr; gap: 2.4rem; align-items: start; }
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; text-align: center; } }
.about-photo { text-align: center; }
.avatar {
  width: 180px; height: 180px; border-radius: 50%;
  margin: 0 auto .8rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--crimson), var(--gold));
  box-shadow: var(--shadow-hi);
}
.avatar-caption { color: var(--muted); font-weight: 300; }
.about-text p { line-height: 2.4; font-weight: 300; color: var(--text-soft); font-size: 1.08rem; }
.about-sub { font-size: 1.35rem; font-weight: 700; margin: 1.8rem 0 .6rem; color: var(--text); }
.about-name {
  font-size: 1.7rem; font-weight: 900; color: var(--gold);
  margin: 0 0 1.2rem;
}
.about-quote {
  margin-top: 1.6rem !important;
  padding: 1.1rem 1.3rem;
  border-right: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold-soft) 40%, transparent);
  border-radius: 10px;
  font-style: italic;
  color: var(--text) !important;
  font-size: 1.12rem !important;
  line-height: 2.2 !important;
}

/* ---------- Contact methods ---------- */
.cl-body { display: flex; flex-direction: column; gap: .1rem; }
.cl-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.cl-value { font-size: 1.02rem; font-weight: 700; color: var(--text); direction: ltr; text-align: right; }
.contact-link:hover .cl-value { color: var(--gold); }
.contact-link { align-items: center; }
.cl-dot { flex-shrink: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form-wrap, .contact-side {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 1.8rem; box-shadow: var(--shadow);
}
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-label { font-weight: 500; font-size: .92rem; color: var(--text-soft); }
.field-input {
  padding: .75rem 1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); font-family: inherit; font-size: 1rem;
  outline: none; resize: vertical; transition: border-color .25s, box-shadow .25s;
}
.field-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.form-err { color: var(--crimson); font-weight: 500; font-size: .9rem; }
.contact-form .btn-primary { animation: none; align-self: flex-start; }

.success-box { text-align: center; padding: 1.2rem; }
.success-icon {
  font-size: 3rem; color: var(--gold);
  animation: rise .5s ease both;
}
.success-box h3 { font-size: 1.4rem; margin: .4rem 0; }
.success-box p { color: var(--text-soft); font-weight: 300; margin-bottom: 1.4rem; }

.contact-side .about-sub { margin-top: 0; }
.contact-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 0; font-weight: 500; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.contact-link:hover { color: var(--gold); }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; }
.cl-dot.gold { background: var(--gold); }
.cl-dot.crimson { background: var(--crimson); }
.contact-note { color: var(--muted); font-size: .85rem; font-weight: 300; margin-top: 1.2rem; line-height: 1.9; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner {
  max-width: 1040px; margin: 0 auto; padding: 2.2rem 1.2rem;
  text-align: center;
}
.footer-brand { font-weight: 900; font-size: 1.2rem; color: var(--gold); margin-bottom: .5rem; }
.footer-copy { color: var(--text-soft); font-weight: 300; font-size: .92rem; margin: 0 0 .7rem; }
.footer-social { color: var(--text-soft); font-size: .9rem; }
.footer-social .sep { margin: 0 .5rem; color: var(--muted); }
.social-link:hover { color: var(--gold); }
.remix-link {
  display: inline-block; margin-top: 1rem; font-size: .8rem;
  color: var(--muted); border: 1px solid var(--line);
  padding: .3rem .9rem; border-radius: 999px;
}
.remix-link:hover { color: var(--gold); border-color: var(--gold-soft); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 1.4rem; left: 1.4rem; z-index: 50;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--gold), var(--crimson));
  box-shadow: var(--shadow-hi);
  animation: rise .4s ease both;
  transition: transform .25s;
}
.back-to-top:hover { transform: translateY(-4px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  z-index: 60;
  background: var(--text); color: var(--bg);
  padding: .7rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-hi);
  animation: toastIn .3s ease both;
}

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.fade-in { animation: fadeIn .5s ease both; }

@media (max-width: 720px) {
  .nav-desktop { display: none; }
  .header-mobile { display: flex; }
}