/*
 * Modhur Rajjo Trace: customer page.
 *
 * The backdrop is light passing through a jar of honey: pale gold at the top,
 * deepening to amber. The card is the jar's paper label. The one moving part
 * is the honey drip that draws the batch's journey.
 *
 * Built by The Darkul Company, https://company.darkul.com
 */

/* Baloo Da 2 for everything (SIL OFL, self-hosted, variable 400-800). One family:
   hierarchy comes from weight and size, and its digits (১ especially) stay clear. */
@font-face {
	font-family: "Baloo Da 2";
	src: url("fonts/baloo-da-2-bengali.woff2") format("woff2");
	font-weight: 400 800;
	font-display: swap;
	unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1, U+11DF0-11DF1;
}
@font-face {
	font-family: "Baloo Da 2";
	src: url("fonts/baloo-da-2-latin.woff2") format("woff2");
	font-weight: 400 800;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

:root {
	/* Light through honey, top to bottom. */
	--glow: #fbe08a;
	--honey: #f2b23a;
	--amber: #c8740f;
	--comb: #8a4708;

	/* The label. */
	--paper: #fffaf0;
	--paper-edge: #ead9b3;
	--ink: #2b1604;
	--ink-soft: #5a3814;

	/* Lychee skin: the verification stamp. */
	--lychee: #b3233c;
	/* Lychee leaf: confirmations. */
	--leaf: #2f5d36;

	--on-backdrop: #2b1604;
	--on-backdrop-soft: rgba(43, 22, 4, 0.72);

	/* Accents that sit on the label; the label stays light in dark mode. */
	--label-accent: #e6a12a;
	--label-link: #8a4708;
	--label-focus: #c8740f;

	--sans: "Baloo Da 2", "Noto Sans Bengali", system-ui, sans-serif;
	--display: var(--sans);

	--radius-label: 22px;
	--radius-control: 12px;
	--gutter: 16px;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--glow: #6b3f0a;
		--honey: #4a2a06;
		--amber: #2e1903;
		--comb: #170b01;

		--paper: #f6ead0;
		--paper-edge: #c9ad78;

		--on-backdrop: #fbe3a6;
		--on-backdrop-soft: rgba(251, 227, 166, 0.74);

		color-scheme: dark;
	}
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: var(--sans);
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.6;
	color: var(--ink);
	background-color: var(--amber);
	background-image:
		radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.55), transparent 60%),
		linear-gradient(180deg, var(--glow) 0%, var(--honey) 38%, var(--amber) 78%, var(--comb) 100%);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
}

