/* =========================================================================
   bijoytounicodes.com — Design System
   Theme: Bangladesh nature & culture (flag green, jute gold, river blue,
   nakshi-kantha motifs). Mobile-first, responsive, light + dark.
   ========================================================================= */

/* ----- Design tokens ----- */
:root {
  /* Brand — Bangladesh */
  --green-900: #052b21;
  --green-800: #073d2f;
  --green-700: #0a5a43;
  --green-600: #006a4e;   /* national flag green */
  --green-500: #0c8a67;
  --green-300: #7fc9b2;
  --green-100: #dcefe7;

  --red-600:   #f42a41;   /* flag sun / accent */
  --red-500:   #e63e52;

  --gold-600:  #d99b2b;   /* jute / harvest */
  --gold-400:  #f0c05a;
  --river-600: #2b7fb0;   /* Padma / Meghna */
  --river-300: #9bcbe6;

  /* Neutrals — warm handmade-paper feel */
  --bg:        #fbfaf5;
  --bg-alt:    #f2f1e9;
  --surface:   #ffffff;
  --surface-2: #f7f6f0;
  --border:    #e5e2d6;
  --ink:       #1c2620;
  --ink-soft:  #46554c;
  --ink-mute:  #6d7c72;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(5, 43, 33, .06), 0 1px 3px rgba(5, 43, 33, .08);
  --shadow-md: 0 6px 18px -6px rgba(5, 43, 33, .18), 0 2px 6px rgba(5, 43, 33, .06);
  --shadow-lg: 0 24px 48px -18px rgba(5, 43, 33, .28);
  --ring: 0 0 0 3px rgba(0, 106, 78, .22);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --maxw: 1140px;
  --gutter: clamp(16px, 4vw, 32px);

  --font-bn: "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --font-en: "Poppins", "Hind Siliguri", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Light theme only — dark mode intentionally not used. */

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-en);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(bn), .bn { font-family: var(--font-bn); }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-en); line-height: 1.2; font-weight: 700; color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* ----- Layout ----- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(40px, 6vw, 72px); }
.stack > * + * { margin-top: 1rem; }

/* ----- Kantha stitch divider ----- */
.kantha {
  height: 10px;
  width: 100%;
  background-image: repeating-linear-gradient(90deg,
      var(--green-600) 0 14px, transparent 14px 26px);
  opacity: .5;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* =====================  HEADER  ===================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 16px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--green-600), var(--green-800));
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand b { color: var(--green-600); }
.brand span.tld { color: var(--gold-600); }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--ink-soft); font-weight: 600; font-size: .93rem;
  padding: 9px 12px; border-radius: 10px; white-space: nowrap;
}
.nav-links a:hover { background: var(--surface-2); color: var(--green-600); text-decoration: none; }
.nav-links a.active { color: var(--green-600); background: var(--green-100); }

.nav-tools { position: relative; }
.nav-tools > button { background: none; border: 0; cursor: pointer; }
.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; display: none;
}
.nav-tools:hover .dropdown, .nav-tools:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.dropdown a:hover { background: var(--surface-2); text-decoration: none; color: var(--green-600); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-soft);
}
.icon-btn:hover { color: var(--green-600); border-color: var(--green-300); }
.lang-btn { width: auto; min-width: 46px; padding: 0 14px; font-weight: 700; font-size: .85rem; letter-spacing: .01em; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: 66px 0 auto 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 20px; margin: 0;
    box-shadow: var(--shadow-md);
    transform: translateY(-140%); transition: transform .28s ease; visibility: hidden;
  }
  .nav-links.open { transform: translateY(0); visibility: visible; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-tools { order: 3; }
  .nav-tools .dropdown { position: static; box-shadow: none; border: 0; padding: 0; display: block; }
  .nav-tools > button { display: none; }
  .dropdown a { padding-left: 26px; }
  .nav-toggle { display: grid; margin-left: auto; }
}

