:root {
  --night: #140b06;
  --cream: #fbf3e4;
  --gold: #e3b668;
  --amber: #c9822f;
  --leaf: #6f9150;
  --display: "Bodoni Moda", "Noto Serif Bengali", Georgia, serif;
  --body: "Figtree", "Hind Siliguri", system-ui, sans-serif;
  --pad: clamp(20px, 6vw, 96px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--night); }
body { font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--cream); background: radial-gradient(120% 80% at 70% 30%, #2a170b, var(--night) 70%) fixed; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--gold); color: var(--night); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- 3D layer ---------- */
#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(8, 4, 2, .7)); }
.no-webgl body { background: linear-gradient(rgba(20, 11, 6, .75), rgba(20, 11, 6, .9)), url("assets/p1.jpg") center / cover fixed; }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--night); transition: opacity .9s var(--ease), visibility .9s; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-mark { width: 74px; height: 74px; border-radius: 50%; background: #f5e8d6 url("assets/logo.jpg") 44% 18% / 179% auto no-repeat; animation: breathe 1.6s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: scale(1.08); } }
.loader-pct { font-family: var(--display); font-size: 2.4rem; font-variant-numeric: tabular-nums; }
.loader-bar { width: 160px; height: 2px; background: rgba(251, 243, 228, .15); }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s linear; }

/* ---------- Nav & chapter dots ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 18px var(--pad); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; background: #f5e8d6 url("assets/logo.jpg") 44% 18% / 179% auto no-repeat; }
.brand-name { font-family: var(--display); font-size: 1.55rem; font-weight: 600; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(251, 243, 228, .1); backdrop-filter: blur(10px); }
.lang button { padding: 5px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600; transition: background .3s, color .3s; }
.lang button[aria-pressed="true"] { background: var(--cream); color: var(--night); }

.dots { position: fixed; right: clamp(14px, 2.4vw, 34px); top: 50%; translate: 0 -50%; z-index: 30; display: grid; gap: 14px; }
.dots a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.dots a::after { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--cream); transition: background .3s, transform .3s; }
.dots a span { opacity: 0; translate: 8px 0; transition: opacity .3s, translate .3s; }
.dots a:hover span, .dots a.is-active span { opacity: 1; translate: 0 0; }
.dots a.is-active::after { background: var(--gold); border-color: var(--gold); transform: scale(1.4); }
:lang(bn) .dots a { letter-spacing: .02em; font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 999px; font-weight: 600; transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-gold { background: var(--gold); color: var(--night); box-shadow: 0 18px 40px -16px rgba(227, 182, 104, .7); }
.btn-gold:hover { transform: translateY(-2px); background: #f0c57a; box-shadow: 0 0 0 8px rgba(227, 182, 104, .15), 0 24px 50px -16px rgba(227, 182, 104, .8); }
.btn-sm { padding: 10px 18px; font-size: .92rem; }
.btn-xl { padding: 22px 42px; font-size: 1.15rem; }

/* ---------- Scenes ---------- */
.track { position: relative; z-index: 10; }
.scene { height: 120vh; display: flex; align-items: center; padding: 90px var(--pad); }
.scene.right { justify-content: flex-end; padding-right: calc(var(--pad) + 70px); }
.scene.bottom { align-items: flex-end; justify-content: center; padding-bottom: 14vh; }
.scene.center { justify-content: center; }
.panel { position: relative; max-width: 520px; text-shadow: 0 2px 18px rgba(10, 5, 2, .9), 0 0 2px rgba(10, 5, 2, .6); }
/* a soft pool of darkness behind every text block keeps it readable over the particles */
.panel::before { content: ""; position: absolute; inset: -18% -22%; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(14, 7, 3, .86), rgba(14, 7, 3, .55) 60%, transparent); filter: blur(10px); }
.panel.wide { max-width: 640px; }
.panel.center { text-align: center; max-width: 760px; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; }
:lang(bn) .eyebrow { letter-spacing: .04em; font-size: .98rem; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; line-height: 1; }
h1 { font-size: clamp(3rem, 6.6vw, 6rem); }
h2 { font-size: clamp(2.4rem, 5vw, 4.6rem); }
h1 span, h1 em, h2 span, h2 em { display: block; }
h1 em, h2 em { font-weight: 400; color: var(--gold); }
:lang(bn) h1, :lang(bn) h2 { letter-spacing: 0; line-height: 1.3; font-weight: 600; }
:lang(bn) h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); }
:lang(bn) h2 { font-size: clamp(2rem, 4vw, 3.6rem); }
:lang(bn) h1 em, :lang(bn) h2 em { font-style: normal; }
.lede { margin-top: 24px; font-size: clamp(1rem, 1.3vw, 1.18rem); opacity: .88; }
.hint { display: flex; align-items: center; gap: 14px; margin-top: 40px; font-size: .9rem; font-weight: 600; letter-spacing: .08em; opacity: .75; }
.hint i { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { opacity: 0; } }

