/* ==========================================================
   خانه‌پز | khanepaz.ir
   رنگ‌ها: گلاب (پس‌زمینه)، زعفران، پسته، هل (سبز تیره)، رز
   فونت‌ها: لالەزار برای عنوان‌ها، عارف رقعه برای جمله‌های دست‌نویس،
            وزیرمتن برای متن
   ========================================================== */

:root {
  --bg: #fff4ee;
  --bg2: #ffe6db;
  --card: #fffaf6;
  --ink: #35201f;
  --muted: #7a5a55;
  --line: #f0d6cb;
  --gold: #e0980b;
  --honey: #f5c451;
  --rose: #d9587a;
  --rose-ink: #b23c63;
  --pist: #9bbf6a;
  --green: #2f4a3a;
  --green-2: #3d5f4a;
  --cream: #fff4ee;
  --btn-bg: #2f4a3a;
  --btn-ink: #fff4ee;
  --hero-a: rgba(245, 196, 81, .38);
  --hero-b: rgba(217, 88, 122, .18);
  --hero-top: #ffe6d4;
  --shadow: 0 14px 34px -16px rgba(90, 40, 30, .38);
  --shadow-sm: 0 6px 16px -8px rgba(90, 40, 30, .3);
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font-body: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --font-display: "Lalezar", "Vazirmatn", Tahoma, sans-serif;
  --font-hand: "Aref Ruqaa", "Vazirmatn", serif;
}

[data-theme="dark"] {
  --bg: #16201a;
  --bg2: #1c2921;
  --card: #22302a;
  --ink: #fbeee2;
  --muted: #bdb0a4;
  --line: #34453b;
  --gold: #f0b13a;
  --rose: #ef86a2;
  --rose-ink: #f5a3b8;
  --green: #0f1a14;
  --green-2: #1b2a21;
  --btn-bg: #f5c451;
  --btn-ink: #23180f;
  --hero-a: rgba(245, 196, 81, .16);
  --hero-b: rgba(239, 134, 162, .12);
  --hero-top: #1d2b22;
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7);
  --shadow-sm: 0 6px 16px -8px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--bg);
  /* الگوی ستاره‌ی هشت‌پر خیلی محو، مثل کاشی */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23b23c63' stroke-opacity='.07' stroke-width='1.2'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.center { display: flex; justify-content: center; margin-top: 2rem; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; position: relative; }
.band { background: var(--bg2); }
.band-green { background: var(--green); color: var(--cream); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-content: center; justify-items: center; gap: 1rem;
  background: var(--bg);
  transition: opacity .6s ease, visibility .6s;
  font-family: var(--font-hand); font-size: 1.5rem; color: var(--rose-ink);
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-steam { display: flex; gap: 10px; height: 70px; align-items: flex-end; }
.loader-steam i {
  width: 12px; height: 60px; border-radius: 50%;
  background: linear-gradient(to top, var(--gold), transparent);
  filter: blur(3px);
  animation: steamUp 1.6s ease-in-out infinite;
}
.loader-steam i:nth-child(2) { animation-delay: .3s; height: 70px; }
.loader-steam i:nth-child(3) { animation-delay: .6s; }

.progress {
  position: fixed; top: 0; inset-inline: 0; height: 4px; z-index: 120;
  background: linear-gradient(90deg, var(--honey), var(--rose));
  transform-origin: 100% 50%; transform: scaleX(0);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; line-height: 1.4; transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-green { background: var(--btn-bg); color: var(--btn-ink); box-shadow: var(--shadow-sm); }
.btn-honey { background: var(--honey); color: #35201f; box-shadow: var(--shadow-sm); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; border: 0; background: transparent; color: var(--ink);
  transition: background .2s;
}
.icon-btn:hover { background: var(--bg2); }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.nav.scrolled { border-color: var(--line); box-shadow: 0 8px 24px -18px rgba(90, 40, 30, .5); }
.nav-in { display: flex; align-items: center; gap: .75rem; height: 68px; }
.logo { display: flex; align-items: center; gap: .4rem; color: var(--green); }
[data-theme="dark"] .logo { color: var(--honey); }
.logo-text { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; letter-spacing: .01em; color: var(--ink); }
.logo-mark .lm-steam { fill: none; stroke: var(--rose); stroke-width: 2; stroke-linecap: round; animation: logoSteam 3s ease-in-out infinite; }
.logo-mark .s2 { animation-delay: 1.2s; }
.nav-links { display: flex; align-items: center; gap: .15rem; margin-inline: auto; }
.nav-links a, .dd-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .45rem .85rem; border-radius: 999px; border: 0; background: none;
  font-weight: 500; font-size: .96rem; transition: background .2s;
}
.nav-links a:hover, .dd-btn:hover, .dd.open .dd-btn { background: var(--bg2); }
.nav-links a.is-active { box-shadow: inset 0 -3px 0 var(--gold); border-radius: 0; }
.nav-tools { display: flex; align-items: center; gap: .25rem; }
.search-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
  min-width: 190px; transition: border-color .2s, box-shadow .2s;
}
.search-pill:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.search-pill kbd {
  margin-inline-start: auto; font: inherit; font-size: .75rem;
  padding: 0 .45rem; border-radius: 6px; border: 1px solid var(--line);
}
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