/* =====================  HERO  ===================== */
.hero { position: relative; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--border); }
.hero-scene {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.hero-scene svg { position: absolute; bottom: 0; left: 0; width: 100%; height: auto; }
.hero-inner { position: relative; z-index: 1; padding-block: clamp(34px, 6vw, 58px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green-700); background: var(--green-100);
  padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.6vw, 3rem); letter-spacing: -.02em; margin-bottom: 14px;
}
.hero h1 .hl { color: var(--green-600); }
.hero p.lede { font-size: clamp(1rem, 2.2vw, 1.18rem); color: var(--ink-soft); max-width: 60ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; }
.hero-stats .stat b { display: block; font-size: 1.5rem; color: var(--green-600); line-height: 1; }
.hero-stats .stat span { font-size: .82rem; color: var(--ink-mute); }

/* =====================  CONVERTER  ===================== */
.converter {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  overflow: hidden;
}
.converter-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.converter-head h2 { font-size: 1.05rem; margin: 0; }
.converter-head .badge {
  font-size: .72rem; font-weight: 700; color: var(--green-700);
  background: var(--green-100); padding: 3px 10px; border-radius: var(--radius-pill);
}
.converter-head .head-actions { margin-left: auto; display: flex; gap: 8px; }

.panes { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane + .pane { border-left: 1px solid var(--border); }
.pane-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px 6px; font-size: .82rem; font-weight: 700; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: .03em;
}
.pane-label .dir { color: var(--green-600); }
.pane textarea {
  width: 100%; flex: 1; min-height: 230px; resize: vertical;
  border: 0; background: transparent; padding: 6px 16px 14px;
  font-size: 1.12rem; line-height: 1.9; color: var(--ink);
}
.pane textarea::placeholder { color: var(--ink-mute); opacity: .8; }
.pane textarea:focus { outline: none; }
.pane textarea.mono-bijoy { font-family: var(--font-en); }
.pane-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; border-top: 1px dashed var(--border);
  font-size: .78rem; color: var(--ink-mute);
}
.pane-foot .spacer { margin-left: auto; }
.pane-foot button {
  background: none; border: 0; cursor: pointer; color: var(--ink-soft);
  font-weight: 600; font-size: .82rem; padding: 4px 8px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px;
}
.pane-foot button:hover { background: var(--surface-2); color: var(--green-600); }

.swap-col { display: flex; align-items: center; justify-content: center; padding: 8px; background: var(--surface-2); }
.swap-btn {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--green-600);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: transform .3s;
}
.swap-btn:hover { transform: rotate(180deg); border-color: var(--green-300); }

.converter-actions {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}

/* Buttons */
.btn {
  --_bg: var(--green-600); --_fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--_bg); color: var(--_fg); border: 1px solid transparent;
  font-weight: 700; font-size: .95rem; padding: 11px 20px; border-radius: var(--radius-pill);
  cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s ease, filter .15s ease;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { --_bg: linear-gradient(150deg, var(--green-500), var(--green-700)); }
.btn.lg { padding: 14px 28px; font-size: 1.02rem; }
.btn.ghost { --_bg: transparent; --_fg: var(--ink-soft); border-color: var(--border); box-shadow: none; }
.btn.ghost:hover { --_fg: var(--green-600); border-color: var(--green-300); filter: none; background: var(--surface); }
.btn.gold { --_bg: linear-gradient(150deg, var(--gold-400), var(--gold-600)); --_fg: #3a2a05; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

@media (max-width: 720px) {
  .panes { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--border); }
  .swap-col { padding: 0; background: transparent; }
  .swap-col { position: relative; height: 0; }
  .swap-btn { position: absolute; top: -23px; left: 50%; transform: translateX(-50%); z-index: 2; background: var(--surface); }
  .swap-btn:hover { transform: translateX(-50%) rotate(180deg); }
  .converter-actions .btn { flex: 1 1 auto; }
}

/* =====================  GENERIC CARDS / GRID  ===================== */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--green-300); }
.card .ic {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--green-100); color: var(--green-700); margin-bottom: 14px;
}
.card .ic svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.card p { color: var(--ink-soft); font-size: .93rem; }
.card a.card-link { font-weight: 700; font-size: .9rem; display: inline-flex; gap: 5px; margin-top: 10px; }