.origin-card { display: grid; grid-template-columns: 130px 1fr; gap: 22px; margin-top: 30px; padding: 18px; border-radius: 22px; background: rgba(20, 11, 6, .55); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(251, 243, 228, .12); text-shadow: none; }
.origin-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 25%; border-radius: 14px; }
.card-title { font-family: var(--display); font-size: 1.6rem; font-weight: 500; }
:lang(bn) .card-title { font-weight: 600; font-size: 1.4rem; }
.notes { font-family: var(--display); font-style: italic; color: var(--gold); margin: 2px 0 12px; }
:lang(bn) .notes { font-style: normal; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-bottom: 16px; font-size: .92rem; }
.facts dt { font-size: .68rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .6; }
:lang(bn) .facts dt { letter-spacing: .02em; font-size: .85rem; }
.facts.big { grid-template-columns: 1fr; gap: 16px; margin-top: 30px; font-size: 1.05rem; }
.facts.big > div { padding-top: 14px; border-top: 1px solid rgba(251, 243, 228, .15); }

.tools { display: flex; gap: 14px; margin-top: 30px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; text-shadow: none; }
.tool { flex: none; width: 170px; scroll-snap-align: start; border-radius: 18px; overflow: hidden; background: rgba(20, 11, 6, .55); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(251, 243, 228, .12); transition: transform .4s var(--ease); }
.tool:hover { transform: translateY(-6px); }
.tool img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.tool b { display: block; padding: 10px 14px 2px; font-family: var(--display); font-weight: 500; font-size: 1.08rem; line-height: 1.2; }
:lang(bn) .tool b { font-weight: 600; font-size: 1rem; line-height: 1.4; }
.tool span { display: flex; align-items: center; gap: 6px; padding: 2px 14px 12px; font-size: .82rem; font-weight: 600; color: var(--gold); }
.tool svg { width: 14px; height: 14px; }

.story { font-family: var(--display); font-size: clamp(1.3rem, 2.3vw, 2rem); line-height: 1.35; }
:lang(bn) .story { line-height: 1.6; font-size: clamp(1.15rem, 2vw, 1.7rem); }
.promises { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; text-shadow: none; }
.promises li { padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; background: rgba(227, 182, 104, .14); box-shadow: inset 0 0 0 1px rgba(227, 182, 104, .35); color: var(--gold); }