.dd { position: relative; }
.dd-panel {
  position: absolute; top: calc(100% + 10px); inset-inline-start: -40px; z-index: 5;
  width: min(420px, 90vw); padding: .7rem; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr 1fr; gap: .25rem;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: .22s var(--ease);
}
.dd.open .dd-panel { opacity: 1; visibility: visible; transform: none; }
.dd-panel button {
  display: flex; align-items: center; gap: .6rem; text-align: start;
  padding: .55rem .7rem; border: 0; border-radius: 14px; background: none; font-weight: 500;
}
.dd-panel button:hover { background: var(--bg2); }
.dd-panel .em { font-size: 1.3rem; }

@media (max-width: 1040px) { .nav-links { display: none; } .nav-tools { margin-inline-start: auto; } }
@media (max-width: 620px) {
  .search-pill { min-width: 0; padding: .55rem; border-radius: 50%; }
  .search-pill span, .search-pill kbd { display: none; }
}

/* ---------- Sidebar ---------- */
.scrim { position: fixed; inset: 0; z-index: 140; background: rgba(30, 15, 12, .5); opacity: 0; visibility: hidden; transition: .3s; }
.scrim.open { opacity: 1; visibility: visible; }
.sidebar {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 150;
  width: min(340px, 88vw); padding: 1.2rem 1.4rem 2rem; overflow-y: auto;
  background: var(--card); box-shadow: var(--shadow);
  transform: translateX(105%); transition: transform .4s var(--ease);
  display: flex; flex-direction: column; gap: .6rem;
}
[dir="rtl"] .sidebar { transform: translateX(105%); }
.sidebar.open { transform: none !important; }
.sb-head { display: flex; align-items: center; justify-content: space-between; }
.sb-note { font-family: var(--font-hand); font-size: 1.2rem; color: var(--rose-ink); line-height: 1.7; }
.sb-title { font-size: .85rem; font-weight: 700; color: var(--muted); margin-top: .8rem; padding-bottom: .3rem; border-bottom: 1px dashed var(--line); }
.sb-list li button, .sb-list li a {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: start;
  padding: .55rem .6rem; border: 0; background: none; border-radius: 14px; font-weight: 500;
}
.sb-list li button:hover, .sb-list li a:hover { background: var(--bg2); }
.sb-list .n { margin-inline-start: auto; font-size: .82rem; color: var(--muted); background: var(--bg2); padding: 0 .55rem; border-radius: 999px; }
.sb-foot { margin-top: auto; padding-top: 1rem; font-size: .9rem; color: var(--muted); }
.sb-foot a { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Search overlay ---------- */
.search-layer {
  position: fixed; inset: 0; z-index: 200; padding: 8vh 1rem 1rem;
  display: flex; justify-content: center; align-items: flex-start;
  background: rgba(30, 15, 12, .55); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: .25s;
}
.search-layer.open { opacity: 1; visibility: visible; }
.search-box {
  width: min(680px, 100%); max-height: 80vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden;
  transform: translateY(-16px); transition: transform .3s var(--ease);
}
.search-layer.open .search-box { transform: none; }
.search-row { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 1.15rem; color: var(--ink); }
.search-results { overflow-y: auto; padding: .6rem; }
.sr-item { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .55rem; border: 0; background: none; border-radius: 16px; text-align: start; }
.sr-item:hover, .sr-item:focus-visible { background: var(--bg2); }
.sr-thumb { flex: none; width: 54px; height: 54px; border-radius: 14px; overflow: hidden; }
.sr-thumb .art { aspect-ratio: 1; height: 100%; }
.sr-thumb .art-emoji { font-size: 1.8rem; animation: none; }
.sr-thumb .wisp { display: none; }
.sr-title { font-weight: 700; }
.sr-sub { font-size: .85rem; color: var(--muted); }
.sr-empty { padding: 1.4rem 1rem; text-align: center; color: var(--muted); }
.sr-hint { padding: .5rem 1rem .2rem; font-size: .85rem; color: var(--muted); }
.sr-tags { display: flex; flex-wrap: wrap; gap: .5rem; padding: .4rem 1rem 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 50% at 78% 18%, var(--hero-a), transparent 70%),
    radial-gradient(45% 45% at 8% 85%, var(--hero-b), transparent 70%),
    linear-gradient(180deg, var(--hero-top), var(--bg));
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2rem;
  padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(5.5rem, 10vw, 8.5rem);
}
.since { font-family: var(--font-hand); font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--rose-ink); margin-bottom: .4rem; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.7rem, 6.4vw, 5.2rem); line-height: 1.3;
  text-shadow: 3px 3px 0 var(--honey);   /* مثل تابلوی شیرینی‌فروشی‌های قدیمی */
  margin-bottom: 1rem;
}
.lead { max-width: 34em; color: var(--muted); font-size: 1.08rem; margin-bottom: 1.6rem; }
.hero-search {
  display: flex; gap: .5rem; max-width: 520px; padding: .4rem;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hero-search input { flex: 1; min-width: 0; padding: .4rem 1rem; border: 0; outline: 0; background: none; font-size: 1.02rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.tag {
  padding: .2rem .85rem; border-radius: 999px; font-size: .9rem;
  border: 1.5px dashed color-mix(in srgb, var(--rose) 60%, transparent); background: transparent; color: var(--rose-ink);
  transition: background .2s, color .2s;
}
.tag:hover { background: var(--rose); color: #fff; border-style: solid; }
.hero-count { margin-top: 1.4rem; color: var(--muted); font-size: .95rem; }

.hero-art { position: relative; justify-self: center; width: min(520px, 100%); }
.hero-art svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 20px 20px rgba(90, 40, 30, .08)); }
.steam path {
  transform-box: fill-box; transform-origin: 50% 100%; opacity: 0;
  animation: steamRise 5.5s ease-in-out infinite;
}
.steam path:nth-child(2) { animation-delay: 1.8s; }
.steam path:nth-child(3) { animation-delay: 3.4s; }
[data-theme="dark"] .steam { opacity: .8; }
.wave { position: absolute; z-index: 3; bottom: -1px; left: 0; width: 100%; height: clamp(40px, 6vw, 90px); fill: var(--bg); }

/* ذرات عطر: شکر، گلبرگ و ادویه که از پایین بالا می‌روند */
.aroma { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.p { position: absolute; bottom: -40px; opacity: 0; animation: floatUp linear infinite; will-change: transform, opacity; }
.p.sugar { width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(#fff 30%, #ffe7b0 62%, transparent 72%); box-shadow: 0 0 10px #fff; }
.p.petal { width: var(--s); height: calc(var(--s) * 1.35); background: linear-gradient(135deg, #f8b0c2, var(--rose)); border-radius: 85% 0 85% 0; }
.p.spice { width: calc(var(--s) * .45); height: calc(var(--s) * 2.2); border-radius: 6px; background: linear-gradient(#b26a36, #6d3517); }

/* ورود یک‌باره‌ی هیرو */
.js .hero-text > * { animation: rise .9s var(--ease) both; }
.js .hero-text > :nth-child(2) { animation-delay: .12s; }
.js .hero-text > :nth-child(3) { animation-delay: .24s; }
.js .hero-text > :nth-child(4) { animation-delay: .36s; }
.js .hero-text > :nth-child(5) { animation-delay: .46s; }
.js .hero-text > :nth-child(6) { animation-delay: .56s; }
.js .hero-art svg { animation: plateIn 1.2s var(--ease) .2s both; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: min(340px, 80%); }
}

[data-theme="dark"] .hero h1 { text-shadow: 3px 3px 0 #a86a10; }

/* ---------- Section heading ---------- */
.sec-head { max-width: 40rem; margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.sec-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.4; }
.sec-head h2::after {
  content: ""; display: block; width: 92px; height: 12px; margin-top: .2rem;
  background:
    radial-gradient(circle, var(--gold) 3px, transparent 3.5px) center / 12px 12px repeat-x;
  opacity: .9;
}
.sec-head p { color: var(--muted); margin-top: .5rem; }
.sec-head.light p { color: color-mix(in srgb, var(--cream) 78%, transparent); }

/* ---------- Art (تصویر جایگزین: گرادیان + ایموجی + بخار) ---------- */
.art {
  position: relative; overflow: hidden; aspect-ratio: 4/3; width: 100%;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, .38), transparent 45%),
    linear-gradient(140deg, var(--a, #f4c26b), var(--b, #c9743a));
  display: grid; place-items: center;
}
.art::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(circle, rgba(255, 255, 255, .5) 1.4px, transparent 2px) 0 0 / 22px 22px;
}
.art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-emoji {
  position: relative; z-index: 1; font-size: clamp(3rem, 8vw, 4.6rem); line-height: 1;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .25));
  animation: bob 4.5s ease-in-out infinite;
}
.wisp {
  position: absolute; bottom: 30%; width: 14px; height: 58px; border-radius: 50%;
  background: linear-gradient(to top, rgba(255, 255, 255, .8), transparent);
  filter: blur(6px); opacity: 0; animation: wisp 3.6s ease-in-out infinite;
}
.wisp.w1 { left: 38%; } .wisp.w2 { left: 50%; animation-delay: 1.2s; } .wisp.w3 { left: 62%; animation-delay: 2.4s; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card {
  position: relative; overflow: hidden; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card .badge {
  position: absolute; top: .8rem; inset-inline-start: .8rem; z-index: 2;
  padding: .1rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(255, 250, 246, .92); color: #35201f;
}
.card .ribbon {
  position: absolute; top: .8rem; inset-inline-end: .8rem; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--honey); color: #35201f; font-size: 1rem; box-shadow: var(--shadow-sm);
}
.card-body { padding: 1rem 1.2rem 1.2rem; }
.card h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.6; }
.card p { color: var(--muted); font-size: .94rem; margin: .2rem 0 .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; align-items: center; gap: .9rem; font-size: .86rem; color: var(--muted); }
.stars {
  direction: ltr; display: inline-block; letter-spacing: 2px; font-size: .95rem; line-height: 1;
  background: linear-gradient(90deg, var(--gold) calc(var(--r, 0) / 5 * 100%), var(--line) 0);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.meta .rate-n { margin-inline-start: -.5rem; font-weight: 700; color: var(--ink); }

/* ---------- Categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.cat {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; text-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.cat:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow-sm); }
.cat-ic { flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.9rem; background: var(--bg2); }
.cat b { display: block; font-size: 1.05rem; }
.cat small { color: var(--muted); line-height: 1.6; display: block; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.chip {
  padding: .4rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  font-weight: 500; transition: .2s;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-selected="true"] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }

/* ---------- Carousel ---------- */
.sec-carousel { padding-top: 0; margin-top: -1.5rem; z-index: 4; }
.carousel { position: relative; height: clamp(400px, 46vw, 460px); border-radius: 32px; overflow: hidden; box-shadow: var(--shadow); background: var(--green); }
.slide {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 1rem;
  padding: clamp(1.5rem, 5vw, 3.8rem) clamp(3.6rem, 8vw, 6rem); color: #fff;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .28), transparent 50%), linear-gradient(120deg, var(--a), var(--b));
  opacity: 0; visibility: hidden; transform: scale(1.04); transition: opacity .9s ease, transform 1.2s var(--ease), visibility .9s;
}
.slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(20, 10, 6, .55), rgba(20, 10, 6, .1) 70%); }
.slide.on { opacity: 1; visibility: visible; transform: none; z-index: 1; }
.slide-text { position: relative; z-index: 1; max-width: 34rem; }
.pill { display: inline-block; padding: .1rem .9rem; border-radius: 999px; background: var(--honey); color: #35201f; font-weight: 700; font-size: .85rem; margin-bottom: .8rem; }
.slide h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.45; text-shadow: 0 3px 14px rgba(0, 0, 0, .35); }
.slide p { margin: .6rem 0 1.4rem; font-size: 1.05rem; text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.slide-art { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; }
.slide-art .big { font-size: clamp(6rem, 16vw, 11rem); line-height: 1; filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .35)); animation: bob 5s ease-in-out infinite; }
.slide-art img { max-height: 90%; border-radius: 24px; box-shadow: var(--shadow); }
.slide-art .wisp { bottom: 55%; }
.slide-art .wisp.w1 { left: 40%; } .slide-art .wisp.w2 { left: 50%; } .slide-art .wisp.w3 { left: 60%; }
.car-btn {
  position: absolute; top: 50%; z-index: 5; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%;
  border: 0; background: rgba(255, 250, 246, .9); color: #35201f; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center; transition: transform .2s, background .2s;
}
.car-btn:hover { transform: scale(1.08); background: #fff; }
.car-btn.prev { right: 1rem; } .car-btn.next { left: 1rem; }
.dots { position: absolute; z-index: 5; bottom: 1rem; inset-inline: 0; display: flex; justify-content: center; gap: .5rem; }
.dots button { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .5); transition: width .3s var(--ease), background .3s; }
.dots button[aria-current="true"] { width: 30px; background: var(--honey); }

@media (max-width: 720px) {
  .carousel { height: 520px; }
  .slide { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: center; padding: 1.5rem 1.5rem 3.5rem; }
  .slide::before { background: linear-gradient(to top, rgba(20, 10, 6, .6), rgba(20, 10, 6, .15)); }
  .slide-art { order: -1; }
  .slide-art .big { font-size: 6rem; }
  .car-btn { top: 22%; }
}

/* ---------- Tutorials ---------- */
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.2rem; }
.tut {
  position: relative; text-align: start; padding: 1.4rem 1.3rem 1.3rem; border: 0; border-radius: 24px;
  background: var(--card); color: var(--ink); overflow: hidden;
  transition: transform .3s var(--ease);
}
.tut::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 8px; background: var(--c); }
.tut:hover { transform: translateY(-5px) rotate(-.6deg); }
.tut-ic { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: color-mix(in srgb, var(--c) 28%, var(--card)); font-size: 2rem; margin-bottom: .8rem; }
.tut h3 { font-size: 1.15rem; line-height: 1.7; }
.tut p { color: var(--muted); font-size: .92rem; margin: .3rem 0 .9rem; }
.tut-meta { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .82rem; }
.tut-meta span { padding: 0 .7rem; border-radius: 999px; background: var(--bg2); }

/* ---------- Gallery ---------- */
.gallery { column-count: 3; column-gap: 1.1rem; }
.g-item { position: relative; display: block; width: 100%; margin: 0 0 1.1rem; padding: 0; border: 0; border-radius: 22px; overflow: hidden; break-inside: avoid; box-shadow: var(--shadow-sm); }
.g-item .art { aspect-ratio: var(--ratio, 1/1); transition: transform .6s var(--ease); }
.g-item:hover .art { transform: scale(1.05); }
.g-item .art-emoji { font-size: clamp(3.5rem, 9vw, 6rem); }
.g-cap {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 3; padding: 1.8rem 1rem .8rem; text-align: start; color: #fff; font-weight: 500;
  background: linear-gradient(to top, rgba(20, 10, 6, .7), transparent);
}
@media (max-width: 900px) { .gallery { column-count: 2; } }
@media (max-width: 520px) { .gallery { column-count: 1; } }

/* ---------- Latest ---------- */
.hscroll { display: flex; gap: 1.1rem; overflow-x: auto; padding: .4rem max(1rem, calc((100vw - 1200px) / 2 + 2rem)) 1.6rem; scroll-snap-type: x proximity; }
.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.mini { flex: 0 0 270px; scroll-snap-align: start; }
.mini .art { aspect-ratio: 16/10; }
.new-dot { position: absolute; top: .8rem; inset-inline-end: .8rem; z-index: 2; padding: .05rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--rose); color: #fff; }
.date { font-size: .82rem; color: var(--muted); }

/* ---------- Best ---------- */
.best-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; }
.rank {
  display: grid; grid-template-columns: 58px 84px 1fr; align-items: center; gap: 1rem; width: 100%;
  padding: .8rem 1rem; text-align: start; border: 1px solid var(--line); border-radius: 22px; background: var(--card);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.rank:hover { transform: translateX(-4px); box-shadow: var(--shadow-sm); }
.rank-n { font-family: var(--font-display); font-size: 2.8rem; line-height: 1; text-align: center; color: transparent; -webkit-text-stroke: 2px var(--gold); }
.rank-top .rank-n { color: var(--gold); -webkit-text-stroke: 0; }
.rank .thumb { width: 84px; border-radius: 16px; overflow: hidden; }
.rank .thumb .art { aspect-ratio: 1; }
.rank .thumb .art-emoji { font-size: 2.4rem; animation: none; }
.rank .thumb .wisp { display: none; }
.rank h3 { font-size: 1.1rem; line-height: 1.6; }
.rank .meta { margin-top: .1rem; }
@media (max-width: 860px) { .best-list { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .rank { grid-template-columns: 44px 68px 1fr; gap: .6rem; } .rank .thumb { width: 68px; } .rank-n { font-size: 2.2rem; } }

/* ---------- Story ---------- */
.story { position: relative; overflow: hidden; background: var(--green); color: var(--cream); padding: clamp(4rem, 9vw, 7rem) 0; }
.story-in { position: relative; z-index: 2; display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.story-num { display: flex; align-items: baseline; gap: .6rem; font-family: var(--font-display); }
.story-num b { font-weight: 400; font-size: clamp(6rem, 16vw, 11rem); line-height: 1; color: transparent; -webkit-text-stroke: 3px var(--honey); }
.story-num span { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--honey); }
.story-text h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.5; margin-bottom: .8rem; }
.story-text p { max-width: 38rem; margin-bottom: .8rem; color: color-mix(in srgb, var(--cream) 88%, transparent); }
.story-text .sig { font-family: var(--font-hand); font-size: 1.5rem; color: var(--honey); }
.story-steam { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.story-steam i {
  position: absolute; bottom: -20px; width: 46px; height: 260px; border-radius: 50%;
  background: linear-gradient(to top, rgba(255, 244, 238, .16), transparent);
  filter: blur(14px); animation: steamUp 9s ease-in-out infinite;
}
.story-steam i:nth-child(1) { left: 12%; } .story-steam i:nth-child(2) { left: 38%; animation-delay: 2.5s; }
.story-steam i:nth-child(3) { left: 64%; animation-delay: 5s; } .story-steam i:nth-child(4) { left: 88%; animation-delay: 1.2s; }
@media (max-width: 760px) { .story-in { grid-template-columns: 1fr; } }

/* ---------- Comments ---------- */
.cm-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2rem; align-items: start; }
.cm-list { display: grid; gap: 1rem; }
.cm { padding: 1.1rem 1.3rem; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.cm-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .4rem; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #35201f; background: var(--c, var(--honey)); }
.cm b { display: block; line-height: 1.4; }
.cm small { color: var(--muted); }
.cm .stars { margin-right: auto; }
.cm p { color: var(--ink); }
.cm .on { display: inline-block; margin-top: .4rem; font-size: .85rem; color: var(--rose-ink); font-weight: 500; border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 4px; }
.cm .mine { font-size: .75rem; padding: 0 .5rem; border-radius: 999px; background: var(--bg2); color: var(--muted); margin-inline-start: .4rem; }
.cm-form { position: sticky; top: 92px; display: grid; gap: .9rem; padding: 1.4rem; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.cm-form h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.cm-form label, .cm-form legend { display: grid; gap: .3rem; font-weight: 500; font-size: .92rem; }
.cm-form input, .cm-form select, .cm-form textarea {
  width: 100%; padding: .6rem .9rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); outline: 0; transition: border-color .2s;
}
.cm-form input:focus, .cm-form select:focus, .cm-form textarea:focus { border-color: var(--gold); }
.cm-form fieldset { border: 0; padding: 0; margin: 0; }
.rate-stars { display: flex; gap: .2rem; direction: ltr; justify-content: flex-end; }
.rate-stars button { border: 0; background: none; font-size: 1.9rem; line-height: 1; padding: .1rem; color: var(--line); transition: transform .15s, color .15s; }
.rate-stars button.on { color: var(--gold); }
.rate-stars button:hover { transform: scale(1.2); }
.hint { font-size: .82rem; color: var(--muted); }
@media (max-width: 900px) { .cm-layout { grid-template-columns: 1fr; } .cm-form { position: static; } }

/* ---------- Footer ---------- */
.footer { background: var(--green); color: var(--cream); padding: 3.5rem 0 1.5rem; }
[data-theme="dark"] .footer { background: #0c140f; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer .logo-text { color: var(--honey); }
.foot-desc { margin: .6rem 0; color: color-mix(in srgb, var(--cream) 78%, transparent); font-size: .95rem; max-width: 26rem; }
.domain { display: inline-block; padding: .1rem .9rem; border-radius: 999px; border: 1.5px dashed var(--honey); color: var(--honey); font-size: .92rem; }
.footer h4 { margin-bottom: .7rem; color: var(--honey); font-size: 1rem; }
.footer li { margin-bottom: .35rem; }
.footer a, .footer li button { color: color-mix(in srgb, var(--cream) 85%, transparent); border: 0; background: none; padding: 0; text-align: start; }
.footer a:hover, .footer li button:hover { color: var(--honey); text-decoration: underline; text-underline-offset: 4px; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 244, 238, .15); font-size: .9rem; color: color-mix(in srgb, var(--cream) 70%, transparent); }
.to-top { border: 1.5px solid rgba(255, 244, 238, .35); background: none; color: var(--cream); padding: .2rem 1rem; border-radius: 999px; }
.to-top:hover { background: var(--honey); color: #35201f; border-color: var(--honey); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 1rem; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.modal.open { opacity: 1; visibility: visible; }
.modal-scrim { position: absolute; inset: 0; background: rgba(30, 15, 12, .6); backdrop-filter: blur(5px); }
.modal-panel {
  position: relative; width: min(920px, 100%); max-height: 92vh; overflow-y: auto; outline: 0;
  background: var(--card); border-radius: 30px; box-shadow: var(--shadow);
  transform: translateY(26px) scale(.98); transition: transform .4s var(--ease);
}
.modal.open .modal-panel { transform: none; }
.m-close { position: absolute; top: .9rem; inset-inline-end: .9rem; z-index: 5; background: rgba(255, 250, 246, .92); color: #35201f; }
.m-head { position: relative; min-height: 230px; display: flex; align-items: flex-end; padding: 1.6rem clamp(1.2rem, 4vw, 2.4rem); color: #fff; overflow: hidden; }
.m-head .art { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.m-head .art-emoji { position: absolute; inset-inline-end: 8%; top: 50%; margin-top: -3.6rem; font-size: 7rem; }
.m-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 10, 6, .72), rgba(20, 10, 6, .05) 70%); }
.m-title { position: relative; z-index: 2; }
.m-title h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.4; text-shadow: 0 3px 12px rgba(0, 0, 0, .4); }
.m-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.m-chips > span { padding: 0 .8rem; border-radius: 999px; font-size: .88rem; background: rgba(255, 250, 246, .92); color: #35201f; }
.m-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(1.2rem, 4vw, 2.4rem); padding: clamp(1.2rem, 4vw, 2.2rem); }
.m-lead { grid-column: 1 / -1; font-size: 1.08rem; color: var(--muted); }
.m-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin-bottom: .6rem; }
.ing { position: sticky; top: 0; align-self: start; padding: 1.1rem; border-radius: 22px; background: var(--bg2); }
.ing label { display: flex; align-items: flex-start; gap: .6rem; padding: .3rem 0; cursor: pointer; line-height: 1.7; }
.ing input { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .45rem; accent-color: var(--green-2); }
.ing input:checked + span { text-decoration: line-through; opacity: .55; }
.steps { counter-reset: st; display: grid; gap: .9rem; }
.steps li { counter-increment: st; position: relative; padding-inline-start: 3rem; }
.steps li::before {
  content: counter(st, persian); position: absolute; inset-inline-start: 0; top: .1rem;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--btn-bg); color: var(--btn-ink); font-weight: 700; font-size: .95rem;
}
.tip { grid-column: 1 / -1; padding: 1rem 1.3rem; border-radius: 20px; background: color-mix(in srgb, var(--honey) 32%, var(--card)); border: 1.5px dashed var(--gold); }
.tip b { font-family: var(--font-hand); font-size: 1.25rem; margin-inline-end: .4rem; }
.m-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .6rem; }
.m-related { grid-column: 1 / -1; }
.m-related .row { display: flex; gap: .6rem; flex-wrap: wrap; }
.m-related button { padding: .35rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); }
.m-related button:hover { border-color: var(--gold); }
.lb-body { padding: 1.4rem clamp(1.2rem, 4vw, 2.2rem) 2rem; display: grid; gap: 1rem; justify-items: start; }
@media (max-width: 700px) { .m-body { grid-template-columns: 1fr; } .ing { position: static; } .m-head .art-emoji { font-size: 5rem; margin-top: -3.5rem; } }