.section-head { text-align: center; max-width: 62ch; margin: 0 auto clamp(24px,4vw,40px); }
.section-head .eyebrow { margin-inline: auto; }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.section-head p { color: var(--ink-soft); margin-top: 10px; }

/* Steps */
.steps { counter-reset: step; }
.steps .card { position: relative; }
.steps .card::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -14px; left: 22px;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(150deg, var(--gold-400), var(--gold-600)); color: #3a2a05;
  font-weight: 800; display: grid; place-items: center; box-shadow: var(--shadow-sm);
}

/* Prose / article */
.prose { max-width: 74ch; }
.prose.wide { max-width: 100%; }
.prose h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 1.8em 0 .5em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.prose p, .prose li { color: var(--ink-soft); }
.prose p { margin: .7em 0; }
.prose ul, .prose ol { margin: .6em 0 .6em 1.2em; }
.prose li { margin: .35em 0; }
.prose a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }
.prose blockquote {
  border-left: 4px solid var(--green-600); background: var(--surface-2);
  padding: 12px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1em 0; color: var(--ink-soft);
}

/* FAQ */
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--green-600); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); padding-bottom: 14px; margin: 0; }

/* Table (encoding reference) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.ref { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.ref th, table.ref td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.ref thead th { background: var(--surface-2); color: var(--ink); font-weight: 700; position: sticky; top: 0; }
table.ref tbody tr:hover { background: var(--surface-2); }
table.ref td.bn { font-family: var(--font-bn); font-size: 1.15rem; }

/* Ad slots */
.ad-slot {
  margin: 26px auto; width: 100%; max-width: 100%; text-align: center;
  min-height: 92px; display: block;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--ink-mute); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase;
  overflow: hidden;
}
.ad-slot ins.adsbygoogle { display: block; width: 100%; }
/* Ad units stay hidden until a real AdSense Publisher ID is set in app.js */
.ad-unit { display: none; }
body.ads-on .ad-unit { display: block; }
.ad-label { font-size: .68rem; color: var(--ink-mute); text-align: center; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }

/* Callout */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--green-100); border: 1px solid var(--green-300);
  border-radius: var(--radius); padding: 16px 18px; color: var(--green-800);
}
.callout svg { flex: none; width: 22px; height: 22px; color: var(--green-600); margin-top: 2px; }
.callout p { margin: 0; font-size: .92rem; }

/* =====================  FOOTER  ===================== */
.site-footer { background: var(--green-900); color: #c9e0d6; margin-top: 40px; }
.site-footer a { color: #bcdccf; }
.site-footer a:hover { color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding-block: 48px; }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand .brand b { color: var(--green-300); }
.footer-brand p { color: #9cbcae; font-size: .9rem; max-width: 34ch; }
.footer-col h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-col a { display: block; padding: 5px 0; font-size: .92rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-block: 20px;
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between;
  font-size: .84rem; color: #9cbcae;
}
.footer-bottom .made { display: inline-flex; align-items: center; gap: 6px; }
.footer-bottom .heart { color: var(--red-500); }
@media (max-width: 820px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-top { grid-template-columns: 1fr; gap: 22px; } }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--green-800); color: #fff; padding: 11px 18px; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  animation: toast-in .25s ease, toast-out .3s ease 2.2s forwards;
}
.toast svg { width: 17px; height: 17px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* Breadcrumb */
.crumbs { font-size: .82rem; color: var(--ink-mute); padding-top: 18px; }
.crumbs a { color: var(--ink-soft); }
.crumbs span { color: var(--green-600); }

/* Cookie bar */
.cookie-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(680px, calc(100% - 24px)); z-index: 150;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px 18px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.cookie-bar p { font-size: .86rem; color: var(--ink-soft); margin: 0; flex: 1 1 260px; }
.cookie-bar .btn { padding: 9px 18px; font-size: .88rem; }

/* Utilities */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .8rem; font-weight: 600; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: var(--radius-pill); }
.tag:hover { color: var(--green-600); border-color: var(--green-300); text-decoration: none; }