.scene.center h2 { margin-bottom: 40px; }
.contact-line { margin-top: 34px; font-size: .98rem; }
.contact-line a { border-bottom: 1px solid rgba(251, 243, 228, .35); }
.fine { margin-top: 16px; font-size: .82rem; opacity: .55; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .dots { display: none; }
  .scene, .scene.right, .scene.bottom, .scene.center { align-items: flex-end; justify-content: flex-start; padding: 90px 20px 10vh; }
  .panel, .panel.wide, .panel.center { max-width: none; text-align: left; padding: 22px; border-radius: 22px; background: rgba(20, 11, 6, .6); backdrop-filter: blur(14px); }
  .promises { justify-content: flex-start; }
  .origin-card { grid-template-columns: 90px 1fr; padding: 0; background: none; box-shadow: none; backdrop-filter: none; }
  .nav .btn span { display: none; }
  .nav .btn { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Brew timer chapter ---------- */
.timer { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: center; margin-top: 30px; padding: 24px; border-radius: 24px; background: rgba(20, 11, 6, .62); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(251, 243, 228, .12); text-shadow: none; }
.dial { position: relative; aspect-ratio: 1; }
.dial svg { width: 100%; height: 100%; rotate: -90deg; }
.dial circle { fill: none; stroke-width: 6; }
.dial-track { stroke: rgba(251, 243, 228, .12); }
.dial-fill { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 615.75; stroke-dashoffset: 615.75; transition: stroke-dashoffset .25s linear; }
.dial-read { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial-read output { font-family: var(--display); font-size: 3.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.dial-read span { font-size: .82rem; font-weight: 600; color: var(--gold); margin-top: 6px; padding: 0 18px; }
.recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(251, 243, 228, .14); }
.recipe-label { font-size: .7rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
:lang(bn) .recipe-label { letter-spacing: .02em; font-size: .9rem; }
.stepper { display: flex; align-items: center; border-radius: 999px; background: rgba(251, 243, 228, .1); padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; transition: background .25s, color .25s; }
.stepper button:hover { background: var(--gold); color: var(--night); }
.stepper output { min-width: 30px; text-align: center; font-weight: 700; }
.recipe-out { font-size: .9rem; }
.recipe-out b { font-family: var(--display); font-size: 1.25rem; font-weight: 500; color: var(--gold); }
.phases li { display: grid; grid-template-columns: 46px 1fr; gap: 0 12px; padding: 9px 0; border-bottom: 1px solid rgba(251, 243, 228, .08); opacity: .45; transition: opacity .4s; font-size: .9rem; }
.phases li.is-active, .phases li.is-done { opacity: 1; }
.phases time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gold); }
.phases b { font-family: var(--display); font-weight: 500; font-size: 1.05rem; }
:lang(bn) .phases b { font-weight: 600; font-size: .98rem; }
.phases p { grid-column: 2; opacity: .8; font-size: .86rem; }
.phases li.is-active b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 9px; border-radius: 50%; background: var(--gold); animation: pulse 1s ease-in-out infinite alternate; vertical-align: middle; }
.phases li.is-done b { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .6; }
@keyframes pulse { to { transform: scale(1.7); opacity: .3; } }
.timer-actions { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.timer-actions .btn { min-width: 140px; justify-content: center; }
.text-link { font-weight: 600; font-size: .9rem; padding-bottom: 2px; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
@media (max-width: 860px) {
  .timer { grid-template-columns: 1fr; padding: 0; background: none; box-shadow: none; backdrop-filter: none; margin-top: 18px; }
  .dial { max-width: 170px; margin: 0 auto; }
}

/* ---------- Phones: the 3D shape sits in the top half, the text card below it ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .scene, .scene.right, .scene.bottom, .scene.center { height: auto; min-height: 100svh; flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 48svh 14px 6svh; }
  #s0 { padding-top: 54svh; }
  .panel, .panel.wide, .panel.center { max-width: none; width: 100%; text-align: left; padding: 20px 18px; border-radius: 20px; background: rgba(20, 11, 6, .74); backdrop-filter: blur(14px); }
  .panel::before { display: none; }
  h1 { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  h2 { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  :lang(bn) h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  :lang(bn) h2 { font-size: clamp(1.6rem, 7.5vw, 2.2rem); }
  .eyebrow { margin-bottom: 12px; }
  .lede { margin-top: 14px; }
  .hint { margin-top: 18px; }
  .origin-card { grid-template-columns: 84px 1fr; gap: 14px; margin-top: 18px; }
  .facts { gap: 6px 12px; font-size: .86rem; }
  .facts.big { margin-top: 18px; gap: 10px; font-size: .95rem; }
  .tools { margin-top: 18px; }
  .tool { width: 140px; }
  .promises { margin-top: 16px; }
  .scene.center h2 { margin-bottom: 22px; }
  .btn-xl { padding: 16px 26px; font-size: 1rem; }
  .contact-line { margin-top: 20px; font-size: .9rem; }
  .vignette { background: linear-gradient(transparent 45%, rgba(8, 4, 2, .55)); }
}
