/* ============ রান্না — design system (learn-anything.xyz style) ============ */

:root {
  --bg: #0a0a0f;
  --surface: #13131c;
  --surface-2: #1a1a26;
  --surface-3: #232333;
  --ink: #f4f0e6;
  --ink-dim: #a9a4b8;
  --ink-faint: #6b6680;
  --accent: #e8a33d;
  --accent-soft: #f2c37d;
  --leaf: #7fb069;
  --chili: #e2574c;
  --radius: 12px;
  --font-display: 'Raleway', 'Noto Serif Bengali', system-ui, sans-serif;
  --font-bn: 'Hind Siliguri', 'Noto Serif Bengali', system-ui, sans-serif;
  --font-serif: 'Noto Serif Bengali', serif;
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-bn);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: rgba(232, 163, 61, 0.35); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2d2d40; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ============ particle canvas ============ */
#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============ app shell ============ */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.nav-brand .bn-tag {
  font-family: var(--font-serif);
  color: var(--accent);
  font-weight: 700;
}

.nav-links { display: flex; align-items: center; gap: 6px; }

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-dim);
  transition: color 0.25s, background 0.25s;
  border: 1px solid transparent;
}

.nav-link:hover { color: var(--ink); background: var(--surface-2); }

.nav-link.active { color: var(--ink); background: var(--surface-2); border-color: rgba(232, 163, 61, 0.3); }

/* ============ hero (landing) ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(-24px);
  animation: drop-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.hero-title .bn-line {
  display: block;
  font-family: var(--font-serif);
  color: var(--accent-soft);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-dim);
  max-width: 480px;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(16px);
  animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.hero-sub .bn {
  font-weight: 600;
  color: var(--ink);
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ command palette ============ */
.palette {
  width: 100%;
  max-width: 560px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.75s forwards;
}