.toast {
  position: fixed; z-index: 400; bottom: 1.4rem; left: 50%; transform: translate(-50%, 30px);
  padding: .7rem 1.4rem; border-radius: 999px; background: var(--green); color: var(--cream); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: .35s var(--ease);
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.error-box { margin: 2rem auto; max-width: 640px; padding: 1.4rem; border-radius: 20px; border: 2px dashed var(--rose); background: var(--card); }
.error-box code { direction: ltr; display: inline-block; padding: 0 .5rem; border-radius: 8px; background: var(--bg2); }

/* ---------- Keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes plateIn { from { opacity: 0; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes steamRise {
  0% { opacity: 0; transform: translateY(26px) scaleX(.9); }
  25% { opacity: .9; }
  70% { opacity: .35; }
  100% { opacity: 0; transform: translateY(-50px) scaleX(1.25) skewX(6deg); }
}
@keyframes steamUp {
  0% { opacity: 0; transform: translateY(20px) scaleY(.8); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-80px) scaleY(1.3) translateX(14px); }
}
@keyframes logoSteam { 0%, 100% { opacity: .2; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes wisp {
  0% { opacity: 0; transform: translateY(20px) scaleY(.7); }
  35% { opacity: .75; }
  100% { opacity: 0; transform: translateY(-48px) translateX(10px) scaleY(1.4); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
  10% { opacity: .95; }
  50% { transform: translate3d(calc(var(--dx) * .5), -46vh, 0) rotate(160deg); }
  90% { opacity: .5; }
  100% { opacity: 0; transform: translate3d(var(--dx), -95vh, 0) rotate(330deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .p, .wisp, .steam path { display: none; }
}

@media print {
  body > *:not(.modal) { display: none !important; }
  .modal { position: static; opacity: 1; visibility: visible; padding: 0; }
  .modal-scrim, .m-close, .m-actions, .m-related { display: none !important; }
  .modal-panel { max-height: none; box-shadow: none; transform: none; }
  .m-head { min-height: 120px; color: #000; }
  .m-head::after { display: none; }
}
