/* A scallop of cord holds one lamp at its lowest point. */
.teomed-garland {
	--wire: #728078;
	--bulb: #fff1c5;
	--bloom: #f1c278;
	--cord-depth: 7px;
	display: flex;
	width: 100%;
	height: 28px;
	overflow: hidden;
	pointer-events: none;
	user-select: none;
	background: var(--teomed-canvas, #f7efe8);
	animation: teomed-garland-finish 0s var(--teomed-garland-remaining) forwards;
}

.teomed-garland > span {
	flex: 1 0 56px;
	position: relative;
}

.teomed-garland > span::before {
	content: "";
	position: absolute;
	inset: -2px 0 auto;
	height: calc(var(--cord-depth) + 2px);
	box-sizing: border-box;
	border-bottom: 1px solid var(--wire);
	border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.teomed-garland > span:nth-child(3n + 2) { --cord-depth: 10px; --tilt: -9deg; --phase: -2.4s; }
.teomed-garland > span:nth-child(3n)     { --cord-depth: 6px; --tilt: 8deg; --phase: -1.2s; }
.teomed-garland > span:nth-child(8n + 3) { --bulb: #a6d7c6; --bloom: var(--teomed-action, #015b4b); }
.teomed-garland > span:nth-child(8n + 6) { --bulb: #ffd4a5; --bloom: var(--teomed-accent, #d1936e); }

.teomed-garland i {
	position: absolute;
	top: calc(var(--cord-depth) - 1px);
	left: 50%;
	width: 5px;
	height: 4px;
	border-radius: 1px;
	background: #596c60;
	transform-origin: 50% 0;
	transform: translateX(-50%) rotate(var(--tilt, 4deg));
}

.teomed-garland i::before,
.teomed-garland i::after {
	content: "";
	position: absolute;
	top: 3px;
	left: -1px;
	width: 7px;
	height: 10px;
	border-radius: 48% 48% 55% 55% / 32% 32% 75% 75%;
}

.teomed-garland i::before {
	background: linear-gradient(135deg, #d4cbbf, #9d978b);
	box-shadow: inset 0 0 0 1px rgb(83 79 66 / 28%);
}

.teomed-garland i::after {
	background: radial-gradient(ellipse at 40% 35%, #fffdf0 8%, var(--bulb) 48%, var(--bloom) 100%);
	box-shadow: inset 0 0 0 1px rgb(115 86 47 / 22%), 0 0 4px 1px var(--bulb), 0 1px 9px 1px var(--bloom);
}

@media (prefers-reduced-motion: no-preference) {
	.teomed-garland i::after { animation: teomed-lamp-blink 3.6s ease-in-out var(--phase, 0s) infinite; }
}

@keyframes teomed-lamp-blink {
	0%, 15%, 100% { opacity: .06; }
	38%, 68% { opacity: 1; }
}
@keyframes teomed-garland-finish { to { height: 0; visibility: hidden; } }

@media (max-width: 767px) {
	.teomed-garland { height: 21px; --cord-depth: 5px; }
	.teomed-garland > span { flex-basis: 42px; }
	.teomed-garland > span:nth-child(3n + 2) { --cord-depth: 7px; }
	.teomed-garland > span:nth-child(3n) { --cord-depth: 4px; }
	.teomed-garland i::before, .teomed-garland i::after { width: 6px; height: 8px; left: -.5px; }
}

@media print, (forced-colors: active) { .teomed-garland { display: none; } }

/* The original logo link stays in its grid cell. Only the ornament is out of flow. */
.teomed-ornament-anchor {
	position: relative;
	display: inline-grid;
	justify-self: start;
	align-self: stretch;
	align-items: center;
}

.teomed-holiday-ornament {
	position: absolute;
	left: calc(50% + 49px);
	top: -48px;
	bottom: calc(50% + 40px);
	width: 23px;
	transform: translateX(-50%);
	pointer-events: none;
	user-select: none;
	animation: teomed-garland-finish 0s var(--teomed-garland-remaining) forwards;
}

.teomed-holiday-ornament::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 50%;
	width: 1px;
	transform: translateX(-50%);
	background: #be9658;
}

.teomed-holiday-ornament img {
	position: absolute;
	top: calc(100% - 1px);
	left: 0;
	display: block;
	width: 100%;
	height: auto;
}

/* The foreground side of each scallop masks the thread exactly at the wire. */
.home .teomed-garland > span::before {
	z-index: 51;
	background: var(--teomed-canvas, #f7efe8);
}

@media (max-width: 767px) {
	.teomed-holiday-ornament {
		left: calc(50% + 39px);
		top: -34px;
		bottom: calc(50% + 32px);
		width: 18px;
	}
}

@media print, (forced-colors: active) { .teomed-holiday-ornament { display: none; } }