/* A faint honeycomb, strongest at the top where the light is. */
body::before {
	content: "";
	position: fixed;
	inset: 0 0 auto;
	height: 70vh;
	pointer-events: none;
	opacity: 0.16;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 1 54 16v32L28 63 2 48V16zM28 63v34M54 48l2 1M2 48 0 49' fill='none' stroke='%237a3e06' stroke-width='1.4'/%3E%3C/svg%3E");
	background-size: 56px 97px;
	-webkit-mask-image: linear-gradient(180deg, #000, transparent);
	mask-image: linear-gradient(180deg, #000, transparent);
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
	outline: 3px solid var(--lychee);
	outline-offset: 3px;
}

[lang="en"] {
	font-feature-settings: "tnum" 1;
}

/* ------------------------------------------------------------------ */
/* Page frame                                                          */
/* ------------------------------------------------------------------ */

.page {
	position: relative;
	width: 100%;
	max-width: 38rem;
	margin: 0 auto;
	padding: max(28px, env(safe-area-inset-top)) var(--gutter) max(28px, env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-height: 100vh;
	min-height: 100dvh;
}

/* ------------------------------------------------------------------ */
/* Brand                                                               */
/* ------------------------------------------------------------------ */

.brand {
	text-align: center;
	color: var(--on-backdrop);
	padding-top: 0;
}

.brand__logo {
	display: block;
	width: clamp(200px, 60vw, 280px);
	height: auto;
	margin: 0 auto;
	/* The oval sits on the backdrop like the sticker on the jar's foil seal. */
	filter: drop-shadow(0 10px 18px rgba(74, 34, 2, 0.28));
}

/* ------------------------------------------------------------------ */
/* The label                                                           */
/* ------------------------------------------------------------------ */

.label {
	position: relative;
	background: var(--paper);
	border-radius: var(--radius-label);
	padding: 44px 22px 28px;
	/* A printed frame inside the paper edge. */
	box-shadow:
		inset 0 0 0 7px var(--paper),
		inset 0 0 0 8px var(--paper-edge),
		0 1px 0 rgba(255, 255, 255, 0.6),
		0 24px 48px -24px rgba(74, 34, 2, 0.55),
		0 2px 6px rgba(74, 34, 2, 0.18);
}

/* The comb cell sitting on the label's top edge. */
.label__cell {
	position: absolute;
	top: -18px;
	left: 50%;
	width: 34px;
	height: 38px;
	transform: translateX(-50%);
	background: linear-gradient(160deg, #f7c95c, #d98a17);
	clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
	box-shadow: 0 0 0 4px var(--paper);
}

.label__cell::after {
	content: "";
	position: absolute;
	inset: 9px 8px;
	background: rgba(255, 248, 225, 0.55);
	clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.label__title {
	margin: 0;
	font-family: var(--display);
	font-weight: 700;
	font-size: clamp(1.75rem, 7vw, 2.25rem);
	line-height: 1.25;
	color: var(--ink);
	text-wrap: balance;
}

.is-form .label__title,
.is-form .label__lede {
	text-align: center;
}

.label__lede {
	margin: 12px 0 0;
	color: var(--ink-soft);
	max-width: 34em;
}

.is-form .label__lede {
	margin-inline: auto;
}

.typed {
	font-weight: 600;
	color: var(--ink);
	letter-spacing: 0.06em;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Code form                                                           */
/* ------------------------------------------------------------------ */

.code-form {
	margin-top: 26px;
}

.code-form__label {
	display: block;
	font-weight: 600;
	font-size: 1rem;
	margin-bottom: 8px;
}

.is-form .code-form__label {
	text-align: center;
}

.code-form__row {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.code-form__input {
	width: 100%;
	min-width: 0;
	font: 600 1.4rem/1.2 var(--sans);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-align: center;
	color: var(--ink);
	background: #fff;
	border: 2px solid var(--paper-edge);
	border-radius: var(--radius-control);
	padding: 16px 14px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.code-form__input::placeholder {
	color: #c7b28a;
	letter-spacing: 0.12em;
}

.code-form__input:focus {
	outline: none;
	border-color: var(--label-focus);
	box-shadow: 0 0 0 4px rgba(242, 178, 58, 0.35);
}

.code-form__input:focus-visible {
	outline: none;
}

.code-form__button {
	font: 600 1.1rem/1 var(--sans);
	color: #fffaf0;
	background: linear-gradient(180deg, #8a4708, #6a3404);
	border: 0;
	border-radius: var(--radius-control);
	padding: 17px 22px;
	cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.35), 0 6px 14px -6px rgba(74, 34, 2, 0.7);
	transition: transform 0.08s, filter 0.15s;
}

.code-form__button:hover {
	filter: brightness(1.08);
}

.code-form__button:active {
	transform: translateY(1px);
}

.code-form__hint {
	margin: 10px 0 0;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

.is-form .code-form__hint {
	text-align: center;
}

@media (min-width: 560px) {
	.label {
		padding: 52px 44px 36px;
	}

	.code-form__row {
		flex-direction: row;
	}

	.code-form__input {
		flex: 1;
		text-align: left;
	}

	.is-form .code-form__input {
		text-align: center;
	}
}

/* ------------------------------------------------------------------ */
/* Verdict                                                             */
/* ------------------------------------------------------------------ */

.verdict {
	display: flex;
	align-items: center;
	gap: 18px;
}

.seal {
	position: relative;
	flex: none;
	width: 92px;
	height: 92px;
	border-radius: 50%;
	color: var(--lychee);
	border: 2px solid currentColor;
	box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px currentColor;
	transform: rotate(-9deg);
	animation: stamp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.seal__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	fill: currentColor;
	font: 600 11px var(--sans);
}

.seal__tick {
	position: absolute;
	inset: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.verdict .label__title {
	font-size: clamp(1.5rem, 6vw, 1.875rem);
}

.verdict__code {
	margin: 4px 0 0;
	color: var(--ink-soft);
}

.verdict__code strong {
	color: var(--ink);
	letter-spacing: 0.08em;
}

@keyframes stamp {
	from {
		opacity: 0;
		transform: rotate(-9deg) scale(1.6);
	}
	to {
		opacity: 1;
		transform: rotate(-9deg) scale(1);
	}
}

/* ------------------------------------------------------------------ */
/* Notes                                                               */
/* ------------------------------------------------------------------ */

.note {
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: var(--radius-control);
	font-size: 1rem;
}

.note--admin {
	background: #fff3cf;
	border: 1px dashed var(--label-focus);
}

.note--expired {
	margin: 22px 0 0;
	background: #fbe6e9;
	color: #6e1424;
	border-left: 4px solid var(--lychee);
}

/* ------------------------------------------------------------------ */
/* Product                                                             */
/* ------------------------------------------------------------------ */

.product {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--paper-edge);
}

.product__name {
	margin: 0;
	font-family: var(--display);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.3;
}

.product__size {
	margin: 2px 0 0;
	color: var(--ink-soft);
}

/* How the jar divides between its ingredients, to scale. */
.ratio {
	display: flex;
	gap: 3px;
	height: 12px;
	margin: 18px 0 12px;
	border-radius: 999px;
	overflow: hidden;
}

.ratio__part {
	flex-grow: 0;
	flex-shrink: 1;
}

.ratio__part--0 { background: linear-gradient(90deg, #f7c95c, #e09a22); }
.ratio__part--1 { background: #7b4a2b; }
.ratio__part--2 { background: #a9774a; }
.ratio__part--3 { background: #5d6b3a; }

.ingredients {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.ingredient {
	display: grid;
	grid-template-columns: 14px 1fr auto;
	column-gap: 10px;
	align-items: baseline;
}

.ingredient::before {
	content: "";
	width: 12px;
	height: 12px;
	border-radius: 3px;
	align-self: center;
	background: #a9774a;
}

.ingredient--0::before { background: linear-gradient(135deg, #f7c95c, #e09a22); }
.ingredient--1::before { background: #7b4a2b; }
.ingredient--3::before { background: #5d6b3a; }

.ingredient__name {
	font-weight: 600;
}

.ingredient__amount {
	color: var(--ink-soft);
	white-space: nowrap;
}

.ingredient__note {
	grid-column: 2 / -1;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Story                                                               */
/* ------------------------------------------------------------------ */

.story {
	margin: 28px 0 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--label-accent);
	font-family: var(--display);
	font-weight: 500;
	font-size: 1.15rem;
	line-height: 1.65;
	color: var(--ink);
}

.story p {
	margin: 0;
}

/* ------------------------------------------------------------------ */
/* Journey: the honey drip                                             */
/* ------------------------------------------------------------------ */

.journey {
	margin-top: 32px;
}

.journey__title {
	margin: 0 0 16px;
	font-family: var(--display);
	font-weight: 700;
	font-size: 1.3rem;
}

.drip {
	--drop: 22px;
	--line: 5px;
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The drip itself: a thick run of honey down the left edge. */
.drip::before {
	content: "";
	position: absolute;
	top: 4px;
	bottom: 18px;
	left: calc((var(--drop) - var(--line)) / 2);
	width: var(--line);
	border-radius: 0 0 999px 999px;
	background: linear-gradient(180deg, #f7c95c, #d8861a 70%, #b8650c);
	transform-origin: top;
	animation: pour calc(0.35s * var(--steps) + 0.3s) cubic-bezier(0.45, 0, 0.2, 1) 0.35s both;
}

.drip__step {
	position: relative;
	display: grid;
	grid-template-columns: var(--drop) 1fr;
	column-gap: 16px;
	padding-bottom: 20px;
}

.drip__step:last-child {
	padding-bottom: 0;
}

.drip__drop {
	grid-row: span 2;
	position: relative;
	z-index: 1;
	width: var(--drop);
	height: var(--drop);
	margin-top: 3px;
	background: radial-gradient(circle at 35% 30%, #fff1c2 0 14%, #f2b23a 40%, #b8650c 100%);
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 0 0 4px var(--paper);
	animation: drop 0.35s ease-out both;
	animation-delay: calc(0.45s + var(--i) * 0.35s);
}

.drip__label {
	font-size: 0.9375rem;
	color: var(--ink-soft);
	line-height: 1.5;
}

.drip__value {
	grid-column: 2;
	font-weight: 600;
	font-size: 1.08rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

@keyframes pour {
	from { transform: scaleY(0); }
	to { transform: scaleY(1); }
}

@keyframes drop {
	from {
		opacity: 0;
		transform: rotate(-45deg) scale(0.3);
	}
	to {
		opacity: 1;
		transform: rotate(-45deg) scale(1);
	}
}

/* ------------------------------------------------------------------ */
/* Check another                                                       */
/* ------------------------------------------------------------------ */

.again {
	margin-top: 32px;
	padding-top: 18px;
	border-top: 1px solid var(--paper-edge);
}

.again summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--label-link);
	list-style-position: inside;
}

.again .code-form {
	margin-top: 14px;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.foot {
	margin-top: auto;
	text-align: center;
	color: #fff4d6;
	font-size: 0.9375rem;
	line-height: 1.6;
	text-shadow: 0 1px 1px rgba(60, 26, 0, 0.35);
}

.foot__tagline {
	margin: 0 0 10px;
	font-family: var(--display);
	font-size: 1.25rem;
	font-weight: 600;
}

.foot__contact {
	font-style: normal;
	display: flex;
	flex-direction: column;
	gap: 2px;
	align-items: center;
}

.foot__phone {
	font-weight: 600;
	font-size: 1.05rem;
	text-decoration: none;
	padding: 6px 4px;
}

.foot__credit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	margin: 18px 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
	opacity: 0.85;
}

.foot__credit a {
	font-weight: 600;
}

/* Side by side once there's room, with a thin rule between. */
@media (min-width: 640px) {
	.foot__credit {
		flex-direction: row;
		justify-content: center;
		gap: 0;
	}

	.foot__credit-line + .foot__credit-line {
		margin-left: 14px;
		padding-left: 14px;
		border-left: 1px solid rgba(255, 244, 214, 0.4);
	}
}

/* ------------------------------------------------------------------ */
/* Orchard: where lychee honey comes from                              */
/* ------------------------------------------------------------------ */

.orchard {
	margin: 0;
}

.orchard__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--radius-label);
	/* Framed like the label card above it. */
	border: 6px solid var(--paper);
	box-shadow: 0 18px 36px -18px rgba(74, 34, 2, 0.55);
}

.orchard__caption {
	margin: 12px 8px 0;
	text-align: center;
	font-family: var(--display);
	font-size: 1.125rem;
	line-height: 1.6;
	color: #fff4d6;
	text-shadow: 0 1px 1px rgba(60, 26, 0, 0.35);
}

/* ------------------------------------------------------------------ */
/* Motion preferences                                                  */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.seal,
	.drip::before,
	.drip__drop {
		animation: none;
	}
}