.palette-box {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.palette-box:focus-within {
  border-color: rgba(232, 163, 61, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(232, 163, 61, 0.08);
}

.palette-input-wrap { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }

.palette-input-wrap svg { flex-shrink: 0; opacity: 0.55; }

.palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 1.05rem;
  padding: 2px 0;
}

.palette-input::placeholder { color: var(--ink-faint); }

.palette-hint {
  font-size: 0.78rem;
  color: var(--ink-faint);
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  color: var(--ink-dim);
  font-family: var(--font-bn);
}

/* ============ palette results ============ */
.palette-results {
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: none;
}

.palette-results.open { display: block; animation: fade-in 0.25s ease both; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.18s;
}

.palette-item:hover, .palette-item.selected { background: var(--surface-2); }

.palette-item .emoji {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border-radius: 10px;
  flex-shrink: 0;
}

.palette-item .titles { flex: 1; min-width: 0; }

.palette-item .t-en { font-size: 0.98rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.palette-item .t-bn { font-size: 0.84rem; color: var(--ink-dim); font-family: var(--font-serif); }

.palette-item .cat {
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid rgba(232, 163, 61, 0.3);
  padding: 2px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.palette-empty {
  padding: 22px 18px;
  color: var(--ink-faint);
  text-align: center;
  font-size: 0.92rem;
}

/* ============ category chips ============ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
  opacity: 0;
  transform: translateY(16px);
  animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
}

.chip {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--ink-dim);
  font-size: 0.92rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip:hover {
  color: var(--ink);
  border-color: rgba(232, 163, 61, 0.45);
  transform: translateY(-2px);
}

.chip .bn { font-family: var(--font-serif); }

/* ============ page header ============ */
.page-head {
  padding: 72px 24px 28px;
  text-align: center;
  opacity: 0;
  animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.01em;
}

.page-title .bn { font-family: var(--font-serif); color: var(--accent-soft); }

.page-sub { color: var(--ink-dim); margin-top: 10px; font-size: 1rem; }

/* ============ recipe grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  padding: 20px 24px 80px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s, box-shadow 0.35s;
  opacity: 0;
  transform: translateY(24px);
}

.card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s, box-shadow 0.35s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(232, 163, 61, 0.35);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.card-media {
  height: 170px;
  display: grid;
  place-items: center;
  font-size: 4rem;
  background: radial-gradient(circle at 30% 20%, var(--surface-3), var(--surface));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card-media { transform: scale(1.06); }

.card-body { padding: 18px 18px 20px; }

.card-title { font-weight: 700; font-size: 1.08rem; line-height: 1.3; }

.card-title .bn {
  font-family: var(--font-serif);
  color: var(--accent-soft);
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 3px;
}

.card-meta {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  align-items: center;
}

.card-source {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink-dim);
  backdrop-filter: blur(6px);
}

.card-source.kaggle { color: #66b8f0; border-color: rgba(102, 184, 240, 0.35); }

/* ============ recipe detail ============ */
.recipe-hero {
  position: relative;
  padding: 56px 24px 0;
  text-align: center;
}

.recipe-hero .emoji {
  font-size: 4.6rem;
  display: block;
  margin-bottom: 18px;
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.recipe-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  animation: drop-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.recipe-hero .bn-title {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--accent-soft);
  margin-top: 8px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 10px;
}

.meta-pill {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.86rem;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  animation: rise-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.recipe-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 0;
  flex-wrap: wrap;
}

.btn {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover { transform: translateY(-2px); border-color: rgba(232, 163, 61, 0.5); }

.btn.primary {
  background: linear-gradient(135deg, #e8a33d, #d98a2b);
  color: #1c1408;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(232, 163, 61, 0.25);
}

.btn.primary:hover { box-shadow: 0 12px 32px rgba(232, 163, 61, 0.35); }

.btn.ghost { background: transparent; }

.btn .fav { color: var(--chili); }

/* ============ two-column detail ============ */
.detail {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 44px;
  padding: 36px 24px 90px;
  align-items: start;
}

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 32px; }
}

.ingredients-panel {
  position: sticky;
  top: 90px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  opacity: 0;
  transform: translateX(-16px);
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@media (max-width: 860px) {
  .ingredients-panel { position: static; }
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.panel-title .bn { font-family: var(--font-serif); color: var(--accent-soft); }

.panel-hint { font-size: 0.78rem; color: var(--ink-faint); margin-bottom: 16px; }

.ing-list { list-style: none; }

.ing-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, padding 0.2s;
  font-size: 0.94rem;
  color: var(--ink-dim);
}

.ing-item:hover { background: var(--surface-2); padding-left: 8px; }

.ing-item .box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  margin-top: 2px;
  display: grid;
  place-items: center;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.ing-item .box svg { opacity: 0; transform: scale(0.4); transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); }

.ing-item.done { color: var(--ink-faint); }

.ing-item.done .box {
  background: var(--leaf);
  border-color: var(--leaf);
}

.ing-item.done .box svg { opacity: 1; transform: scale(1); }

.ing-item.done .text { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }

/* ============ steps timeline ============ */
.steps-block { min-width: 0; }

.steps-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.steps-title .bn { font-family: var(--font-serif); color: var(--accent-soft); }

.steps-sub { color: var(--ink-faint); margin-bottom: 30px; font-size: 0.92rem; }

.step {
  position: relative;
  padding: 0 0 34px 56px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.step.revealed { opacity: 1; transform: translateY(0); }

.step::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 6px;
  bottom: -6px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(232, 163, 61, 0.5), rgba(232, 163, 61, 0.08));
}

.step:last-child::before { display: none; }

.step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(232, 163, 61, 0.3);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.step.active .step-num {
  background: linear-gradient(135deg, #e8a33d, #d98a2b);
  color: #1c1408;
  border-color: transparent;
  box-shadow: 0 0 0 6px rgba(232, 163, 61, 0.15), 0 8px 24px rgba(232, 163, 61, 0.3);
  transform: scale(1.08);
}

.step.done .step-num {
  background: var(--leaf);
  color: #0c120a;
  border-color: transparent;
}

.step-text {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 18px 22px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-dim);
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.step.active .step-text {
  border-color: rgba(232, 163, 61, 0.4);
  background: var(--surface-2);
  color: var(--ink);
  transform: translateX(6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.step.done .step-text { opacity: 0.55; }

/* ============ cook mode ============ */
.cook-bar {
  position: sticky;
  bottom: 20px;
  z-index: 40;
  max-width: 640px;
  margin: 0 auto;
  background: rgba(26, 26, 38, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  padding: 16px 18px;
  display: none;
  align-items: center;
  gap: 14px;
}

.cook-bar.open { display: flex; animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

.cook-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #e8a33d, #f2c37d);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.cook-label { font-size: 0.86rem; color: var(--ink-dim); flex: 1; }

.cook-label strong { color: var(--accent-soft); font-family: var(--font-serif); }

.cook-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface-3);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: all 0.25s;
}

.cook-btn:hover { border-color: rgba(232, 163, 61, 0.5); transform: translateY(-1px); }

.cook-btn.primary { background: linear-gradient(135deg, #e8a33d, #d98a2b); color: #1c1408; border-color: transparent; }

/* ============ footer ============ */
.footer {
  text-align: center;
  padding: 40px 24px 30px;
  color: var(--ink-faint);
  font-size: 0.84rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer .bn { font-family: var(--font-serif); color: var(--ink-dim); }

/* ============ toast ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--surface-2);
  border: 1px solid rgba(232, 163, 61, 0.4);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 0.92rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ saved page ============ */
.saved-empty {
  text-align: center;
  padding: 90px 24px;
  color: var(--ink-faint);
}

.saved-empty .emoji { font-size: 3.6rem; display: block; margin-bottom: 16px; }

.saved-empty .bn { font-family: var(--font-serif); color: var(--ink-dim); font-size: 1.1rem; }

/* ============ reveal helper ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ============ spinner ============ */
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ responsive nav ============ */
@media (max-width: 640px) {
  .nav-link span.long { display: none; }
  .hero { padding: 90px 18px 60px; }
  .grid { grid-template-columns: 1fr; }
}